online navad
online navad

Reputation: 27

FFMPEG watermark scale

Im trying to set watermark scale to 0.9 or 0.7 and ... how to do it with this code?

exec("ffmpeg -i file.mp4 -i logo.png \
-filter_complex \"overlay=x=(main_w-overlay_w)/2:y=(main_h-overlay_h)/2\" watermarked.mp4");

Upvotes: 2

Views: 4233

Answers (1)

Gyan
Gyan

Reputation: 93339

Use this command to scale the watermark to 70%:

ffmpeg -i file.mp4 -i logo.png -filter_complex \
      "[1]scale=iw*0.7:-1[wm];[0][wm]overlay=x=(W-w)/2:y=(H-h)/2" watermarked.mp4

To also change opacity of the PNG logo, use

ffmpeg -i file.mp4 -i logo.png -filter_complex \
      "[1]colorchannelmixer=aa=0.5,scale=iw*0.7:-1[wm];[0][wm]overlay=x=(W-w)/2:y=(H-h)/2" watermarked.mp4

Upvotes: 6

Related Questions