FFmpeg: add a watermark image to a video with overlay

Add a watermark image to a video with FFmpeg: pass the logo as a second input and use overlay=W-w-10:H-h-10 for the bottom-right corner.

5 min readSume
All posts

To add a watermark image to a video with FFmpeg, pass the logo as a second input and draw it with the overlay filter: ffmpeg -i input.mp4 -i logo.png -filter_complex "overlay=W-w-10:H-h-10" -c:a copy output.mp4 puts the logo 10 pixels from the bottom-right corner. Use a PNG with a transparent background, scale it first with scale if it is too big, and the audio is copied untouched.

The FFmpeg behavior below is quoted from the FFmpeg filters documentation, the ffmpeg documentation and the FFmpeg utilities documentation; the Sume facts come from the Timeline compose and Video filter docs. All were read on 2026-09-29, and every command was run on a 1920×1080 test clip with FFmpeg 9.0.1.

What do W, H, w and h mean in overlay?

overlay takes two inputs: the first is the main video, the second is drawn on top of it. Its x and y options place the logo's top-left corner and default to 0, the top-left of the frame. In those expressions W and H are the main video's width and height, and w and h are the logo's. Because the logo is a second input, the command needs -filter_complex, the option for graphs with more than one input.

Positions built from the overlay variables in the FFmpeg filters documentation, read 2026-09-29. The margin is 10 px.
Corner`overlay=` value
Top left10:10
Top rightW-w-10:10
Bottom left10:H-h-10
Bottom rightW-w-10:H-h-10
Center(W-w)/2:(H-h)/2

How do I resize the watermark?

Scale the logo input before the overlay, and label the result. scale=200:-1 makes it 200 pixels wide; when only one of the values is -1, scale picks the other so the logo keeps its aspect ratio.

To size the logo from the video instead, scale can read a second, reference input: [1:v][0:v]scale=w=oh*dar:h=rh/10 makes the logo a tenth of the video's height and keeps its shape, as in the FFmpeg docs example. On the test clip that gave a 216×108 logo.

# Logo 200 px wide, bottom-right, 10 px margin
ffmpeg -i input.mp4 -i logo.png -filter_complex \
  "[1:v]scale=200:-1[logo];[0:v][logo]overlay=W-w-10:H-h-10" \
  -c:a copy output.mp4

# Logo a tenth of the video's height
ffmpeg -i input.mp4 -i logo.png -filter_complex \
  "[1:v][0:v]scale=w=oh*dar:h=rh/10[logo];[0:v][logo]overlay=W-w-10:H-h-10" \
  -c:a copy output.mp4

How do I make the watermark semi-transparent?

A PNG with an alpha channel already keeps its transparent areas transparent. To fade the whole logo, lower its alpha before the overlay: colorchannelmixer has an aa option for the output alpha channel, which defaults to 1, so aa=0.5 halves it. Convert to rgba first so there is an alpha channel to change.

ffmpeg -i input.mp4 -i logo.png -filter_complex \
  "[1:v]format=rgba,colorchannelmixer=aa=0.5[logo];[0:v][logo]overlay=W-w-10:H-h-10" \
  -c:a copy output.mp4

How do I show the watermark for only part of the video?

Add enable to the overlay. For filters with timeline support, FFmpeg evaluates the enable expression before each frame and passes the frame through unchanged when it is 0. between(t,0,3) is 1 from 0 to 3 seconds, so overlay=W-w-10:H-h-10:enable='between(t,0,3)' shows the logo for the first three seconds only. ffmpeg -filters lists which filters have timeline support; on FFmpeg 9.0.1 overlay is one.

Does adding a watermark re-encode the video?

Yes. The ffmpeg docs say filters can't run on a stream copy, "since filters work on decoded frames", so the picture is always encoded again. -c:a copy keeps the audio as it was. How to crop a video with FFmpeg has the same trade-off.

Can I add a watermark without running FFmpeg?

On Sume, yes, but not with the Video filter: its filtergraph allows no inputs, no outputs and no paths, and filters that read a file are not on its allowlist, so there is no way to hand it a logo. The route is Timeline compose with operation: "overlay", which How to add a logo or watermark to a video walks through; Bulk add a watermark to videos runs it over a set. What matters when you are coming from FFmpeg:

  • Both files must already be in your Sume workspace on media.sume.com, such as earlier Sume outputs; off-host URLs are refused.
  • position is only top, center or bottom. There is no corner setting like W-w-10, and the still is held for the whole clip, so there is no time window like enable.
  • Each job reserves up to $0.02 and is captured at its own compute cost, never above that, plus a 5.5% agent fee by default.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume