Skip to content
streamneo.
Comparisons12 min read

FFmpeg Concat Demuxer vs Playlist File for a Continuous YouTube Stream

Understand the difference between FFmpeg concat scripts and HLS playlists, when to use each, and what YouTube requires for HLS ingest.

sn.
StreamNeoPublished 4 October 2026
Worth sharing?

The FFmpeg concat demuxer and an HLS playlist are different tools, even though both involve text files that list media. Use a concat script to sequence compatible local files; use an HLS media playlist when you are sending segmented media through YouTube’s HLS ingest.

For most fixed collections of local clips, start by checking whether their streams match and then consider the concat demuxer. If they need format changes or re-encoding, look at the concat filter; if you intend to deliver HLS, follow YouTube’s media-playlist requirements rather than treating a concat script as an HLS manifest.

First identify which “playlist” you mean

The word “playlist” causes the confusion. An FFmpeg concat script is a plain-text input list for FFmpeg. It names files that FFmpeg should read in sequence. An HLS .m3u8 playlist is a manifest for media segments and is part of an HLS delivery workflow. They are not two versions of the same file.

A typical concat script might contain lines such as file 'morning.mp4' and file 'evening.mp4'. FFmpeg reads each named input and presents its packets as a sequence. By contrast, an HLS media playlist contains references to segmented media, along with timing and other information needed to interpret those segments. The playlist and segments together make up the HLS media presentation.

That distinction should come before a command recommendation. If your aim is to play a folder of finished videos one after another into a live encoder, a concat input may fit. If your aim is to send HLS segments to YouTube, you need an HLS output workflow with a compliant media playlist. You do not turn one file type into the other merely by giving it a .m3u8 extension.

What the concat demuxer does

FFmpeg’s concat demuxer documentation describes a demuxer that reads a text list of files and processes them one after another as though their packets had been muxed together. “Demuxer” means it reads and interprets media inputs; it is not the component that creates an HLS stream. The concat demuxer is useful when you have a sequence of local media files and want FFmpeg to treat them as one continuing input.

The usual script begins with the directive ffconcat version 1.0, followed by one file line for each input. It can be supplied to FFmpeg with the concat demuxer selected as the input format. The exact command depends on the codecs, container, output protocol and whether you will copy streams or encode them again, so do not assume that a short example is safe for every collection of files.

The important constraint is compatibility. FFmpeg says the files must have the same streams, including the same codecs and time bases. In practice, compare more than filenames and extensions: check which audio and video streams exist, their codecs, timing characteristics, dimensions and other properties relevant to the output. Two MP4 files can still have different stream layouts. A clip with no audio is not automatically compatible with one that has an audio stream simply because both play normally on a computer.

The demuxer adjusts timestamps using each file’s duration. If one stream in a file is longer than another, or if duration information is inaccurate, the next file’s timestamps may leave a gap or create an unwanted transition. This is why “the files are in the right order” does not prove that a stream-copy join will look or sound clean. Review the joined output rather than assuming that the script resolves differences.

The concat demuxer is attractive when its constraints fit because it can avoid re-encoding. That can save processing work and avoid another lossy encode. The trade-off is that it relies on inputs being sufficiently alike; it is not a general-purpose repair step for incompatible material.

What an HLS playlist does

HLS, or HTTP Live Streaming, packages a presentation as media segments described by a playlist. FFmpeg’s HLS muxer documentation describes a separate output mechanism that creates a playlist and segment files. That is distinct from the concat demuxer, which reads a list of whole input files.

An HLS media playlist is normally the manifest for a particular stream of segments. A master playlist, by contrast, can describe variant streams for different qualities or renditions. The distinction matters in this context because YouTube’s HLS ingestion guide says that YouTube supports media playlists for HLS ingestion and ignores master playlists. Do not send a master playlist on the assumption that YouTube will choose a variant from it.

HLS is relevant when you have chosen HLS as the ingest protocol and can generate and serve its playlist and segments in the required manner. It is not a more sophisticated way to list local MP4 files for FFmpeg. Creating an HLS output involves segmenting encoded media and maintaining a manifest that describes the segments; a concat script alone does neither.

There are two separate decisions here. First, decide how FFmpeg should read or assemble your source material. Second, decide which protocol and format you will use to deliver the encoded stream to YouTube. You might use a concat demuxer to sequence compatible local files and then encode or mux the result for a different ingest protocol. If you choose HLS delivery, the output must meet HLS ingest requirements regardless of how the source clips were assembled.

Choose concat for sequential local files

Choose the concat demuxer when the source is a fixed set of local files, you want them played in order, and their streams are compatible enough for file-level concatenation. This is a reasonable starting point for a devotional channel rotating a prepared set of aarti videos, or a study channel joining several recordings, provided you have checked the media properties and the timing behaves as expected.

Make a small test list before building the full schedule. Include a representative transition, especially one between files that were exported at different times or from different editing software. Check the sound at the end of the first clip and start of the next, whether the image resumes at the intended frame, and whether audio and video remain in sync. A short preview can reveal an incompatibility before it becomes a problem in an overnight broadcast.

If you plan to stream-copy the result, remember that copying means FFmpeg is not re-encoding the media to make it match. That is efficient only when the inputs and target are compatible. If you change your mind and need to standardise dimensions, frame rate, sample rate or codecs, stream copy will not perform that conversion; you need an encoding step, which costs processing time and can affect quality.

Plan the sequence as carefully as the format. Use stable local paths, keep the script’s file order explicit, and avoid changing or moving source files while the broadcast is running. A relative file path is interpreted in relation to the process’s working directory, so a script that works from one folder can fail when launched by a scheduled job from another. For a practical discussion of rotating devotional clips, see how to use a playlist file to rotate aarti videos in FFmpeg; check whether its use of “playlist” refers to the same mechanism you intend to use.

