FFmpeg - concat videos error, do not match the corresponding output link?

前端 未结 1 828
滥情空心
滥情空心 2020-12-11 07:49

I\'m trying to concat some video into one single video using ffmpeg.

input information:

a.mp4 1920x808 , b.mkv 1280x720

First I tried command below

相关标签:
1条回答
  • 2020-12-11 08:16

    The concat filters require all segments to have the same properties, including aspect ratio. You can tell the filter to ignore that

    concat=n=2:v=1:a=1:unsafe=1 (not recommended)

    or set same aspect ratio for both video streams,

    ffmpeg -i b.mkv -i a.mp4
    -f lavfi -t 0.1 -i anullsrc
    -filter_complex
    [0:v]scale=1920:808:force_original_aspect_ratio=decrease,pad=1920:808:(ow-iw)/2:(oh-ih)/2,setsar=1[v0];
    [1:v]setsar=1[v1];[v0][0:a][v1][1:a]concat=n=2:v=1:a=1[outv][outa]
    -map [outv] -map [outa] -vcodec libx264 -crf 27
    -preset ultrafast -threads 2 out.mp4
    
    0 讨论(0)
提交回复
热议问题