Skip to content
streamneo.
Setup Guides13 min read

How to Schedule Different Video Playlists in an FFmpeg YouTube Stream

Learn how FFmpeg orders playlist files, how a clock scheduler selects a playlist, and how YouTube broadcast scheduling fits in.

sn.
StreamNeoPublished 4 October 2026
Worth sharing?

FFmpeg can join prerecorded files into an ordered playlist, but the concat list does not decide when that playlist runs. To switch playlists at a chosen time, you need a separate clock-based scheduler or wrapper, and YouTube event scheduling is a third, separate control.

A reliable setup starts by preparing and checking each playlist, choosing the right concat method for its files, and testing how your scheduler starts or switches the encoder. Then configure the YouTube broadcast in Studio or through the API; scheduling that event does not change FFmpeg’s input.

Three controls, three different jobs

It helps to draw the workflow as three layers before writing commands. The first is media ordering: the files that make up a sequence and their order. The second is playlist selection: the mechanism that decides which sequence the encoder should use at a particular time. The third is YouTube event scheduling: the broadcast entry viewers can find and receive reminders for, and the controls that govern when that event goes live.

An FFmpeg concat list handles the first layer. It names files in the order they should be read, such as a morning devotional sequence or an evening bhajan sequence. It has no built-in instruction saying “start this list at 06:00” or “replace it at sunset”. That decision belongs to an external scheduler, a wrapper script, or another orchestration method you implement and test.

YouTube Studio or the YouTube Live Streaming API handles the broadcast event, not the media playlist. Google’s documentation on broadcasts and streams distinguishes the broadcast event from the stream carrying audio and video. An event can be scheduled in advance, but FFmpeg still needs its own input-selection plan.

For example, you might prepare one playlist for a morning prayer programme and another for instrumental music in the evening. Your scheduler selects which FFmpeg process or list to use; Studio has a separate scheduled event and encoder connection to configure. If a process restart is part of the changeover, treat it as a planned transition to test, not as a guaranteed seamless hand-off.

Prepare a separate list for each playlist

Start with the intended sequences and their boundaries. Write down what should be in each one, the order of the files, and when that sequence should be selected. Keeping the lists separate makes later corrections easier: changing the evening sequence does not accidentally reorder the morning one.

For a simple list, create a UTF-8 text file such as morning.txt with one FFmpeg file directive per input:

file '/media/prayer/introduction.mp4'
file '/media/prayer/bhajan-one.mp4'
file '/media/prayer/bhajan-two.mp4'

A second sequence might be in evening.txt:

file '/media/music/tanpura.mp4'
file '/media/music/instrumental-one.mp4'
file '/media/music/instrumental-two.mp4'

These are examples of list structure, not a schedule. The names and paths must match files on the machine running FFmpeg. Quote paths consistently, particularly when directory or file names contain spaces, and test the list from the same user account and working environment that will run the stream. A path that works in an interactive terminal may fail under a scheduled task if that task uses a different working directory or permissions.

One useful practice is to keep a human-readable playlist plan alongside the actual concat files. Record the desired start time, list filename, expected duration, and what should happen if the current run is still active at the next start time. This avoids relying on a filename to explain an operating decision. For a regional-language channel, for instance, you may want a morning sequence in one language and an evening sequence in another; separate lists make that editorial distinction explicit.

If you are building a longer prerecorded channel, the article on making a live stream from recorded videos on a low budget in India may help you think through the rest of the file-based workflow. For an FFmpeg-specific example, see the guide to setting up a 24/7 acoustic guitar radio stream. Neither replaces the need to test your own inputs and schedule.

Check compatibility and duration before joining files

The concat demuxer is convenient when the input files are compatible, but “both are MP4” is not enough to establish that. Check the streams present in each file, including video and audio codecs, stream layout, time bases, and relevant parameters such as dimensions and frame rate. The FFmpeg manual says the demuxer expects the same streams, with the same codecs and time bases, among other requirements.

Also check each file’s reported duration against what it actually plays. The demuxer adjusts timestamps globally as it reads inputs. FFmpeg notes that gaps can occur if streams do not have exactly the same length, and that inaccurate stored duration can lead to artifacts. That matters when one file is meant to end exactly as the next begins: a small discrepancy can show up as a pause, a jump, or audio and video that no longer line up as expected.

Test representative transitions, not just each file on its own. Play through the end of one file and into the next while watching and listening for a black frame, a repeated frame, an audio click, silence, or a change in sync. Check files that were exported by different editing tools or captured using different settings especially carefully. A list that opens without an error is not proof that the joins look or sound right.

