Skip to content
streamneo.
Troubleshooting13 min read

How to Fix FFmpeg Playlist Order Changing During a 24/7 YouTube Music Stream

Trace the exact FFmpeg concat playlist in use, then check list generation, file ordering, stream compatibility and duration-related transition artefacts.

sn.
StreamNeoPublished 4 October 2026
Worth sharing?

When a 24/7 YouTube music stream appears to play tracks in the wrong order, first verify the exact concat script opened by the running FFmpeg process. Then compare its entries with the intended sequence before investigating wrappers, scheduled jobs, file listings or timing artefacts.

For FFmpeg’s concat demuxer, the text input list determines which files are read and in what order. A transition that sounds like a skip or overlap does not, by itself, prove that FFmpeg reordered that list; stream compatibility and duration metadata can affect how files meet.

Confirm the running process’s playlist path

Start with the process that is actually broadcasting, not the playlist you remember creating or the file open in an editor. Find the command line used to launch FFmpeg and identify its input. A concat-demuxer command commonly includes an option such as -f concat -i playlist.txt; the path after -i is the place to investigate, interpreted relative to the process’s working directory if it is not absolute.

The distinction matters when a launcher starts FFmpeg from a different directory, when a container has its own filesystem paths, or when several copies of a playlist exist. Editing ./playlist.txt in a shell does not establish that the live process reads that copy. These are possibilities to check, not conclusions about what happened in any particular stream.

Record the full command, working directory and exact input path while the broadcast is running. If a supervisor, container entrypoint or scheduled task starts FFmpeg, inspect the command it launches rather than relying only on the outer command used to start that supervisor. Redact stream keys and other credentials before sharing command output or logs.

Also identify the kind of input. This article concerns FFmpeg’s local concat demuxer, not every file called a “playlist”. A YouTube HLS ingest playlist is a separate, segment-oriented input. The FFmpeg documentation for the concat demuxer describes its file-list input, while Google’s YouTube Live HLS ingestion guide covers a different workflow. Do not apply local concat-file advice to an HLS Media Playlist without checking the relevant HLS requirements.

If your wider setup involves a pre-recorded visual that repeats alongside audio, keep the video-loop question distinct from the audio playlist question. The practical notes in making a 24/7 rain stream look smooth when the video loops concern visual continuity; they do not identify what input list your FFmpeg process is reading.

Inspect the concat script order

Once you have the path, open that precise file and compare its file directives from top to bottom against the desired playback order. FFmpeg documentation describes the concat demuxer as reading files one after another. In this mode, the sequence of entries in the script is the direct evidence of the intended sequence at input; the names of files in a folder do not independently define playback order unless a tool generated the script from them.

Make a copy of the active list for diagnosis before changing it. Give the copy a timestamp or another clear label, then annotate the observed order separately. If the running file changes during your inspection, preserve both versions. That lets you distinguish “the list currently says this” from “the list said this when the transition was observed”. Avoid editing the active file in the middle of an evidence-gathering pass: a change can fix the symptom, but it can also erase the clue that explains it.

Check the format as well as the sequence. A concat script is plain text with directives and paths. Paths with spaces or special characters must be represented correctly, for example using appropriate quoting or escaping. If you use the optional ffconcat version 1.0 signature for automatic format recognition, FFmpeg specifies that it must be exact and appear at the very beginning of the file, without leading whitespace or a byte-order mark. A malformed or misread input is a different problem from a valid list that has the wrong order.

For a readable audit, number the entries in a separate copy or use a small table with three columns: position in intended sequence, path in the running script, and expected track identity. Keep the actual script’s syntax intact. This makes repeated names, stale paths and numbering mistakes easier to see without relying on memory or on how a track sounds after a long broadcast.

If you use a rotating playlist and need to prevent a repeated item at a block boundary, compare this method with rotating playlists on a YouTube 24/7 stream without repeating the last video. The underlying goal is similar, but a rotation policy and FFmpeg’s concat input are separate layers; verify the list FFmpeg actually receives.

Check for regenerated or replaced lists

If the script’s current order differs from the intended order, find out how the file was made and whether anything can replace it. Search the launcher, wrapper, scheduler, container entrypoint or other list-generation code for operations that write, copy, rename or regenerate the playlist. A stream may use a static list, or a job may rebuild it; neither should be assumed without checking the setup.

