Skip to content
streamneo.
Setup Guides12 min read

How to Create an FFmpeg Playlist File for a YouTube Live Loop

Create an FFmpeg concat playlist for a YouTube Live loop, escape file paths, check compatibility and connect the encoder output safely.

sn.
StreamNeoPublished 4 October 2026
Worth sharing?

An FFmpeg playlist file for a YouTube Live loop is a plain-text concat script that names local media files in playback order. It is not a YouTube HLS media playlist, and the file alone does not configure YouTube ingest; you still need compatible media and an encoder output set up for your stream.

Create and test the concat script locally before building the live output. That gives you a chance to catch path errors, mismatched streams and unwanted gaps without debugging them while viewers are waiting.

Which playlist this guide covers

The word “playlist” can mean different things in a live video workflow. This guide covers the FFmpeg concat demuxer’s local script: a text file that tells FFmpeg which media files to read, in what order. It is useful when you have separate clips, recordings or programme segments and want them to play one after another as input to an encoder.

YouTube HLS uses a different kind of playlist. It is part of a network delivery protocol, with media segments and a rolling playlist; YouTube documents separate HLS ingest requirements and latency considerations in its HLS streaming guidance. Those rules do not describe the local concat script in this article. Do not rename a concat script an HLS playlist or apply HLS segment rules to it.

The concat script also does not make a channel live by itself. It neither supplies your YouTube stream key nor chooses the encoder’s codecs, bitrate, output format or destination. Think of it as an ordered input list: FFmpeg reads the listed media, while a separate set of output options handles the live stream.

This distinction matters if you are following a tutorial for a continuous broadcast. A local playlist made for FFmpeg may be suitable for a concat input, while YouTube’s HLS workflow expects its own protocol-specific setup. If you are deciding between an FFmpeg workflow and a desktop playlist workflow, this guide to automating a continuous YouTube Live channel with playlists in XSplit can help you compare the shape of the work without confusing the file formats.

Create the playlist.ffconcat text file

Make a plain-text file in the directory that contains your media, or choose another location and use paths that point to the files. A simple name is playlist.ffconcat. The extension is not a substitute for correct contents, but it makes the purpose of the file clear to you when you return to the project later.

For a first test, use a short list with two or three known clips:

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

Save the file as plain text, not as a rich-text document. Some editors add formatting or a byte-order mark at the start of a file; either can interfere with automatic format detection. The example assumes the clips sit beside the playlist file. If they are elsewhere, specify paths to their actual locations.

Keep the first test intentionally small. If the list contains an entire day’s programme, a failure can be harder to trace to one particular file. Start with a pair of representative clips, test playback, then add the remaining files in batches. Include files that are likely to be difficult: a clip exported from a phone, a recording with a different frame rate, or a segment with a separate audio track.

A playlist is a list, not a media conversion step. It does not repair a damaged file, standardise frame sizes or make audio formats match. The FFmpeg documentation describes the concat demuxer as joining inputs under compatibility requirements; use the official concat demuxer documentation as the reference for the exact script syntax and directives supported by your installed version.

Put the exact header first

For FFmpeg to recognise this script by its contents, the first line must be exactly ffconcat version 1.0. It must be at the beginning of the file: no leading spaces, blank line or byte-order mark before the f. Do not wrap it in quotation marks or add a colon. A visible blank line after the header is fine, but unnecessary in the starter file.

The header is a format marker, not a command to start streaming. If it is absent or malformed, automatic detection may fail. You can explicitly select the concat demuxer in an FFmpeg command, but doing so does not make a malformed script correct; the file entries still need to follow the demuxer’s syntax.

When a text editor offers encoding choices, save as UTF-8 without a byte-order mark. If you are unsure whether an invisible prefix exists, create a new plain-text file with a simple editor and type the header yourself. Do not copy it through an application that may prepend document formatting.

If FFmpeg reports that it cannot determine the format, check the first bytes and the filename before changing unrelated encoder settings. The header is a small detail, but it is one of the few requirements that applies to every auto-detected concat script. Keep the file simple until a basic test succeeds.

List files in playback order

