title: Why OpenCV's `cvCreateCameraCapture` and `cvCreateFileCapture` do not work?
body: <p>Have an AVI videofile, and a webcam. <code>cvQueryFrame</code> returns null in both cases. Code is applied(only for cam):</p>
  
  <pre><code>#include "highgui.h"
  #include &lt;iostream&gt;
  
  using namespace std;
  
  int main( int argc, char** argv )
  {   
      cvNamedWindow( "KillCam", CV_WINDOW_AUTOSIZE );
      cvWaitKey(0);
      CvCapture* capture = cvCreateCameraCapture(-1);
      assert(capture != NULL);
      IplImage* frame;
  
      while(1){
          frame = cvQueryFrame( capture ); 
          if( !frame ) break;
          cvShowImage( "KillCam", frame );
          char c = cvWaitKey(33);
          if( c == 30 ) break;
      }
      cvReleaseCapture( &amp;capture );
      cvDestroyWindow( "KillCam" );
  }
  </code></pre>