When an FFmpeg playlist reaches its last video, you can show a still image by appending a prepared fallback video to the concat-demuxer list. Its encoded duration sets how long that image stays on screen; it does not turn a finite playlist into an indefinite live stream.
The reliable approach is to make the still into a video with compatible video and audio streams, place it last, then send the concatenated input to YouTube at real-time speed. If viewers must see the image for an open-ended period, you need a separate continuing source or a supervised transition, not just a finite fallback file.
Choose the fallback behaviour and duration
First decide whether the image is a brief ending, a long holding screen, or a source that must remain live until someone intervenes. Those are different operating requirements. A prepared fallback file is a good fit when the playlist has a known endpoint and the still only needs to cover a defined tail, such as a closing card or an overnight holding period that you have deliberately bounded.
The fallback duration is the length of the prepared video, not a property of the image itself. A JPEG or PNG has no playback duration on its own. When you turn it into a video, you define how long its frames and any accompanying audio stream are available. At the end of that file, the concat input has also reached its end unless another source or process takes over.
For example, if a devotional channel has a set of recordings followed by a closing image, prepare the image video for the interval you want viewers to see after the last recording. If it needs to cover a planned session, allow for the possibility that the playlist takes longer than expected or starts late. Do not mistake a generously long tail for an unlimited one.
| Approach | Duration | Stream continuity | Compatibility and operations |
|---|---|---|---|
| Prepared fallback video | Bounded by the file's encoded duration | Continues through the appended file if the input and output remain healthy | Straightforward once the streams match; no automatic continuation after its end |
| Supervised transition to a continuing still source | Potentially indefinite while the source and supervision continue working | May involve a source change, restart or brief interruption | More orchestration and monitoring; test how the actual setup behaves |
An indefinite requirement usually means you should design a continuing source and a way to detect that the playlist has finished. A process can watch for completion and switch to a still-image source, but how seamless that is depends on the streaming arrangement. A restart or source transition may be visible to viewers. If you are weighing bounded playback against a managed continuous channel, how to set up a continuous YouTube live stream for a Punjabi podcast archive gives a related example of planning continuous playback.
Prepare a still-image fallback video
Use a still-image video rather than adding a bare image file to the concat list. The resulting file should have the intended frame size and frame rate and should last for the chosen interval. It also needs an audio stream layout compatible with the files before it. If the preceding clips carry audio, a silent audio track in the fallback can be useful to keep the stream layout consistent; if all clips share a different layout, match that instead.
A command outline for making a fallback is below. Replace the example image, dimensions, frame rate, duration and output name with values chosen for your material. The values shown are examples, not universal settings. Confirm the available filters and encoders in your installed FFmpeg build, and inspect a short output before using it in a live sequence.
ffmpeg -loop 1 -i still.png -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 \
-t 00:10:00 -vf "scale=1280:720,fps=30,format=yuv420p" \
-c:v libx264 -pix_fmt yuv420p -c:a aac -b:a 128k -shortest fallback.mp4
This illustration loops the image as an input while the output is being encoded, and uses a silent audio input. The -t value bounds the output. It does not instruct a later concat operation to keep generating frames forever. The scale, frame rate, pixel format, codecs, audio layout and duration all need to be adapted to the playlist and delivery settings; an arbitrary command may not match your source files.
Before relying on it, inspect the result: play it, check that the whole image is visible, confirm the duration, and listen for unwanted audio or an unexpected silence track behaviour. If your source videos have letterboxing or a particular aspect ratio, decide whether the still should fill the frame, retain borders or use a designed background. A simple test file is easier to adjust than a live broadcast with viewers already watching.
The FFmpeg formats documentation describes image input and concat demuxing behaviour. Its command-line documentation is the reference for options and their placement. Documentation and local builds can differ, so check the version and available components on the machine that will run the stream.
Match the playlist stream layouts
The concat demuxer joins packets from successive files; it is not a general-purpose editor that reconciles any two arbitrary videos. For reliable concatenation, the inputs need matching streams, including compatible codecs, stream ordering and time bases. Practical mismatches can include one clip having audio while another has none, different audio channel layouts, differing video dimensions, or codecs and parameters that do not line up.
Start by identifying the layout of the files you will concatenate. Use ffprobe or another inspection method available in your environment to check each file's video and audio streams, dimensions, frame rate, codec and time base. Compare the fallback with the last playlist entry and, ideally, the other entries too. A match only with the final clip may not be enough if earlier entries have a different layout.
If all files are already compatible, make the fallback match them. If not, choose a common output layout and normalise or re-encode the clips and fallback to it before concatenating. Re-encoding takes time and may affect image or audio quality, but it is often more predictable than hoping the demuxer will accommodate variations. Keep the original sources so that you can regenerate normalised files if the chosen layout needs to change.
Audio deserves particular attention. If some clips have no audio stream and others do, the sequence may not have a consistent layout. Adding silence to the fallback addresses only that fallback; it does not fix mismatches among the original videos. Conversely, a silent track is not needed just because a still image is involved if the entire playlist and expected output are video-only. Match the preceding stream arrangement rather than following a generic command blindly.
For a playlist with music, also listen for a hard audio change at the boundary. A silent tail may be appropriate for a closing card, but it will sound like the music stops. If you need music to continue, that requires a compatible audio source and a deliberate mix or transition, not simply a static image. For broader audio troubleshooting, see how to fix audio delay in screen recordings; the same habit of checking the sound at the actual boundary is useful here.
Append the fallback in the concat list
Create a text file in concat-demuxer format and list the source files in playback order, with the fallback last. A minimal example is:
ffconcat version 1.0
file 'clip-01.mp4'
file 'clip-02.mp4'
file 'fallback.mp4'
The first line declares the format. Each following file entry identifies a media file. Use paths that resolve from the working directory where FFmpeg will run, or provide full paths. If paths contain spaces or special characters, quote and escape them according to the concat demuxer syntax rather than assuming ordinary shell quoting rules apply to the list file.
Keep the fallback after every clip that should play normally. Putting it in the middle means the still appears before the remaining playlist material. The list itself does not make the fallback loop, and a duration directive in the list is not a replacement for preparing a correctly timed media file. FFmpeg documents a duration directive that can override a file's stored duration in concat input, but that does not create extra image frames beyond the media that is available.
Use a simple directory and descriptive names while testing. A misspelled path, an unescaped apostrophe or a list file saved in an unexpected encoding can prevent the sequence from opening. Once the list works, avoid changing filenames or moving files without updating the entries. For larger playlists, keep a copy of the exact list used for a test run so you can reproduce the sequence and identify which source caused a boundary issue.
Run and verify the FFmpeg sequence
For a real-time broadcast, FFmpeg must read the concat input at its natural pace rather than racing through it as quickly as the machine can process the files. The command structure below is illustrative; add the correct input options for your build and configure the output URL and stream key privately. Do not put a stream key in a public script, screenshot or shared troubleshooting log.
ffmpeg -re -f concat -safe 0 -i playlist.txt \
-c:v copy -c:a copy -f flv "rtmp://YOUR_INGEST_URL/YOUR_STREAM_KEY"
This example uses stream copy, which is suitable only when the concatenated streams and output container are compatible with the target delivery setup. If your sources need normalisation, encode to a consistent output instead of copying packets. The YouTube ingest endpoint and account configuration must come from your channel's live setup; do not treat the placeholder URL as an actual destination.
YouTube's live encoder settings guidance lists supported delivery and encoding guidance, including RTMP or RTMPS, video and audio codec choices, and recommendations for keyframes and bitrate behaviour. Recheck the current page before a broadcast because platform guidance can change. The settings need to suit the stream you actually send, not only the fallback file.
Before a public session, run a short private or unlisted test with representative playlist files. Watch the transition from the last clip to the still, then let the fallback reach its own end if possible. Check the YouTube stream health view, the command output, picture, audio and whether FFmpeg exits or reports an input problem at the end. A test that stops just after the first clip will not reveal whether the final transition or tail duration behaves as intended.
If you are assembling a long sequence, a file-size or upload constraint may matter as well as playback. Gyre upload limits for long videos and large playlists discusses a related planning concern; do not assume another tool's limits apply to FFmpeg, but account for the media files and the machine that will read them.
Handle a stream that must remain live
A finite playlist followed by a finite fallback has a finite total duration. When the fallback file ends, the input is exhausted. Looping the image while creating a fallback only generates the number of frames allowed by the output duration and encoding process. It does not add an infinite tail to an already finite concat list.
For a stream that must stay live beyond a bounded period, there are two sensible directions. You can make a longer fallback file that covers a known operating window, accepting that it still ends. Or you can supervise playlist completion and switch to a continuing still-image source. The second can support an open-ended holding state, but it requires a process to recognise completion, maintain a valid stream, and recover if the source or encoder fails.
Consider what viewers will experience at the switch. If the same encoder and output session can change source without stopping, the transition may be less disruptive, but you must verify that behaviour in your own setup. If the design stops one FFmpeg process and starts another, viewers may see a break or YouTube may register a stream interruption. Test the exact transition with the same account, output settings and type of connection you intend to use.
Do not call a stream indefinite merely because a still source is set to loop. The whole chain must continue producing and delivering valid media, and someone or something must handle failures. If you would rather not keep a computer at home running the playlist and manage the transition yourself, StreamNeo can remove that particular burden by turning an uploaded video into a YouTube live stream that runs with your computer off and restarts automatically if it drops. It is YouTube-only, so it does not solve a requirement to distribute the same stream to other platforms.
For a locally managed setup, continuity and recovery are separate jobs: the source needs to keep producing frames after the playlist, and the process needs a recovery plan if the stream drops. The practical details overlap with how to restart a YouTube 24/7 stream automatically after it disconnects, but a restart policy does not by itself decide what to play once the playlist has ended.
Common concat and transition checks
When the fallback does not appear, check the order and paths in the list before changing encoding options. Confirm that the file is actually listed last, that FFmpeg can open it from the process's working directory, and that the list syntax is valid. Then inspect the input streams: a still video prepared with an unexpected frame size, missing audio stream or different codec may fail at the transition even though it plays on its own.
If playback stops before the fallback, inspect the FFmpeg log for the first error rather than only the final message. A corrupt or unsupported clip earlier in the sequence can prevent later entries from being reached. Test entries individually, then test a shorter list that ends with the fallback. This isolates whether the problem is a source file, the concat list or the output configuration.
If the image displays but the broadcast ends at the end of the fallback, that is expected for a finite sequence. Increase the prepared duration if a longer bounded tail is all you need. If the requirement is genuinely open-ended, add a supervised continuing source and test its failure behaviour; merely adding an image loop option to one input is not an equivalent fix.
If the change is abrupt, distinguish video from audio. The still may appear correctly while the audio track ends, resumes at a different level, or changes layout. Decide whether silence, continued music or a fade is intended, and prepare streams that support that result. Any fade or mix must be created in the media or handled by a separate transition process; the concat list simply orders files.
Finally, distinguish FFmpeg input success from YouTube delivery health. A command that reads all files may still send an output format or encoding configuration that does not match current ingest guidance. Check the official encoder page, run the test in the real output configuration, and keep the stream key out of logs shared outside your team.
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
Can I add a JPG directly as the last concat file?
For a predictable result, render the JPG into a video with a defined duration and compatible streams, then append that video. A still image input has no natural duration that makes it behave like a playlist clip, and its looping options do not automatically extend the concat sequence forever.
How long should the fallback video be?
Choose a duration that covers the actual bounded interval you intend to show the image. Account for the playlist's expected finish time and how long someone can wait before checking the stream, but remember that the fallback ends when its encoded duration is exhausted.
Why does FFmpeg stop after the still image?
The concat input has reached the end of its last file. That is normal for a finite list with a finite fallback; extend the file for a longer bounded tail or arrange a continuing source transition if the stream must remain live.
Does a silent audio stream belong in the fallback?
Only if it matches the stream layout you need to maintain. If preceding clips carry audio, silence can keep an audio stream present, but it does not fix mismatches among the playlist files or continue music for you.