Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2456 closed defect (fixed)

can't concatenate two video files because of different SARs

Reported by: DK Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords: aspect
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

I've got two videos encoded from a sequence of png images and audio streams from mp3 with similar params.
When I try to concatenate them using a custom filter I get this error:

[Parsed_concat_0 @ 00000000020a20e0] Input link in1:v0 parameters (size 1280x720, SAR 1:1) do not match the corresponding output link in0:v0 parameters (1280x720, SAR 0:1)

I don't quite understand how SARs of my videos both produced from 1280x720 pngs with the same FFMPEG parameters ended up having different SARs.

Here's the command line:

ffmpeg.exe" -report -i test3.mov -i test-h264-jpg.mov -filter_complex "[0:0] [0:1] [1:0] [1:1] concat=n=2:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" -start_number 0 -r 25 -vcodec libx264 -crf 15 -preset slow -profile:v main -pix_fmt yuv420p -ac 2 -ar 48000 -ab 320k -y concatted-mux.mov

and full output:

ffmpeg started on 2013-04-10 at 22:19:06
Report written to "ffmpeg-20130410-221906.log"
Command line:
"ffmpeg.exe" -report -i test3.mov -i test-h264-jpg.mov -filter_complex "[0:0] [0:1] [1:0] [1:1] concat=n=2:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" -start_number 0 -r 25 -vcodec libx264 -crf 15 -preset slow -profile:v main -pix_fmt yuv420p -ac 2 -ar 48000 -ab 320k -y concatted-mux.mov
ffmpeg version N-49527-g985e93a Copyright (c) 2000-2013 the FFmpeg developers

built on Feb 1 2013 18:47:10 with gcc 4.7.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 17.100 / 52. 17.100
libavcodec 54. 91.100 / 54. 91.100
libavformat 54. 61.104 / 54. 61.104
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 35.100 / 3. 35.100
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100

Splitting the commandline.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-i' ... matched as input file with argument 'test3.mov'.
Reading option '-i' ... matched as input file with argument 'test-h264-jpg.mov'.
Reading option '-filter_complex' ... matched as option 'filter_complex' (create a complex filtergraph) with argument '[0:0] [0:1] [1:0] [1:1] concat=n=2:v=1:a=1 [v] [a]'.
Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '[v]'.
Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '[a]'.
Reading option '-start_number' ... matched as AVOption 'start_number' with argument '0'.
Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with argument '25'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'libx264'.
Reading option '-crf' ... matched as AVOption 'crf' with argument '15'.
Reading option '-preset' ... matched as AVOption 'preset' with argument 'slow'.
Reading option '-profile:v' ... matched as option 'profile' (set profile) with argument 'main'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'yuv420p'.
Reading option '-ac' ... matched as option 'ac' (set number of audio channels) with argument '2'.
Reading option '-ar' ... matched as option 'ar' (set audio sampling rate (in Hz)) with argument '48000'.
Reading option '-ab' ... matched as AVOption 'ab' with argument '320k'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option 'concatted-mux.mov' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Applying option filter_complex (create a complex filtergraph) with argument [0:0] [0:1] [1:0] [1:1] concat=n=2:v=1:a=1 [v] [a].
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file test3.mov.
Successfully parsed a group of options.
Opening an input file: test3.mov.
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000032ef00] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000032ef00] ISO: File Type Major Brand: qt
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000032ef00] File position before avformat_find_stream_info() is 10775937
[h264 @ 000000000032f460] Using externally provided dimensions
[h264 @ 000000000032f460] no picture
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000032ef00] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000032ef00] File position after avformat_find_stream_info() is 3111
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test3.mov':

Metadata:

major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf54.61.104

Duration: 00:03:34.20, start: 0.000000, bitrate: 402 kb/s

Stream #0:0(eng), 3, 1/12800: Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720, 74 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
Metadata:

handler_name : DataHandler

