title: How can I compress and create mp4 video file from batch of images on hard disk using ffmpeg?
body: <p>In my directory I copied ffmpeg.exe to the same directory where all the images are.
  All images are bitmaps.</p>
  
  <p>Then in the command prompt windows I typed:</p>
  
  <pre><code>ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1920x1080 -i \\.\pipe\mytestpipe -map 0 -c:v mpeg4 -r  out.mp4
  </code></pre>
  
  <p>But I get error that there is no a directory name:</p>
  
  <blockquote>
    <p>\.\pipe\mytestpipe</p>
  </blockquote>
  
  <p>So I removed it and typed the same line without the pipe part.</p>
  
  <pre><code>ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1920x1080 -i -map 0 -c:v mpeg4 -r  out.mp4
  </code></pre>
  
  <p>Now there is no a directory name -map</p>
  
  <p>So I moved the <code>-map 0</code></p>
  
  <pre><code>ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1920x1080 -i -c:v mpeg4 -r  out.mp4
  </code></pre>
  
  <p>Now I'm getting error:</p>
  
  <blockquote>
    <p>-c:v: Protocol not found</p>
  </blockquote>
  
  <p>I used this line with the pipe in my c# program as arguments to ffmpeg using <code>ProcessStartInfo</code> but now I don't want to use pipes only in the command prompt to type it and compress and create mp4 video file.</p>
  
  <p>Edit I tried this now:</p>
  
  <pre><code>ffmpeg -framerate 1/5 -i screenshot%06d.bmp -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
  </code></pre>
  
  <p>And what I get is some errors:</p>
  
  <pre><code>E:\screenshots&gt;ffmpeg -framerate 1/5 -i screenshot%06d.bmp -c:v libx264 -r 30 -p
  ix_fmt yuv420p out.mp4
  ffmpeg version N-73165-gf1e1730 Copyright (c) 2000-2015 the FFmpeg developers
    built with gcc 4.9.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-libbs2b --enable-libcaca --
  enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
  ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
  le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
  able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena
  ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
   --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
  e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --ena
  ble-decklink --enable-zlib
    libavutil      54. 27.100 / 54. 27.100
    libavcodec     56. 45.100 / 56. 45.100
    libavformat    56. 38.102 / 56. 38.102
    libavdevice    56.  4.100 / 56.  4.100
    libavfilter     5. 18.100 /  5. 18.100
    libswscale      3.  1.101 /  3.  1.101
    libswresample   1.  2.100 /  1.  2.100
    libpostproc    53.  3.100 / 53.  3.100
  [bmp @ 0000000002eb7f80] bad magic number
      Last message repeated 2 times
  [image2 @ 0000000002eb64e0] decoding for stream 0 failed
  [image2 @ 0000000002eb64e0] Could not find codec parameters for stream 0 (Video:
   bmp, none): unspecified size
  Consider increasing the value for the 'analyzeduration' and 'probesize' options
  screenshot%06d.bmp: could not find codec parameters
  Input #0, image2, from 'screenshot%06d.bmp':
    Duration: 00:07:35.00, start: 0.000000, bitrate: N/A
      Stream #0:0: Video: bmp, none, 0.20 fps, 0.20 tbr, 0.20 tbn, 0.20 tbc
  Output #0, mp4, to 'out.mp4':
  Output file #0 does not contain any stream
  </code></pre>
  
  <p>For those who can see. When i'm doing it on a single file for example: <code>ffmpeg -framerate 1/5 -i screenshot000002.bmp -c:v libx264 -r 30 -pix_fmt yuv420p out1.mp4</code> or <code>screenshot000003.bmp</code> or <code>screenshot000122.bmp</code> it will work fine and create the video file. But when i'm doing this for all images i'm getting all the errors: <code>ffmpeg -framerate 1/5 -i screenshot%06d.bmp -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4</code> <a href="http://pastebin.com/HCjHYE25" rel="nofollow">here</a> is the results when i did on <code>screenshot000002.bmp</code> and it worked fine.</p>
  
  <p>When i'm doing it on a single image file it's working fine like <code>screenshot000002.bmp</code> but when doing it on all the images <code>screenshot%06d.bmp</code> it's giving me all the errors i mentioned above.</p>