[FFmpeg-user] How to scale watermark proportionally to width and height of video frame?

Барт Гопник bart.gopnik at gmail.com
Mon Jan 19 14:00:54 CET 2015


Hi!

How to scale watermark proportionally video frame size (to width and
to height of video frame)?

Now I use the following command:

ffmpeg -i input.mkv -i logo.png -filter_complex
"[1:v]scale=w=iw/3:h=ih/3[watermark_scaled];[0:v][watermark_scaled]overlay=x=main_w-overlay_w-main_w/20:y=main_h-overlay_h-main_w/20"
output.mkv

I use scale=w=iw/3:h=ih/3, but I can't use "main_w" and "main_h"
variables in this place. E.g. scale=w=main_w*0.05:main_h*0.05 don't
work. How to get video frame width and height to use them for scaling
watermark?

Thanks in advance!


More information about the ffmpeg-user mailing list