Look for the point at which generation happens. A job that creates a list at startup may behave differently from one that rewrites it on a schedule. A wrapper may create a temporary file and then move it into place. A management panel may store a source list in one location while the running command points elsewhere. These examples describe diagnostic paths, not established causes for your stream.

When you find the generator, inspect how it selects and sorts paths. Does it use a hand-maintained sequence, a numeric prefix, file modification time or an unsorted listing? Is the expected ordering rule explicit? A sequence such as track-1, track-10, track-2 may not sort as a person expects if names are compared as text. If numbering is intended to control playback, use a consistent naming convention and make the sorting rule match it. Then inspect the generated output rather than assuming the generator produced the intended result.

Compare versions at useful moments: the list before FFmpeg starts, the one at an observed transition, and the one after any scheduled task runs. If you can, log the generated entries and the time they were generated. Keep this logging separate from the audio itself, and do not expose private paths or credentials when sharing it. If the generated list changes but the process keeps reading an earlier copy, that is a path or lifecycle question; if the active file changes, investigate what wrote it and when.

A 24/7 operation also benefits from keeping the media source and playlist-generation process conceptually separate. Advice on storing video files for a continuous YouTube stream may help with file availability, but storage location alone does not establish playback order. Trace the generated text list and the exact input path independently.

Verify globs and directory listings

A playlist generator may derive its entries from a glob or a directory listing. If so, inspect the selection pattern and the ordering step. A pattern that matches more files than expected can add tracks; a directory listing whose order is not explicitly sorted can produce a sequence that differs from the one you had in mind. Again, these are things to test, not claims about the cause of an individual stream.

Check for similarly named files, duplicate copies and extensions the pattern includes. A folder might contain an old export alongside the current master, or a naming convention may include both a full track and a shorter edit. Confirm each generated path points to the file you believe it does. If a generator uses a shell glob, reproduce its match set in the same environment and directory context as the running job; a test from your desktop may not have the same working directory or files.

Make the ordering rule visible in the generator. If playback should follow track numbers, sort by a consistently padded numeric prefix or provide an explicit sequence rather than relying on whatever order a tool returns. If it should follow a hand-curated set, keep that set in a manifest and have the generator follow its lines. After changing the rule, inspect the resulting concat file line by line before restarting the stream.

Do not confuse an FFmpeg concat list with a YouTube HLS Media Playlist. The latter describes media segments for an HLS ingest workflow, while a local concat script lists files for FFmpeg’s demuxer. If your command includes an HLS output or input path, establish which side of the pipeline is under investigation. For current ingest details, return to the official YouTube HLS guide, since requirements can change.

Check input streams and time bases

If the concat script order is stable but the sound or picture behaves oddly at file boundaries, check the inputs’ stream layouts and properties before calling it a reordering problem. FFmpeg’s concat demuxer expects the files to have the same streams, codecs and time base. Compare the files you actually list, not just one representative track. A set of audio files may have been exported with differing properties, or one item may contain an extra stream; inspect with FFmpeg tools and note what is present.

The demuxer adjusts timestamps so one file follows the previous one. FFmpeg notes that gaps can occur when streams have different lengths. That can make a boundary feel wrong even when the next file directive is exactly where expected. Listen around the transition and compare it with the list position, rather than concluding from a perceived pause or overlap that the order changed.

For an input-by-input check, make a table of path, audio stream presence, codec, time base, duration information and expected next item. The table is for comparison, not a substitute for the FFmpeg documentation. If one file differs, test it separately or produce a consistent set of media before returning to a long-running stream. Keep the original files and the test output distinct so you can roll back if the new set introduces a different problem.

There are two concatenation approaches worth distinguishing. The concat demuxer can avoid re-encoding when inputs are suitably compatible. The concat filter is a different method and may be appropriate when you need to re-encode or normalise inputs; FFmpeg’s FAQ on concatenating media discusses the alternatives. The trade-off is that re-encoding adds a media-processing step and requires checking the output, while trying to use the demuxer with incompatible inputs can produce problems at joins. Choose based on the files and the operation you need, not on the assumption that one method is always better.

