To make FFmpeg play children’s videos alphabetically on YouTube Live, put each video in the order you want in a concat-demuxer file. FFmpeg follows those file entries; it does not sort filenames for you.
Choose a precise rule for what “alphabetical” means, inspect the finished list, and check that the videos are suitable for the concat demuxer before you send them to YouTube. The list controls playback order, while the stream URL and key configure the separate connection to your channel.
Decide what alphabetical means for your channel
Start by agreeing on a rule you can apply consistently. A filename list can include capital letters, digits, punctuation, episode numbers and different spellings of the same character. Those details affect what a reader considers alphabetical, and different tools may arrange them differently. Do not assume that FFmpeg will resolve those choices: the concat file must already contain the intended sequence.
For example, you might want a programme’s episodes to appear in title order, with “Bluey - episode 01” before “Bluey - episode 02”, followed by “Puffin Rock - episode 01”. That is a human-readable ordering rule, not a claim that a particular shell command will produce it on every computer. Decide whether capitalisation matters, how to treat punctuation, and whether episode numbers should be read as text or as numbers. If you need episode 2 before episode 10, say so in your rule rather than relying on an unspecified default.
Filename consistency makes the job easier. If you can prepare the collection in advance, use one spelling for each programme and a predictable format for episode numbers. Avoid changing a video’s name after building the playlist unless you also update the corresponding file entry. The concat file refers to paths, not to a general idea such as “all files whose names start with Bluey”.
If you are comparing ways to keep a prerecorded channel running, the trade-offs in running a recorded video stream on an Ubuntu server can help you decide whether maintaining a local FFmpeg setup suits your operation. This guide stays with the ordering and connection work; it does not assume that every channel needs the same hosting arrangement.
Write the concat file in playback order
The concat demuxer reads a text script with one file directive for each input. Put the first video you want to play on the first file line, the next video on the second line, and continue until the playlist is complete. That line order is the playback sequence. It is not a directory scan and does not alphabetize the paths on your behalf.
A simple illustrative file could look like this:
ffconcat version 1.0
file 'Bluey - episode 01.mp4'
file 'Bluey - episode 02.mp4'
file 'Puffin Rock - episode 01.mp4'
The names here are examples only. Replace them with the actual paths to your videos, and make sure the paths are valid from the location where FFmpeg will read the script. The first line, ffconcat version 1.0, is an optional identifying line documented by FFmpeg. If you include it and want automatic format recognition, FFmpeg’s documentation says that line must match exactly at the start of the file; extra spaces or a byte-order mark can stop that recognition. See the FFmpeg concat demuxer documentation for the syntax and details.
Save the script as plain text. UTF-8 is a practical choice for a text file, but the important task is to preserve the exact path spelling and use syntax FFmpeg understands. Spaces and special characters need the appropriate quoting or escaping for the concat-file syntax. Do not copy the sample lines unchanged if your filenames differ, and do not treat quotation marks as a universal fix for every special character. Check the demuxer documentation when paths contain characters that need escaping.
Build the list by whatever method is reliable in your environment, but do not present a sorting command as portable unless you have confirmed its behaviour on the machine you will use. Sorting can depend on case handling, locale and whether a program compares digits as text or as numeric values. For a modest playlist, manually arranging the lines may be straightforward; for a larger library, a script can help, provided you inspect its output and know what rule it applies.
Inspect the playlist before streaming
Opening the concat file and reading it from top to bottom is a simple check that catches many avoidable mistakes. Confirm that every intended video appears once, none are missing, and the order matches the naming rule you chose. Look especially at groups of episodes with numbers, titles beginning with capitals or lower-case letters, and filenames containing punctuation.
Check the paths as well as the order. A correct-looking filename can still point to the wrong folder, a renamed file, or a path that works only on a different computer. If FFmpeg reports that it cannot open an input, check the path and spelling before changing the YouTube connection settings. Keep the media and list in a predictable location, and avoid moving either during a stream.
It can help to keep a clean copy of the playlist you have checked. If you regenerate it, compare the new order with the intended rule rather than assuming the tool produced the same result. A list that is alphabetically ordered but includes an unintended file is still the wrong playlist. Likewise, a sequence can look plausible at the beginning and contain a misplaced title further down.
If your plan is a continuous channel rather than a one-off broadcast, also consider how the sequence behaves when it reaches its end and how you intend to restart or change it. The mechanics of playing a long video on repeat to YouTube Live are a related but different problem: repeating a single file does not by itself define an alphabetical sequence of several files. Keep the repeat behaviour separate from the order you have established in the concat script.
Check whether the concat demuxer fits the files
Correct ordering does not make incompatible videos compatible. FFmpeg’s concat demuxer expects the input files to have matching streams, codecs and time bases. In practice, check that the files have the same relevant stream layout and encoding characteristics before relying on the demuxer to join them without re-encoding. A collection assembled from different sources can vary even when every file plays correctly by itself.
The concat demuxer also uses file durations to set the timestamps for subsequent files. FFmpeg warns that inaccurate duration information can cause gaps or other timestamp artefacts. If playback jumps, stalls between files or shows timing problems, do not assume the alphabetical list is the cause. Check the media properties and duration metadata as well as the playlist order.
There are two distinct FFmpeg approaches here. The concat demuxer reads a list of files and can avoid re-encoding when the inputs are compatible. The concat filter works on decoded inputs and is the appropriate direction when the material needs to be re-encoded to a consistent output profile. FFmpeg’s FAQ on concatenating media explains the distinction. The filter route takes more setup and requires a suitable output encoding configuration; the demuxer route is simpler when its compatibility conditions are met.
| Choice | Use it when | Main check |
|---|---|---|
| Concat demuxer | The inputs meet the matching stream, codec and time-base requirements | Confirm paths, entry order and duration information |
| Concat filter | The inputs need decoding and re-encoding to a consistent output | Configure the filter graph and output encoding deliberately |
If you do not know whether a set of files matches, inspect their media properties before scheduling a long broadcast. Test a short sequence that includes files from different parts of the collection. A successful test is useful evidence about those inputs, but it does not make incompatible files elsewhere in the library compatible. If the set is mixed, normalise it to a consistent profile or use a concat-filter workflow rather than expecting the demuxer to sort out differences.
A useful reference for the output side is the FFmpeg settings checklist for streaming internet radio to YouTube. Its subject is audio rather than a children’s video playlist, so adapt only what applies; the central lesson is to decide the output configuration for the material and destination you actually have.
Connect FFmpeg to YouTube Live
Once the files and concat list are ready, set up the broadcast in YouTube Studio’s Live Control Room. Create or select the live stream and copy the server URL and stream key shown for that stream into your encoder configuration. YouTube’s encoder setup help describes the same basic hand-off: enter the server URL and stream key in the encoder. The exact values are channel-specific, so use the ones displayed in your own Live Control Room rather than an example copied from a guide.
Treat the stream key as a credential. Keep it out of public documents, screenshots, shared playlist files and messages that do not need it. If you think it has been exposed, use YouTube’s current controls to manage the stream credentials. The concat file does not need the stream key; keep the media ordering script and broadcast credentials as separate pieces of configuration.
In the FFmpeg output configuration, use the supplied ingest URL and key in the form expected by your chosen encoder workflow. Google’s Live Streams API documentation describes an RTMPS primary ingestion URL and notes that encoders may take the URL and stream name separately or together. That API description helps explain the connection pieces, but for a normal channel setup, follow the current instructions and values in Live Control Room.
Start the encoder and check the YouTube preview or stream status before completing the remaining live-control steps. Confirm that YouTube receives a picture and sound, and that the stream is attached to the intended broadcast. The order list and the ingest settings solve different problems: a correct key does not repair a misplaced playlist entry, and a perfect playlist cannot connect with an incorrect URL.
If you are deciding whether to keep the encoder on a machine you maintain or use a different operating arrangement, compare the practical distinctions in VPS and cloud streaming for a 24/7 lecture channel. A local FFmpeg setup gives you direct control of the process, but means the computer, network and running job need attention. The right fit depends on who will maintain it and what failure recovery you need, not on the playlist’s alphabetic order.
Monitor the order and the stream
Before relying on a long-running broadcast, observe the transition between several files. Check that the first file starts where expected and that later titles follow the inspected list. If the sequence differs, return to the concat file and verify its lines; if the sequence is right but timing or picture quality is wrong, investigate compatibility, duration metadata and output settings instead.
Monitor YouTube’s stream status as well as what FFmpeg reports. A live stream can have a healthy input order while the connection drops, or it can remain connected while a particular file causes a playback issue. Keep notes about the point in the list where a problem occurs, which file was playing, and what the encoder or YouTube status showed. That gives you a specific starting point for diagnosis instead of changing several settings at once.
For a channel intended to run through the night, decide in advance who will notice a stopped process or a failed connection and what they can do. FFmpeg running on a computer is not the same as a supervised service: the machine may sleep, lose power or internet access, or stop the process. A restart plan, a tested playlist and a person responsible for checking the channel reduce uncertainty, though they cannot guarantee uninterrupted broadcasting.
If repeated manual recovery is the pain point, StreamNeo can remove the need to leave your own computer running: you upload the video, provide the YouTube stream key, and the stream runs from the cloud with monitoring and automatic restart if it drops. It is YouTube-only, and it does not change the need to prepare and validate your sequence or check YouTube’s current requirements. Keep your ordering work separate from the choice of where the broadcast runs.
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 alphabetize the files in a folder?
No. For the concat demuxer, the order of the file directives determines the sequence. Prepare the list in the order you want and inspect it before streaming.
Should I use the concat demuxer or concat filter?
Use the demuxer when the inputs meet its matching stream, codec and time-base requirements. If they need to be decoded and re-encoded to a consistent output, FFmpeg’s FAQ points to the concat filter approach.
Why might a transition have a gap or timestamp problem?
The concat demuxer uses file durations to set timestamps for later files, and inaccurate duration information can cause artefacts. Check duration metadata and input compatibility as well as the order of the list.
Where do I get the YouTube stream URL and key?
Get both from the live stream setup in YouTube Studio’s Live Control Room and enter them in your encoder configuration. Keep the key private, and check YouTube’s current official guidance if the controls or workflow have changed.