带有 yup420 输出问题的移动 FFMPEG 过滤器复杂

问题描述

我正在通过使用复杂过滤器和格式 yuv420 的移动 ffmpeg 通过图像创建视频,我遇到了宽度不能被 2(601*900) 整除的问题,像这样。 某些视频创作出现此错误,但许多工作正常。 我的过滤器复合体是缩放、旋转和覆盖输入图像。 这是 ffmpeg 命令:

ffmpeg -loop 1 -t 10 -i background.jpg -s 700x900 

-loop 1 -i img1.png -loop 1 -i img2.jpg 
-loop 1 -i img3.jpg

-filter_complex
[1]scale=eval=frame:w='72':h='72'[img1];
[2]scale=eval=frame:w='598':h='382',rotate=a=0*PI/180:c=black@0:oh='roth(0*PI/180)':ow='rotw(0*PI/180)':bilinear=1,fade=in:st=2:d=3:alpha=1[img2];
[3]scale=eval=frame:w='598':h='382',fade=in:st=3:d=4:alpha=1[img3];
[0][img1]overlay=W-w-5:5:format=auto:shortest=1:format=auto[bg1];
[bg1][img2]overlay=44:500:shortest=1:format=auto[bg2];
[bg2][img3]overlay=44:22:shortest=1:format=auto,format=yuv420p" 

output.mp4

搜索了一下,发现 -vf 过滤器可以调整宽度:高度,但限制不能与过滤器复合物一起使用...

我的错误日志:

 E/mobile-ffmpeg: [libx264 @ 0xbd8c8800] 
 E/mobile-ffmpeg: width not divisible by 2 (601x901)
 E/mobile-ffmpeg: Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate,rate,width or height

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)