title: OpenCV VideoCapture can't read from my webcam at all
body: <p>I'm using OpenCV 2.4.6 on Ubuntu 13.04 (on an Acer C7 Chromebook), and I'm using a simple test program to see if my webcam will work with OpenCV. It works fine with Cheese and Skype, so I know that the webcam itself isn't the issue.</p>
  
  <p>Here is my code (which compiles without any errors):</p>
  
  <pre><code>#include "opencv2/opencv.hpp"
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  using namespace std;
  using namespace cv;
  
  int main(int argc, char *argv[])
  {
    cv::VideoCapture cap;
    if(argc &gt; 1)
      {
        cap.open(string(argv[1]));
      }
    else
      {
        cap.open(CV_CAP_ANY);
      }
    if(!cap.isOpened())
      {
        printf("Error: could not load a camera or video.\n");
      }
    Mat frame;
    namedWindow("video", 1);
    for(;;)
    {
      waitKey(20);
      cap &gt;&gt; frame;
    if(!frame.data)
      {
        printf("Error: no frame data.\n");
        break;
      }
      imshow("video", frame);
    }
  }
  </code></pre>
  
  <p>If I run the program without any arguments (since I want it to use CV_CAP_ANY), I get</p>
  
  <pre><code>Error: could not load a camera or video.
  init done 
  opengl support available 
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  Error: no frame data.
  </code></pre>
  
  <p>If I specify /dev/video0 (my only camera) as the argument, I get</p>
  
  <pre><code>demux_wavpack: (open_wv_file:127) open_wv_file: non-seekable inputs aren't supported yet.
  (ERROR)icvOpenAVI_XINE(): Unable to open source '/dev/video0'
  init done 
  opengl support available 
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  libpng warning: Application built with libpng-1.2.49 but running with 1.5.12
  GStreamer Plugin: Embedded video playback halted; module source reported: Could not read from resource.
  Error: no frame data.
  </code></pre>
  
  <p>If I specify the path to a video file as the argument, it plays the video just fine.</p>
  
  <p>I'd appreciate any help. Thanks in advance!</p>