title: FFMPEG - Images to Video
body: <pre><code>ffmpeg -f image2 -r 15 -i images/img%03d.jpg -vcodec libx264 video.mp4
  </code></pre>
  
  <p>I run this code with exec in php.</p>
  
  <p>I am not getting the output. The video.mp4 is blank.</p>
  
  <p>However if i modify this commade to something like this,</p>
  
  <pre><code>ffmpeg -f image2 -i i.jpg -vcodec libx264 -t 15 video.mp4
  </code></pre>
  
  <p>The video is running for 15 seconds.</p>
  
  <p>I tried <strong>-r 1/15</strong>. It is not working too.
  Where do i do the mistake?</p>
  
  <pre><code>&lt;?php
  $command = "/usr/bin/ffmpeg -f image2 -r 15 -i images/img%03d.jpg -vcodec libx264 video.mp4";
  exec($command);
  ?&gt;
  </code></pre>
  
  <p>images folder has img001.jpg img002.jpg ... img005.jpg</p>
  
  <pre><code>Array
  (
  [0] =&gt; ffmpeg version N-48645-gf3c9d8d Copyright (c) 2000-2013 the FFmpeg developers
  [1] =&gt;   built on Jan  9 2013 04:08:32 with gcc 4.7 (Debian 4.7.2-5)
  [2] =&gt;   configuration: --extra-cflags=-I../static/include --extra-ldflags='-L../static/lib -static' --enable-gpl --enable-version3 --enable-static --disable-shared --disable-debug --enable-runtime-cpudetect --disable-x11grab --enable-libmp3lame --enable-libx264 --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --disable-ffserver
  [3] =&gt;   libavutil      52. 13.100 / 52. 13.100
  [4] =&gt;   libavcodec     54. 86.100 / 54. 86.100
  [5] =&gt;   libavformat    54. 59.106 / 54. 59.106
  [6] =&gt;   libavdevice    54.  3.102 / 54.  3.102
  [7] =&gt;   libavfilter     3. 32.100 /  3. 32.100
  [8] =&gt;   libswscale      2.  1.103 /  2.  1.103
  [9] =&gt;   libswresample   0. 17.102 /  0. 17.102
  [10] =&gt;   libpostproc    52.  2.100 / 52.  2.100
  [11] =&gt; Input #0, image2, from 'images/img%03d.jpg':
  [12] =&gt;   Duration: 00:00:45.00, start: 0.000000, bitrate: N/A
  [13] =&gt;     Stream #0:0: Video: mjpeg, yuvj420p, 200x300 [SAR 1:1 DAR 2:3], 0.07 fps, 0.33 tbr, 0.07 tbn, 0.07 tbc
  [14] =&gt; [libx264 @ 0x3283080] using SAR=1/1
  [15] =&gt; [libx264 @ 0x3283080] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX
  [16] =&gt; [libx264 @ 0x3283080] profile High, level 1.2
  [17] =&gt; [libx264 @ 0x3283080] 264 - core 129 r2230 1cffe9f - 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=6 lookahead_threads=1 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=1 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
  [18] =&gt; Output #0, mp4, to 'videos/video.mp4':
  [19] =&gt;   Metadata:
  [20] =&gt;     encoder         : Lavf54.59.106
  [21] =&gt;     Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuvj420p, 200x300 [SAR 1:1 DAR 2:3], q=-1--1, 16384 tbn, 0.07 tbc
  [22] =&gt; Stream mapping:
  [23] =&gt;   Stream #0:0 -&gt; #0:0 (mjpeg -&gt; libx264)
  [24] =&gt; Press [q] to stop, [?] for help
  [25] =&gt; Input stream #0:0 frame changed from size:200x300 fmt:yuvj420p to size:200x300 fmt:yuvj444p
  [26] =&gt; frame=    3 fps=0.0 q=-1.0 Lsize=      43kB time=00:00:15.00 bitrate=  23.2kbits/s
  [27] =&gt; video:42kB audio:0kB subtitle:0 global headers:0kB muxing overhead 1.912722%
  [28] =&gt; [libx264 @ 0x3283080] frame I:1     Avg QP:18.97  size: 13250
  [29] =&gt; [libx264 @ 0x3283080] frame P:2     Avg QP:18.68  size: 14368
  [30] =&gt; [libx264 @ 0x3283080] mb I  I16..4:  0.8% 81.4% 17.8%
  [31] =&gt; [libx264 @ 0x3283080] mb P  I16..4:  0.0% 84.8% 15.2%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip: 0.0%
  [32] =&gt; [libx264 @ 0x3283080] 8x8 transform intra:83.7%
  [33] =&gt; [libx264 @ 0x3283080] coded y,uvDC,uvAC intra: 96.4% 99.2% 97.6%
  [34] =&gt; [libx264 @ 0x3283080] i16 v,h,dc,p:  0%  0% 100%  0%
  [35] =&gt; [libx264 @ 0x3283080] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 18% 13%  5%  8% 11%  8% 10%  7%
  [36] =&gt; [libx264 @ 0x3283080] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 14%  9%  7%  9% 13%  8%  7%  7%
  [37] =&gt; [libx264 @ 0x3283080] i8c dc,h,v,p: 45% 17% 26% 12%
  [38] =&gt; [libx264 @ 0x3283080] Weighted P-Frames: Y:0.0% UV:0.0%
  [39] =&gt; [libx264 @ 0x3283080] kb/s:7.46
  </code></pre>
  
  <p>)</p>