title: X264 Error message when capturing video
body: <p>I'm writing a program to save some webcam video to a file. I'm using the x264 codec found here 
  <a href="http://www.free-codecs.com/x264_VfW_download.htm" rel="nofollow noreferrer">x264</a></p>
  
  <p>When I try writing frames to a file I get this error message poping up. 
  <img src="https://i.stack.imgur.com/3wyBF.png" alt="error"></p>
  
  <blockquote>
    <p>x264vfw [warning]: Few frames probably would be lost. Ways to fix
    this:</p>
    
    <p>x264vfw [warning]: -if you use VirtualDub or its fork than you can
    enable 'VirtualDub Hack' option</p>
    
    <p>x264vfw [warning]: -you can enable 'File' output mode</p>
    
    <p>x264vfw [warning]: -you can enable 'Zero Latency' option</p>
  </blockquote>
  
  <p>I found this <a href="http://sourceforge.net/p/x264vfw/discussion/770224/thread/be94ab99/" rel="nofollow noreferrer">VirtualDub Hack</a> but then I'm not using virtual dub. 
  I'm not sure what the File output mode and zero latency mean.</p>
  
  <p>I think the problem is related to the codec since when I change to using a different codec, everything works fine. I'm using C# and emgu but I dont think thats where the problem lies.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>In case the code helps</p>
  
  <pre><code>public static void StartCapture()
  {
      try
      {
          capture = new Capture();
          capture.SetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_WIDTH, 1920);  //1920
          capture.SetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_HEIGHT, 1080); //1080
  
          CaptureOutput = new VideoWriter
          (
              "capture output.avi",
              CvInvoke.CV_FOURCC('X','2','6','4'),
              50, //fps
              (int)capture.GetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_WIDTH), 
              (int)capture.GetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_HEIGHT), 
              true
          );
  
          if (capture != null)
          {
              capture.ImageGrabbed += SaveFrame;
              capture.Start();
          }
      }
      catch (Exception e)
      {
          MessageBox.Show(e.ToString());
      }
  }
  
  static void SaveFrame(System.Object sender, EventArgs e)
  {
      Image&lt;Bgr, Byte&gt; video;
      video = capture.RetrieveBgrFrame();
      CaptureOutput.WriteFrame(video);
  }
  </code></pre>