Skip to content
streamneo.
Tools13 min read

How to Use FFmpeg Concat Files to Schedule Separate Blocks on a YouTube 24/7 Stream

Order prerecorded blocks for YouTube Live with FFmpeg’s concat demuxer, and understand its compatibility and scheduling limits.

sn.
StreamNeoPublished 5 October 2026
Worth sharing?

FFmpeg concat files can put compatible prerecorded blocks in a defined playback order and feed them through one encoder output to YouTube Live. They do not schedule blocks for particular clock times, create YouTube broadcast events, or guarantee an uninterrupted stream.

This workflow is useful when you have, for example, a morning devotional block followed by an evening bhajan block, but want the sequence described in a file rather than assembling one long video. The key is to treat media order, broadcast-event management and continuous operation as separate jobs.

What the concat file controls—and what it does not

The concat demuxer reads a plain-text script containing a list of files. FFmpeg processes those inputs sequentially and adjusts timestamps so that each next file follows the preceding one. In practical terms, the script says: play this block, then that block, then the next. The order is relative to the start of the input sequence, not to the date or time of day.

That distinction matters if you want different content at 6 am and 6 pm. A list containing morning.mp4 before evening.mp4 does not wait for morning or evening on a clock. It simply plays the first listed file and proceeds when that file ends. If the sequence reaches its final entry, what happens next depends on how you arrange the FFmpeg process; the concat script itself is not a calendar scheduler or a system for repeatedly launching broadcasts.

Nor does changing files in the input sequence create or manage a YouTube Live event. YouTube models broadcast events separately from the incoming media stream. Its Live broadcasts and streams documentation explains the distinction between a broadcast and a stream resource. You still need to set up and manage the broadcast using YouTube’s tools or API.

A concat list can include directives such as inpoint, outpoint and duration to select portions or describe durations. These alter how FFmpeg interprets the media sequence; they are not instructions to change content at a wall-clock time. For a repeating service, think of the file as a run sheet for the encoder, not a diary entry that says what should be live at a given hour.

If what you need is a straightforward playlist or continuous loop rather than different blocks with precise cuts, compare the approach with looping ASMR videos in FFmpeg. The right method depends on whether your main problem is file order, repetition or changing content according to a calendar.

Check input stream and codec compatibility

The concat demuxer does not automatically make unrelated media files alike. FFmpeg’s concat demuxer documentation states: “All files must have the same streams (same codecs, same time base, etc.).” In other words, check that each block has a compatible set of streams and that the relevant stream properties match before relying on direct concatenation.

A set of clips can all end in .mp4 and still be unsuitable for a simple demuxer workflow. One might contain video and audio while another contains only video; their codecs or time bases might differ. Treat the container extension as a clue, not proof of compatibility. Inspect the actual streams in each file and compare them before putting the list on air. If there is a mismatch, test a short sequence rather than finding out during a live run.

Duration information matters as well. The demuxer uses the preceding file’s duration to determine where the next file’s timestamps begin. If a file reports an inaccurate duration, FFmpeg can position subsequent material incorrectly, producing timestamp problems or visible and audible artefacts. A file that plays correctly on its own is not necessarily correct as part of a concatenated sequence.

When the files are not compatible, FFmpeg’s FAQ on concatenation points to the concat filter when re-encoding is needed. The filter can be part of a workflow that brings inputs into a common format, but it involves more processing and needs its own testing. The demuxer is a candidate when the inputs meet its requirements and you want file-level concatenation without re-encoding; it is not a universal shortcut for arbitrary files.

For a channel with recorded news segments, the same preparation principle applies even if clips arrive from several sources. The guide to building a 24/7 YouTube news stream from recorded clips is a useful comparison for the broader editorial workflow. Whatever the format of the content, standardise or transcode incompatible files before treating them as a single sequence.

Write the concat list in playback order

Create a text file with one file directive for each block. Put the exact signature on the first line when you want FFmpeg to recognise the format automatically, then list the files in the sequence you want them played:

ffconcat version 1.0
file 'block-01.mp4'
file 'block-02.mp4'
file 'block-03.mp4'

Save the list as a plain-text file, for example blocks.ffconcat, and keep it somewhere your FFmpeg process can read. The signature must be exactly ffconcat version 1.0 as the first line: do not add leading spaces, a heading or a byte-order mark. If the format is not recognised automatically, you can explicitly select the concat demuxer in the command, but keeping the prescribed first line avoids a needless ambiguity.

