bav ko ten
bav ko ten

Reputation: 532

ffmpeg add watermark libx264 width not divisible by 2 (853x480)

I want to add watermark for video. My code:

ffmpeg -i final_480p.mov \
-i watermark480p.png \
-filter_complex overlay=10:H-h-10 \
-y test.mov

with video size divisible by 2, command is good.

When i add watermark for video (853x480) don't work with error

[libx264 @ 075656e0] width not divisible by 2 (853x480)

How to fix this error? ( add more arguments, v.v..). Tks for reading

Upvotes: 0

Views: 3330

Answers (1)

Gyan
Gyan

Reputation: 93271

Use

ffmpeg -i final_480p.mov \
-i watermark480p.png \
-filter_complex [0]scale='iw-mod(iw,2)':'ih-mod(ih,2)'[m];[m][1]overlay=10:H-h-10 \
-y test.mov

The scale filter will conform each odd dimension to an even number, and leave even dimensions alone.

Upvotes: 2

Related Questions