Skip to content
streamneo.
Setup Guides12 min read

How to Stream a Playlist of Multiple MP4 Videos to YouTube Live Using FFmpeg

Build an ordered MP4 playlist with FFmpeg, choose copy or encoding carefully, and test YouTube RTMPS stream health before going live.

sn.
StreamNeoPublished 4 October 2026
Worth sharing?

To stream several MP4 files to one YouTube Live broadcast with FFmpeg, create a text file listing them in playback order, then use FFmpeg’s concat demuxer to read the list and send the output to YouTube’s RTMPS ingest. Whether you can copy the media streams or need to encode them depends on the files and the output you need.

Treat the command examples below as patterns to adapt, not universal recipes. Check the actual playlist in a private or otherwise suitable test broadcast, confirm YouTube’s preview and stream health, and keep your stream name private.

Prepare the MP4 files in playback order

Start by putting the videos in a known order and checking that each file can be read on the machine that will run FFmpeg. Give files clear names such as morning-intro.mp4, bhajan-a.mp4, and closing.mp4; this makes the playlist easier to inspect than a sequence of names that differ only by a digit. Make sure the intended files are complete, not temporary downloads or partial transfers.

The concat demuxer joins media inputs at the container level. It does not make every combination of MP4 files behave like a single, seamless video. Inputs with different stream layouts or media properties may need conversion or other preparation; do not assume that matching .mp4 extensions mean the streams are interchangeable. FFmpeg’s concat FAQ distinguishes the concat demuxer, which can avoid re-encoding when suitable, from the concat filter, which is useful when re-encoding is needed.

Before building the list, decide what a viewer should hear and see at each boundary. If one file has no audio and the next has an audio track, or if their aspect ratios differ, the transition may not behave as you expect. Check a few seconds at the beginning and end of each source, and listen for abrupt level changes or silence. For a devotional channel, for example, a short opening clip followed by several bhajans may need a consistent audio level even if every file plays successfully.

Keep a copy of the original files and work from a separate folder if you plan to normalise or transcode them. That gives you a way back if the output sounds worse or a conversion fails. For longer-running channels, a playlist is also a useful boundary for documenting what is meant to play next; the process for adding new videos to a running 24/7 stream is a separate operational task from preparing this initial list.

Create a concat-demuxer playlist file

Create a plain-text file named playlist.txt in the directory where you intend to run FFmpeg. Put one file directive on each line, in the order viewers should see the videos:

file 'morning-intro.mp4'
file 'bhajan-a.mp4'
file 'closing.mp4'

Relative paths are interpreted from the process’s working directory, so run FFmpeg from the folder that contains these files, or write paths that correctly locate them. The FFmpeg demuxer documentation describes the concat file format and its path safety behaviour. The demuxer checks paths by default; if your list uses paths outside its safe subset, -safe 0 can permit them. Use that option only when needed, and only with a playlist you trust. It relaxes a safety check; it does not repair an incorrect path or make an untrusted list safe.

Paths containing spaces should be quoted in the playlist. For example:

file 'videos/Evening Aarti.mp4'
file 'videos/Quiet closing.mp4'

Use paths that the FFmpeg process can actually access. On Windows, you may need to use a path format accepted by your FFmpeg build and shell; on a Linux VPS, check capitalisation because video.mp4 and Video.mp4 can refer to different files. Avoid copying a path from a file manager without verifying how its quoting and separators are interpreted by FFmpeg.

The list is not a playlist of YouTube URLs. It is a local instruction file that FFmpeg reads before sending one outgoing live feed. If a listed file is missing or unreadable, the job may stop or fail when it reaches that entry. Read through the file in order before testing, and confirm each entry opens locally. If you store the list and videos on a mounted VPS volume, check that the volume is available when the stream starts; this guide to storing an FFmpeg playlist on a mounted VPS volume covers that separate storage concern.

Choose whether to encode or copy

There are two broad output choices. Stream copy passes the existing encoded video and audio through without decoding and encoding them again. Encoding decodes and converts the material to a chosen output format, which takes more processing but gives you more control over consistent output. Neither choice is automatically right for every set of files.