Method or input When it fits What to verify
Concat demuxer Inputs can be joined without re-encoding and meet its compatibility expectations Same streams, codecs and time base; correct list and duration information
Concat filter Inputs need processing or re-encoding to make a consistent output Filter graph, output properties and resulting transitions
HLS Media Playlist Your workflow sends or consumes HLS segments Segment sequence and current YouTube ingest requirements

The table is not a complete command recipe. In particular, HLS segment ordering is not a way to repair a local concat list, and a concat filter does not automatically correct every duration or source-media issue. Use the method appropriate to the point where the discrepancy occurs.

Investigate incorrect file durations

A stable order can still sound as if something has been skipped when a file’s duration information is missing or inaccurate. FFmpeg uses durations to determine timestamps for subsequent files in the concat demuxer; its documentation warns that an incorrect duration can cause artefacts. That is why it is important to separate the script’s sequence from the timing of the resulting stream.

Compare the reported duration with the actual playable content for every listed file, especially around a transition that seems wrong. A duration entry in the concat script, if present, is an input to timestamp calculation; it should not be added or copied blindly. A file may also have media metadata that does not reflect the length you expect. Check the relevant file and the FFmpeg log, and keep track of whether you are examining source duration, a script directive or output timestamps.

Use an isolated test of the two neighbouring files when practical. If the same apparent pause or overlap occurs outside the full playlist, that points you towards a boundary or timing issue to investigate, but it does not alone establish its cause. Compare the expected start of the next item with the observed transition and the logged timestamps. Avoid “fixing” a duration based only on how long a track feels; establish what the media contains and how FFmpeg is interpreting it.

If the list position and timestamps indicate the next file is correct but the transition remains unusable, consider making the source properties consistent or using a concat filter where re-encoding is needed. Re-test the resulting files before returning them to the live playlist. A technical change to durations or encoding can alter timing and quality, so retain the originals and document the test rather than making multiple changes at once.

Retest with a fixed playlist

After diagnosing the active path, generator and media properties, build a small fixed test list from known files in the intended sequence. Avoid a glob or scheduled regeneration for this test. Use clear paths, confirm the list syntax, and check that each entry resolves to the intended file. The point is to remove moving parts temporarily, not to claim that a short test proves how a 24/7 operation will behave overnight.

Run the test through the same relevant FFmpeg input method and inspect the output around several file boundaries. Keep a note of the expected order, the actual list, the command (with secrets redacted), FFmpeg version and any useful log lines. If the fixed list behaves as intended but the usual process does not, compare the two launch paths and list-generation steps. If it does not, revisit syntax, path resolution, media properties and durations. Neither result identifies a cause on its own; it narrows what to inspect next.

When ready to restore automation, change one variable at a time: first the generator or sort rule, then the schedule or wrapper, then any media conversion. Verify the list produced by each change before relying on it for a long broadcast. Keep a known-good copy and a way to restore it. For a non-technical operator, a plain-text manifest reviewed before launch is often easier to audit than an implicit folder-order rule.

If maintaining a local computer and its repeatable process is the part causing you trouble, StreamNeo can remove that specific operational burden by taking an uploaded video and keeping a YouTube broadcast running without your computer switched on. It does not diagnose or repair an FFmpeg playlist, so first establish whether your issue is the input list, media timing or another part of the workflow.

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 FFmpeg randomly change the order in a concat playlist?

The concat demuxer follows the file directives in its input script, so inspect the exact script opened by the running process before drawing a conclusion. A wrapper or generator may produce a different script, and timing artefacts can resemble a skip, but the available evidence does not establish a cause for any particular stream.

Why does the next song seem to start early or late?

The list may still be in the intended order while duration information or differing stream properties affect timestamps at a boundary. Compare the adjacent files, their duration information and the output log before treating the transition as proof of reordering.

Should I use the concat filter instead?

Use the concat demuxer when the inputs are compatible and you want to avoid re-encoding. FFmpeg’s FAQ points to the concat filter when re-encoding is needed; check the source properties and test the output before changing a long-running setup.

Is a YouTube HLS playlist the same as playlist.txt?

No. A local concat script is FFmpeg input listing files, while an HLS Media Playlist describes segments in an HLS workflow. Confirm which input or output your command uses and check the current official YouTube guidance if you are working with HLS ingestion.

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