[FFmpeg-user] -filter_complex scale + concat

kalle ralle betonpfeiler at googlemail.com
Sun Jan 26 20:20:36 CET 2014


Hello Everyone!

I have to combine and resize two videos, each filter on its own works fine,
but if I combine those to filters I get a broken Video...
(Commandline below)

The combined and resized videostream frezzes at the last frame of the first
Clip, audio however keeps playing. I encountered this issue on VLC, QT
aswell as ffplay.
When checking with mediainfo (output at the bottom), the combined video has
3 streams with the lengths of track1: Clip1, track2: Clip2 and track3:
Clip1+Clip2, but only one audiostream. The streams 1 and 2 get the resize,
the third stream is not resized, only the first stream gets played...
I tested this with different sourcevideos, filter orders always the same
result...
I assume that I did something wrong in combining the filters...

Thanks!
J

____________________________________________

*Command line:*

ffmpeg -i clip1.mov -i clip2.mov -filter_complex "[0:0] [0:1] [1:0] [1:1]
concat=n=2:v=1:a=1 [v] [a]; [0:0] scale=1920x1080; [1:0] scale=1920x1080"
-map "[a]" -map"[v]" -vcodec libx264  -intra -b:v 2M -acodec libmp3lame
-b:a 256k -y out.mov

*Console output: *

C:\Users\USER\Documents\python>ffmpeg -i
C:\Users\USER\Documents\python\ffmpeg_t
est\part1.mov -i C:\Users\USER\Documents\python\ffmpeg_test\part1.mov
-filter_co
mplex "[0:0] [0:1] [1:0] [1:1] concat=n=2:v=1:a=1 [v] [a];[0:0]
scale=1920x1080;
 [1:0] scale=1920x1080 " -map "[a]" -map "[v]"  -vcodec libx264  -intra