Keep the intended broadcast output in mind as well. If the files have different dimensions or frame rates, even if the demuxer accepts the streams, the resulting output may not be consistent for your encoder or channel format. Decide whether you can keep inputs as they are or should normalise them before building the final sequence. If you use an FFmpeg command for probing or conversion, confirm its output and errors during a short test rather than assuming the command succeeded because the process started.

Use the concat demuxer for compatible files

When the inputs meet the compatibility requirements, the concat demuxer can read a text list in sequence without requiring the files to be re-encoded. A basic test command looks like this:

ffmpeg -re -f concat -safe 0 -i morning.txt -c copy -f flv output.flv

This illustrates the method, not a complete production command. -f concat selects the concat demuxer, -i morning.txt supplies its list, and -c copy asks FFmpeg to copy the streams rather than encode them again. The output container and streaming options need to suit your actual destination and encoder setup. -safe 0 permits paths the demuxer would otherwise reject as unsafe; only use it with a list you control and have checked.

Before sending a test to YouTube, write to a local output or otherwise validate the result. Confirm that it starts at the intended first file, progresses in the expected order, and handles each boundary acceptably. If the media is not compatible, stream copying does not make it so; it may fail, produce problematic timestamps, or lead to unwanted output. Do not respond to a mismatch by adding options until the symptoms disappear without identifying which property differs.

The demuxer is a good fit when you have prepared files with matching stream characteristics and want to avoid the cost and quality change of re-encoding. That convenience comes with a stricter input requirement. If a sequence includes a mix of video dimensions, codecs, audio layouts, or timing properties, a normalisation workflow is usually more appropriate than trying to force a direct copy.

For a live encoder, also make the end-of-list behaviour explicit. A list that reaches its final file is not automatically an endless schedule of different playlists. Determine whether your intended operation is to stop, repeat the same sequence, or let a scheduler start a different playlist, then test that exact behaviour. Do not infer clock-based switching from the fact that the files are concatenated successfully.

Normalise differing inputs with the concat filter

When inputs differ, one approach is to decode, transform, and encode them into a consistent set of streams before combining them. FFmpeg’s FAQ recommends the concat filter when re-encoding is needed. The filter workflow gives you a place to scale video, set a common frame rate or pixel format, resample audio, and bring inputs into an agreed output profile.

Normalising involves choices. Re-encoding takes processing time and can alter image or sound quality depending on settings. You need to select a target that fits your material and delivery setup, then check the result rather than adopting a command intended for another channel. A phone recording, a static image with music, and a high-frame-rate clip may all need different source handling even if the finished playlist should have a consistent format.

The concat filter’s inputs are decoded streams, and filter graphs can become lengthy when there are many files. For an easier-to-maintain operation, you might normalise each source file to a common intermediate format first and then build the final sequence, or generate a filter graph deliberately and keep it with the playlist notes. The appropriate choice depends on how often the files change and how much processing your machine can handle. Do a small test with the most different files before preparing a full schedule.

A filter-based workflow does not itself solve clock scheduling either. It produces the sequence; an external controller still chooses when to run it. If processing and delivery happen on the same machine, leave enough headroom for the encoding work and observe resource use during a realistic test. If the output falls behind or the machine struggles, simplify the workflow or prepare files ahead of broadcast rather than discovering the constraint during a scheduled slot.

Select the playlist at the chosen time

The reviewed FFmpeg concat documentation explains how to read a list and join its files; it does not define a complete native wall-clock scheduler for changing lists during a broadcast. Treat playlist selection as a separate implementation choice. A scheduler or wrapper can, for example, launch the process with the list assigned to a time slot, or decide that a running process must be stopped and another started. The exact mechanism needs to be tested in your environment.

A restart-based approach is easier to reason about than an unverified promise of in-process replacement: at a planned boundary, the controller stops or lets one run finish, then launches the next configured list. But this may interrupt the encoder output or create a gap, and it raises practical questions about what YouTube sees while the old connection ends and the new one starts. Do not describe this as seamless unless you have tested the complete path under the conditions you expect.

A schedule should define more than start times. Decide what happens if the previous sequence runs long, the machine reboots, a process exits early, or the intended file is missing. Establish a clear policy: skip a slot, delay it, retry, or alert an operator. Test how the scheduler handles local time and daylight-saving changes if those apply to your operating location. Avoid overlapping launches that might cause two encoders to compete for the same stream key; this guide to two encoders using one YouTube stream key is relevant when planning that hand-off.

