title: Turning images into videos with ffmpeg
body: <p>I asked this on another forum but never had any luck. I found the following command online that is supposed to create a video from images(duration of 5 seconds each) using FFmpeg.</p>
  
  <p>ffmpeg -f image2 -r 1/5 -i img%03d.png -vcodec libx264 out.mp4</p>
  
  <p>I have ran that and I have two images named img001.png and img002.png, however when I play out.mp4, it's only a 5 second clip with img001.png being played. What's really strange as well, is in my Windows Media Player, it thinks it's 10 seconds long (2 images @ 10 seconds), but when the gauge gets half way through(5 seconds) the video, it ends.</p>
  
  <p>Any suggestions of what could be going on?</p>
  
  <p>I also tried a bunch of other commands I found online but never had any luck. They would end up showing both images, but the first one would just flash for a fraction of a second, or some other ones would do the same thing would happen to the second image at the end of the video.</p>
  
  <p>I have it ImageMagick installed into XAMPP on my Windows Vista PC. I can provide my command line output from the command if needed.</p>
  
  <p>Edit: Added command line output</p>
  
  <pre><code>C:\xampp\htdocs&gt;ffmpeg -f image2 -r 1/5 -i img%03d.png -vcodec libx264 out.mp4
  ffmpeg version N-50911-g9efcfbe Copyright (c) 2000-2013 the FFmpeg developers
    built on Mar 13 2013 21:26:48 with gcc 4.7.2 (GCC)
    configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
  isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
  le-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libg
  sm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libo
  pencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-li
  bschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-lib
  twolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enabl
  e-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
    libavutil      52. 19.100 / 52. 19.100
    libavcodec     55.  0.100 / 55.  0.100
    libavformat    55.  0.100 / 55.  0.100
    libavdevice    54.  4.100 / 54.  4.100
    libavfilter     3. 45.103 /  3. 45.103
    libswscale      2.  2.100 /  2.  2.100
    libswresample   0. 17.102 /  0. 17.102
    libpostproc    52.  2.100 / 52.  2.100
  Input #0, image2, from 'img%03d.png':
    Duration: 00:00:10.00, start: 0.000000, bitrate: N/A
      Stream #0:0: Video: png, rgb24, 800x600 [SAR 1:1 DAR 4:3], 0.20 tbr, 0.20 tb
  n, 0.20 tbc
  [libx264 @ 0032cae0] using SAR=1/1
  [libx264 @ 0032cae0] using cpu capabilities: MMX2 SSE2Slow SlowCTZ
  [libx264 @ 0032cae0] profile High 4:4:4 Predictive, level 3.1, 4:4:4 8-bit
  [libx264 @ 0032cae0] 264 - core 130 r2274 c832fe9 - H.264/MPEG-4 AVC codec - Cop
  yright 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=4 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 i
  nterlaced=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=1 scenecu
  t=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 'out.mp4':
    Metadata:
      encoder         : Lavf55.0.100
      Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv444p, 800x600 [SAR 1:1
   DAR 4:3], q=-1--1, 16384 tbn, 0.20 tbc
  Stream mapping:
    Stream #0:0 -&gt; #0:0 (png -&gt; libx264)
  Press [q] to stop, [?] for help
  frame=    2 fps=0.0 q=2621023.0 Lsize=      37kB time=00:00:10.00 bitrate=  30.0
  kbits/s
  video:36kB audio:0kB subtitle:0 global headers:0kB muxing overhead 2.142993%
  [libx264 @ 0032cae0] frame I:1     Avg QP:11.18  size: 17627
  [libx264 @ 0032cae0] frame P:1     Avg QP:11.45  size: 18415
  [libx264 @ 0032cae0] mb I  I16..4: 18.3% 69.5% 12.3%
  [libx264 @ 0032cae0] mb P  I16..4: 11.6% 60.1%  9.7%  P16..4:  8.9%  6.6%  2.2%
   0.0%  0.0%    skip: 0.8%
  [libx264 @ 0032cae0] 8x8 transform intra:71.4% inter:67.1%
  [libx264 @ 0032cae0] coded y,u,v intra: 57.0% 24.1% 22.3% inter: 42.6% 25.7% 16.
  4%
  [libx264 @ 0032cae0] i16 v,h,dc,p: 28% 50% 15%  8%
  [libx264 @ 0032cae0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 39% 28%  2%  2%  2%  3%
   3%  4%
  [libx264 @ 0032cae0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 53% 23%  1%  2%  2%  3%
   0%  2%
  [libx264 @ 0032cae0] Weighted P-Frames: Y:0.0% UV:0.0%
  [libx264 @ 0032cae0] kb/s:28.83
  
  C:\xampp\htdocs&gt;
  </code></pre>