Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
DocumentaryTube
FFmpeg

How to Add a Static Overlay to an Nginx RTMP YouTube Stream with FFmpeg

Use FFmpeg's overlay filter to add a static image to an nginx-rtmp feed before sending it to YouTube Live, with command patterns, settings, and troubleshooting.

By DocumentaryTube Team 7 min read
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To add a static logo or graphic to an Nginx RTMP stream, have FFmpeg read the incoming RTMP feed and an image, composite them with the overlay filter, then encode and send the result to YouTube Live. You can supervise FFmpeg as a separate service or have nginx-rtmp start it for each published stream with exec_push. The example below is a starting pattern, not a tested, universal command: adapt it to your FFmpeg build, source stream, and current YouTube ingest settings.

How the overlay pipeline works

FFmpeg takes the live feed as its main video input and a transparent image—typically a PNG—as the overlay input. Its filter documentation describes the first input as the main video and the second as the image placed over it. The filter’s coordinates set the image position. FFmpeg must encode the composited video; -c:v copy cannot preserve an overlay because the video frames have changed.

The usual flow is: publish a source to nginx-rtmp, let FFmpeg read that local RTMP stream and apply the overlay, then send the processed stream to YouTube’s current ingest server using the stream key from your YouTube live setup. The image must be readable by the user running FFmpeg, and the server needs enough CPU capacity for real-time video encoding.

Start with this FFmpeg command pattern

This example uses an incoming local RTMP stream, loops a logo image, places it near the top-left corner, and sends the result to a YouTube RTMP ingest address:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
ffmpeg 
  -i 'rtmp://127.0.0.1:1935/live/STREAM' 
  -loop 1 -i '/path/to/logo.png' 
  -filter_complex '[0:v][1:v]overlay=10:10[v]' 
  -map '[v]' -map '0:a?' 
  -c:v libx264 -preset veryfast -tune zerolatency 
  -pix_fmt yuv420p -g 60 
  -c:a aac -b:a 128k 
  -f flv 'rtmp://a.rtmp.youtube.com/live2/STREAM_KEY'

Replace the local RTMP URL, image path, output destination, stream key, frame rate, keyframe interval, and encoding settings for your installation. YouTube’s live setup supplies the current server URL and stream key; do not assume the example address is the right destination for every account or configuration. Keep the key private.

Position, size, and timestamp behavior

overlay=10:10 places the image 10 pixels from the left and 10 pixels from the top. Change the x and y expressions to place it elsewhere. A transparent PNG allows the picture beneath it to show through. Check the image at the output resolution so it remains legible without covering important documentary footage, captions, or other essential content.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

If the inputs begin with different timestamps, FFmpeg advises considering setpts=PTS-STARTPTS in the filter graph. Live-source timing varies, so check audio/video synchronization and test with your own stream. The example uses -loop 1 to keep the still image available, but behavior can depend on the installed FFmpeg build and image demuxer. Verify the option with ffmpeg -h demuxer=image2 or the local manual before relying on it.

Match the encode to YouTube’s current guidance

YouTube recommends RTMPS, a secure extension to RTMP. Its live encoder guidance, accessed in 2026, lists RTMP/RTMPS ingest, H.264, H.265, or AV1 video, up to 60 fps, CBR, AAC or MP3 audio, a recommended two-second keyframe interval, and a four-second maximum. Check YouTube’s encoder settings before a production broadcast because platform recommendations can change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
H.264 output profile YouTube recommended bitrate range (2026 page)
1080p at 30 fps 5–14 Mbps
1080p at 60 fps 6–17 Mbps
720p at 30 fps 3–8 Mbps
720p at 60 fps 3–8 Mbps

These are YouTube’s listed recommendations, not a guarantee of the bitrate your connection or encoder can sustain. Choose a rate for the resolution and frame rate you actually send, leave adequate upload headroom, and monitor stream health. The command’s -g 60 corresponds to a two-second GOP only at 30 fps; adjust the GOP to match the frame rate and current keyframe recommendation. Set a video bitrate and any other profile details to match the selected output—this pattern intentionally leaves them to be configured rather than claiming one value fits all.

The example uses libx264 and AAC, but your FFmpeg build must include the requested encoder and filters. Audio is mapped only if present with 0:a?; AAC is encoded here. Audio can be copied only if its codec and parameters are acceptable to the destination. Confirm your actual encoder options with the installed FFmpeg build.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Choose how FFmpeg is started

Run FFmpeg as a separate managed process

