To add a static logo to an FFmpeg stream, provide the video and logo as separate inputs, composite them with the overlay filter, and map the filtered video to the output. Looping the video, handling its audio, choosing encoders and connecting to YouTube Live are separate parts of the setup; the overlay does not perform those jobs.
The command structure below shows how those pieces fit together, but it is a starting point, not a universal command. Your FFmpeg build, input streams and chosen YouTube settings can require changes, so check each piece and test with representative media before relying on it overnight.
How FFmpeg combines a video and a logo
FFmpeg processes media through inputs, filters and outputs. In this case, one input supplies the video, another supplies the logo image, a filter graph combines their pictures, and output mapping selects the result to encode and send. The official FFmpeg documentation describes the command-line and filter approach; its examples establish the building blocks, not a guarantee that one assembled command fits every installation.
The overlay filter takes a main video and a second video stream, which can come from a still image. It draws the second stream over the first at a chosen position. A typical fragment looks like this:
-filter_complex "[0:v][1:v]overlay=20:20[outv]"
Here, [0:v] refers to the video stream from the first input and [1:v] to the image stream from the second. overlay=20:20 places the logo 20 pixels from the left and top of the main frame. The label [outv] names the filtered result so it can be selected later with -map.
That filter fragment only describes the picture composition. It does not tell FFmpeg to repeat the video, decide whether audio exists, encode either stream, or connect to YouTube. Keeping those concerns separate makes troubleshooting clearer: a misplaced logo is a filter or geometry issue, while a missing soundtrack is a mapping or input issue.
For a broader comparison of playlist approaches, see how FFmpeg handles concat demuxers and filters. A single clip with a logo is simpler than a multi-file playlist, but both arrangements still need an explicit output and a plan for audio and looping.
Prepare the video and still-image inputs
Check what is actually in the source file before writing the full command. A video may have one video stream and one audio stream, several audio or subtitle streams, or no audio at all. The logo may be a transparent PNG or a flattened image format. Those properties affect which streams can be mapped and how the logo will look.
A common input order is the video first and the logo second:
-i video.mp4 -i logo.png
Input order matters because stream labels such as [0:v] and [1:v] use the order in which inputs are declared. If you move the logo input before the video, update the labels in the filter graph accordingly. The file extensions in these examples are illustrative; use the formats your installed FFmpeg build can read.
Use a transparent image if you want the video to show through around the logo. A PNG with an alpha channel is a practical choice, but transparency only helps if it is present in the source file and preserved by the filter and output path. A white rectangle around a logo is often a sign that the artwork has a solid background rather than transparency, not a problem with the overlay position.
Choose an image with enough resolution to remain clear at its displayed size, without making it needlessly large. If it is much larger than the video frame, scale it in the filter graph rather than assuming the filter will choose the design size you want. Keep a copy of the original image so you can adjust size or opacity without repeatedly editing a compressed output.
Before streaming, inspect the source dimensions, frame rate and audio layout with a media inspection tool or FFmpeg’s own reporting options. Then play a short test output locally. This catches a wrong input path, an unsupported image format, a surprising aspect ratio or a logo that covers a title. If your larger plan is based on an always-on prerecorded channel, this guide to a low-cost children’s story stream setup considers the wider operating choices; the logo filter remains just one part of that system.
Build the overlay filter graph
For a straightforward composite, give the main video and logo streams to overlay, then label its output. The illustrative command structure is:
ffmpeg -i video.mp4 -i logo.png \\
-filter_complex "[0:v][1:v]overlay=20:20[outv]" \\
-map "[outv]" -map 0:a? \\
[encoding options] -f flv [YouTube ingest URL]
The backslashes indicate a continued line in many shells; a command entered on one line does not need them. The bracketed placeholders are not literal FFmpeg options. Replace them with choices appropriate to your file and ingest configuration. In particular, this example is not a tested, ready-to-run command for every FFmpeg build or input.
The graph combines pictures, while mapping later tells FFmpeg which resulting stream should go to the output. The label [outv] is how the composited video is addressed. If you omit the mapping or refer to a different label, FFmpeg may select streams in a way that does not produce the intended output, or it may report a graph or map error.
For an opaque logo, this basic graph may be enough. If you need to resize it, a scale filter can be chained before overlay; if you want to adjust transparency, use a filter that changes alpha only if your build and image format support the behaviour you expect. Check the FFmpeg full documentation for the exact filter options available in your version. Filter syntax and pixel-format negotiation can be version-sensitive, so verify the command against the installed documentation and test a short output.
Do not add looping logic to this graph just because the final broadcast repeats. A still image is handled as an input, and the video loop is configured separately. Mixing too many unrelated changes into one initial command makes a failed test difficult to diagnose. First confirm that one pass of the source video has the logo in the right place; then add the repeat behaviour and output settings.
Set the logo’s position and appearance
The two values in overlay=20:20 are x and y coordinates in pixels: the first measures from the left edge and the second from the top. Change them to suit the frame and the area you want to keep clear. A logo in the top-left corner can obscure a channel name or captions; a bottom corner can overlap subtitles or other on-screen information.
You can use expressions instead of fixed pixel coordinates when placement should follow the frame dimensions. For example, expressions based on the main video’s width and height can keep a margin from the right or bottom edges. Consult the filter documentation for supported expression variables and syntax in your build. Expressions are convenient when the source resolution changes, but they are less immediately readable than fixed coordinates when you are just learning the graph.
Size is a presentation decision, not a YouTube requirement. A logo should be legible at the delivered resolution without becoming the main subject. If you scale it, keep its aspect ratio unless the artwork is intentionally designed to stretch. Test the actual output frame size: a graphic that looks restrained on a desktop preview may dominate a small mobile screen.
Opacity is also a choice. Full opacity preserves brand colours but may draw attention away from lyrics, a speaker or the footage. Reduced opacity can make the logo less intrusive, but details may become hard to see over changing backgrounds. A useful check is to watch the logo over both bright and dark parts of the source, not only over a static frame.
Keep a clear margin from the edges rather than placing artwork flush against them. Different screens and player layouts can crop or visually crowd the frame, and text inside the logo needs enough room to remain readable. For a devotional channel, for example, avoid covering lyrics that viewers follow; for local news, keep the logo away from a ticker or headline area.
Configure looping and input handling
Looping belongs to input handling, not to overlay. FFmpeg offers input options for repeating media, but their placement and behaviour depend on the option and input type. An option that configures an input generally needs to appear before the -i it applies to. Check the FFmpeg full documentation for the option supported by the installed build and confirm that it behaves as expected with your source format.
A negative loop count is commonly used in FFmpeg input-looping examples to request indefinite repetition, but verify the exact option and behaviour for your version. Do not assume that a command copied from another build or media type has the same effect. Some approaches may loop a video stream differently from how they handle audio, and a file with unusual timestamps or stream layouts can need extra treatment.
Real-time pacing matters when a file is being read for a live broadcast. If FFmpeg processes the file as quickly as possible instead of at its intended playback rate, the output may not behave like a normal live programme. Review the relevant input options for real-time reading and test duration against a clock. A short test should include the point where the source reaches its end and starts again, because that is where a gap, abrupt transition or audio discontinuity becomes apparent.
Think through the transition between the last frame and the first. A loop is not automatically seamless: the visual action may jump, an audio phrase may be cut, or a silent interval may occur. Select or edit the source so its endpoints make sense together, and listen through the transition. If you are joining multiple clips rather than repeating one file, the FFmpeg playlist construction guide discusses a different set of trade-offs.
Keep the loop option distinct from the still-image input. If the image input requires special handling in your build, configure that input specifically and test that the logo remains available throughout playback. An image that disappears, freezes unexpectedly or prevents output from starting calls for an input-handling check, not a change to the logo’s x/y coordinates.
Map video and audio deliberately
The filtered video has to be mapped to the output, while audio is usually selected from the original file. In the example, -map "[outv]" selects the composite and -map 0:a? asks for audio streams from input zero if present. The question mark makes that map optional in FFmpeg syntax; it can be useful when some source files have no audio, but confirm compatibility with the installed build and your intended output.
If audio is required, an optional map can conceal a problem: a silent source would still leave no soundtrack. Decide whether silence is acceptable, whether to supply a separate audio input, or whether the source file should be corrected before streaming. If the file has multiple audio tracks, map the intended track explicitly rather than relying on automatic selection. Check the output with playback and stream-health tools before the broadcast is left unattended.
Mapping a filtered video does not automatically map audio. Conversely, mapping the source video stream directly instead of the labelled filter output would bypass the logo. The map statements should therefore reflect the actual design: composited picture from the filter graph, and the chosen soundtrack from the desired input stream.
Video and audio also need output encoders and formats that fit the destination. Choose a video codec and audio codec supported by the FFmpeg build and the YouTube ingest setup, then make sure the container or streaming format is appropriate. The -f flv fragment in the example is illustrative of a common RTMP-style output structure; it is not a claim that every build, codec combination or ingest path should use identical options.
If a stream is rejected or arrives without expected tracks, separate the diagnosis into stream mapping, encoding and ingest rather than changing the overlay at random. The FFmpeg stream rejection troubleshooting guide can help frame that investigation. It is also useful to review the output’s stream list locally before connecting to YouTube.
Encode and connect to YouTube Live
Retrieve the ingest details from YouTube Live Control Room, where the current stream setup provides the server URL and stream key. Treat the key as a password: do not publish it in a script, screenshot or public log, and rotate it if it is exposed. YouTube recommends RTMPS; its RTMPS help page explains that it is RTMP carried over a TLS/SSL connection to provide encryption.
Use the RTMPS URL and key in the form expected by the encoder, taking care not to confuse the server address with the private key. Keep secrets out of shared examples. FFmpeg command-line arguments can be visible in process listings or logs on some systems, so consider how you store and run the command on a machine others can access.
Resolution, frame rate, codecs, bitrate and keyframe interval are output decisions, separate from the filter graph. YouTube’s live encoder settings guidance provides current recommendations that vary with resolution, frame rate and codec. As listed in YouTube Help and accessed on 3 October 2026, its table recommends H.264 at 5 Mbps for 1080p at 30 fps, and 8 Mbps for 720p at 60 fps; the corresponding AV1/H.265 recommendations are 10 Mbps and 6 Mbps. Those are platform recommendations for the named modes, not measurements of your connection or a guarantee of successful streaming.
The same YouTube guidance recommends a two-second keyframe interval and says not to exceed four seconds. It supports frame rates up to 60 fps for RTMP/RTMPS. Check the live guidance before choosing settings, since the recommendations can change and your encoder build may offer different options. YouTube Help also says, “We recommend running a speed test to test your upload bitrate.” Select a mode your upload can sustain, with room for variation, rather than copying a value intended for a different resolution or codec.
Before a public broadcast, make a test with the same kind of motion and audio you plan to run. YouTube advises testing before going live and monitoring stream health and messages during the event. Confirm that the logo stays in place, the loop transitions acceptably, sound is present, and the incoming stream uses the intended settings. A local preview can verify composition, but only a live test checks the whole path to YouTube.
For readers who do not want a local computer and connection to keep running, StreamNeo removes the need to leave that computer switched on for a file-based stream by turning an uploaded video into a YouTube broadcast. That does not replace checking the video, key and channel setup, or testing the result in YouTube Live Control Room.
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 the overlay filter make the video repeat?
No. The overlay filter composites the logo onto video frames; input looping is configured separately. Check the loop option and its placement in the documentation for your installed FFmpeg build, then test the transition from the end of the file back to the start.
Why is the logo missing from the output?
Check that the image is a valid input, that its stream label matches the input order, and that the filter output label is the one mapped to video. Also check the FFmpeg output for filter or pixel-format errors and make a short local test before changing the live destination.
Can I use a logo with transparency?
Yes, provided the image contains an alpha channel and the processing path preserves the transparency you expect. A transparent PNG is a common starting point; inspect the source and test over both light and dark footage to catch a solid background or hard-to-read artwork.
Will this command work with every FFmpeg build and video?
No. FFmpeg versions, available codecs, stream layouts, image handling and input timestamps can differ. Treat the example as a structure, check the documentation for your installed build, and validate the complete output with representative media before going live.