Skip to content
streamneo.
Setup Guides11 min read

How to Set Up FFmpeg to Play a Folder of Recorded Lessons in Alphabetical Order on YouTube

Create an ordered FFmpeg manifest, check lesson compatibility and send one continuous prerecorded programme to YouTube Live.

sn.
StreamNeoPublished 4 October 2026
Worth sharing?

To stream recorded lessons from a folder in alphabetical order, create a text manifest that lists them in the exact sequence you want, then have FFmpeg read that manifest. FFmpeg’s concat demuxer follows the manifest; it does not scan a directory and sort its contents for you.

This produces one continuous YouTube Live broadcast from prerecorded files, not separate uploaded videos. Before building the list, decide what “alphabetical” means for filenames with numbers, such as whether Lesson 2 should come before Lesson 10.

One broadcast, not a batch of uploads

The workflow has two separate parts: prepare an ordered input sequence for FFmpeg, then send the resulting continuous feed to YouTube Live. Viewers tune in to the live broadcast as it runs. The original lesson files do not become individual YouTube uploads as a result of this process.

That distinction matters if you need viewers to choose lessons individually, search for each recording, or watch on demand. Those needs point towards uploading separate videos and organising them in a YouTube playlist instead. A live sequence is useful when you want a scheduled programme, such as a day of classes that plays without someone selecting each lesson in Studio.

A playlist of files on your computer is not enough to define broadcast order. The FFmpeg concat demuxer reads a manifest: a text file that names each input in sequence. You control the sequence by writing or generating that file. For background on the outcome rather than this FFmpeg method, see how to loop multiple videos on YouTube Live.

Plan for the broadcast to be one run through the listed files unless you deliberately prepare a repeating workflow. If the live stream must continue when its last file ends, that is a separate concern from ordering; the guide to keeping a YouTube livestream from ending when a video finishes explains why the final input matters.

Decide what filename order means

“Alphabetical” sounds unambiguous until a folder contains labels with numbers. A simple text sort may place Lesson 10.mp4 before Lesson 2.mp4, because it compares characters rather than interpreting the numbers as lesson numbers. The research for this procedure establishes that the manifest controls playback sequence; it does not establish a universal sorting rule for your shell, file manager, or script.

Choose the intended convention before making the manifest. For example, if you want lesson numbers to sort as numbers, use zero-padded names such as Lesson 02.mp4 and Lesson 10.mp4. If you want ordinary letter-by-letter ordering, decide how punctuation, upper- and lower-case letters, and accents should be treated, then check the result in the tool you use to create the list.

A reliable small-folder method is to write the desired order yourself. For a large collection, a file manager or script can produce a candidate list, but inspect it before feeding it to FFmpeg. Do not assume that “sort by name” means the same thing in every operating system or locale. A manifest is explicit and reviewable, so it is a good place to catch a lesson numbered incorrectly or a duplicate recording.

Keep the filenames stable while preparing and testing. If you rename or move an input after writing the manifest, its entry may no longer resolve to the intended file. A short review against the lesson plan, including the first and last entries, can prevent a session from starting with the wrong class or stopping before the closing lesson.

Write the manifest in playback order

Create a plain-text file outside the lesson media directory, for example lessons.ffconcat. Put this exact header on the first line, with no blank line or other text before it:

ffconcat version 1.0
file 'Lesson 01.mp4'
file 'Lesson 02.mp4'
file 'Lesson 10.mp4'

Each file directive names one input, and the directives appear in playback order. In this example, the numbering has been padded so the intended numeric sequence is clear. The header lets FFmpeg recognise the concat demuxer format automatically when the manifest is used as input. The FFmpeg concat demuxer documentation describes the manifest format and its file directives.

This example assumes the manifest is in the same directory as the lesson files and that the filenames are simple. If the manifest is elsewhere, write paths that resolve from its location or use a deliberate working-directory arrangement. Do not shuffle lines later as a shortcut: the line sequence is the broadcast sequence.

For repeatability, retain a copy of the final manifest with the project notes. Before a longer broadcast, read it from top to bottom and compare it with the desired lesson schedule. If two files have similar names, a small typo can point to the wrong lesson or a nonexistent path, even though the manifest itself looks orderly.

Check paths and media compatibility

A manifest can be correctly ordered and still fail to play. Check that every referenced file exists, that the spelling and extension match, and that FFmpeg can read the path. Paths with spaces or special characters need correct quoting or escaping in the manifest syntax. Begin with simple filenames where possible, and avoid adding -safe 0 casually: the concat demuxer applies safe-path restrictions by default, and relaxing them changes what paths it accepts.

The concat demuxer is intended for inputs whose streams, codecs and time bases match. Matching extensions do not prove that files are compatible. Two .mp4 lessons might differ in video codec, frame rate, audio layout, or other stream properties. Inspect representative files with FFmpeg’s media-information tools and compare their streams before relying on packet concatenation.

Input situation Practical approach Trade-off
The files have matching streams and relevant codec parameters Use the concat demuxer with an ordered manifest Avoids a re-encoding preparation pass, but depends on genuine compatibility
The files differ and need a consistent output Prepare them to common parameters, or use the concat filter workflow Requires more processing and care; re-encoding can affect quality and takes time
You are unsure whether they match Inspect a sample from the beginning, middle and end, then test a short sequence Takes time before broadcast, but reveals mismatches before the full run

FFmpeg’s concat FAQ distinguishes the demuxer approach from the concat filter, which is designed for cases where re-encoding is needed. Normalisation is a preparation step, not something achieved just by changing a file extension. Make a deliberate choice based on the actual inputs and the capabilities of your FFmpeg build.