Stream #0:1(eng), 1, 1/44100: Audio: mp3 (.mp3 / 0x33706D2E), 44100 Hz, stereo, s16p, 320 kb/s
Metadata:

handler_name : DataHandler

Successfully opened the file.
Parsing a group of options: input file test-h264-jpg.mov.
Successfully parsed a group of options.
Opening an input file: test-h264-jpg.mov.
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000032a160] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000032a160] ISO: File Type Major Brand: qt
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000032a160] File position before avformat_find_stream_info() is 1982254
[h264 @ 0000000004194920] Using externally provided dimensions
[h264 @ 0000000004194920] no picture
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000032a160] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000032a160] File position after avformat_find_stream_info() is 2064
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'test-h264-jpg.mov':

Metadata:

major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf54.61.104

Duration: 00:00:12.09, start: 0.000000, bitrate: 1311 kb/s

Stream #1:0(eng), 3, 1/12800: Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1021 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
Metadata:

handler_name : DataHandler

Stream #1:1(eng), 1, 1/44100: Audio: mp3 (.mp3 / 0x33706D2E), 44100 Hz, stereo, s16p, 320 kb/s
Metadata:

handler_name : DataHandler

Successfully opened the file.
Parsing a group of options: output file concatted-mux.mov.
Applying option map (set input stream mapping) with argument [v].
Applying option map (set input stream mapping) with argument [a].
Applying option r (set frame rate (Hz value, fraction or abbreviation)) with argument 25.
Applying option vcodec (force video codec ('copy' to copy stream)) with argument libx264.
Applying option profile:v (set profile) with argument main.
Applying option pix_fmt (set pixel format) with argument yuv420p.
Applying option ac (set number of audio channels) with argument 2.
Applying option ar (set audio sampling rate (in Hz)) with argument 48000.
Successfully parsed a group of options.
Opening an output file: concatted-mux.mov.
[concat @ 0000000002089720] Setting entry with key 'n' to value '2'
[concat @ 0000000002089720] Setting entry with key 'v' to value '1'
[concat @ 0000000002089720] Setting entry with key 'a' to value '1'
[buffer @ 0000000002099900] Setting entry with key 'video_size' to value '1280x720'
[buffer @ 0000000002099900] Setting entry with key 'pix_fmt' to value '0'
[buffer @ 0000000002099900] Setting entry with key 'time_base' to value '1/12800'
[buffer @ 0000000002099900] Setting entry with key 'pixel_aspect' to value '0/1'
[buffer @ 0000000002099900] Setting entry with key 'sws_param' to value 'flags=2'
[buffer @ 0000000002099900] Setting entry with key 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 00000000020a1e60] w:1280 h:720 pixfmt:yuv420p tb:1/12800 fr:25/1 sar:0/1 sws_param:flags=2
[abuffer @ 0000000002098be0] Setting entry with key 'time_base' to value '1/44100'
[abuffer @ 0000000002098be0] Setting entry with key 'sample_rate' to value '44100'
[abuffer @ 0000000002098be0] Setting entry with key 'sample_fmt' to value 's16p'
[abuffer @ 0000000002098be0] Setting entry with key 'channel_layout' to value '0x3'
[graph 0 input from stream 0:1 @ 00000000020a1f00] tb:1/44100 samplefmt:s16p samplerate:44100 chlayout:0x3
[buffer @ 0000000002098ca0] Setting entry with key 'video_size' to value '1280x720'
[buffer @ 0000000002098ca0] Setting entry with key 'pix_fmt' to value '0'
[buffer @ 0000000002098ca0] Setting entry with key 'time_base' to value '1/12800'
[buffer @ 0000000002098ca0] Setting entry with key 'pixel_aspect' to value '1/1'
[buffer @ 0000000002098ca0] Setting entry with key 'sws_param' to value 'flags=2'
[buffer @ 0000000002098ca0] Setting entry with key 'frame_rate' to value '25/1'
[graph 0 input from stream 1:0 @ 00000000020a1de0] w:1280 h:720 pixfmt:yuv420p tb:1/12800 fr:25/1 sar:1/1 sws_param:flags=2
[abuffer @ 0000000002098d40] Setting entry with key 'time_base' to value '1/44100'
[abuffer @ 0000000002098d40] Setting entry with key 'sample_rate' to value '44100'
[abuffer @ 0000000002098d40] Setting entry with key 'sample_fmt' to value 's16p'
[abuffer @ 0000000002098d40] Setting entry with key 'channel_layout' to value '0x3'
[graph 0 input from stream 1:1 @ 00000000020a1960] tb:1/44100 samplefmt:s16p samplerate:44100 chlayout:0x3
[aformat @ 0000000002088720] Setting entry with key 'sample_fmts' to value 's16'
[aformat @ 0000000002088720] Setting entry with key 'sample_rates' to value '48000'
[aformat @ 0000000002088720] Setting entry with key 'channel_layouts' to value '0x3'
Successfully opened the file.
[audio format for output stream 0:1 @ 00000000020a1ba0] auto-inserting filter 'auto-inserted resampler 0' between the filter 'Parsed_concat_0' and the filter 'audio format for output stream 0:1'
[Parsed_concat_0 @ 00000000020a1d40] Input link in1:v0 parameters (size 1280x720, SAR 1:1) do not match the corresponding output link in0:v0 parameters (1280x720, SAR 0:1)
[Parsed_concat_0 @ 00000000020a1d40] Failed to configure output pad on Parsed_concat_0
[AVIOContext @ 000000000209e320] Statistics: 266930 bytes read, 2 seeks
[AVIOContext @ 000000000032a980] Statistics: 77594 bytes read, 2 seeks