The filenames are resolved in relation to the working directory or path rules you use when invoking FFmpeg. Test with the same directory layout and command you intend to run in production. Simple filenames in one folder are easy to maintain; absolute paths can be easier to reason about when a process starts from a different working directory. Paths with spaces or special characters need correct escaping according to the FFmpeg documentation. Do not assume that quotation marks in a shell command and quoting in the concat file follow identical rules.

Make the order easy to audit. Names such as block-01-opening.mp4, block-02-reading.mp4 and block-03-music.mp4 help a person reviewing the list see what is meant to play next. The number is a sequence label, not a time-of-day instruction. If you rearrange a block, edit the list and verify it again; do not assume that renaming a file changes its position in the script.

The optional inpoint and outpoint directives can select a portion of an input. Use them only after checking where the actual audio and video should start and finish. A cut that appears sensible from a nominal duration may still clip an introduction, a spoken word or the tail of a devotional track. Play the resulting joins, not just the original files.

Use duration only when the reported duration is missing or inaccurate and you have a reliable value for the material you intend to include. The value affects where following files are positioned, so a mistaken correction can shift later timestamps. It is not a timer telling FFmpeg to hold a block until a scheduled hour. Keep a copy of the source list and a record of intentional edits, particularly if multiple people prepare the channel.

Run FFmpeg with the concat demuxer

A basic command shape is:

ffmpeg -f concat -safe 0 -i blocks.ffconcat -c copy OUTPUT_OPTIONS

This illustrates the input side, not a complete YouTube publishing command. -f concat selects the demuxer explicitly and -i points to the list. -c copy asks FFmpeg to pass the selected streams through without re-encoding. That is appropriate only if the input streams are suitable for this approach and the output requirements are met. It does not repair incompatible codecs, time bases or stream layouts.

The -safe 0 setting permits paths that the default safety rules may reject. Use it only when you control and trust the list and its paths. If the file list contains paths you have not checked, do not loosen the safety check just to make a failed command proceed. You can instead place the media and list in a simple, controlled directory structure.

Before starting a long run, test a short list with at least one transition. Check that video and sound continue through the join, that the next file begins at the expected point, and that the output stream properties are acceptable to your intended ingest. A command that launches successfully has not proved that every later file is compatible or that the timing will remain right across a long sequence.

If direct stream copying does not fit the files, use a workflow that normalises the media and re-encodes as needed. The concat filter is the documented alternative to consider when re-encoding is required, but it is a different construction from feeding a concat-demuxer list with -c copy. Choose deliberately rather than adding flags until the command stops reporting errors.

FFmpeg can run on a computer or other environment you control, but the process remains dependent on that environment and its connection. Keep the list, source files and command configuration together in a way you can inspect. A successful test is evidence that a particular sequence worked under test conditions, not a promise that a process will continue indefinitely or recover automatically from every failure.

Send the output to YouTube Live ingest

YouTube’s encoder workflow uses the stream URL and stream key shown in YouTube Studio. Add those as output settings to the FFmpeg command or configuration you use, following YouTube’s current instructions. Keep the key private: it grants access to send a feed to the associated stream, so do not paste a real key into an article, public script repository, screenshot or support message.

The output side of a command varies with the formats and settings you choose. Do not copy a command from another channel and assume its video dimensions, frame rate, audio settings or transport options suit your files and YouTube’s current ingest guidance. Configure and test the output deliberately. The sample above leaves OUTPUT_OPTIONS as a placeholder because the ingest destination and encoding settings belong to your own YouTube Studio setup.

Start the encoder, then inspect the preview in YouTube Live Control Room. YouTube’s streaming help describes the Live workflow, including preview and going live. Use the controls there to start or manage the broadcast when appropriate. Sending a signal to ingest and making a broadcast public are related steps, but they are not the same operation.

This distinction is useful when a channel runs a continuous feed while you manage a separate event, such as an interview. The media sequence can continue independently of the broadcast-event actions described by the platform. A new block in blocks.ffconcat does not create a second event, change an event’s visibility or decide when YouTube should publish it.

For a simpler playlist-based setup, you may also want to compare the OBS playlist workflow for YouTube Live. That approach changes how you assemble and send content, but the same operational separation remains: know what is playing, know what YouTube event is active, and verify the preview before relying on a live output.

Check timestamps and possible gaps

