0

Lie a few others I'm trying to watermark a video with an image (see FFmpeg - How to scale a video then apply a watermark?). Oh, and I'm transcoding the format too.

The difference is I want my image to be the exact same size as the video. I need to do this as a filter chain because each video is a different size and I'm using a single watermark image. Furthermore, the server it has to run on has an older version of ffmpeg so it doesn't recognise the -filter_complex option.

So far, I've gotten as far as

ffmpeg -y -i input_video.mov -vcodec libx264 -vf "movie=watermark.png [watermark]; [watermark] scale=main_w:main_h [scaled_watermark]; [in][scaled_watermark] overlay=0:0 [out]" output_video.m4v

The problem is that the main_w and main_h constants only seem to be recognised in the overlay filter graph and not in the scale filter graph.

So how do I find out the width and height of input_video.mov so that I can scale the watermark correctly?

Community
  • 1
  • 1
richard
  • 1,565
  • 2
  • 18
  • 35

0 Answers0