[FFmpeg-user] Concat limited to certain file types?

Jan Ehrhardt phpdev at ehrhardt.nl
Wed Oct 17 01:16:01 CEST 2012


Roger Pack in gmane.comp.video.ffmpeg.user (Tue, 16 Oct 2012 15:36:09 -0600):
>>>What is a command line that failed?
>>
>> For instance:
>>
>> ffmpeg -i S1000001.MP4 -i S1000002.MP4 -filter_complex "[0:0] [0:1]
>>         [1:0] [1:1] concat=n=2:v=1:a=1 [v] [a],scale=384:288"
>>         -map [v] -map [a] -aspect 4:3 -vcodec libx264 -b:v 320k
>>         -strict -2 -acodec aac -ab 96k -y out.mp4
>> Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_scale_1
>
>My guess is you need to provide an input to scale, like "[v] scale" ?

This one produced the same output as the one with -s 384x288:

-filter_complex " \
	[0:0] scale=384:288 [0:2], \
	[1:0] scale=384:288 [1:2], \
	[0:2] [0:1] [1:2] [1:1] concat=n=2:v=1:a=1 [v] [a]"
	-map [v] -map [a]

To my surprise, you do not see any mention to 0:2 and 1:2 in the
FFMpeg output:

Output #0, mp4, to 'out.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: mp42avc1
    encoder         : Lavf54.29.104
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 384x288 [SAR 1:1 DAR 4:3], q=-1--1, 320 kb/s, 25 tbn, 25 tbc
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, flt, 96 kb/s
Stream mapping:
  Stream #0:0 (h264) -> scale
  Stream #0:1 (aac) -> concat:in0:a0
  Stream #1:0 (h264) -> scale
  Stream #1:1 (aac) -> concat:in1:a0
  concat:out:v0 -> Stream #0:0 (libx264)
  concat:out:a0 -> Stream #0:1 (aac)

Full output below. The audio track is 00:00:14.992, just like
the -s 384x288 version:

S:\>\utils\mp4box -info out.mp4
* Movie Info *
        Timescale 1000 - Duration 00:00:15.080
        2 track(s)
        Fragmented File: no
        File suitable for progressive download (moov before mdat)
        File Brand isom - version 512
        Created: UNKNOWN DATE
File has no MPEG4 IOD/OD

iTunes Info:
        Encoder Software: Lavf54.29.104

Track # 1 Info - TrackID 1 - TimeScale 25 - Duration 00:00:15.080
Media Info: Language "Undetermined" - Type "vide:avc1" - 377 samples
Visual Track layout: x=0 y=0 width=384 height=288
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 384 x 288
        AVC Info: 1 SPS - 1 PPS - Profile Baseline @ Level 3
        NAL Unit length bits: 32
        Pixel Aspect Ratio 1:1 - Indicated track size 384 x 288
Self-synchronized

Track # 2 Info - TrackID 2 - TimeScale 48000 - Duration 00:00:14.992
Media Info: Language "Undetermined" - Type "soun:mp4a" - 701 samples
MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40
MPEG-4 Audio MPEG-4 Audio AAC LC - 2 Channel(s) - SampleRate 48000
Synchronized on stream 1
Alternate Group ID 1

Jan


ffmpeg version 1.0 Copyright (c) 2000-2012 the FFmpeg developers
  built on Oct 12 2012 05:31:57 with gcc 4.7.1 (GCC)
  configuration: --prefix=/usr/local/x64 --enable-w32threads --enable-static --enable-libmp3lame --enable-nonfree --enable-libfaac --enable-gpl --enable-libx264 --enable-libvorbis --enable-libtheora --enable-libvpx --enable-zlib --enable-bzlib