The concat demuxer adjusts timestamps so the next file follows the previous one, but that does not promise gapless playback. FFmpeg’s documentation notes that gaps can occur when streams within files have different lengths. For example, the video may end slightly before the audio, or the audio may continue after the picture ends. The adjustment between files cannot make unequal stream endings identical by magic.

Inspect both picture and sound around each join. Listen for a clipped word, a stretch of silence, a sudden change in loudness or audio that carries across a cut. Watch for a black frame, a frozen image or a change in frame cadence. A short local test can reveal problems that are easy to miss when you only inspect the start and end of each source file.

Check duration metadata when later blocks appear early, late or out of sequence. The next file’s timestamp placement depends on the duration FFmpeg reads for the preceding file. If that value is wrong, a duration directive may be appropriate, but verify the real intended cut point first. Do not use it as a guess to suppress a warning or cover an unexplained gap.

Keep the original media unchanged while debugging. Make one correction at a time: confirm compatibility, verify the list order, then check durations and cut points. If you change codecs or re-encode, repeat the join test because the output may behave differently from the source files. A clean first transition does not establish that all transitions are clean.

Plan a way to observe the live output after you begin. Check the Control Room preview and, where practical, the stream as a viewer would hear and see it. Monitoring can tell you that a problem has occurred; it does not prevent every fault. Recovery from a process crash, loss of power or network interruption is a separate operational plan, not a property of the concat demuxer.

This is often the point at which a local computer becomes the fragile part of the workflow. StreamNeo can remove the need to leave your own computer running for a file-based YouTube stream: you upload the video and provide the YouTube stream key, while the broadcast runs with monitoring and restart handling. It is YouTube-only, and it does not turn a media sequence into a wall-clock scheduler or remove the need to manage broadcast events separately.

Plan calendar scheduling separately

If blocks must change at a particular local time, build that requirement outside the concat file. The list handles an ordered run from its starting point; a calendar scheduler has to decide when a process or content change begins. That decision might be managed by an operator, a separate scheduling system or a planned broadcast workflow. Whichever route you choose, test how it behaves at the boundary between blocks and events.

Write down what each tool owns. The concat list owns file order and any media-relative cuts. FFmpeg owns reading and encoding or passing through those inputs. YouTube Studio or its API owns broadcast resources and event actions. A separate operating procedure owns clock-based changes, observation and recovery. Keeping the responsibilities explicit makes it easier to find whether a problem came from the media, encoder, event state or schedule.

YouTube’s API documentation describes a model in which a broadcast is a distinct resource from the live stream carrying media. That matters for a 24/7 channel: changing the content feed does not itself schedule or complete an event. If you need an interview or other separately managed broadcast while a continuing feed remains available, plan that as a platform-event decision, not as an extra line in the concat file.

Archive expectations deserve their own check. YouTube Help states that streams under 12 hours are automatically archived. Do not turn that into a promise that an uninterrupted 24/7 run will become one complete replay. If you need a replay or record of particular blocks, check YouTube’s current guidance and consider how to retain source files and create separate, reviewable recordings.

A useful operating checklist can be short: verify today’s list and source files; test the joins after any edit; confirm the intended broadcast event in YouTube Studio; start the encoder and inspect the preview; and know whom or what to check if the signal drops. Those tasks are separate from writing the file order, but they are what make a planned sequence usable in a real channel routine.

If your goal is to set up a continuous channel from a laptop, compare the Windows and BSNL broadband loop guide for the connectivity and local-machine side of the problem. It complements this concat workflow rather than replacing the compatibility checks or YouTube event controls.

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 file schedule a block for a particular time?

No. It orders files relative to the beginning of the input sequence, and FFmpeg proceeds through them in that order. A clock-based change requires a separate scheduling or operating process.

Can I use -c copy with any MP4 files?

No. The concat demuxer requires compatible streams, codecs and time bases, and duration metadata can affect timestamp placement. Inspect and test the files; use a workflow involving the concat filter and re-encoding when that is needed.

Will the concat demuxer guarantee gapless playback or keep running indefinitely?

No. Stream lengths can differ and cause gaps, and the demuxer does not guarantee uninterrupted operation or automatic recovery. Test transitions and plan monitoring and recovery separately.

Will YouTube archive my entire 24/7 stream as one video?

Do not assume that. YouTube Help says streams under 12 hours are automatically archived; check its current guidance for longer continuous feeds and plan any recording or replay needs separately.

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 Tools guides ↗ · All topics ↗