Copying can be appropriate when the files’ streams and timing are compatible for the concat demuxer and the resulting feed meets YouTube’s current requirements. It avoids an encoding step, but it cannot reconcile differing codecs, dimensions, frame rates, or audio layouts. A successful FFmpeg start is not proof that every transition will play cleanly; inspect transitions and the YouTube preview.

Encoding is the more controllable route when inputs need to be brought to a common output, but it adds processing work and can introduce its own configuration errors. The output codec, frame rate, resolution, bitrate, and audio settings should suit both the source material and the available upload capacity. YouTube’s encoder settings and bitrate guidance varies by codec, resolution, and frame rate, so consult the current table rather than treating one bitrate as right for all streams.

Choice What FFmpeg does Consider it when Main trade-off
Stream copy Passes through the existing encoded streams The concatenated inputs are compatible and their output already suits the intended feed Less processing, but little ability to reconcile differences
Re-encode Decodes and encodes to an output you specify Inputs need normalising or you need a consistent output format More processing and settings to verify, with control over the output

The concat demuxer is the relevant method when copying is appropriate. When re-encoding is needed to make a common output, consider whether preparing the files consistently first, or using FFmpeg’s concat filter workflow, is the better fit. The exact commands and filter graph depend on the tracks and properties in your files; check the FFmpeg documentation and test your actual material rather than copying a filter graph meant for different inputs.

For example, imagine one MP4 is a 25 fps phone recording with stereo AAC audio and the next is a 30 fps export with a different frame size. The file extension alone does not tell you whether a stream-copy join will be suitable. Inspect the files with a media probe, test the joined output, and choose a conversion workflow if the output needs to be made consistent. Do not convert merely for the sake of converting if compatible sources already produce the result you need.

Set YouTube’s RTMPS ingest and stream name

Open YouTube Live Control Room for the intended broadcast and obtain its primary RTMPS ingest address and stream name there. They identify where FFmpeg sends the feed and which broadcast receives it. Google’s Live Streams API documentation explains that encoders may accept the ingest address and stream name separately or use them together, depending on the encoder.

Treat the stream name as a secret credential. Do not include it in screenshots, public scripts, shared documents, or support posts. If someone else needs to help, share a redacted command and let them inspect the non-secret settings. You can place the value into the command locally when you run it, but avoid saving a real key in a file that will be published or committed to a shared repository.

YouTube recommends RTMPS for encrypted delivery. Use the primary ingest details shown for the broadcast you intend to test, and confirm the format expected by your FFmpeg command. The following is an illustrative encoding pattern: substitute your own local playlist and ingest value, and check the options available in your installed FFmpeg build before relying on them.

ffmpeg -re -f concat -i playlist.txt \\
  -c:v libx264 -preset veryfast -b:v 4500k -maxrate 4500k -bufsize 9000k \\
  -g 60 -c:a aac -b:a 128k -ar 44100 \\
  -f flv 'rtmps://YOUR_INGEST_URL/YOUR_STREAM_NAME'

This example is not a guaranteed fit for every file or connection. The shown keyframe setting of -g 60 corresponds to two seconds only when the output runs at 30 frames per second; choose a keyframe interval based on your actual output frame rate. The bitrate shown is illustrative, not a recommendation for every resolution or frame rate. Check YouTube’s current guidance and whether your sustained upload capacity can carry the selected output with room for ordinary network variation.

-re reads the input at its native rate rather than sending the file as fast as the machine can process it. The concat input tells FFmpeg to read the ordered entries from playlist.txt; the output options then describe the stream sent to the ingest. If you need -safe 0 for trusted paths, add it before -i playlist.txt, but do not add it by habit. For a copy workflow, the codec options would differ; a copy command is appropriate only after checking the inputs and confirming the result in a test.

Check the command and test the feed before the event

Do not wait until the scheduled broadcast to discover a typo in a path, a missing file, an unsupported encoder, or a rejected ingest value. First run a local check on the playlist and watch the transitions. Verify that playback reaches the second and later entries, not just the first. Listen through a transition on headphones or speakers rather than relying only on a progress indicator.

Then test the outgoing feed in YouTube Live Control Room. Use a test broadcast or another suitable private workflow, and keep enough time to adjust and repeat the test. Confirm that the preview shows motion, that audio is present and at a sensible level, and that YouTube reports the stream health you expect. YouTube explicitly advises testing with audio and movement similar to the planned stream in its encoder settings guidance.

