To add a countdown between videos in an FFmpeg YouTube Live playlist, render it as a video clip and place that clip in the ordered sequence sent to the encoder. FFmpeg does not add a countdown automatically: you choose its duration and appearance, then concatenate it with the surrounding videos using an approach that suits their formats.
Use the concat demuxer only when the files have compatible streams, codecs and time bases. If they differ, use the concat filter to normalise and re-encode them; that costs processing time but gives you control over the output format.
Plan where the countdown belongs
A countdown slate is part of the outgoing audio-video feed. It does not create a separate YouTube broadcast or schedule one. If your sequence is video1.mp4, a countdown clip, then video2.mp4, viewers see the countdown after the first video and before the second. Repeat the slate entry at each transition where you want one.
Decide first what the slate is for. It might give viewers time to settle before a devotional programme, show the start time of a local news segment, or mark the next study session. A fixed slate is straightforward to place in a static playlist. If the next item or its start time changes during the day, a pre-rendered countdown will not adjust itself; you will need to regenerate the clip or use a workflow that can select and switch content dynamically.
The position in the list also determines when viewers see it. A slate at the end of a loop appears every time playback reaches that point. If you only want a countdown before a particular programme, place it directly before that item rather than at the end of every video. Write down the intended order before editing commands; a short text list is easier to inspect than a long chain of input arguments.
For a playlist of recorded classes, for instance, you could put a slate between a morning lesson and a later lesson so the transition is deliberate rather than an abrupt cut. The same planning applies to a stream assembled from several language playlists. If that is your use case, see how to rotate language playlists on a multilingual channel for the broader scheduling problem; the countdown itself remains a media item in the FFmpeg sequence.
Set duration, canvas and audio
Choose the slate’s duration to fit the interval you want viewers to have. A brief transition may need only a short title card, while a longer countdown can communicate an exact programme start. The research examples use 30 or 60 seconds as possible choices, not universal recommendations. Pick a length that suits your schedule, and check that the displayed countdown reaches its intended endpoint without freezing or ending early.
The canvas means the video’s width and height, along with its frame rate. When practical, match these to the videos around the slate and to the output you intend to send to YouTube. A mismatched canvas may be scaled or padded during processing, and a different frame rate can complicate transitions or output timing. Decide whether to preserve the source appearance, add bars, or fill the frame; preview the result rather than assuming that automatic scaling will look right.
Audio needs an explicit decision too. A slate can carry silence, music, or continuing background audio, but the choice affects both the viewer experience and stream compatibility. Silence is suitable for a clean pause, provided you deliberately create an audio stream if adjacent files have one. Music needs a level that does not jump sharply at either cut. Continuing ambience may require a more involved mix than simply inserting a self-contained clip.
A playlist with audio on every item and a slate with no audio has a changing stream layout. That is one reason the demuxer’s compatibility requirements matter. Adding a silent audio track can keep the layout consistent, but it does not by itself guarantee that codecs or time bases match. If audio changes are already causing trouble, the guide to fixing audio out of sync on a YouTube stream can help you reason about the symptom separately from the slate workflow.
Generate the slate with FFmpeg sources and filters
FFmpeg’s color source can produce a background, while its drawtext filter can place text over it. You can therefore render a simple countdown clip without starting a separate graphics application. The FFmpeg filters documentation describes these filter capabilities and their options; check the documentation for the FFmpeg build you have installed, since available features can vary.
A typical construction has a colour source with a defined size and duration, followed by text drawn over it. The text can be static, such as “Next session starts soon”, or use an expression based on elapsed clip time to display a changing count. Specify a font file explicitly with fontfile where needed. Font lookup differs across systems, and a path that works on a desktop may not exist on a small Linux machine.
A conceptual command shape is:
ffmpeg -f lavfi -i "color=c=black:s=1280x720:r=30:d=60" \
-vf "drawtext=fontfile=/path/to/font.ttf:text='Next session soon':x=(w-text_w)/2:y=(h-text_h)/2:fontsize=48:fontcolor=white" \
-an -c:v libx264 -pix_fmt yuv420p countdown.mp4
This creates a static text slate, not a running numerical countdown. It is an illustrative template: adjust the canvas, frame rate, duration, font path and encoding to suit your files and FFmpeg build. To show changing numbers, use a drawtext text expression tied to elapsed clip time, and test its expression syntax locally. Do not rely on a copied command until you have confirmed that your build can find the font and render the intended text.
The example omits audio with -an. If the other playlist files expose audio, create a silent audio stream for the slate or choose a concat-filter workflow that gives every segment a deliberate audio output. If you choose music, render or mix it into the slate at an appropriate level. A video-only slate may play successfully as a clip on its own yet fail the stream-layout condition needed for demuxer concatenation.
Use a distinctive filename and keep the rendered file alongside the playlist list or in a path you can reference reliably. A finished clip is easier to reuse and inspect than attempting to generate graphics as an implicit part of each playlist transition. Keep the countdown as media in the same outgoing sequence; it is the encoder feed, rather than a separate YouTube event, that determines what viewers see.
Match the slate to the playlist output
Before concatenating, inspect what each file actually contains: video dimensions, frame rate, codec, time base, audio presence, channel layout and duration. File extensions do not tell you whether two files are compatible. Two MP4 files can differ in their encoded streams, and files with similar-looking pictures may still have distinct time bases or audio layouts.
If all the inputs already share the conditions required by the concat demuxer, avoid unnecessary conversion and preserve that common format. If the slate is the odd one out, re-encode it to match the playlist rather than converting every long programme file by default. If multiple clips differ, a single normalisation pass may be easier to reason about. Choose a target format that your encoder can send to YouTube and that your machine can sustain.
The YouTube Help guide for creating a live stream with an encoder explains how to obtain the stream URL and key and configure an encoder. Consult YouTube’s current encoder recommendations when choosing output settings; do not treat a sample command as a guarantee that every combination of resolution, frame rate, audio and machine capacity will work. The relevant output is one continuous feed, even though its content is assembled from multiple files.
If your priority is to keep a playlist running without leaving a home computer on, a cloud-based workflow can remove that specific machine-availability concern. StreamNeo turns an uploaded video into a YouTube-only live stream, so it is relevant when the operational problem is keeping a file-based broadcast running while your computer is off. It does not replace the need to plan the media, confirm rights, or check the live feed.
Use the concat demuxer for compatible inputs
The concat demuxer reads a text list of files in sequence and adjusts timestamps based on their durations. It is convenient when every input has the same streams, codecs and time base. The FFmpeg concat demuxer documentation sets out those compatibility conditions and the list syntax. Do not assume that it will work reliably when stream layout, codecs or time bases differ.
An illustrative list looks like this:
ffconcat version 1.0
file 'video1.mp4'
file 'countdown.mp4'
file 'video2.mp4'
file 'countdown.mp4'
The signature, when used, must be exactly at the beginning of the file for automatic recognition. Each file directive adds the next item in playback order. Use paths that exist from the location where FFmpeg runs, and escape paths correctly if they contain characters with special meaning. For a long playlist, check the list line by line; one misplaced entry changes what viewers see.
A matching output command can use the list as an input and send the resulting sequence to an ingest endpoint. For example:
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.ffconcat \
-c:v libx264 -preset veryfast -pix_fmt yuv420p \
-c:a aac -b:a 128k -f flv 'YOUTUBE_INGEST_URL/STREAM_KEY'
This is an implementation template, not a tested universal command. Confirm that the installed FFmpeg supports the options as used, replace the placeholders with the current YouTube ingest details, and choose output settings suitable for the source and available processing capacity. Keep the stream key private: it is a credential, not ordinary diagnostic text, so avoid sharing it in public scripts, screenshots or logs.
Duration metadata deserves attention. The demuxer uses file duration when it advances timestamps to the next input. If a file reports an inaccurate duration, the next segment can begin at the wrong time, producing gaps, overlaps or audio and video artefacts. FFmpeg documents an optional duration directive for cases where metadata needs correction. Use it only after checking the actual clip, rather than masking a bad or unexpectedly truncated file.
The -stream_loop -1 option in the example repeats the input sequence indefinitely. That is useful for a fixed playlist, but it does not create or update a countdown based on a changing schedule. The countdown repeats as rendered. If you need the content or time to change during the day, a static ffconcat list is not a scheduling system.
Normalise with the concat filter when needed
When inputs do not meet the demuxer’s compatibility conditions, use the concat filter to bring their video and audio streams to a consistent form, then encode the result. FFmpeg’s FAQ on concatenating video distinguishes the demuxer route from the filter route and recommends the filter when re-encoding is needed. This takes more processing than joining compatible files and can introduce another generation of encoding, so use it when format differences make that trade-off worthwhile.
A filter workflow gives you the opportunity to scale or pad each video, set a common frame rate, align timestamps and arrange audio streams. If a segment has no audio while others do, decide whether silence or a different mix is intended, then ensure each segment supplies the expected audio output. Normalisation should be deliberate: arbitrarily stretching an image, changing frame rates, or mixing unrelated audio can solve a technical mismatch while making the programme less pleasant to watch.
The filter’s concat operation expects its inputs to be prepared consistently. For a small playlist, an explicit graph can be manageable; for many files, generating the graph from metadata reduces hand-editing mistakes. In either case, test a short segment first. Re-encoding every file can be slow on modest hardware, especially if it must happen at the same time as live output. If your computer cannot encode the normalised result in real time, prepare the files beforehand and use a compatible output sequence.
Do not choose between methods by the word “concat” alone. The practical comparison is the input compatibility, tolerance for re-encoding, processing load, and confidence in duration information:
| Approach | Best fit | Main trade-off | Check before relying on it |
|---|---|---|---|
| Concat demuxer | Inputs already have matching streams, codecs and time bases | Avoids a filter-based re-encode, but is sensitive to compatibility and duration metadata | Compare stream layouts and confirm reported durations |
| Concat filter | Inputs need normalising or re-encoding | More control over a common output, with added processing and encoding cost | Prepare every segment consistently and check real-time capacity |
Neither method repairs poor source material automatically. If one clip has unexpectedly low audio, a different aspect ratio, or an incorrect duration, identify whether to preserve, correct or replace it before building the final sequence.
Test ordering and output before YouTube Live
Render a local sample or test the feed privately before you depend on it overnight. Watch the transition into the slate, the displayed count, and the cut into the next video. Listen through the same points with headphones or speakers you normally use. A visual check will not catch an audio gap, and listening alone will not reveal a frame that freezes at the transition.
Check that the playlist order is right, the slate lasts as intended, and the total run time is plausible. Confirm that audio stays at a sensible level and that a silent slate does not unexpectedly remove audio from later items. Review the output for cropping, letterboxing, font substitution and timestamp glitches. When duration metadata is suspect, compare the file’s actual playback with what FFmpeg reports before deciding whether to use an explicit duration.
For a YouTube test, create or schedule a stream in Live Control Room and use its current server URL and stream key in the encoder. YouTube’s instructions say to start the encoder and wait for the preview; for a scheduled broadcast, select Go live in Live Control Room after the preview appears. A connected encoder feed and a published broadcast are distinct steps. The Google for Developers explanation of broadcasts and streams describes that distinction: inserting a slate changes the incoming feed, not the identity or schedule of a broadcast.
A private or unlisted test can still reveal problems with the encoder path and transitions, but it does not establish that every future session will behave identically. Recheck the current stream key, feed preview and event state before going live. If the channel remains at “Waiting for encoder”, the issue may be connection or configuration rather than slate content; see the guide to the encoder waiting message on a church stream.
Keep a copy of the working playlist list, the rendered slate, and the settings used to encode them. This makes it easier to reproduce a known-good sequence or identify which change caused a new fault. For an always-on channel, test changes when you can observe the result rather than making several edits immediately before leaving the stream unattended.
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 insert a countdown between playlist videos automatically?
No. Render a countdown as a clip and put it at the required position in the input sequence. A fixed clip repeats as rendered; it does not calculate a new start time from your schedule.
Can I use the concat demuxer if my videos are all MP4 files?
The container extension alone is not enough. The demuxer requires the inputs to have matching streams, codecs and time bases, and inaccurate duration information can affect timestamp adjustment. Inspect the files or normalise them with the concat filter when needed.
Should the countdown have an audio track?
That depends on the surrounding playlist and the intended transition. If the other entries have audio, an audio-free slate changes the stream layout; adding silence can preserve the layout, but you must still check codec and time-base compatibility. Music or continuing ambience should be mixed and tested so the level does not jump at either cut.
Does a countdown slate schedule a new YouTube Live broadcast?
No. It changes the content being sent in the encoder feed. Create or schedule the broadcast separately in Live Control Room, then follow YouTube’s current steps for preview and going live.