title: How do I dump the buffer when encoding H264 with FFMPEG?
body: <p>I'm using a c++ library to write images captured from a webcam to an libx264 encoded mp4 file.
  The encoding is working properly but when it starts it writes 40 frames to the buffer. When I close the file these frames aren't flushed so about 6 seconds of video are left unwritten (cam is about 6fps).</p>
  
  <p>So i'm calling:</p>
  
  <pre><code>out_size = libffmpeg::avcodec_encode_video( codecContext, data-&gt;VideoOutputBuffer,data-&gt;VideoOutputBufferSize, data-&gt;VideoFrame );
  
  // if zero size, it means the image was buffered
  if ( out_size &gt; 0 )
  {
  //... write to file
  }
  </code></pre>
  
  <p>I can't see a way of accessing the images that are left in the buffer. Any ideas?</p>