title: How to capture video in OpenCV 2.4 with Video4Linux2 (v4l2) in Qt 4.8 (C++)?
body: <p>I have Xubuntu 12.04.
  My web camera, as I can see, does not provided by linux version of OpenCV 2.4, because in Windows XP (on the same machine) code</p>
  
  <pre><code>CvCapture* capture = cvCaptureFromCAM(0)
  </code></pre>
  
  <p>does not return NULL, but in Linux it does. I experimented with many arguments (many negative, many positive numbers and zero).</p>
  
  <p>But other applications can capture video from my web camera in Linux.</p>
  
  <p>I've tried to compile and run <a href="http://linuxtv.org/downloads/v4l-dvb-apis/capture-example.html" rel="nofollow">this code</a> and, I think, it runs good, because I can see dots, and I also can see some strange content of buffer (using -o key). I think, the content is frames, but I can't understand, how to use it (for example, create correct IplImage* from it).</p>
  
  <p>How can I capture video from my web camera in Qt for further OpnenCV video processing?</p>
  
  <p>And I also will need to capture video from several USB and IP cameras in one time.</p>
  
  <p>The solution must be <strong>free for commercial use</strong>.</p>