To loop podcast episodes under one still image on YouTube Live, give FFmpeg an ordered concat playlist, loop that audio input and the image separately, then map and encode both streams for YouTube ingest. The example below is a starting point, not a command tested against your particular computer or FFmpeg build.
You also need an event’s RTMPS ingest address and stream key from YouTube Live Control Room. Test the stream privately or unlisted before relying on it overnight: playlist paths, available encoders, upload capacity and event settings all affect whether a command that looks right will actually run.
Prepare an ordered episode playlist
Put the MP3 files in the order you want them played, then create a plain-text file called episodes.txt. For simple filenames, its contents can be:
file 'episode-01.mp3'
file 'episode-02.mp3'
file 'episode-03.mp3'
The concat demuxer reads those entries in sequence as one audio input. Put the playlist and MP3s together for a straightforward relative-path setup, or use absolute paths if they live elsewhere. Relative paths are resolved from the playlist file’s location, not necessarily from the directory you happen to be in when starting FFmpeg.
Keep filenames plain where you can. Apostrophes, backslashes and unusual characters need the concat demuxer’s quoting and escaping rules; copying the simple example unchanged for such filenames can make FFmpeg parse a path incorrectly. If FFmpeg reports that it cannot open a file, check the exact spelling and path first, then the quoting. The FFmpeg concat demuxer documentation describes the file format and its safety behaviour.
The example command uses -safe 0 so the playlist can use paths that the demuxer would otherwise restrict. That option makes the playlist more permissive, so use it only with a file you control and have checked. Do not run a playlist supplied by someone else without inspecting its entries.
Before starting the stream, play the episodes in order and check their opening and ending. A quiet file after a loud one, a long silence at the end, or a mismatched sample rate can be more noticeable when the sequence repeats for hours than it is during a quick edit. FFmpeg can join files for playback, but the command below does not normalise their loudness or guarantee a gapless transition. If consistent levels matter, prepare and listen to the audio first.
For separate files, a playlist is easier to revise than making one large combined file: you can reorder or replace an entry. If you already have a single prepared audio file, you can loop that file directly instead. A pre-recorded playlist with scheduled breaks is a better model if the programme needs planned interruptions rather than an unbroken cycle.
Loop the MP3 playlist and still image
The input options do two different jobs. -stream_loop -1 before the playlist input tells FFmpeg to repeat that input indefinitely; -1 is FFmpeg’s setting for infinite repetition. The image input’s -loop 1 keeps the still available as a repeating video input. See the FFmpeg command-line documentation for input-option details.
ffmpeg -re \
-loop 1 -framerate 1 -i artwork.jpg \
-stream_loop -1 -f concat -safe 0 -i episodes.txt \
-map 0:v:0 -map 1:a:0 \
-c:v libx264 -preset veryfast -tune stillimage \
-pix_fmt yuv420p -r 30 -g 60 -keyint_min 60 -sc_threshold 0 \
-b:v 4M -maxrate 4M -bufsize 8M \
-c:a aac -b:a 128k -ar 44100 \
-f flv 'rtmps://INGEST_HOST/APP/STREAM_KEY'
Replace artwork.jpg, episodes.txt and the destination placeholder with your own values. Keep the input options immediately before the inputs they govern: here the still-image options precede the image, and the playlist loop and concat options precede episodes.txt. FFmpeg options are position-sensitive. Moving an input option after the relevant -i can change which input it affects.
-re reads the file input at its natural rate rather than sending it as fast as the machine can process it. This matters for a live destination: you want the output to progress in real time, not to race through the playlist. The image remains present while the audio cycles. -shortest is intentionally absent, because ending the output when one input ends is not the intended behaviour for a continuous programme.
An alternative is to combine the MP3s into one audio file ahead of time and put -stream_loop -1 before that file’s -i. That can simplify a stable programme, but it is less convenient when you want to change episode order. Neither approach by itself fixes silence, level differences or pauses already present in the audio. A college radio station streaming guide covers a broader continuous-programme workflow; this page focuses on the FFmpeg inputs for episodes and artwork.
Map video and audio explicitly
The -map options in the example say exactly which streams to send: 0:v:0 means the first video stream from input 0, the artwork, and 1:a:0 means the first audio stream from input 1, the concat playlist. Without explicit mapping, FFmpeg may select streams automatically. That is not what you want to leave to chance when one input is an image and the other is a playlist of audio files.
The image input comes first, so it is input 0; the playlist is input 1. If you change the order of the -i arguments, change the map numbers as well. A common failure is to rearrange inputs while leaving maps untouched, then wonder why FFmpeg reports a missing stream or produces an output without the intended picture or sound.
Mapping is selection, not encoding. It tells FFmpeg what to include, while the codec options later in the command tell it how to produce streams suitable for the output container and destination. The MP3s are source audio; the command encodes the selected audio as AAC. The still is not a ready-made live video stream; FFmpeg turns it into a repeating video stream.
The output is sent in FLV format, which is used with the RTMP-family live destination in this example. Do not assume that because an MP3 file plays on your computer, sending that file alone to a live destination creates the image-and-audio programme you intend. The explicit maps and output encoders make the expected combination clear.
If you are debugging, first run FFmpeg against a short, local output file rather than the live destination. Check that the file contains both image and sound, and that the sequence starts in the intended order. Then restore the RTMPS destination. This separates input and mapping mistakes from YouTube event or network issues.
Choose live-compatible encoding
The example uses H.264 video with libx264 and AAC audio. YouTube’s live encoder settings list H.264 for video and AAC or MP3 for audio with RTMP/RTMPS ingest. The command chooses AAC and a 30 fps output; the example’s 60-frame GOP at that frame rate corresponds to a two-second keyframe interval.
The video settings shown are a usable pattern, not a universal prescription. In particular, the sample bitrate values are not guaranteed to suit your chosen resolution, upload speed or event configuration. YouTube’s current encoder guidance gives different H.264 bitrate recommendations for different resolutions and frame rates. Check the guidance and your Live Control Room settings before choosing output values, then make sure your connection can sustain the combined stream with room for variation.
For context, YouTube lists 3 Mbps minimum and 8 Mbps recommended for 720p at 30 fps, and 5 Mbps minimum and 14 Mbps recommended for 1080p at 30 fps in the cited encoder guidance. Those figures describe YouTube’s published recommendations, not a promise that a particular connection or FFmpeg command will work. Pick the resolution you actually need; a still image does not gain useful detail merely because you send a larger video frame.
The command includes -pix_fmt yuv420p, a widely used pixel format for compatibility, and -tune stillimage, which adjusts the H.264 encoder for a mostly static picture. -preset veryfast is an encoder speed/complexity choice. It trades some compression efficiency for lower processing demand; whether it is appropriate depends on your machine and chosen output. Confirm that your local build includes libx264 and an AAC encoder. FFmpeg installations differ, and this example is not evidence that those encoders are available on your system.
YouTube recommends a two-second keyframe interval and says not to exceed four seconds. The example’s frame rate and GOP settings aim at the two-second interval, but check the actual output and current official guidance before an event. For audio, the command specifies AAC, 128 kbps and 44.1 kHz. Treat these as example settings, not requirements or claims about the quality of every podcast source.
Add the YouTube ingest URL and stream key
In YouTube Live Control Room, create or open the event and obtain its stream URL and key. YouTube’s stream setup instructions explain the setup flow. The key is a credential: do not publish it, paste it into a public document or leave it in a script that other people can read.
Replace the final placeholder with the RTMPS destination and key supplied for your event. The precise address format is event-specific, so use the values shown in Control Room rather than copying the placeholder literally. The stream key is not something FFmpeg or this article supplies. If a key has been exposed, use YouTube’s controls to manage it before broadcasting.
YouTube recommends RTMPS in its encoder guidance. The destination is separate from the media inputs: the playlist and image describe what to send, while the final argument describes where to send it. A correct command can still fail if you have an old key, an incorrect destination, or an event that is not ready to receive a stream.
If this is your first test, set the event to private or unlisted as appropriate and make sure you understand who can see it. Check the current event visibility and live settings in YouTube rather than assuming that a test command determines them. Once the stream is live, use the event preview and health indicators to confirm that YouTube is receiving the feed you intended.
Test playback and stream health
Run a test before the public broadcast, ideally with the same playlist, image, computer and network conditions you expect to use. YouTube’s encoder guidance says, “Make sure to test before you start your live stream.” Start with a private or unlisted event, listen to the audio and watch the preview. Confirm that the image is present, episodes arrive in the right order, and the playlist returns to the first file when it reaches the end.
Watch the console output for errors about missing files, unsupported encoders or failed connections. If the command stops immediately, test the local inputs and output encoders separately. If a local file works but the live event does not receive it, check the event’s stream URL and key, event status and network path. Do not infer that a quiet or frozen preview means the MP3 files themselves are faulty.
YouTube’s streaming tips recommend leaving upload headroom, with 20% recommended. That is useful when estimating whether a connection has capacity, but it does not eliminate network interruptions. Avoid planning to use every bit of a connection’s measured upload speed for the stream; other traffic and changes in the connection can leave too little room.
During the test, check the platform’s stream health and listen for clicks, long pauses or sudden changes in loudness at episode boundaries. A still image makes visual checking simple, but it does not tell you whether audio is moving correctly. If you need to run a continuous channel while your own computer is off, StreamNeo can remove the need to keep this local FFmpeg process running and to restart it yourself if it drops; it is designed for YouTube streams made from an uploaded video.
For a manually operated FFmpeg setup, plan how you will notice a stopped process and restart it, and who is responsible for the stream overnight. A command in a terminal is not an operations plan. If the issue is primarily where a long-running process should live, compare the practical trade-offs in Azure VM versus a home PC. If the programme needs switching between different video assets, see the looping fireplace command for a related FFmpeg pattern.
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
Will this command play the episodes gaplessly?
No. It sequences the files and repeats the playlist, but it does not promise gapless transitions. Prepare and listen to the episode files in order, especially around their ends and starts, before using them in a long broadcast.
What if my filenames contain apostrophes or spaces?
The simple file 'name.mp3' example is intended for straightforward filenames. The concat demuxer has quoting and escaping rules, so use its documented format for unusual characters and test the playlist locally before connecting to YouTube.
Can I use a single combined MP3 instead of episodes.txt?
Yes. If the audio is already combined, put -stream_loop -1 before that file’s input and map its audio stream. A playlist is easier to edit episode by episode; a combined file can be simpler when the programme order is settled.
Does FFmpeg provide the YouTube stream key?
No. You get the event’s ingest URL and stream key from YouTube Live Control Room and insert them as the output destination. Treat the key like a password, and check YouTube’s current setup guidance before going live.