A media check should include audio as well as video. One lesson may have stereo audio while another has a different layout or sample rate; a title card may have no audio stream at all. These differences can make an otherwise tidy folder a poor match for direct concatenation. If you need to standardise files, test the prepared outputs rather than assuming a conversion succeeded because it produced a file.

Point FFmpeg at the manifest

From a shell in the directory containing both the manifest and lesson files, a basic input command is:

ffmpeg -f concat -safe 1 -i lessons.ffconcat -c copy output.mp4

This example reads the manifest with the concat demuxer and copies the encoded streams into a local output file. It is a useful way to test whether the sequence can be joined without re-encoding. It is not a universal command for every folder: it assumes the manifest paths are acceptable under safe mode and that the files are compatible for stream copying. If the output fails or has a discontinuity, revisit paths and stream compatibility rather than immediately changing the safety setting.

For a live output, the same manifest input can be paired with an output configuration for YouTube, but do not treat a command copied from another machine as ready to run. FFmpeg options for codecs, frame rate, keyframes, audio, rate control and destination must match the output you intend to send and the capabilities of your installed build. A command that copies source streams may not produce the encoding settings YouTube recommends.

When inputs need re-encoding, use a preparation workflow that gives them compatible properties or consider the concat filter. That route has more moving parts and may need enough local processing capacity to keep up with the intended broadcast. Check the result locally with a short sample sequence before combining media preparation and a live YouTube output in one troubleshooting step.

Configure the YouTube Live destination

In YouTube Studio, create a live stream or schedule one, then open the Live Control Room and copy the ingest URL and stream key for that event. Configure FFmpeg’s output for that destination. Treat the stream key like a password: do not include it in a screenshot, public repository, shared command transcript, or other material that viewers or strangers can access.

YouTube’s live encoder settings recommend RTMP or RTMPS workflows and provide guidance for codecs, frame rate, keyframes, audio and bitrate. Its current guidance includes a two-second keyframe frequency, no more than four seconds, CBR and AAC or MP3 audio for the listed workflow. It also recommends progressive scan, square pixels and SDR Rec. 709. Treat these as YouTube’s recommendations, not proof that every source file or FFmpeg build supports every combination.

Use the bitrate guidance for the selected codec, resolution and frame rate rather than copying a single rate from a tutorial. For example, YouTube Help lists 5 Mbps for H.264 at 1080p and 30 fps, and 8 Mbps for 720p at 60 fps; those are settings guidance, not a guarantee of a successful broadcast. YouTube also recommends testing upload capacity. Your practical choice has to account for the actual output profile and a stable connection with room for variation.

YouTube says RTMPS is RTMP over TLS/SSL. Copy the secure endpoint shown in your own Live Control Room instead of guessing it from a generic RTMP example; its RTMPS guidance explains where to obtain it. If the broadcast is scheduled, wait for the preview to appear in Live Control Room and then select Go live when you are ready. Creating the event and sending an encoder feed are not necessarily the same as making the scheduled broadcast public.

Test sequence, then monitor the run

Test a short private or unlisted stream with actual lesson audio and motion before using the full manifest. Check the preview in Live Control Room and review stream health. YouTube’s live streaming setup guidance advises creators to test and monitor their streams. A still frame or silent section is not enough to show that both the audio path and the sequence are behaving as intended.

Include a transition between lessons in the test. Confirm that the last seconds of one recording are followed by the expected first seconds of the next, and listen for gaps, abrupt changes in volume or missing audio. Test a file with the less common properties in your collection too, not only the first lesson. This is where differences in streams or manifest paths are more likely to show up.

During the broadcast, keep an eye on stream health and on the current lesson. If the feed freezes, the manifest order may be fine while the output or network has a problem; if the wrong lesson appears, compare the current position with the manifest rather than changing encoding settings at random. For a troubleshooting reference, see what to check when a YouTube live stream freezes but stays online.

YouTube says streams under 12 hours are automatically archived. Do not rely on that statement for a longer stream, or treat an archive as a substitute for separately publishing lesson videos when viewers need on-demand access. If the programme is scheduled, remember to use Go live after the preview is ready, and decide in advance how you will handle the end of the final file.

A folder sequence is only one part of an overnight or all-day operation. Someone still needs to verify the media, destination, and channel state, and decide what should happen if the feed stops. StreamNeo removes the specific burden of keeping your own computer on for a file-based YouTube broadcast by running an uploaded file from the cloud and restarting automatically if the broadcast drops; it is YouTube-only, and the manifest and content still need to be prepared correctly.

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 alphabetise the folder automatically?

No. The concat demuxer follows the sequence of file directives in the manifest you provide. Create or generate that sequence yourself and inspect it before sending the feed.

Will Lesson 2 play before Lesson 10?

Only if the manifest lists it first. A text-based filename sort can put Lesson 10 before Lesson 2; use a naming convention such as zero-padded numbers if that is the sequence you intend, then verify the generated list.

Can I concatenate lessons with different formats using the same manifest?

The concat demuxer requires matching streams, codecs and time bases for the direct packet-concatenation approach. If the lesson files differ, inspect them and prepare compatible outputs or use a concat-filter workflow that can re-encode.

Does this publish every lesson as an individual YouTube video?

No. It sends the ordered prerecorded files as one continuous live broadcast. If viewers must select and revisit lessons separately, publish them as individual videos and organise them independently.

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 ↗