[FFmpeg-user] Time-lapse with ffmpeg, frame rate and duration

Dieter Knopf dieterknopf at googlemail.com
Wed Aug 24 08:36:55 CEST 2011


Hello,

i have a problem with ffmpeg and time-lapse movies. I want to create a
time-lapse movie out of 80k jpg-pictures with a duration of ~5
minutes.

250 pictures/sec would be enough for 5,3 minutes.

But how?

I tried something like that:
 ffmpeg -r 250 -i %06d.jpg -vcodec libx264 -crf 22 -threads 0 -vf
scale=1920:-1 -r 15 -metadata title="foo" output.mp4

This works fine, but the video stops exactly after 46 seconds.

Here the log:
# ffmpeg -r 250 -i %06d.jpg -vcodec libx264 -crf 22 -threads 0 -vf
scale=1920:-1 -r 15 -metadata title="foo" output.mp4
ffmpeg version 0.7.3, Copyright (c) 2000-2011 the FFmpeg developers
  built on Aug 24 2011 06:05:52 with gcc 4.4.5
  configuration: --prefix=/usr --libdir=/usr/lib64
--shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared
--cc=x86_64-pc-linux-gnu-gcc --disable-static --enable-gpl
--enable-version3 --enable-postproc --enable-avfilter
--disable-stripping --disable-debug --disable-network --disable-vaapi
--enable-libmp3lame --enable-libvo-aacenc --enable-libtheora
--enable-libvorbis --enable-libx264 --enable-libxvid --enable-libfaac
--enable-nonfree --disable-indev=v4l --disable-indev=v4l2
--disable-indev=oss --disable-indev=jack --enable-x11grab
--disable-outdev=oss --enable-libfreetype --enable-pthreads
--enable-libopenjpeg --disable-altivec --disable-avx --cpu=core2
--enable-hardcoded-tables
  libavutil    50. 43. 0 / 50. 43. 0
  libavcodec   52.122. 0 / 52.122. 0
  libavformat  52.110. 0 / 52.110. 0
  libavdevice  52.  5. 0 / 52.  5. 0
  libavfilter   1. 80. 0 /  1. 80. 0
  libswscale    0. 14. 1 /  0. 14. 1
  libpostproc  51.  2. 0 / 51.  2. 0

Seems stream 0 codec frame rate differs from container frame rate:
250.00 (250/1) -> 0.08 (1/12)
Input #0, image2, from '%06d.jpg':
  Duration: 00:04:52.18, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: mjpeg, yuvj420p, 640x480 [PAR 1:1 DAR 4:3],
250 fps, 0.08 tbr, 250 tbn, 250 tbc
[buffer @ 0x2490170] w:640 h:480 pixfmt:yuvj420p tb:1/1000000 sar:1/1 sws_param:
[scale @ 0x248f050] w:640 h:480 fmt:yuvj420p -> w:1920 h:1440
fmt:yuvj420p flags:0x4
[libx264 @ 0x248b2a0] Default settings detected, using medium profile
[libx264 @ 0x248b2a0] using SAR=1/1
[libx264 @ 0x248b2a0] using cpu capabilities: MMX2 SSE2Fast SSSE3
FastShuffle SSE4.2
[libx264 @ 0x248b2a0] profile High, level 5.0
[libx264 @ 0x248b2a0] 264 - core 115 - H.264/MPEG-4 AVC codec -
Copyleft 2003-2011 - 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=6 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=15 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 'output.mp4':
  Metadata:
    title           : foo
    encoder         : Lavf52.110.0
    Stream #0.0: Video: libx264, yuvj420p, 1920x1440 [PAR 1:1 DAR
4:3], q=2-31, 200 kb/s, 15 tbn, 15 tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop, [?] for help
[mjpeg @ 0x248bd90] overread 535   56452kB time=00:00:33.86
bitrate=13655.0kbits/s dup=0 drop=8740
frame=  704 fps=  5 q=-1.0 Lsize=   78174kB time=00:00:46.80
bitrate=13683.7kbits/s dup=0 drop=11008
video:78164kB audio:0kB global headers:0kB muxing overhead 0.012308%
frame I:11    Avg QP:22.90  size:236916
[libx264 @ 0x248b2a0] frame P:510   Avg QP:24.86  size:121248
[libx264 @ 0x248b2a0] frame B:183   Avg QP:25.38  size: 85228
[libx264 @ 0x248b2a0] consecutive B-frames: 48.7% 49.7%  0.4%  1.1%
[libx264 @ 0x248b2a0] mb I  I16..4:  4.3% 86.0%  9.7%
[libx264 @ 0x248b2a0] mb P  I16..4:  5.4% 35.5%  2.0%  P16..4: 29.9%
17.2%  7.5%  0.0%  0.0%    skip: 2.6%
[libx264 @ 0x248b2a0] mb B  I16..4:  1.8%  8.6%  0.4%  B16..8: 30.0%
14.5%  5.1%  direct:23.5%  skip:16.2%  L0:50.5% L1:33.2% BI:16.3%
[libx264 @ 0x248b2a0] 8x8 transform intra:82.6% inter:81.3%
[libx264 @ 0x248b2a0] coded y,uvDC,uvAC intra: 71.8% 57.7% 13.5%
inter: 70.2% 67.9% 4.0%
[libx264 @ 0x248b2a0] i16 v,h,dc,p: 53% 23%  4% 20%
[libx264 @ 0x248b2a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11% 28% 19%  6%
7%  5%  8%  5% 10%
[libx264 @ 0x248b2a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 30% 10%  8%
11%  7% 10%  6%  8%
[libx264 @ 0x248b2a0] i8c dc,h,v,p: 49% 32% 13%  6%
[libx264 @ 0x248b2a0] Weighted P-Frames: Y:46.7% UV:41.6%
[libx264 @ 0x248b2a0] ref P L0: 39.4% 17.1% 21.1% 16.0%  6.5%
[libx264 @ 0x248b2a0] ref B L0: 59.0% 41.0%
[libx264 @ 0x248b2a0] ref B L1: 100.0%  0.0%
[libx264 @ 0x248b2a0] kb/s:13643.05


Thanks.


More information about the ffmpeg-user mailing list