--arch=x86_64 --cross-prefix=x86_64-w64-mingw32- --target-os=mingw32 --disable-shared --disable-doc --extra-cflags=-m64 --extra-ldflags='-m64 -L/usr/local/x64/lib'
  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'S1000001.MP4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: mp42avc1
    creation_time   : 2012-09-19 13:25:59
  Duration: 00:00:10.00, start: 0.000000, bitrate: 6841 kb/s
    Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 6121 kb/s, 50 fps, 50 tbr, 60k tbn, 100 tbc
    Metadata:
      creation_time   : 2012-09-19 13:25:59
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 246 kb/s
    Metadata:
      creation_time   : 2012-09-19 13:25:59
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'S1000002.MP4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: mp42avc1
    creation_time   : 2012-09-19 13:26:20
  Duration: 00:00:05.00, start: 0.000000, bitrate: 7077 kb/s
    Stream #1:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 6170 kb/s, 50 fps, 50 tbr, 60k tbn, 100 tbc
    Metadata:
      creation_time   : 2012-09-19 13:26:20
    Stream #1:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 237 kb/s
    Metadata:
      creation_time   : 2012-09-19 13:26:20
[libx264 @ 00000000019a25e0] using SAR=1/1
[libx264 @ 00000000019a25e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX
[libx264 @ 00000000019a25e0] profile Constrained Baseline, level 3.0
[libx264 @ 00000000019a25e0] 264 - core 125 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=1:0:0 analyse=0x1:0x110 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16
chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=25 keyint_min=12 scenecut=0
intra_refresh=0 rc_lookahead=15 rc=abr mbtree=1 bitrate=320 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=51 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'out.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: mp42avc1
    encoder         : Lavf54.29.104
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 384x288 [SAR 1:1 DAR 4:3], q=-1--1, 320 kb/s, 25 tbn, 25 tbc
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, flt, 96 kb/s
Stream mapping:
  Stream #0:0 (h264) -> scale
  Stream #0:1 (aac) -> concat:in0:a0
  Stream #1:0 (h264) -> scale
  Stream #1:1 (aac) -> concat:in1:a0
  concat:out:v0 -> Stream #0:0 (libx264)
  concat:out:a0 -> Stream #0:1 (aac)
Press [q] to stop, [?] for help
frame=  125 fps=0.0 q=34.0 size=     207kB time=00:00:04.45 bitrate= 380.5kbits/s dup=0 drop=121    
frame=  236 fps=229 q=36.0 size=     457kB time=00:00:08.93 bitrate= 418.5kbits/s dup=0 drop=233    
frame=  350 fps=227 q=33.0 size=     637kB time=00:00:13.49 bitrate= 386.3kbits/s dup=0 drop=346    
Starting second pass: moving header on top of the file
frame=  377 fps=226 q=-1.0 Lsize=     706kB time=00:00:15.08 bitrate= 383.4kbits/s dup=0 drop=373    

video:520kB audio:177kB subtitle:0 global headers:0kB muxing overhead 1.374440%
[libx264 @ 00000000019a25e0] frame I:16    Avg QP:28.38  size:  6560
[libx264 @ 00000000019a25e0] frame P:361   Avg QP:32.04  size:  1181
[libx264 @ 00000000019a25e0] mb I  I16..4: 34.1%  0.0% 65.9%
[libx264 @ 00000000019a25e0] mb P  I16..4:  3.8%  0.0%  0.0%  P16..4: 37.0%  9.6%  1.1%  0.0%  0.0%    skip:48.5%
[libx264 @ 00000000019a25e0] final ratefactor: 28.02
[libx264 @ 00000000019a25e0] coded y,uvDC,uvAC intra: 38.9% 40.8% 15.5% inter: 12.6% 7.7% 0.0%
[libx264 @ 00000000019a25e0] i16 v,h,dc,p: 31% 35% 16% 18%
[libx264 @ 00000000019a25e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 26% 15%  9%  6%  5%  7%  5%  6%
[libx264 @ 00000000019a25e0] i8c dc,h,v,p: 49% 23% 21%  7%
[libx264 @ 00000000019a25e0] kb/s:281.90



More information about the ffmpeg-user mailing list