How to Add a Logo to a Video Using FFmpeg (Step-by-Step Guide)
If you need to programmatically add a logo to hundreds or thousands of videos, a graphical video editor won't cut it. You need a CLI tool. Enter FFmpeg — the open-source, industry-standard beast for all things video processing. In this guide, we'll walk through the exact commands to overlay a transparent PNG logo onto any video, scale it, position it, and adjust its opacity.
Wait... don't want to mess with the terminal?
If you only need to brand a few videos and don't want to deal with compiling FFmpeg, syntax errors, and CPU hogging, skip the coding and use LogoOnVideo. It uses a cloud-optimized processing engine to add your logo in seconds — right in your browser.
Add Logo Without Code →Prerequisites & Setup
Before we start, you need FFmpeg installed on your machine.
Download the executable from the official site or use a package manager like Chocolatey.
You'll also need two files in your working directory: input.mp4 and your logo file, logo.png (which should have a transparent background).
1. The Basic Overlay Command
Let's start with the simplest command: taking the logo and
placing it directly over the top-left corner of the video.
FFmpeg uses the overlay filter for this.
How this works:
-i input.mp4: Input video (stream 0)-i logo.png: Input image (stream 1)-filter_complex: Tells FFmpeg we are combining multiple inputs using a filter graph."overlay=0:0": Places the top-left corner of the image at the 0,0 coordinates (top-left) of the video.
2. Positioning the Logo Correctly
You rarely want the logo jammed hard into the top-left corner. Usually, you want it in the bottom-right corner with a 10px or 20px margin.
FFmpeg provides mathematical variables we can use to calculate
the position dynamically:
• W and H are the width and
height of the main video.
• w and h are the width and height
of the overlay image.
Bottom Right (with 10px margin)
Top Right (with 10px margin)
Bottom Left (with 10px margin)
3. Scaling the Logo
Unless your logo was exported at the exact perfect size for your
1080p or 4K video, it's going to look huge or tiny. We need to
chain another filter before the overlay: the scale filter.
Breaking down the filter chain:
[1:v]grabs the video stream of the second input (the logo).scale=200:-1resizes the logo to 200px width. The-1automatically calculates the height to maintain the aspect ratio.[logo]assigns a label to the newly scaled asset.[0:v][logo]overlay=...takes the main video and overlays the newly labeled[logo]on top of it.
4. Adding Transparency (Opacity)
To create a subtle watermark, you'll want to lower the opacity
of the logo. We use the colorchannelmixer filter for
this. Since we now have three steps (scale → opacity → overlay),
our filter graph gets slightly longer.
The aa=0.5 sets the alpha (transparency) channel
multiplier to 0.5 (50% opacity). Use 0.3 for a very
faint watermark or 0.8 for higher visibility.
5. The Ultimate Production Command (with Audio)
By default, FFmpeg's filter_complex might drop audio if not explicitly mapped, and the default encoding settings might bloat your file size or lose quality.
Here is the rock-solid, production-ready command you should actually copy and paste into your scripts. It scales the logo, sets it to 60% opacity, places it in the bottom right, preserves audio, and uses H.264 encoding for web compatibility.
-c:a copyensures the original audio track is copied without re-encoding (saves time and quality).-c:v libx264forces standard H.264 video encoding.-crf 23sets the Constant Rate Factor (between 0 and 51, where lower means better quality and larger file size. 23 is the default sweet spot).-preset veryfastspeeds up encoding at the expense of slight file size increases.
Conclusion: FFmpeg vs. Point-and-Click
FFmpeg is incredibly powerful. If you're building a backend service that needs to watermark 5,000 user-submitted videos a day, FFmpeg is absolutely the tool you should use.
But if you're a creator, an agency, or a business owner who just
shot a few marketing videos and needs a logo added right now...
booting up a CLI, remembering the filter_complex syntax, and waiting for your laptop fan to scream while rendering
is overkill.
Skip the scripting.
Instead of fighting syntax errors, just drag your video and logo right into your browser. Free, fast, and no coding required.
Use LogoOnVideo Web App