how to use ffmpeg to apply 1:1 SAR before concat on large complex filter

孤者浪人 提交于 2019-12-01 08:21:09

问题


I use ffmpeg to concat videos in a fashion similar to this:

I ran into a weird error with my inputs

[Parsed_concat_0 @ 000000002a05bb80] Input link in10:v0 parameters (size 1280x720, SAR 2049:2048) 
do not match the corresponding output link in0:v0 parameters (1280x720, SAR 1:1)

From what I've researched I need to use setsar to force all the videos to be 1:1 before I concat, but I'm not sure how to do that in my filter.


回答1:


Add the setsar filter:

ffmpeg -i 0.mp4 -i 1.mp4 -i 2.mp4 -filter_complex "[0:v]setsar=1[v0];[v0][1:v][2:v]concat=n=3:v=1:a=0[v]" -map "[v]" out.mp4

This example is assuming that 0.mp4 is the video with the wrong SAR.



来源:https://stackoverflow.com/questions/45426981/how-to-use-ffmpeg-to-apply-11-sar-before-concat-on-large-complex-filter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!