A still image can make a live feed appear to work while revealing little about encoding or motion issues. Include representative material: a section with movement, a quiet passage if your channel has one, and a transition between files. If the channel plays music, check both for clipping and for a sudden change in loudness at a join. A test that only reaches the opening clip cannot tell you whether a later file is missing or has a different track layout.

Check that the machine running FFmpeg can sustain the chosen encoding workload. If the CPU is consistently busy, playback or output may become unstable; if you choose stream copy, lower CPU load does not remove the need to verify media compatibility and network delivery. Similarly, a strong-looking local preview does not confirm that YouTube is receiving a healthy feed. Use both the local playback check and the Control Room feedback.

Write down what you changed between tests. If you alter the output frame rate, keyframe interval, bitrate, or audio settings, make one deliberate change at a time where practical, then check the result again. This makes it easier to understand which adjustment helped. Keep a redacted copy of the working command, without the stream name, and store the credential separately.

Monitor YouTube stream health while live

Once the broadcast is running, leave Live Control Room available and watch for health messages, interruptions, or a preview that stops updating. Stream health is feedback about what YouTube is receiving, not a promise that every viewer’s connection or playback device will behave identically. If YouTube reports a problem, use the specific warning and current official guidance to narrow down whether the issue concerns bitrate, keyframes, connection stability, or the encoder output.

Keep an eye on the FFmpeg process as well. A command that exits, reports repeated input errors, or stops advancing through the playlist needs attention even if the Control Room tab remains open. Do not assume the process will recover from every file error or network drop. For a channel that must continue unattended, a running process also needs a plan for supervision and recovery; the stream-health warning guide is useful when interpreting warnings, while the exact remedy should follow the message and your own test results.

If you are using your own computer and the channel needs to run while it is switched off, that changes the operating arrangement, not the media compatibility rules. StreamNeo turns an uploaded video into a 24/7 YouTube live stream, so you do not have to keep this FFmpeg process running on your computer to keep the channel going; the playlist and broadcast still need to be prepared and checked. It is YouTube-only, so it is not a fit if your requirement is to send the same feed to another platform.

For a feed intended to run continuously, consider how you will notice a failure and how you will restore the correct broadcast without exposing the stream name. A local restart plan can help with some process failures, but it does not establish that a playlist will loop cleanly or that every network problem will recover without intervention. Test the behaviour you actually intend to use, including what should happen after the last file finishes. For a dedicated looping question, see how to loop a video on YouTube Live 24/7, but do not assume that a multi-file loop command behaves the same across all FFmpeg builds without testing it.

If you change the playlist after testing, repeat the relevant checks. Replacing one MP4 can alter a track or frame-rate mismatch, and moving the playlist folder can break relative paths. A short pre-flight record of the file order, output settings, ingest target, and test result is more useful than a memory of what worked on an earlier version.

Before committing, compare the operating options on the pricing page. When the file and channel are ready, start free — 24-hour trial, no card.

FAQ

Can I use stream copy for any MP4 playlist?

No. MP4 is a container, and files with that extension can contain different streams and media properties. Copy only when the actual inputs are compatible for the concat demuxer and the resulting feed is suitable; test the playlist and its transitions.

Does this command make the playlist repeat forever?

No. The example reads the listed files in order; it is not presented as a universal loop command. Looping behaviour can depend on the FFmpeg build and input arrangement, so test the exact version and workflow you plan to use before relying on continuous playback.

Where do I get the RTMPS URL and stream name?

Get the primary ingest address and stream name from YouTube Live Control Room for the intended broadcast. Keep the stream name private, and do not paste it into a public command, screenshot, or support request.

Which bitrate should I enter?

Use YouTube’s current encoder guidance for the chosen codec, resolution, and frame rate, then account for your available upload capacity. A bitrate from an example command is not a fit for every source or connection; test the output and check stream health before the event.

YOU’VE REACHED THE END

Keep the ideas coming.

More guides, useful tools and a little help for your next broadcast.

Back to the journal ↗
YOUR NEXT READ

A little more to explore.

More Setup Guides guides ↗ · All topics ↗