-b:v 2M
-acodec libmp3lame -b:a 256k -y out_big.mov
ffmpeg version N-60023-g13e0109 Copyright (c) 2000-2014 the FFmpeg
developers
  built on Jan 20 2014 22:06:57 with gcc 4.8.2 (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-libmodplug --enable-libmp3lame
--ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
--enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr
--enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvo-aa
cenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable-libwavp
ack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 63.100 / 52. 63.100
  libavcodec     55. 48.102 / 55. 48.102
  libavformat    55. 25.100 / 55. 25.100
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     4.  1.100 /  4.  1.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'C:\Users\USER\Documents\python\ffmpeg_t
est\part1.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf54.63.104
  Duration: 00:00:10.02, start: 0.011021, bitrate: 3493 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
512x288 [
SAR 1:1 DAR 16:9], 3238 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:1(eng): Audio: mp3 (.mp3 / 0x33706D2E), 48000 Hz, mono, s16p,
255
kb/s (default)
    Metadata:
      handler_name    : DataHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from
'C:\Users\USER\Documents\python\ffmpeg_t
est\part1.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf54.63.104
  Duration: 00:00:10.02, start: 0.011021, bitrate: 3493 kb/s
    Stream #1:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
512x288 [
SAR 1:1 DAR 16:9], 3238 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
    Metadata:
      handler_name    : DataHandler
    Stream #1:1(eng): Audio: mp3 (.mp3 / 0x33706D2E), 48000 Hz, mono, s16p,
255
kb/s (default)
    Metadata:
      handler_name    : DataHandler
[libx264 @ 00000000029d7240] using SAR=1/1
[libx264 @ 00000000029d7240] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2
AVX
[libx264 @ 00000000029d7240] profile High, level 4.0
[libx264 @ 00000000029d7240] 264 - core 140 r2377 1ca7bb9 - H.264/MPEG-4
AVC cod
ec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options:
cabac=1 r
ef=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00
mixed
_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11
fast_pski
p=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0
nr=0 dec
imate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0
weightp=0 key
int=1 keyint_min=1 scenecut=40 intra_refresh=0 rc=abr mbtree=0 bitrate=2000
rate
tol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[libx264 @ 00000000029d8b80] using SAR=1/1
[libx264 @ 00000000029d8b80] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2
AVX
[libx264 @ 00000000029d8b80] profile High, level 4.0
[libx264 @ 00000000029d8b80] 264 - core 140 r2377 1ca7bb9 - H.264/MPEG-4
AVC cod
ec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options:
cabac=1 r
ef=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00
mixed
_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11
fast_pski
p=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0
nr=0 dec
imate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0
weightp=0 key
int=1 keyint_min=1 scenecut=40 intra_refresh=0 rc=abr mbtree=0 bitrate=2000
rate
tol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[libx264 @ 0000000004babd40] using SAR=1/1
[libx264 @ 0000000004babd40] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2
AVX
[libx264 @ 0000000004babd40] profile High, level 2.1
[libx264 @ 0000000004babd40] 264 - core 140 r2377 1ca7bb9 - H.264/MPEG-4
AVC cod
ec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options:
cabac=1 r
ef=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00
mixed
_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11
fast_pski
p=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0
nr=0 dec
imate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0
weightp=0 key
int=1 keyint_min=1 scenecut=40 intra_refresh=0 rc=abr mbtree=0 bitrate=2000
rate
tol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mov, to 'out_big.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf55.25.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p,
1920x1080 [
SAR 1:1 DAR 16:9], q=-1--1, 2000 kb/s, 12288 tbn, 24 tbc
    Stream #0:1: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p,
1920x1080 [
SAR 1:1 DAR 16:9], q=-1--1, 2000 kb/s, 12288 tbn, 24 tbc
    Stream #0:2: Audio: mp3 (libmp3lame) (.mp3 / 0x33706D2E), 48000 Hz,
mono, s1
6p, 256 kb/s (default)
    Stream #0:3: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p,
512x288 [SA
R 1:1 DAR 16:9], q=-1--1, 2000 kb/s, 12288 tbn, 24 tbc
Stream mapping:
  Stream #0:0 (h264) -> concat:in0:v0
  Stream #0:0 (h264) -> scale
  Stream #0:1 (mp3) -> concat:in0:a0
  Stream #1:0 (h264) -> concat:in1:v0
  Stream #1:0 (h264) -> scale
  Stream #1:1 (mp3) -> concat:in1:a0
  scale -> Stream #0:0 (libx264)
  scale -> Stream #0:1 (libx264)
  concat:out:a0 -> Stream #0:2 (libmp3lame)
  concat:out:v0 -> Stream #0:3 (libx264)
Press [q] to stop, [?] for help
frame=   28 fps=0.0 q=37.0 q=37.0 q=20.0 size=     658kB time=00:00:01.42
bitrat
frame=   55 fps= 54 q=37.0 q=37.0 q=19.0 size=    1521kB time=00:00:02.53
bitrat
frame=   81 fps= 53 q=39.0 q=39.0 q=21.0 size=    2365kB time=00:00:03.63
bitrat
frame=  110 fps= 54 q=41.0 q=41.0 q=23.0 size=    3613kB time=00:00:04.85
bitrat
frame=  139 fps= 55 q=42.0 q=42.0 q=24.0 size=    4710kB time=00:00:06.05
bitrat
[Parsed_concat_0 @ 00000000029dff00] Buffer queue overflow, dropping.
    Last message repeated 47 times
frame=  167 fps= 55 q=43.0 q=43.0 q=25.0 size=    5692kB time=00:00:07.20
bitrat
[Parsed_concat_0 @ 00000000029dff00] Buffer queue overflow, dropping.
    Last message repeated 48 times
frame=  195 fps= 55 q=43.0 q=43.0 q=25.0 size=    6645kB time=00:00:08.41
bitrat
[Parsed_concat_0 @ 00000000029dff00] Buffer queue overflow, dropping.
    Last message repeated 50 times
frame=  224 fps= 55 q=43.0 q=43.0 q=24.0 size=    7594kB time=00:00:09.58
bitrat
[Parsed_concat_0 @ 00000000029dff00] Buffer queue overflow, dropping.
    Last message repeated 12 times
[output stream 0:3 @ 0000000004bac980] 100 buffers queued in output stream
0:3,
something may be wrong.
[output stream 0:2 @ 00000000029dabe0] 100 buffers queued in output stream
0:2,
something may be wrong.
frame=  240 fps= 51 q=-1.0 Lq=-1.0 q=-1.0 size=   11119kB time=00:00:20.03
bitra
te=4546.2kbits/s
video:10598kB audio:506kB subtitle:0 global headers:0kB muxing overhead
0.135117
%
[libx264 @ 00000000029d7240] frame I:240   Avg QP:36.27  size: 11838
[libx264 @ 00000000029d7240] mb I  I16..4: 49.8% 50.1%  0.1%
[libx264 @ 00000000029d7240] final ratefactor: 39.17
[libx264 @ 00000000029d7240] 8x8 transform intra:50.1%
[libx264 @ 00000000029d7240] coded y,uvDC,uvAC intra: 8.3% 32.6% 0.1%
[libx264 @ 00000000029d7240] i16 v,h,dc,p: 11% 62%  4% 22%
[libx264 @ 00000000029d7240] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30% 32% 27%  2%
 1%
 1%  2%  2%  2%
[libx264 @ 00000000029d7240] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 26% 16%  9%
 6%
 4%  5%  4%  3%
[libx264 @ 00000000029d7240] i8c dc,h,v,p: 68% 22%  7%  3%
[libx264 @ 00000000029d7240] kb/s:2272.90
[libx264 @ 00000000029d8b80] frame I:240   Avg QP:36.27  size: 11838
[libx264 @ 00000000029d8b80] mb I  I16..4: 49.8% 50.1%  0.1%
[libx264 @ 00000000029d8b80] final ratefactor: 39.17
[libx264 @ 00000000029d8b80] 8x8 transform intra:50.1%
[libx264 @ 00000000029d8b80] coded y,uvDC,uvAC intra: 8.3% 32.6% 0.1%
[libx264 @ 00000000029d8b80] i16 v,h,dc,p: 11% 62%  4% 22%
[libx264 @ 00000000029d8b80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30% 32% 27%  2%
 1%
 1%  2%  2%  2%
[libx264 @ 00000000029d8b80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 26% 16%  9%
 6%
 4%  5%  4%  3%
[libx264 @ 00000000029d8b80] i8c dc,h,v,p: 68% 22%  7%  3%
[libx264 @ 00000000029d8b80] kb/s:2272.90
[libx264 @ 0000000004babd40] frame I:480   Avg QP:22.85  size: 10767
[libx264 @ 0000000004babd40] mb I  I16..4: 26.4% 43.1% 30.6%
[libx264 @ 0000000004babd40] final ratefactor: 17.51
[libx264 @ 0000000004babd40] 8x8 transform intra:43.1%
[libx264 @ 0000000004babd40] coded y,uvDC,uvAC intra: 66.3% 89.0% 64.1%
[libx264 @ 0000000004babd40] i16 v,h,dc,p:  4% 55%  2% 39%
[libx264 @ 0000000004babd40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  9% 46%  9%  5%
 6%
 3%  9%  4%  9%
[libx264 @ 0000000004babd40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 37%  9%  5%
 6%
 4%  9%  4%  7%
[libx264 @ 0000000004babd40] i8c dc,h,v,p: 26% 49% 11% 13%
[libx264 @ 0000000004babd40] kb/s:2067.32

C:\Users\USER\Documents\python>


*Media Info Output:*





*GeneralComplete name                            :
C:\Users\USER\Documents\python\out_big.movFormat
        : MPEG-4Format profile                           : QuickTimeCodec
ID                                 : qt  File size
       : 10.9 MiBDuration                                 : 20s 58msOverall
bit rate mode                    : VariableOverall bit rate
        : 4 541 KbpsWriting application                      :
Lavf55.25.100Video #1ID                                       : 1Format
                              : AVCFormat/Info
 : Advanced Video CodecFormat profile                           :
High at L4.0Format settings, CABAC                   : YesFormat settings, GOP
                    : N=1Codec ID                                 :
avc1Codec ID/Info                            : Advanced Video
CodingDuration                                 : 10s 0msBit rate mode
                     : VariableBit rate                                 : 2
273 KbpsNominal bit rate                         : 2 000 KbpsWidth
                           : 1 920 pixelsHeight
      : 1 080 pixelsDisplay aspect ratio                     : 16:9Frame
rate mode                          : ConstantFrame rate
          : 24.000 fpsColor space                              : YUVChroma
subsampling                       : 4:2:0Bit depth
       : 8 bitsScan type                                :
ProgressiveBits/(Pixel*Frame)                       : 0.046Stream size
                         : 2.71 MiB (25%)Writing library
       : x264 core 140 r2377 1ca7bb9Encoding settings
 : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 /
psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 /
trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 /
chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 /
nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 /
bframes=0 / weightp=0 / keyint=1 / keyint_min=1 / scenecut=40 /
intra_refresh=0 / rc=abr / mbtree=0 / bitrate=2000 / ratetol=1.0 /
qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 /
aq=1:1.00Language                                 : EnglishVideo #2ID
                                : 2Format
: AVCFormat/Info                              : Advanced Video CodecFormat
profile                           : High at L4.0Format settings, CABAC
          : YesFormat settings, GOP                     : N=1Codec ID
                          : avc1Codec ID/Info                            :
Advanced Video CodingDuration                                 : 10s 0msBit
rate mode                            : VariableBit rate
            : 2 273 KbpsNominal bit rate                         : 2 000
KbpsWidth                                    : 1 920 pixelsHeight
                        : 1 080 pixelsDisplay aspect ratio
    : 16:9Frame rate mode                          : ConstantFrame rate
                          : 24.000 fpsColor space
   : YUVChroma subsampling                       : 4:2:0Bit depth
                     : 8 bitsScan type                                :
ProgressiveBits/(Pixel*Frame)                       : 0.046Stream size
                         : 2.71 MiB (25%)Writing library
       : x264 core 140 r2377 1ca7bb9Encoding settings
 : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 /
psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 /
trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 /
chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 /
nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 /
bframes=0 / weightp=0 / keyint=1 / keyint_min=1 / scenecut=40 /
intra_refresh=0 / rc=abr / mbtree=0 / bitrate=2000 / ratetol=1.0 /
qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 /
aq=1:1.00Language                                 : EnglishVideo #3ID
                                : 4Format
: AVCFormat/Info                              : Advanced Video CodecFormat
profile                           : High at L2.1Format settings, CABAC
          : YesFormat settings, GOP                     : N=1Codec ID
                          : avc1Codec ID/Info                            :
Advanced Video CodingDuration                                 : 20s 0msBit
rate mode                            : VariableBit rate
            : 2 000 KbpsWidth                                    : 512
pixelsHeight                                   : 288 pixelsDisplay aspect
ratio                     : 16:9Frame rate mode                          :
ConstantFrame rate                               : 24.000 fpsColor space
                           : YUVChroma subsampling                       :
4:2:0Bit depth                                : 8 bitsScan type
                   : ProgressiveBits/(Pixel*Frame)                       :
0.565Stream size                              : 4.93 MiB (45%)Writing
library                          : x264 core 140 r2377 1ca7bb9Encoding
settings                        : cabac=1 / ref=1 / deblock=1:0:0 /
analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 /
mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 /
deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 /
lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 /
bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=1 /
keyint_min=1 / scenecut=40 / intra_refresh=0 / rc=abr / mbtree=0 /
bitrate=2000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 /
ip_ratio=1.40 / aq=1:1.00Language                                 :
EnglishAudioID                                       : 3Format
                      : MPEG AudioFormat version
: Version 1Format profile                           : Layer 3Codec ID
                          : .mp3Duration                                 :
20s 58msBit rate mode                            : ConstantBit rate
                        : 256 KbpsChannel(s)
: 1 channelChannel positions                        : Front: CSampling rate
                           : 48.0 KHzCompression mode
  : LossyStream size                              : 506 KiB (5%)Writing
library                          : LAME3.99.5Language
          : English*


More information about the ffmpeg-user mailing list