ffmpeg concat error-unusual video

别说谁变了你拦得住时间么 提交于 2019-12-02 13:18:33

Your inputs vary in frame rate, H.264 profile, and audio channels, but the concat demuxer requires that everything be the same. Conform everything to similar parameters before using the concat demuxer, or use the concat filter instead.

Basic example:

ffmpeg -i input0.mp4 -i input1.mp4 -filter_complex "[0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1" output.mp4

This will rely on the defaults of the concat filter which will automatically choose a common pixel format for video streams, and a common sample format, sample rate and channel layout for audio streams. These "common" parameters will, of course, vary depending on your inputs, so it may be advisable to prefix the concat filter with other filters to conform everything if you want consistent results.

Advanced example:

ffmpeg -i input0.mp4 -i input1.mp4 -filter_complex "[0:v]fps=25,format=yuv420p,setpts=PTS-STARTPTS[v0];[0:a]aformat=sample_rates=44100:channel_layouts=stereo,asetpts=PTS-STARTPTS[a0];[1:v]fps=25,format=yuv420p,setpts=PTS-STARTPTS[v1];[1:a]aformat=sample_rates=44100:channel_layouts=stereo,asetpts=PTS-STARTPTS[a1];[v0][a0][v1][a1]concat=n=2:v=1:a=1" -movflags +faststart output.mp4
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!