Keep a record of the actual playlist launched and its result. A simple log that says which list was selected, when the process began, and whether it exited normally can make a late-night failure much easier to diagnose. If you need the channel to continue while your own computer is switched off, StreamNeo removes the need to keep a local machine running by taking an uploaded video and running it as a YouTube live stream; it does not replace the FFmpeg scheduler described here.

Keep the YouTube event separate

In YouTube Studio, create or schedule the broadcast event separately from the FFmpeg playlist plan. YouTube Help explains that scheduling a stream lets you promote it, and viewers can be offered reminders for the upcoming event. The Studio event controls when a broadcast is presented to viewers; they do not tell an FFmpeg process which concat list to read.

For an encoder workflow, YouTube Help directs you to configure the encoder with the YouTube stream URL and stream key, start the encoder, and use Live Control Room to go live. Check the current official instructions because Studio screens and available controls can change. Before a public slot, confirm the selected event, stream URL, key, and encoder status in Live Control Room. Use a private or otherwise suitable test arrangement if you need to verify the path without exposing a programme publicly.

You can also manage broadcasts and streams through the API. The YouTube API documentation calls the event a liveBroadcast and the incoming media configuration a liveStream. It explains that a stream can be reused for broadcasts at different times. This distinction helps when designing a recurring channel: the broadcast event and the incoming encoder connection are related objects, not the playlist file itself.

If you use HLS rather than RTMP for ingestion, follow YouTube’s HLS-specific requirements in its HLS setup guidance. Those instructions include segment, playlist, and request requirements, and YouTube notes that HLS has higher latency than a continuous RTMP stream. Do not apply HLS segment rules as if they were concat demuxer requirements; they concern how media is delivered to YouTube, not how FFmpeg orders source files.

A useful preflight is to run the intended playlist, confirm that YouTube receives it, and inspect the preview before the scheduled event. Check both the media and the event state. A working local concat test does not verify the stream key or broadcast configuration, just as a scheduled YouTube event does not verify that the scheduler selected the right list.

Choose a method by the constraint that matters

The practical choice depends on the inputs and the transition you can tolerate. Use the table as a decision aid, not as a guarantee about output; test the full route from source files through FFmpeg and into the broadcast setup.

Situation Playlist method Main trade-off to check
Inputs have matching streams, codecs, and time bases Concat demuxer with stream copy Less re-encoding work, but compatibility and stored durations matter
Inputs differ and need a common output profile Decode, normalise, and use the concat filter or prepared intermediates More processing and a quality trade-off from encoding
Different sequences must start at clock times External scheduler or wrapper selects the list/process Restart and recovery behaviour must be tested
A viewer-facing broadcast needs a start time and reminder Schedule/manage the YouTube event in Studio or API This does not select the FFmpeg playlist

If a playlist changes only when one sequence finishes, a simple controller that waits for completion may be sufficient. If it must change at a fixed clock time regardless of whether the current list has finished, decide explicitly whether to cut off the sequence or defer the next one. Those are editorial choices with different viewer effects, not settings the concat list can decide for you.

For continuity problems after the encoder starts, the FFmpeg reconnecting-stream troubleshooting guide may help distinguish a connection issue from a playlist issue. Keep those diagnoses separate: reconnection behaviour concerns the encoder-to-YouTube path, while ordering and selection concern the media and scheduler. No single test substitutes for checking each layer.

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

Does a concat list schedule a playlist by time?

No. It gives FFmpeg an ordered set of files to read. Use a separate scheduler or wrapper to select a list or launch a process at the intended time, and test what happens at the transition.

Can I use the concat demuxer when my MP4 files differ?

The container extension alone does not tell you whether the inputs are compatible. Check the streams, codecs, time bases, and durations; where the inputs need re-encoding or normalisation, use a filter-based workflow or prepare consistent files first.

Does scheduling a YouTube broadcast choose the media playlist?

No. Studio scheduling concerns the YouTube event and its promotion, while FFmpeg needs its own playlist selection. Verify both the event and the encoder’s selected input before the planned start.

Is a restart between playlists guaranteed to be gap-free?

No. A restart can interrupt the encoder output, and incompatible inputs or inaccurate durations can also produce gaps or artifacts. Test the actual hand-off and decide how your schedule should recover if a process exits or a file is missing.

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 ↗