Each file line names one input. FFmpeg reads entries in the order written, so arrange clips in the intended programme sequence rather than expecting the demuxer to sort them by filename, creation date or folder order. A filename scheme such as clip-01, clip-02 can make the order easy to see, but the lines in the script remain authoritative.

For a recurring devotional programme, for example, the list could place an opening chant first, a longer bhajan session second and a closing segment last. For a local news loop, you might place the station ident, headlines and community notices in a deliberate sequence. The media still needs to be suitable for concatenation; the playlist only tells FFmpeg what comes next.

To make the list repeat, a common approach is to list the sequence again after its final entry. That is straightforward but makes the script longer and can be awkward to maintain when the programme changes. Another option is to arrange the input or output workflow to loop, but the correct option depends on the command and FFmpeg build you are using. Test an actual transition from the last clip back to the first rather than assuming the loop boundary will be seamless.

If you use a duration directive, it affects timestamp handling for the following input and should be based on a reliable duration. The concat demuxer uses input timing to place later files after earlier ones. Incorrect or estimated durations can create a pause, overlap or timestamp problem at a transition. A truncated file may also have misleading duration metadata, so do not add a guessed duration just to suppress a warning.

This is also a good point to consider what happens when one clip is no longer wanted. Remove or replace its file line, then run the test again. For another example of the concat demuxer in a looping channel context, see how to use FFmpeg’s concat demuxer for church service recordings. The relevant idea is the ordered input list; it does not remove the need to check each asset.

Quote or escape paths carefully

Paths with spaces or punctuation require care. The example uses single quotes around each filename, which is convenient for ordinary paths such as morning prayer.mp4. The concat demuxer has its own quoting and escaping rules; do not assume that shell quoting rules apply, because the playlist is parsed by FFmpeg rather than by your command shell.

For example, a relative path with spaces can be written as:

file 'Morning Session/clip one.mp4'

Apostrophes inside a path are more troublesome. FFmpeg’s documented syntax uses escaping within the quoted path; consult its file and escaping syntax notes and test the exact path you intend to use. Do not blindly add backslashes copied from a shell command: the playlist parser and your shell are separate layers, and a path can be interpreted differently at each one.

Relative paths are resolved from the working directory or in relation to the script according to how FFmpeg is invoked and the demuxer’s safety rules. To reduce ambiguity, keep the playlist alongside its media and test from the same directory you expect to use in production. Alternatively, use absolute paths and verify that the account running FFmpeg can access them.

The concat demuxer applies safety checks to paths. A command pattern sometimes includes -safe 0 to relax those checks, but that should not be a casual fix. It permits paths that the default safety mode rejects, so use it only when you trust and control the playlist contents. A playlist assembled from untrusted input should not be granted broader path access simply to make a test pass.

Avoid special characters in a first draft where practical. A simple directory such as live-media and filenames such as clip-01.mp4 make it easier to isolate compatibility errors from path-parsing errors. Once the basic script works, test a representative filename with spaces or punctuation before adding a whole archive of complicated paths.

Check compatibility and test playback

Matching filename extensions do not prove that two files can be concatenated safely. Two .mp4 files might contain different video codecs, audio layouts, time bases, frame rates or stream arrangements. The concat demuxer joins packet streams; it is not a general-purpose transcoder that normalises every input on the way through.

FFmpeg’s concat guidance sets out the compatibility conditions and distinguishes the concat demuxer from the concat filter. The demuxer is useful when the inputs already have compatible streams and you want to avoid re-encoding. When assets need to be converted to a common format, a filter-based workflow with re-encoding may be the more appropriate route. The FFmpeg FAQ on concatenating media explains that method choice. You can also review a practical discussion of FFmpeg bitrate settings for a 1080p 30fps playlist, while keeping in mind that the right output settings depend on your own source files and stream configuration.

A sensible test sequence is:

  1. Confirm that every listed path exists and that the FFmpeg process can read it.
  2. Inspect representative inputs for their video and audio streams, including resolution, codec, frame rate and audio layout.
  3. Run a local playback or short file-output test before sending anything to YouTube.
  4. Watch and listen across every transition, including the final-to-first boundary if you intend to repeat the sequence.
  5. Check FFmpeg’s messages for timestamp warnings, missing streams and decode errors, then test again after any conversion or script change.

