title: How to use ffmpeg to encode video in H.264?
body: <p>I have installed ffmpeg 3.0 from <a href="https://github.com/FFmpeg/FFmpeg" rel="nofollow">https://github.com/FFmpeg/FFmpeg</a>, I am trying to convert a video coded with mepeg4 part 2 to H264, but I got <code>Unknown encoder 'libx264'</code>
   error</p>
  
  <p>Here is my comannd: (I tried h264, x264, libx264, none of them worked)</p>
  
  <pre><code>ffmpeg -i Fashion.divx -acodec aac -vcodec libx264  out.mp4
  </code></pre>
  
  <p>I checked the list of supported codec</p>
  
  <pre><code>Codecs:
   D..... = Decoding supported
   .E.... = Encoding supported
   ..V... = Video codec
   ..A... = Audio codec
   ..S... = Subtitle codec
   ...I.. = Intra frame-only codec
   ....L. = Lossy compression
   .....S = Lossless compression
   -------
   D.VI.. 012v                 Uncompressed 4:2:2 10-bit
  </code></pre>
  
  <p>Here is h264:</p>
  
  <pre><code> D.V.LS h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_vdpau)
  </code></pre>
  
  <p>I am using ffmpeg 3.0, from that list, it seems that encoding with h264 is not supported, only decoding h264 is supported, right?</p>
  
  <p>I tried to enable h.264 with this guide 
  <a href="https://trac.ffmpeg.org/wiki/How%20to%20quickly%20compile%20FFmpeg%20with%20libx264%20%28x264,%20H.264%29" rel="nofollow">How to quickly compile FFmpeg with libx264 (x264, H.264)</a></p>
  
  <pre><code>./configure --enable-gpl --enable-libx264
  </code></pre>
  
  <p>bu I get 
   ./configure --enable-gpl --enable-libx264 </p>
  
  <pre><code>ERROR: libx264 not found
  
  If you think configure made a mistake, make sure you are using the latest
  version from Git.  If the latest version fails, report the problem to the
  ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
  Include the log file "config.log" produced by configure as this will help
  solve the problem.
  </code></pre>
  
  <p>what should I do to make encode video in h.264 work?</p>