To put a still image behind an audio-only YouTube Live stream, make the image FFmpeg’s video input and your audio file its audio input. Loop the image, map both streams explicitly, encode a compatible output, and send it to the ingest address and stream key shown in YouTube Live Control Room.
The command below is an illustrative starting template, not a tested recipe or a universal setting. Your file formats, FFmpeg build, upload connection and YouTube’s current recommendations all affect what will work; test the actual setup before relying on it for a long broadcast.
Prepare the image and audio files
Choose the image viewers should see while the audio plays. A square devotional poster, a wide lofi illustration or a simple station card can all serve as a visual source, but check that the image’s shape suits the video frame you plan to send. If the image is taller or squarer than the output, the encoder may scale or crop it, depending on the filters you use. The command here does not add a scaling or cropping filter, so prepare an image whose dimensions suit your intended output or add an appropriate filter after confirming the result.
Keep the image and audio file in a folder you can reach from the command line. The example uses background.jpg and audio.mp3; substitute your real file names, including their extensions. If a path contains spaces, keep it inside quotation marks, as in the example. For a first test, use a short audio file you have permission to stream and listen to the source before broadcasting. A file that plays correctly in a media player can still expose an unsupported codec, damaged metadata or an unexpected channel layout when FFmpeg reads it.
Think about the content as well as the file. A fixed image is a visual backdrop, not a promise that every viewer will see a continuously moving picture. YouTube recommends testing with audio and video movement similar to the planned stream; for a static-image station, make the test reflect the actual still image and audio behaviour rather than inventing movement that will not be in the broadcast. Check that the artwork is legible at the intended viewing size and that it does not contain details you do not want on a public channel.
If you are building a longer prerecorded channel rather than testing one file, first decide how audio is meant to repeat, change or stop. The command in this guide reads one audio input; it does not create a playlist or automatically restart a finished track. For a broader workflow using recorded audio, the guide to setting up a 24/7 Sikh kirtan stream with prerecorded audio is a useful companion. Keep the separate question of whether you have the rights to use each recording in view; technical success does not answer that question.
Loop the still image and set a frame rate
FFmpeg’s image2 demuxer can read a still image as an input and generate video frames from it. The options -loop 1 and -framerate 30 appear before the image’s -i because they apply to that input. Looping tells FFmpeg to keep supplying the still image rather than treating it as a single frame that quickly ends. The generated frame rate tells it how often to produce frames from that image.
The value 30 in the template is an example, not a universal requirement. Frame rate affects the output profile and the relationship between frame rate and keyframe spacing. A static picture does not need visual motion to create frames, but YouTube still receives a video stream with a defined frame rate. Choose an output that your encoder can sustain and compare it with YouTube’s current settings guidance for the chosen codec and resolution.
The -r 30 later in the command sets the output frame rate as well. Keeping the input generation and output rate aligned makes the example easier to follow. If you change one, review the other and the GOP setting rather than changing a number in isolation. FFmpeg’s image2 demuxer documentation describes the image input’s looping and frame-rate options; consult it if your installed FFmpeg version behaves differently or you need to handle an image sequence instead of one still.
A common symptom of incorrect image input options is a stream with no video or a picture that ends immediately. Check that the file opens, the input options precede the image -i, and the loop option is enabled. The image itself is not an output video until FFmpeg has read it as an input and the selected stream has been included in the output mapping.
Map the image video and audio explicitly
The command uses two inputs: input 0 is the still image, and input 1 is the audio file. The mapping options -map 0:v:0 -map 1:a:0 select the first video stream from the image input and the first audio stream from the audio input. This explicit mapping prevents FFmpeg from guessing which streams you intend to send.
That distinction matters when you adjust the command. If you accidentally map 0:a:0, there may be no audio stream to select from the image. If you map only 1:a:0, you may send sound without the background video. Read each map as input number, stream type, and stream index: 0:v:0 means the first video stream from the first input; 1:a:0 means the first audio stream from the second input.
The -re option before the audio input asks FFmpeg to read that file at its native rate for live-style output. It can help avoid sending a finite file as fast as the machine can process it, but whether it suits your source and FFmpeg version should be checked. It is not a replacement for managing a playlist or deciding what should happen when a file ends. If the audio is shorter than the intended broadcast, the command does not make more audio appear after the input is exhausted.
For people comparing a computer-based workflow with a more managed one, the Docker and FFmpeg 24/7 livestream guide discusses a broader continuous-stream setup. The mapping here remains the same basic idea: create the intended video and audio streams, then make sure the output contains both. A static image is especially useful for a simple station identity, but it does not resolve restarts, playlist logic or monitoring by itself.
Choose compatible video and audio encoding
The example encodes video with libx264 and audio with AAC. It also sets -pix_fmt yuv420p, a commonly used pixel format for compatibility, plus an audio sample rate and example audio bitrate. Treat every one of those as a starting point to check, not a guarantee that YouTube will accept every file or configuration. FFmpeg must also have the relevant encoder available in the build you installed.
YouTube’s current live encoder guidance lists H.264, H.265/HEVC and AV1 for RTMP/RTMPS video ingest, and AAC or MP3 for audio. It also gives different recommended video bitrates depending on codec, resolution and frame rate, and recommends constant bitrate delivery. The settings table is not one bitrate for every stream. For example, its recommendation for 1080p30 H.264 differs from its recommendation for 1080p30 AV1 or H.265. Check the YouTube encoder settings and bitrate guidance for the profile you actually select.
In the template, -b:v 5M, -maxrate 5M and -bufsize 10M are illustrative values, not YouTube’s universal recommendation. The example is not a claim that a five-megabit video rate suits 1080p, a particular connection or every encoder. A still image may appear simple to encode, but the relevant comparison is the chosen codec and output profile against stable upload capacity and YouTube’s guidance, not the apparent complexity of the artwork. Do not set a rate higher than your connection can sustain reliably.
-g 60 sets an example GOP length of sixty frames. At the example 30 frames per second, that corresponds to a keyframe interval of about two seconds. YouTube recommends a two-second interval and says the maximum is four seconds; if you use a different frame rate, adjust the GOP so its time interval remains appropriate. Confirm what your encoder reports and check YouTube’s stream health messages during a test, rather than assuming the option was applied exactly as expected.
The -preset veryfast and -tune stillimage options are encoder choices in this example. Presets trade encoding effort against compression behaviour, and the still-image tune is intended to suit a static picture. Neither removes the need to test your machine and output. If you are encoding on a small computer that also performs other work, a more demanding choice may affect whether it can keep pace; a less demanding choice can affect the resulting stream quality. There is no single setting that settles that trade-off for every device.
Use the YouTube Live ingest details
Create or select the live stream in YouTube Live Control Room before starting FFmpeg. YouTube’s instructions explain where to find the stream URL and key and how to enter them in an encoder. Use the active values displayed for your stream; do not copy a key from a guide, a previous broadcast or somebody else’s configuration. Treat the key as a credential and avoid pasting it into public logs, screenshots or shared messages.
The last argument in the example is a placeholder: rtmps://INGEST_ADDRESS/STREAM_KEY. Replace it with the exact address and key format YouTube gives you. The YouTube Live encoder setup instructions describe the Control Room process. The LiveStreams API reference describes ingestion addresses and stream-name handling; depending on the details YouTube provides, a stream name may be entered separately or appended to an ingestion URL. For a manual setup, follow the exact combination presented in Control Room rather than trying to infer it from a generic example.
YouTube recommends RTMPS. Make sure the output protocol and URL you use match the ingest details available for your live stream. A mismatch between server address, protocol and key can look like an FFmpeg encoding problem even when the image and audio inputs are fine. If YouTube does not show an incoming stream, first recheck that the correct live event is selected and that the exact current URL and key were copied correctly.
Run an illustrative FFmpeg command
The following template shows the input order, stream mapping, encoding options and output location together. It is deliberately presented as a working shape to adapt, not as a verified command for every operating system, FFmpeg build, file or YouTube configuration.
ffmpeg \
-loop 1 -framerate 30 -i "background.jpg" \
-re -i "audio.mp3" \
-map 0:v:0 -map 1:a:0 \
-c:v libx264 -preset veryfast -tune stillimage \
-pix_fmt yuv420p -r 30 -g 60 -b:v 5M -maxrate 5M -bufsize 10M \
-c:a aac -b:a 128k -ar 44100 \
-f flv "rtmps://INGEST_ADDRESS/STREAM_KEY"
Replace background.jpg, audio.mp3, and the ingest placeholder with your own values. Keep -loop 1 and -framerate 30 before the image input because they are image-input options. Keep the output encoding and muxer settings after both inputs and before the final destination. The -f flv output format is shown for this RTMP/RTMPS-style example; do not assume it fits a different ingest protocol or output path.
Before you start, confirm that your FFmpeg command is available in the terminal you are using and that the selected encoders are present. If the command stops with an unknown encoder message, that is a build or installation issue, not evidence that the image mapping is wrong. If it reports that it cannot open an input, verify the path and file name first. If it begins encoding but YouTube receives nothing, check the ingest details and network path separately from the media inputs.
To make a continuous channel, you also need to decide what happens when this audio file ends. This template is not a playlist manager and does not automatically choose another recording. If your goal is an always-on loop, the repeat or playlist logic must be designed and tested as part of the full workflow. The guide to streaming a 24/7 ocean-waves ambience video covers a related long-running use case. Where the strain of keeping a computer on and restarting a dropped broadcast is the problem, StreamNeo removes that specific burden by letting you upload a video and run its YouTube broadcast with your computer switched off; it does not replace checking that your channel, media and live settings are ready.
A final practical distinction is whether you need the video to be generated live at all. FFmpeg is useful when you want control over input mapping and encoding or need to combine a still with an audio source. If you already have a complete video file and only want it sent repeatedly, a file-based workflow may be simpler than building the image and audio inputs separately. Match the method to the files you actually have, rather than adding complexity because a command can do so.
Check the live output before relying on it
Start with a short, representative test rather than leaving the first run unattended overnight. Confirm that the Control Room sees an incoming stream, the still image appears, and the sound is audible and in sync with what you expect. YouTube advises testing before going live with audio and video movement similar to the planned stream. For this format, that means checking the actual image and the kind of audio you will send, and reviewing stream health messages while the test is running.
Look for problems at each layer. No picture points you towards the image path, image input options or video mapping. A picture that disappears suggests the image loop or input handling needs attention. No sound points towards the audio file, audio mapping or encoder. A stream that does not reach YouTube calls for checking the selected live stream’s active URL and key, along with whether the output protocol matches the provided ingest details.
If YouTube reports connection or quality warnings, compare the actual codec, resolution, frame rate, bitrate and keyframe cadence with the current settings table. A static frame does not make the bitrate guidance irrelevant: the encoder still sends a video stream, and the stream still has a defined profile. Also check the upload connection under the conditions in which you intend to broadcast. A short test on a quiet connection does not prove that the same connection will remain stable during a full day of other household or office use.
Keep a note of the settings and messages from a successful test, but do not treat one clean run as a guarantee of future availability. Test again after changing the image dimensions, FFmpeg build, audio source, bitrate, network or ingest configuration. To finish an event, stop the encoder’s outgoing content and check Control Room to confirm the stream has ended. YouTube says streams under twelve hours are automatically archived, but archive handling is separate from keeping a stream continuously available.
If the file and channel are ready, the next step is a controlled test with the actual ingest details rather than a guess at what might work.
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
How do I add a background image to an audio-only FFmpeg YouTube stream?
Use the still image as one input and the audio file as another, then map the image’s video stream and the file’s audio stream explicitly. Loop the image input so it continues producing frames, encode the output to a profile that matches current YouTube guidance, and send it to the active ingest details from Control Room.
Why does my still image disappear from the stream?
Check that the image opens correctly and that -loop 1 appears before the image input’s -i. Also confirm that the output maps 0:v:0 when the image is input zero; without that mapping, the image may not be included as video.
Is the example bitrate right for my stream?
Not necessarily. The example values are illustrative, while YouTube’s recommendations vary by codec, resolution and frame rate, and your upload connection must sustain the chosen output. Check the current official settings table and test the profile you intend to use.
Can this command run a 24/7 channel by itself?
It demonstrates how to combine one still image with one audio input, but it does not manage a playlist or restart the file after it ends. A continuous channel needs a tested plan for audio repetition, process restarts, monitoring and the active YouTube ingest configuration.