[FFmpeg-user] overlay video dramatically slows down output framerate

Damon Edwards dzedward at gmail.com
Fri Apr 27 20:15:10 CEST 2012


When I overlay a 3 second video onto a 7 second video it slows the output
down almost to what seems like 1 frame per second or less.

outputs clean video:
ffmpeg -i table.mp4 -r 29 -vcodec libx264 -acodec libfaac -ab "96k" -ac 2
-y overlaid.mp4

outputs really slow video:
ffmpeg -i table.mp4 -vf
"movie=text.mp4,fade=in:0:10:alpha=1,fade=out:30:10:alpha=1[logo];[in][logo]
overlay=0:0 [out]" -r 29 -vcodec libx264 -acodec libfaac -ab "96k" -ac 2 -y
overlaid.mp4

console output of video overlay instructions:
[root at localhost test]# ffmpeg -i table.mp4 -vf
"movie=text.mp4,fade=in:0:10:alpha=1,fade=out:30:10:alpha=1[logo];[in][logo]
overlay=0:0 [out]" -r 29 -vcodec libx264 -acodec libfaac -ab "96k" -ac 2 -y
overlaid.mp4
ffmpeg version N-40099-g2b336df Copyright (c) 2000-2012 the FFmpeg
developers
  built on Apr 26 2012 13:40:42 with gcc 4.4.6 20110731 (Red Hat 4.4.6-3)
  configuration: --enable-gpl --enable-libmp3lame --enable-libtheora
--enable-libvo-aacenc --enable-libvorbis --enable-libvpx --enable-libx264
--enable-version3 --enable-libfaac --enable-nonfree --enable-libfreetype
  libavutil      51. 47.100 / 51. 47.100
  libavcodec     54. 15.100 / 54. 15.100
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 72.100 /  2. 72.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 11.100 /  0. 11.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'table.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2012-04-03 00:57:29
  Duration: 00:00:07.60, start: 0.000000, bitrate: 330 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 /
0x31637661), yuv420p, 270x360, 254 kb/s, 29.97 fps, 29.97 tbr, 60k tbn,
59.94 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, s16,
71 kb/s
    Metadata:
      creation_time   : 2012-04-03 00:57:29
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
[buffer @ 0x2f7e360] w:270 h:360 pixfmt:yuv420p tb:1/1000000 sar:0/1
sws_param:flags=2
[movie @ 0x2f62620] seek_point:0 format_name:(null) file_name:text.mp4
stream_index:0
[fade @ 0x2f6cc20] type:in start_frame:0 nb_frames:10 alpha:1
[fade @ 0x2f63ce0] type:out start_frame:30 nb_frames:10 alpha:1
[overlay @ 0x2f64b60] auto-inserting filter 'auto-inserted scale 0' between
the filter 'Parsed_fade_2' and the filter 'Parsed_overlay_3'
[scale @ 0x2f818e0] w:250 h:200 fmt:rgba sar:1/1 -> w:250 h:200
fmt:yuva420p sar:1/1 flags:0x4
[overlay @ 0x2f64b60] main w:270 h:360 fmt:yuv420p overlay x:0 y:0 w:250
h:200 fmt:yuva420p
[overlay @ 0x2f64b60] main_tb:1/1000000 overlay_tb:1/29 -> tb:1/29000000
exact:1
[libx264 @ 0x2f88480] using cpu capabilities: MMX2 SSE2Fast SSSE3
FastShuffle SSE4.2 AVX
[libx264 @ 0x2f88480] profile High, level 1.3
[libx264 @ 0x2f88480] 264 - core 122 r2184 5c85e0a - 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=-2 threads=3 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
[libfaac @ 0x2f89200] channel_layout not specified
Guessed Channel Layout for Output Stream #0.1 : stereo
Output #0, mp4, to 'overlaid.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2012-04-03 00:57:29
    encoder         : Lavf54.3.100
    Stream #0:0(und): Video: h264 (![0][0][0] / 0x0021), yuv420p, 270x360,
q=-1--1, 29 tbn, 29 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (@[0][0][0] / 0x0040), 44100 Hz, stereo,
s16, 96 kb/s
    Metadata:
      creation_time   : 2012-04-03 00:57:29
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
  Stream #0:1 -> #0:1 (aac -> libfaac)
Press [q] to stop, [?] for help
frame= 6371 fps=607 q=-1.0 Lsize=     969kB time=00:00:07.59
bitrate=1045.5kbits/s dup=6143 drop=0
video:820kB audio:67kB global headers:0kB muxing overhead 9.170402%
[libx264 @ 0x2f88480] frame I:26    Avg QP:16.56  size: 10744
[libx264 @ 0x2f88480] frame P:1659  Avg QP:21.49  size:   287
[libx264 @ 0x2f88480] frame B:4686  Avg QP:28.99  size:    18
[libx264 @ 0x2f88480] consecutive B-frames:  1.5%  0.6%  2.1% 95.8%
[libx264 @ 0x2f88480] mb I  I16..4: 16.4% 37.1% 46.5%
[libx264 @ 0x2f88480] mb P  I16..4:  0.8%  0.5%  0.3%  P16..4:  6.5%  2.5%
 0.7%  0.0%  0.0%    skip:88.7%
[libx264 @ 0x2f88480] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.9%  0.0%
 0.0%  direct: 0.0%  skip:99.1%  L0:50.7% L1:48.4% BI: 0.9%
[libx264 @ 0x2f88480] 8x8 transform intra:32.2% inter:47.2%
[libx264 @ 0x2f88480] coded y,uvDC,uvAC intra: 56.4% 59.2% 24.6% inter:
0.6% 0.6% 0.0%
[libx264 @ 0x2f88480] i16 v,h,dc,p: 15% 41%  9% 36%
[libx264 @ 0x2f88480] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 43% 16%  3%  4%
 2%  5%  3%  5%
[libx264 @ 0x2f88480] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 47% 11%  3%  3%
 5%  4%  4%  4%
[libx264 @ 0x2f88480] i8c dc,h,v,p: 50% 33% 13%  4%
[libx264 @ 0x2f88480] Weighted P-Frames: Y:1.2% UV:0.1%
[libx264 @ 0x2f88480] ref P L0: 83.3%  6.2%  9.7%  0.7%  0.0%
[libx264 @ 0x2f88480] ref B L0: 72.2% 27.5%  0.3%
[libx264 @ 0x2f88480] ref B L1: 94.9%  5.1%
[libx264 @ 0x2f88480] kb/s:30.57
[root at localhost test]#


-- 
Damon Edwards
gplus.to/damonedwards


More information about the ffmpeg-user mailing list