A conceptual input pattern is ffmpeg -re -f concat -safe 0 -i playlist.ffconcat .... This is not a tested, universal command: the ellipsis stands for the encoding, muxing and output options that must suit the files and destination. The -re option is often used to read inputs at their native pace for a live-style workflow, but exact flags and their placement matter. Before production, check ffmpeg -h demuxer=concat on the installed build and consult the current guidance for the encoder settings you plan to use.

Pay particular attention to duration accuracy. The demuxer adjusts timestamps so later inputs follow earlier ones, but a wrong duration can shift the next clip’s start time. If the source has a reliable measured duration, a duration directive can override stored timing as documented. Do not use it as a guessed repair. If the clips are structurally different, standardise them first rather than trying to conceal the mismatch with timing changes.

Compatibility testing is not wasted effort when the final goal is a 24/7 channel. A quiet gap between two clips may be acceptable for a study station but not for a tightly scheduled news loop. A frame-size jump might be tolerable in a casual archive stream yet distracting in a polished devotional channel. Decide what a good transition looks and sounds like for your viewers, then test those transitions before enabling the live output.

Connect the encoder output to YouTube

After the local input test behaves as expected, configure the encoder output separately. In YouTube Live Control Room, create or open the intended stream and obtain the server URL and stream key provided for that stream. Enter them in the encoder’s private output settings, then start the encoder and monitor the incoming preview. YouTube’s encoder setup instructions describe the platform workflow; follow the current instructions in Live Control Room because interface labels and requirements can change.

Do not put the stream key in playlist.ffconcat. The concat file should contain media paths and relevant concat directives only. Keep the key out of a public script, repository, screenshot or log. Anyone who obtains it may be able to send a broadcast to your channel, so treat it as a credential and use YouTube’s current controls if you need to replace it.

A typical setup has two separate parts: the input side reads the concat script and the output side encodes and sends a stream to YouTube’s ingest destination. A command such as ffmpeg -re -f concat -safe 0 -i playlist.ffconcat ... illustrates where the playlist enters the workflow, but it does not supply universal video and audio codecs, bitrate, keyframe interval or muxer settings. Use a current encoder configuration suitable for your source and YouTube’s guidance, and verify the exact command on your installed FFmpeg version.

When you schedule a stream, check the preview in Live Control Room before you make it public or click Go live. Look for stable video, audible sound, correct sequence and a clean transition. For a live channel intended to run unattended, also decide who will notice a dropped encoder, what restart process is available, and how you will verify that the broadcast has resumed. An ordered playlist is only one part of an operating plan.

If maintaining a computer and watching for a failed process is the part that makes an always-on channel impractical, StreamNeo can remove that specific burden by running an uploaded video as a 24/7 YouTube stream while your own computer is off. It does not change the need to prepare compatible media, protect your stream key or check YouTube’s current ingest guidance.

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 playlist.ffconcat a YouTube HLS playlist?

No. It is a local FFmpeg concat script that lists media inputs. YouTube HLS is a distinct network ingest protocol with its own segment and playlist requirements, so use the HLS guidance only when you are configuring HLS ingest.

Why does my FFmpeg playlist fail or show a gap?

First check the exact header, path spelling, quoting and whether FFmpeg can read every file. Then check whether the inputs have compatible streams and whether their durations are accurate; mismatches or bad timing metadata can cause errors or gaps at transitions.

How do I make the playlist go live on YouTube?

The playlist supplies FFmpeg’s input sequence, not the YouTube destination. Configure the encoder output with the stream URL and key from Live Control Room, keep the key private, start the encoder and check the incoming preview before going live.

Should I use the concat demuxer or concat filter?

Use the concat demuxer when the files already have compatible stream structures and you want to join them without re-encoding. If they need normalising or re-encoding, consult FFmpeg’s concat guidance on the filter-based approach and test the resulting output before connecting it to YouTube.

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 ↗