For an always-on channel, also consider what happens when the sequence reaches its end. A concat demuxer reads the listed files in order; it does not by itself provide a permanent repeat policy. Your broader FFmpeg command or operating arrangement must handle looping or restarting in a way suited to the channel. If you are building a continuous FFmpeg workflow, the guide to running a continuous podcast stream with FFmpeg on YouTube can help with the surrounding operational questions.

When to use the concat filter

Use the concat filter as a candidate when the clips need re-encoding or more substantial normalisation before they can be joined. FFmpeg’s FAQ on concatenation distinguishes the demuxer approach from the filter approach and points to the filter when re-encoding is needed. The filter works on decoded media streams, so you can apply processing as part of building a common output rather than simply presenting source packets in sequence.

That flexibility has a cost. Re-encoding consumes CPU or GPU capacity, can take longer than copying streams, and introduces a generation of compression. On a machine that is also responsible for an uninterrupted live output, encoding load is part of the reliability plan. If you are running from a small computer, the article on reducing CPU use in a 24/7 YouTube lofi stream is relevant to deciding whether to encode continuously or prepare a standardised file in advance.

The filter is not a promise of seamless joins. Inputs still need to be mapped and handled deliberately, and differences such as video dimensions, pixel formats, frame rates, audio sample rates or channel layouts may require explicit treatment. You need to decide what the common output should be and check that each input is converted appropriately. A join can be technically successful yet still have an audible level jump, a brief silence or an unwanted change in picture cadence.

A useful decision is whether to normalise once before broadcast or to transform every clip as it is played. If your library is stable, preparing consistent files in advance can reduce the work required during the live session. If clips arrive frequently, an on-the-fly filter may be more convenient, but test the processing load and output over a representative run. There is no universal command without knowing source properties and the accepted output format.

YouTube HLS playlist requirements

If you choose HLS ingest, follow YouTube’s current documentation rather than general assumptions about HLS. Its HLS ingestion guide specifies the playlist type and delivery conditions. In particular, it calls for HTTPS, persistent requests, a single encoded stream, and audio and video muxed together. It also states that master playlists are ignored, so provide a media playlist for the stream rather than expecting YouTube to select one from multiple variants.

These requirements concern the HLS delivery to YouTube, not the format of your local source files. Your source could be a single recording, a concat sequence or material processed with a filter; the HLS output still needs to meet the documented ingest rules. Likewise, making an HLS playlist does not fix a poor join in the underlying video. You must validate both the assembly of your content and the delivery format.

Do not copy an HLS example without checking whether it represents a complete ingest workflow. A playlist reference that works in a browser or a locally served test may not establish the persistent connection or other behaviour YouTube expects. Confirm the current official instructions for the protocol, playlist and segment details before you commit a long-running channel to that route. If your actual plan is to use RTMP rather than HLS, treat it as a separate ingest choice; a concat script can still be an input mechanism without becoming an HLS playlist.

Validate the inputs and the live output

Start by inspecting every source, not just the first one. Record whether it has video, audio, or both, and note the codec and time base for each stream. Check dimensions and frame rate for video, and sample rate and channel layout for audio. These checks help identify files that cannot be safely stream-copied as a sequence. They also give you the information needed to decide whether to standardise the files ahead of time or use a filter and encode.

Next, validate ordering and path handling. Put a few files into a test concat script and confirm the order by watching the result. Test from the same directory and under the same launch method you intend to use for the actual stream. A script can appear correct in an interactive terminal and then fail under a scheduler because the working directory is different or a file is unavailable.

Then check transitions. Listen for a cut in speech, abrupt volume changes, silence, clicks or a shift in background noise. Look for a blank frame, a change in aspect ratio, an unexpected crop or a pause before the next clip. In a bhajan stream, a join in the middle of a sung phrase may matter more to viewers than a small technical discontinuity; in a local news loop, a stale slate or an unplanned black frame may be the more visible issue.

Finally, monitor a test broadcast through a complete sequence and, if it loops, through the return to the first item. Check YouTube’s live preview and the actual playback path you care about, rather than relying only on FFmpeg reporting that it is running. Keep an eye on whether the encoder can sustain the chosen settings and whether the ingest remains connected. For stream-copy or encoding decisions that affect the output, compare your target against the guidance in YouTube Live encoder settings for bitrate, keyframes, profile and preset. If a stream disconnects, distinguish a content-boundary issue from an ingest or network issue before changing the file assembly method.

A sensible rollout is a short file-level test, then a longer unattended test, then the intended schedule. Keep the source set and script unchanged during each test so that a result can be repeated. Record which boundary caused a problem and what the output did; this is more useful than changing multiple settings at once and guessing which change helped.

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

Is an FFmpeg concat script the same as an HLS .m3u8 playlist?

No. A concat script tells FFmpeg which local files to read in sequence. An HLS media playlist describes segments for HLS delivery, and YouTube’s HLS guidance says it ignores master playlists.

Can I use the concat demuxer for any two MP4 files?

No. The container extension does not establish that their streams match. Check codecs, streams and time bases, and test durations and transitions; mismatched material may need normalisation or the concat filter with re-encoding.

Does the concat demuxer create HLS segments?

No. It is an input mechanism for reading a sequence of files. FFmpeg’s HLS muxer is a separate output mechanism that creates a playlist and media segments.

Which method should I choose for a continuous YouTube stream?

For compatible local files, the concat demuxer is the relevant way to sequence them, with a separate plan for looping and ingest. Use a concat filter when re-encoding or normalisation is needed; use an HLS media playlist only when you are choosing HLS delivery and can meet YouTube’s current requirements.

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