title: OpenCV VideoCapture with H264 CODEC
body: <p>I am using new logitech camera c920 for my project to do object recognition .<br>
  My camera can support H264 codec and can display H264 HD output.<br>
  But How I can set CODEC type as H264 in my below code to get out put as H264 DECODED STREAM
  by using OpenCV instruction .</p>
  
  <p>I am capturing video by using below logic : ref:<a href="http://docs.opencv.org/java/org/opencv/highgui/VideoCapture.html" rel="nofollow">this link</a></p>
  
  <pre><code>#include "opencv2/opencv.hpp"
  
  using namespace cv;
  
  int main(int, char**)
  {
      VideoCapture cap(0); // open the default camera
      if(!cap.isOpened())  // check if we succeeded
          return -1;
  
      for(;;)
      {
          Mat frame;
          cap &gt;&gt; frame; // get a new frame from camera
          imshow("display", frame);
          if(waitKey(30) &gt;= 0) break;
      }
      // the camera will be deinitialized automatically in VideoCapture destructor
      return 0;
  }
  </code></pre>