In this arrangement, your source publishes to nginx-rtmp and a separately supervised FFmpeg process reads the local stream, overlays the image, and publishes directly to YouTube. A system service can give the process its own restart policy and logs. It can also keep the YouTube key out of nginx configuration if you manage the secret separately. Make sure the service account can read the logo and run the FFmpeg binary.

Start FFmpeg with nginx-rtmp exec_push

The nginx-rtmp module documents exec_push as a command run for each published stream. It supports the $app and $name substitutions and is described as useful for FFmpeg transcoding and republishing. The child process is terminated when publishing stops. Confirm the directive exists in your installed module or fork before using it.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Use the full path to the FFmpeg binary where practical, and check the nginx process environment and filesystem permissions. The module documentation notes that nginx normally clears its environment, which can make relying on PATH unreliable. Commands placed in nginx configuration are process arguments: quote paths and filter expressions for the actual command syntax, protect the stream key, and run nginx -t before reloading configuration. Consult the nginx-rtmp directive documentation for the behavior supported by your installed version.

Use nginx push only as a relay

The nginx-rtmp push directive publishes a stream to a remote server; it does not composite an image. If FFmpeg sends its processed output to another nginx-rtmp application, that application’s push can relay the stream onward. The module’s push_reconnect directive configures the delay before trying to reconnect after a disconnect.

A 2016 module issue shows an example of pushing to YouTube, but it is a historical user discussion, not current YouTube ingest guidance. Use the server URL and key in your current YouTube live setup.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Test the setup before going live

  1. Check the installation. Confirm FFmpeg is executable and includes the selected video encoder, audio encoder, and overlay filter. Verify the image path and read permissions for the FFmpeg process.
  2. Verify still-image looping. Check -loop 1 against ffmpeg -h demuxer=image2 or your installed manual. Builds and demuxer behavior can differ.
  3. Validate configuration. If using nginx directives, run nginx -t after changes. Verify that the command’s quoting, substitutions, and binary path work in nginx’s actual process environment.
  4. Run a controlled stream test. Test with a short local recording or a controlled live source before your event. Check that the overlay appears at the intended position, audio remains continuous and synchronized, and the output frame rate and resolution are correct.
  5. Watch resource use and YouTube health. Check CPU headroom, dropped frames, FFmpeg and nginx logs, and YouTube’s stream-health indicators. YouTube recommends pre-event testing with similar audio and motion and monitoring stream health.
  6. Protect the stream key. Do not expose it in public examples, screenshots, shell history, or world-readable configuration. Rotate it in YouTube if it is disclosed.

Troubleshoot common failures

Symptom Likely cause What to check
FFmpeg cannot open the logo Incorrect path, permissions, or image format issue Check the path as seen by the FFmpeg process and confirm its user can read the file.
The logo appears briefly or vanishes The still-image input is not being looped as expected Verify -loop 1 for the installed image2 demuxer and build; test locally.
FFmpeg exits as soon as the source stops The source publishing session ended For exec_push, this is consistent with the documented behavior: the child is terminated when publishing stops. Check the source and process lifecycle.
No stream reaches YouTube Wrong ingest URL or key, incompatible output, or network/encoder error Use the current YouTube stream setup values, inspect FFmpeg logs, and compare output settings with YouTube’s current guidance.
Video stutters or frames drop Insufficient encoding CPU or upload headroom, or unsuitable bitrate/settings Inspect server CPU and dropped-frame logs; reduce output demands or select settings appropriate to available capacity.
Audio is absent or rejected No input audio stream, incompatible copied audio, or audio mapping/encoding issue Check whether the source contains audio and review FFmpeg’s stream mapping. Encode compatible audio, as the example does with AAC, when copying is unsuitable.
nginx cannot find FFmpeg or read the image nginx environment or filesystem permissions differ from your shell Use an absolute binary path and verify execution and file-read access as the nginx worker user.
Audio and video drift or the output starts oddly Input timestamps differ Inspect source timestamps and test the filter graph with setpts=PTS-STARTPTS where appropriate.

Or let it run in the cloud

If your goal is to keep uploaded video playing as a YouTube live stream rather than process a camera or live RTMP source, StreamNeo is a cloud alternative: upload a recording or build a playlist, add your YouTube stream key once, and go live. Nothing has to stay running at home; it streams the uploaded video as made, up to 4K 60fps at one flat price per slot, and automatically recovers if YouTube drops the stream. The first day is free with no card. Monthly billing is $9.99 per month. This is for uploaded videos, not a camera feed, and StreamNeo streams to YouTube only. Start the free day with StreamNeo.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Screening Room

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.