I am concatenating three videos using ffmpeg. However, for some reasons I am getting error.
I am using NReco Video Converter which is a FFMpeg C# wrapper .
Any help would be highly appreciated.
Below is my complete console output :
C:\ffmpeg-20151130-git-7b11eea-win64-static\ffmpeg-20151130`enter code here`
-git-7b11eea-win64-static\bin
>ffmpeg -i I.mp4 -i V.mp4 -i O.mp4 -t 500 -f mp4 -s 1080*720 -filter_complex "co
ncat=n=3:v=1 [v]" -map "[v]" output.mp4
ffmpeg version N-76957-g7b11eea Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 5.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena
ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --
enable-lzma --enable-decklink --enable-zlib
libavutil 55. 9.100 / 55. 9.100
libavcodec 57. 16.101 / 57. 16.101
libavformat 57. 19.100 / 57. 19.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 17.100 / 6. 17.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'I.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.12.100
Duration: 00:00:03.52, start: 0.036281, bitrate: 2041 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1080x720
[SAR 40:33 DAR 20:11], 1926 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp,
128 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'V.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.12.100
Duration: 00:00:31.29, start: 0.036281, bitrate: 1560 kb/s
Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1080x720,
1428 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp,
128 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from 'O.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.12.100
Duration: 00:00:03.52, start: 0.036281, bitrate: 2041 kb/s
Stream #2:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1080x720
[SAR 40:33 DAR 20:11], 1926 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #2:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp,
128 kb/s (default)
Metadata:
handler_name : SoundHandler
[Parsed_concat_0 @ 000000d2ed8bee80] Input link in1:v0 parameters (size 1080x720
, SAR 0:1) do not match the corresponding output link in0:v0 parameters (1080x72
0, SAR 40:33)
[Parsed_concat_0 @ 000000d2ed8bee80] Failed to configure output pad on Parsed_concat_0
Error configuring complex filters.
Invalid argument
As you can see from the console output the issue is that the three inputs have different SAR values:
0:1
for the second input vs40:33
for the first and third inputs.You can set the corect SAR value using the setsar filter, eg:
then pass
[1v0sar]
to theconcat
filter along with the other video streams.