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
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