Attachments (1)

test-264-240.mov (540.8 KB ) - added by DK 11 years ago.
video sample (SAR = 0:1)

Download all attachments as: .zip

Change History (11)

comment:1 by Carl Eugen Hoyos, 11 years ago

Is an external library (libx264) required to reproduce the problem or is it also reproducible with -vcodec mpeg4 ?

comment:2 by DK, 11 years ago

it is not required if both videos have different SAR (e.h video0 SAR 0:1 (I'm still not sure how this one was calculated but it was produced using libx264) and video1 SAR 1:1).
I tried generating both videos using mpeg4 and then applying the same filter. It worked fine but the sound was somehow distorted even though I used exactly the same audio settings.

in reply to:  2 comment:3 by Carl Eugen Hoyos, 11 years ago

Replying to DK:

it is not required if both videos have different SAR (e.h video0 SAR 0:1 (I'm still not sure how this one was calculated but it was produced using libx264) and video1 SAR 1:1).

Please upload a short sample with SAR 0:1 (or explain how to encode it).

by DK, 11 years ago

Attachment: test-264-240.mov added

video sample (SAR = 0:1)

comment:4 by DK, 11 years ago

Thanks, the file is attached. It was produced using libx264 (it gives me better quality, faster times and no sound artefacts compared to "mpeg4") from a set of png files:

ffmpeg.exe -report -threads 0 -f image2 -i "tst (%%d).png" -i "sound.mp3" -r 25 -vcodec libx264 -crf 20 -preset slow -profile:v main -pix_fmt yuv420p -acodec libmp3lame -ac 2 -ar 44100 -y -ab 320k "test-h264.mov"

My platform is windows7 x64.

comment:5 by Carl Eugen Hoyos, 11 years ago

Component: undeterminedavfilter
Keywords: aspect added
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master
$ ffmpeg -i test-264-240.mov -qscale 2 out.avi
...
$ ffmpeg -i test-264-240.mov -i out.avi -filter_complex concat -qscale 2 concat.avi
ffmpeg version N-51698-g62a1181 Copyright (c) 2000-2013 the FFmpeg developers
  built on Apr 10 2013 01:32:09 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 25.100 / 52. 25.100
  libavcodec     55.  2.100 / 55.  2.100
  libavformat    55.  1.100 / 55.  1.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 49.101 /  3. 49.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test-264-240.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf54.61.104
  Duration: 00:00:12.09, start: 0.000000, bitrate: 366 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720, 48 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
    Metadata:
      handler_name    : DataHandler
    Stream #0:1(eng): Audio: mp3 (.mp3 / 0x33706D2E), 44100 Hz, stereo, s16p, 320 kb/s
    Metadata:
      handler_name    : DataHandler
Input #1, avi, from 'out.avi':
  Metadata:
    encoder         : Lavf55.1.100
  Duration: 00:00:12.12, start: 0.000000, bitrate: 937 kb/s
    Stream #1:0: Video: mpeg4 (Simple Profile) (FMP4 / 0x34504D46), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
    Stream #1:1: Audio: ac3 ([0] [0][0] / 0x2000), 44100 Hz, stereo, fltp, 192 kb/s
Please use -q:a or -q:v, -qscale is ambiguous
[Parsed_concat_0 @ 0x1713460] Input link in1:v0 parameters (size 1280x720, SAR 1:1) do not match the corresponding output link in0:v0 parameters (1280x720, SAR 0:1)
[Parsed_concat_0 @ 0x1713460] Failed to configure output pad on Parsed_concat_0

comment:6 by Cigaes, 11 years ago

You can use the setsar filter to for the aspect ratio for the stream that does not have it.

It would be interesting to know how you arrived there. You should post the exact command line that you used to produce test3.mov, along with its full output (at default log level, that should be enough).

comment:7 by Carl Eugen Hoyos, 11 years ago

$ ffmpeg -i tests/lena.pnm sar0.mp4
ffmpeg version N-51893-gd83c481 Copyright (c) 2000-2013 the FFmpeg developers
  built on Apr 11 2013 13:59:45 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack --enable-libx264
  libavutil      52. 26.100 / 52. 26.100
  libavcodec     55.  2.100 / 55.  2.100
  libavformat    55.  2.100 / 55.  2.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 52.101 /  3. 52.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Input #0, image2, from 'tests/lena.pnm':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: ppm, rgb24, 256x256, 25 tbr, 25 tbn, 25 tbc
[format @ 0x25931c0] This syntax is deprecated. Use '|' to separate the list items.
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x25911e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX
[libx264 @ 0x25911e0] profile High 4:4:4 Predictive, level 1.3, 4:4:4 8-bit
[libx264 @ 0x25911e0] 264 - core 128 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'sar0.mp4':
  Metadata:
    encoder         : Lavf55.2.100
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv444p, 256x256, q=-1--1, 12800 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (ppm -> libx264)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=28.0 Lsize=       6kB time=00:00:00.04 bitrate=1283.8kbits/s  
video:5kB audio:0kB subtitle:0 global headers:0kB muxing overhead 13.429935%
[libx264 @ 0x25911e0] frame I:1     Avg QP:30.12  size:  4947
[libx264 @ 0x25911e0] mb I  I16..4:  7.0% 62.9% 30.1%
[libx264 @ 0x25911e0] 8x8 transform intra:62.9%
[libx264 @ 0x25911e0] coded y,u,v intra: 74.9% 36.6% 41.4%
[libx264 @ 0x25911e0] i16 v,h,dc,p: 56%  6% 11% 28%
[libx264 @ 0x25911e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31%  7% 15% 11%  4%  8%  4% 14%  7%
[libx264 @ 0x25911e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29%  6% 14% 15%  6% 10%  4% 13%  3%
[libx264 @ 0x25911e0] kb/s:989.40
$ ffmpeg -i sar0.mp4 sar1.avi
ffmpeg version N-51893-gd83c481 Copyright (c) 2000-2013 the FFmpeg developers
  built on Apr 11 2013 13:59:45 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack --enable-libx264
  libavutil      52. 26.100 / 52. 26.100
  libavcodec     55.  2.100 / 55.  2.100
  libavformat    55.  2.100 / 55.  2.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 52.101 /  3. 52.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sar0.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.2.100
  Duration: 00:00:00.04, start: 0.000000, bitrate: 1283 kb/s
    Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv444p, 256x256, 1124 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
    Metadata:
      handler_name    : VideoHandler
Output #0, avi, to 'sar1.avi':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    ISFT            : Lavf55.2.100
    Stream #0:0(und): Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 256x256, q=2-31, 200 kb/s, 25 tbn, 25 tbc
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mpeg4)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=3.8 Lsize=      15kB time=00:00:00.04 bitrate=3097.6kbits/s   
video:10kB audio:0kB subtitle:0 global headers:0kB muxing overhead 58.331630%
$ ffmpeg -i sar0.mp4 -i sar1.avi -filter_complex concat out.avi
ffmpeg version N-51893-gd83c481 Copyright (c) 2000-2013 the FFmpeg developers
  built on Apr 11 2013 13:59:45 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack --enable-libx264
  libavutil      52. 26.100 / 52. 26.100
  libavcodec     55.  2.100 / 55.  2.100
  libavformat    55.  2.100 / 55.  2.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 52.101 /  3. 52.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sar0.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.2.100
  Duration: 00:00:00.04, start: 0.000000, bitrate: 1283 kb/s
    Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv444p, 256x256, 1124 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
    Metadata:
      handler_name    : VideoHandler
Input #1, avi, from 'sar1.avi':
  Metadata:
    encoder         : Lavf55.2.100
  Duration: 00:00:00.04, start: 0.000000, bitrate: 3097 kb/s
    Stream #1:0: Video: mpeg4 (Simple Profile) (FMP4 / 0x34504D46), yuv420p, 256x256 [SAR 1:1 DAR 1:1], 25 tbr, 25 tbn, 25 tbc
[Parsed_concat_0 @ 0x251c6e0] Input link in1:v0 parameters (size 256x256, SAR 1:1) do not match the corresponding output link in0:v0 parameters (256x256, SAR 0:1)
[Parsed_concat_0 @ 0x251c6e0] Failed to configure output pad on Parsed_concat_0

comment:8 by kn100, 11 years ago

This is affecting me too on the latest build (May 13th.)

The first file is an AVI created with Beepa FRAPS - A screen recording application
The second file is an MKV which was created by running the above AVI through FFMPEG with libx264 and libvorbis selected.

Setting the SAR seemed to fix it for me. I have included a link to the two test files I am using below.

Here is my initial command, which fails.

D:\Visual Studio 2010\Projects\FFREND\FFREND\bin\Debug>ffmpeg  -i "C:\Users\Kevi
n\Desktop\test clips kn100\vid1.avi" -i "C:\Users\Kevin\Desktop\test clips kn100
\vid1.mkv" -filter_complex "[0:0] [0:1] [1:0] [1:1] concat=n=2:v=1:a=1 [v] [a] "
 -map "[v]" -map "[a]" -vf "setsar=sar=1/1" -vcodec libx264 -crf 27 "C:\Users\Ke
vin\Desktop\spaghetticat 0-33-0- Part 1.mkv"
ffmpeg version N-53033-g56ba331 Copyright (c) 2000-2013 the FFmpeg developers
  built on May 13 2013 22:18:29 with gcc 4.7.3 (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-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrn
b --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libr
tmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheo
ra --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-li
bvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --ena
ble-zlib
  libavutil      52. 31.100 / 52. 31.100
  libavcodec     55.  9.100 / 55.  9.100
  libavformat    55.  7.100 / 55.  7.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 65.100 /  3. 65.100
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
[avi @ 02402940] Stream #1: not enough frames to estimate rate; consider increas
ing probesize
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, avi, from 'C:\Users\Kevin\Desktop\test clips kn100\vid1.avi':
  Duration: 00:00:01.87, start: 0.000000, bitrate: 94972 kb/s
    Stream #0:0: Video: fraps (FPS1 / 0x31535046), yuvj420p, 1280x720, 30 fps, 3
0 tbr, 30 tbn, 30 tbc
    Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16
, 1536 kb/s
Input #1, matroska,webm, from 'C:\Users\Kevin\Desktop\test clips kn100\vid1.mkv'
:
  Metadata:
    ENCODER         : Lavf55.7.100
  Duration: 00:00:01.93, start: 0.000000, bitrate: 448 kb/s
    Stream #1:0: Video: h264 (High), yuvj420p, 1280x720, SAR 1:1 DAR 16:9, 30 fp
s, 30 tbr, 1k tbn, 60 tbc (default)
    Stream #1:1: Audio: vorbis, 48000 Hz, stereo, fltp (default)
File 'C:\Users\Kevin\Desktop\spaghetticat 0-33-0- Part 1.mkv' already exists. Ov
erwrite ? [y/N] y
[Parsed_concat_0 @ 03e21300] Input link in1:v0 parameters (size 1280x720, SAR 1:
1) do not match the corresponding output link in0:v0 parameters (1280x720, SAR 0
:1)
[Parsed_concat_0 @ 03e21300] Failed to configure output pad on Parsed_concat_0

And here is the arguments I use which seem to fix it.

D:\Visual Studio 2010\Projects\FFREND\FFREND\bin\Debug>ffmpeg  -i "C:\Users\Kevi
n\Desktop\test clips kn100\vid1.avi" -i "C:\Users\Kevin\Desktop\test clips kn100
\vid1.mkv" -filter_complex "[0:0] setsar=1/1[sarfix];[sarfix] [0:1] [1:0] [1:1]
concat=n=2:v=1:a=1 [v] [a] " -map "[v]" -map "[a]" -vcodec libx264 -crf 27 "C:\U
sers\Kevin\Desktop\spaghetticat 0-33-0- Part 1.mkv"
ffmpeg version N-53033-g56ba331 Copyright (c) 2000-2013 the FFmpeg developers
  built on May 13 2013 22:18:29 with gcc 4.7.3 (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-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrn
b --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libr
tmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheo
ra --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-li
bvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --ena
ble-zlib
  libavutil      52. 31.100 / 52. 31.100
  libavcodec     55.  9.100 / 55.  9.100
  libavformat    55.  7.100 / 55.  7.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 65.100 /  3. 65.100
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
[avi @ 0242d220] Stream #1: not enough frames to estimate rate; consider increas
ing probesize
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, avi, from 'C:\Users\Kevin\Desktop\test clips kn100\vid1.avi':
  Duration: 00:00:01.87, start: 0.000000, bitrate: 94972 kb/s
    Stream #0:0: Video: fraps (FPS1 / 0x31535046), yuvj420p, 1280x720, 30 fps, 3
0 tbr, 30 tbn, 30 tbc
    Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16
, 1536 kb/s
Input #1, matroska,webm, from 'C:\Users\Kevin\Desktop\test clips kn100\vid1.mkv'
:
  Metadata:
    ENCODER         : Lavf55.7.100
  Duration: 00:00:01.93, start: 0.000000, bitrate: 448 kb/s
    Stream #1:0: Video: h264 (High), yuvj420p, 1280x720, SAR 1:1 DAR 16:9, 30 fp
s, 30 tbr, 1k tbn, 60 tbc (default)
    Stream #1:1: Audio: vorbis, 48000 Hz, stereo, fltp (default)
File 'C:\Users\Kevin\Desktop\spaghetticat 0-33-0- Part 1.mkv' already exists. Ov
erwrite ? [y/N] y
No pixel format specified, yuvj420p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 04297c60] using SAR=1/1
[libx264 @ 04297c60] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX XOP
FMA4 FMA3 SSEMisalign LZCNT BMI1
[libx264 @ 04297c60] profile High, level 3.1
[libx264 @ 04297c60] 264 - core 132 r2309 3b1f1f7 - H.264/MPEG-4 AVC codec - Cop
yleft 2003-2013 - http://www.videolan.org/x264.html - options:  cabac=1 ref=3 de
block=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1
me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chr
oma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1
 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=
1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scen
ecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=27.0 qcomp=0.60 qpmi
n=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, matroska, to 'C:\Users\Kevin\Desktop\spaghetticat 0-33-0- Part 1.mkv'
:
  Metadata:
    encoder         : Lavf55.7.100
    Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuvj420p, 1280x720 [
SAR 1:1 DAR 16:9], q=-1--1, 1k tbn, 30 tbc
    Stream #0:1: Audio: vorbis (libvorbis) (oV[0][0] / 0x566F), 48000 Hz, stereo
, fltp
Stream mapping:
  Stream #0:0 (fraps) -> setsar
  Stream #0:1 (pcm_s16le) -> concat:in0:a0
  Stream #1:0 (h264) -> concat:in1:v0
  Stream #1:1 (vorbis) -> concat:in1:a0
  concat:out:v0 -> Stream #0:0 (libx264)
  concat:out:a0 -> Stream #0:1 (libvorbis)
Press [q] to stop, [?] for help
frame=  112 fps=0.0 q=2686543.0 Lsize=     119kB time=00:00:03.79 bitrate= 256.3
kbits/s
video:72kB audio:40kB subtitle:0 global headers:4kB muxing overhead 2.613164%
[libx264 @ 04297c60] frame I:1     Avg QP:23.18  size: 36793
[libx264 @ 04297c60] frame P:28    Avg QP:21.17  size:   928
[libx264 @ 04297c60] frame B:83    Avg QP:32.17  size:   125
[libx264 @ 04297c60] consecutive B-frames:  0.9%  0.0%  2.7% 96.4%
[libx264 @ 04297c60] mb I  I16..4: 27.2% 55.7% 17.1%
[libx264 @ 04297c60] mb P  I16..4:  0.3%  0.6%  0.0%  P16..4:  6.9%  0.6%  0.6%
 0.0%  0.0%    skip:90.9%
[libx264 @ 04297c60] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  2.5%  0.0%  0.0%
 direct: 0.0%  skip:97.5%  L0:20.9% L1:79.1% BI: 0.0%
[libx264 @ 04297c60] 8x8 transform intra:58.1% inter:90.6%
[libx264 @ 04297c60] coded y,uvDC,uvAC intra: 42.3% 42.3% 10.3% inter: 0.3% 1.2%
 0.0%
[libx264 @ 04297c60] i16 v,h,dc,p: 54% 29%  8% 10%
[libx264 @ 04297c60] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 17% 35%  6%  6%  4%  7%
 6%  6%
[libx264 @ 04297c60] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 24% 12%  6%  8%  7%  6%
 5%  5%
[libx264 @ 04297c60] i8c dc,h,v,p: 62% 20% 16%  2%
[libx264 @ 04297c60] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 04297c60] ref P L0: 74.8%  4.7% 12.2%  8.2%
[libx264 @ 04297c60] ref B L0: 77.5% 18.9%  3.6%
[libx264 @ 04297c60] ref B L1: 94.6%  5.4%
[libx264 @ 04297c60] kb/s:154.04

https://mega.co.nz/#!HkgHFL4C!CIXkeTrz4XaGOwvxNPxdZ2koBnsRgjE7xgd2tl_KbEM

comment:9 by Elon Musk, 11 years ago

Resolution: wontfix
Status: openclosed

There is nothing to fix use setsar/setdar filter

comment:10 by Carl Eugen Hoyos, 11 years ago

Resolution: wontfixfixed

Fixed in 36b21e1, thank you for the report!

Note: See TracTickets for help on using tickets.