FFMPEG command not working on MP4 files as expected - ffmpeg

I am trying to set the output time offset for mp4 file.
ffmpeg -ss 13.554000 -i input.mp4 -c copy -t 10 -output_ts_offset 13.554000 output.mp4
This code works for WEBM file as expected but not for MP4.
In webm it delays start time of video to the specified timestamp and duration is 23.554 but in mp4 it just cuts the video, start time is set to 0 and duration is 10
Cannot find what is problem.
ffmpeg -ss 12.960000 -i v.mp4 -c copy -t 10 -output_ts_offset 12.960000 output.mp4
ffmpeg version git-2019-12-26-b0d0d7e Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.2.1 (GCC) 20191125
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig
--enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora
--enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis
--enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid
--enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
--enable-libopenmpt --enable-amf
libavutil 56. 37.100 / 56. 37.100
libavcodec 58. 65.100 / 58. 65.100
libavformat 58. 35.101 / 58. 35.101
libavdevice 58. 9.101 / 58. 9.101
libavfilter 7. 69.101 / 7. 69.101
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'v.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01T00:00:00.000000Z
encoder : Lavf53.24.2
Duration: 00:00:29.57, start: 0.000000, bitrate: 1421 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1032 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : SoundHandler
Output #0, mp4, to 'output.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.35.101
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 1032 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : SoundHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 250 fps=0.0 q=-1.0 Lsize= 1687kB time=00:00:09.99 bitrate=1382.7kbits/s speed=2.21e+03x
video:1212kB audio:468kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.408804%```

Related

FFMPEG - cut video result in longer cut

I'm trying to cut the last 8 seconds of a video I got; the problem is that ffmpeg is picking the last 10 seconds instead and I don't really know why. I checked and there is no offset between "0:00:00" and the effective start of the video, so why should it take more seconds?
this is my code:
ffmpeg.exe -ss 00:01:02 -i "F:\temp\input.mp4" -c copy -t 00:00:08 "D:\temp\1_output.mp4"
this is the output:
ffmpeg version N-90893-gcae6f806a6 Copyright (c) 2000-2018 the FFmpeg
developers built with gcc 7.3.0 (GCC) configuration: --enable-gpl
--enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth libavutil 56. 17.100 / 56. 17.100 libavcodec 58. 19.100 / 58. 19.100 libavformat 58. 13.100 / 58. 13.100 libavdevice 58. 4.100 /
4.100 libavfilter 7. 21.100 / 7. 21.100 libswscale 5. 2.100 / 5. 2.100 libswresample 3. 2.100 / 3. 2.100 libpostproc 55. 2.100 / 55. 2.100 Input #0,
mov,mp4,m4a,3gp,3g2,mj2, from 'F:\temp\input.mp4': Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.13.100 Duration: 00:01:10.34, start: 0.000000, bitrate: 14542 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 576x1024, 14346 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 193 kb/s (default)
Metadata:
handler_name : SoundHandler Output #0, mp4, to 'D:\temp\1_output.mp4': Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.13.100
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 576x1024, q=2-31, 14346 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc
(default)
Metadata:
handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 193 kb/s (default)
Metadata:
handler_name : SoundHandler Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help frame= 252
fps=0.0 q=-1.0 Lsize= 3089kB time=00:00:07.99 bitrate=3164.7kbits/s
speed=1e+003x video:2841kB audio:240kB subtitle:0kB other
streams:0kB global headers:0kB muxing overhead: 0.283155%
I don't really understand what i'm doing wrong
Thanks
do not use "-c copy" it sucks up everything.
just try like this and you are good to go...
ffmpeg.exe -i "F:\temp\input.mp4" -ss 00:01:02 -to 00:01:10 "D:\temp\1_output.mp4"

Split 2 video FFMpeg

can you help me split 2 videos
enter image description here
ffmpeg -i input1.mp4 -i input2.mp4 -filter_complex "[0:v][1:v]vstack[v];[0:a][1:a]amerge=inputs=2[a]" -map "[v]" -map "[a]" -ac 2 output.mp4
Don't work
My complete log
C:\Users\forumrulez\Desktop\POST>ffmpeg -i input1.mp4 -i input2.mp4 -filter_complex "[0:v][1:v]vstack[v];[0:a][1:a]amerge=inputs=2[a]" -map "[v]" -map "[a]" -ac 2 output.mp4
ffmpeg version N-91447-g0bd48ab2d9 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7.3.1 (GCC) 20180709
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
libavutil 56. 18.102 / 56. 18.102
libavcodec 58. 21.104 / 58. 21.104
libavformat 58. 17.101 / 58. 17.101
libavdevice 58. 4.101 / 58. 4.101
libavfilter 7. 25.100 / 7. 25.100
libswscale 5. 2.100 / 5. 2.100
libswresample 3. 2.100 / 3. 2.100
libpostproc 55. 2.100 / 55. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input1.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.17.101
Duration: 00:01:00.08, start: 0.000000, bitrate: 586 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 260x480 [SAR 128:39 DAR 16:9], 428 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 152 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'input2.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.17.101
Duration: 00:01:00.08, start: 0.000000, bitrate: 703 kb/s
Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 360x480 [SAR 64:27 DAR 16:9], 545 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 152 kb/s (default)
Metadata:
handler_name : SoundHandler
File 'output.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
Stream #0:0 (h264) -> vstack:input0
Stream #0:1 (aac) -> amerge:in0
Stream #1:0 (h264) -> vstack:input1
Stream #1:1 (aac) -> amerge:in1
vstack -> Stream #0:0 (libx264)
amerge -> Stream #0:1 (aac)
Press [q] to stop, [?] for help
[Parsed_amerge_1 # 00000165b1e6af00] No channel layout for input 1
[Parsed_amerge_1 # 00000165b1e6af00] Input channel layouts overlap: output layout will be determined by the number of distinct input channels
[Parsed_vstack_0 # 00000165b29f1040] Input 1 width 360 does not match input 0 width 260.
[Parsed_vstack_0 # 00000165b29f1040] Failed to configure output pad on Parsed_vstack_0
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #1:0
Conversion failed!

How to use ffmpeg to copy streams and preserve format and metadata?

I have two files with multiple streams in each.
Output.mp4 has 2 streams: video and audio (streams 0,1)
Input.mp4 has 3 streams: video, audio and data (streams 0,1,2)
I need to add stream 2 from Input.mp4 to Output.mp4 yielding Final.mov.
I tried using this command but it does seem to preserve the format and metadata for the stream that is added:
ffmpeg -y -i Output.mp4 -i Input.mp4 -c copy -map 0:0 -map 0:1 -map 1:2 Final.mov
The output from ffmpeg seems to show that it is working but the format and metadata for the streams in the Final.mov is not correct.
I would appreciate any help with how to change the command to make it work.
Thank you!
Here is the command output:
ffmpeg -y -i Output.mp4 -i Input.mp4 -c copy -map 0:0 -map 0:1 -map 1:2 Final.mov
ffmpeg version N-84679-gd65b595 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 6.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 51.100 / 55. 51.100
libavcodec 57. 86.103 / 57. 86.103
libavformat 57. 67.100 / 57. 67.100
libavdevice 57. 3.101 / 57. 3.101
libavfilter 6. 78.100 / 6. 78.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Output.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41
creation_time : 2018-04-15T21:57:13.000000Z
Duration: 00:24:25.05, start: 0.000000, bitrate: 3571 kb/s
Stream #0:0(eng): Video: hevc (Main) (hvc1 / 0x31637668), yuvj420p(pc, bt709), 7680x3840 [SAR 1:1 DAR 2:1], 3252 kb/s, 1 fps, 1 tbr, 100k tbn, 2.15 tbc (default)
Metadata:
creation_time : 2018-04-15T21:57:13.000000Z
handler_name : Alias Data Handler
encoder : HEVC Coding
Side data:
stereo3d: 2D
spherical: equirectangular (0.000000/0.000000/0.000000)
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
Metadata:
creation_time : 2018-04-15T21:57:13.000000Z
handler_name : Alias Data Handler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'Input.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
creation_time : 2018-04-12T12:02:32.000000Z
make : Insta360
model : Insta360 Pro
encoder : Lavf57.71.100
description : {"info":{"gyro_stabilized":false,"initial_view_changed":false}}
Duration: 00:24:25.00, start: -0.004233, bitrate: 6394 kb/s
Stream #1:0(und): Video: hevc (Main) (hev1 / 0x31766568), yuv420p(tv), 7680x3840, 6196 kb/s, 1 fps, 1 tbr, 360k tbn, 5 tbc (default)
Metadata:
creation_time : 2018-04-12T12:02:32.000000Z
handler_name : VideoHandler
Side data:
stereo3d: 2D
spherical: equirectangular (0.000000/0.000000/0.000000)
Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 4.0, fltp, 129 kb/s (default)
Metadata:
creation_time : 2018-04-12T12:02:32.000000Z
handler_name : SoundHandler
Stream #1:2(und): Data: none (camm / 0x6D6D6163), 36 kb/s
Metadata:
creation_time : 2018-04-12T12:02:32.000000Z
handler_name : CameraMetadataMotionHandler
Output #0, mov, to 'Final.mov':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41
encoder : Lavf57.67.100
Stream #0:0(eng): Video: hevc (Main) (hvc1 / 0x31637668), yuvj420p(pc, bt709), 7680x3840 [SAR 1:1 DAR 2:1], q=2-31, 3252 kb/s, 1 fps, 1 tbr, 100k tbn, 100k tbc (default)
Metadata:
creation_time : 2018-04-15T21:57:13.000000Z
handler_name : Alias Data Handler
encoder : HEVC Coding
Side data:
stereo3d: 2D
spherical: equirectangular (0.000000/0.000000/0.000000)
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
Metadata:
creation_time : 2018-04-15T21:57:13.000000Z
handler_name : Alias Data Handler
Stream #0:2(und): Data: none (camm / 0x6D6D6163), 36 kb/s
Metadata:
creation_time : 2018-04-12T12:02:32.000000Z
handler_name : CameraMetadataMotionHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Stream #1:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
[mov # 0000000004894f00] Unknown hldr_type for camm / 0x6D6D6163, writing dummy valuesd= 629x
frame= 1465 fps=625 q=-1.0 Lsize= 650825kB time=00:24:24.98 bitrate=3639.3kbits/s speed= 625x
video:581593kB audio:56757kB subtitle:0kB other streams:6602kB global headers:0kB muxing overhead: 0.910633%
Here are the streams in the Final.mp4 file:
ffmpeg -i Final.mov
ffmpeg version N-84679-gd65b595 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 6.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 51.100 / 55. 51.100
libavcodec 57. 86.103 / 57. 86.103
libavformat 57. 67.100 / 57. 67.100
libavdevice 57. 3.101 / 57. 3.101
libavfilter 6. 78.100 / 6. 78.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100
[mov,mp4,m4a,3gp,3g2,mj2 # 0000000002726860] overread end of atom 'stsd' by 2974416 bytes
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Final.mov':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf57.67.100
Duration: 00:24:25.00, start: 0.000000, bitrate: 3639 kb/s
Stream #0:0(eng): Video: hevc (Main) (hvc1 / 0x31637668), yuvj420p(pc, bt709), 7680x3840 [SAR 1:1 DAR 2:1], 3252 kb/s, 1 fps, 1 tbr, 100k tbn, 2.15 tbc (default)
Metadata:
handler_name : DataHandler
encoder : HEVC Coding
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
Metadata:
handler_name : DataHandler
Stream #0:2(eng): Data: none (stts / 0x73747473), 36 kb/s
Metadata:
handler_name : DataHandler

FFMPEG change audio channel tag for MOV file

I am having difficulty renaming audio stream on MOV (works fine on MP4).
As you can see during the run it shows expected result - audio stream 2 labelled as 'div', but when I check using ffprobe all the streams are labelled 'eng'.
Below is the code that I use.
PS C:\Tools\ffmpeg-20160224-git-10fa50c-win64-static\bin> .\ffmpeg.exe -i C:\Users\dan\Downloads\IceRoadDVTest2.mov -vcodec copy -acodec copy -map 0:v:0 -map 0:a:0 -map 0:a:1 -metadata:s:a:1 language=div -qp 0 TEST2_copy.mov
ffmpeg version N-78646-g10fa50c Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enab
le-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --ena
ble-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 19.100 / 55. 19.100
libavcodec 57. 24.106 / 57. 24.106
libavformat 57. 26.100 / 57. 26.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 35.100 / 6. 35.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Guessed Channel Layout for Input Stream #0.2 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\dan\Downloads\IceRoadDVTest2.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2015-04-23 16:12:25
com.apple.finalcutstudio.media.uuid: 34E5E804-CFCA-47F4-9F88-38A1AF158F12
Duration: 00:01:00.29, start: 0.000000, bitrate: 53086 kb/s
Stream #0:0(eng): Video: mpeg2video (4:2:2) (xd5b / 0x62356478), yuv422p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 49997 kb/s, 29.97 fps, 29.97 tbr, 2997 tbn, 59.94 tbc (default)
Metadata:
creation_time : 2015-04-23 16:12:25
handler_name : Apple Alias Data Handler
encoder : XDCAM HD422 1080i60 (50 Mb/s)
timecode : 00:00:00;00
Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 2 channels, s16, 1536 kb/s (default)
Metadata:
creation_time : 2015-04-23 16:12:25
handler_name : Apple Alias Data Handler
Stream #0:2(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 2 channels, s16, 1536 kb/s (default)
Metadata:
creation_time : 2015-04-23 16:12:25
handler_name : Apple Alias Data Handler
Stream #0:3(eng): Data: none (tmcd / 0x64636D74) (default)
Metadata:
creation_time : 2015-04-23 16:12:42
handler_name : Apple Alias Data Handler
timecode : 00:00:00;00
Output #0, mov, to 'TEST2_copy.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
com.apple.finalcutstudio.media.uuid: 34E5E804-CFCA-47F4-9F88-38A1AF158F12
encoder : Lavf57.26.100
Stream #0:0(eng): Video: mpeg2video (xd5b / 0x62356478), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 49997 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 2997 tbc (default)
Metadata:
creation_time : 2015-04-23 16:12:25
handler_name : Apple Alias Data Handler
encoder : XDCAM HD422 1080i60 (50 Mb/s)
timecode : 00:00:00;00
Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, 1536 kb/s (default)
Metadata:
creation_time : 2015-04-23 16:12:25
handler_name : Apple Alias Data Handler
Stream #0:2(div): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, 1536 kb/s (default)
Metadata:
creation_time : 2015-04-23 16:12:25
handler_name : Apple Alias Data Handler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
frame= 1807 fps=0.0 q=-1.0 Lsize= 390647kB time=00:01:00.29 bitrate=53076.7kbits/s speed=99.2x
video:367986kB audio:22610kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.013180%
PS C:\Tools\ffmpeg-20160224-git-10fa50c-win64-static\bin> .\ffprobe.exe .\TEST2_copy.mov
ffprobe version N-78646-g10fa50c Copyright (c) 2007-2016 the FFmpeg developers
built with gcc 5.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enab
le-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --ena
ble-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 19.100 / 55. 19.100
libavcodec 57. 24.106 / 57. 24.106
libavformat 57. 26.100 / 57. 26.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 35.100 / 6. 35.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 '.\TEST2_copy.mov':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf57.26.100
Duration: 00:01:00.29, start: 0.000000, bitrate: 53076 kb/s
Stream #0:0(eng): Video: mpeg2video (4:2:2) (xd5b / 0x62356478), yuv422p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 49997 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 59.94 tbc (default)
Metadata:
handler_name : DataHandler
encoder : XDCAM HD422 1080i60 (50 Mb/s)
timecode : 00:00:00;00
Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
Metadata:
handler_name : DataHandler
Stream #0:2(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
Metadata:
handler_name : DataHandler
Stream #0:3(eng): Data: none (tmcd / 0x64636D74)
Metadata:
handler_name : DataHandler
timecode : 00:00:00;00
Unsupported codec with id 0 for input stream 3

Parsed_concat_1 # 02ad98e0 Failed to configure output pad on Parsed_concat_1 ffmpeg

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 vs 40:33 for the first and third inputs.
You can set the corect SAR value using the setsar filter, eg:
[1:v:0]setsar=sar=40/33[1v0sar]
then pass [1v0sar] to the concat filter along with the other video streams.

Resources