ffmpeg add watermark libx264 width not divisible b

2019-01-27 11:32发布

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

标签: ffmpeg
1条回答
对你真心纯属浪费
2楼-- · 2019-01-27 12:10

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.

查看更多
登录 后发表回答