title: cvCreateFileCapture strange error
body: <p>i'm trying to create a simple Opencv program in C that creates a file capture from a .avi, and it plays it in a window highlighting faces. I'm running a self-compiled version of Opencv (i already tried the same with a jpeg image and it works).</p>
  
  <p>Building goes well, no errors, no warning, but when i launch it this the console output this: </p>
  
  <p>Unknown parameter encountered: "server role"
  Ignoring unknown parameter "server role"</p>
  
  <p>And the program simply stops</p>
  
  <p>Previously it was complaining for a missing /home/#user/.smb/smb.conf file, so i tried installing samba ( even though i've still no idea what does samba have to do in all this )</p>
  
  <p>here is my code:</p>
  
  <p>main(){</p>
  
  <pre><code>    printf("Ciao!");
  
      cvNamedWindow("window", CV_WINDOW_AUTOSIZE);
  
      cvWaitKey(0);
  
      printf("ok");
  
      CvCapture* capture = cvCreateFileCapture("monsters.avi");
  
  
      CvHaarClassifierCascade* cascade = load_object_detector("haarcascade_frontalface_alt.xml");
  
      CvMemStorage* storage = cvCreateMemStorage(0);
  
      //List of the faces
      CvSeq* faces;
  
      while (0&lt;10) {
          CvArr* image = cvQueryFrame(capture);
  
  
          double scale = 1;
  
          faces = cvHaarDetectObjects(image,cascade, storage, 1.2, 2, CV_HAAR_DO_CANNY_PRUNING, cvSize(1,1), cvSize(300,300));
  
          int i;
  
          for(i = 0; i &lt; faces-&gt;total; i++ )
              {
  
                  CvRect face_rect = *(CvRect*)cvGetSeqElem( faces, i );
                  cvRectangle( image,
                              cvPoint(face_rect.x*scale,face_rect.y*scale),
                              cvPoint((face_rect.x+face_rect.width)*scale,(face_rect.y+face_rect.height)*scale),
                              CV_RGB(255,0,0) , 3, 8, 0);
              }
  
          cvReleaseMemStorage( &amp;storage );
  
          cvShowImage("window", image);
      }
  
      cvWaitKey(0);
  
      printf("Ciao!");
  </code></pre>
  
  <p>}</p>
  
  <hr>
  
  <p>I thank you for your answer, i switched to C++ for my trials. Now i did this:</p>
  
  <pre><code>int main(){
  namedWindow("Video", CV_WINDOW_FREERATIO);
  
  VideoCapture cap("sintel.mp4");
   if(!cap.isOpened())  // check if we succeeded
          return -1;
  
  Mat edges;
  for(;;){
  
  
      Mat frame;
      cap&gt;&gt;frame;
      cvtColor(frame, edges, CV_BGR2GRAY);
      GaussianBlur(edges, edges, Size(7,7), 1.5, 1.5);
      Canny(edges, edges, 0, 30, 3);
  
      imshow("Video", edges);
      //cvWaitKey(0);
  
  }
  
  
  return(0);
  }
  </code></pre>
  
  <p>Now it succesfully load the video and query a frame, evry time i press a key it obviously query another frame and everything works fine, but if i comment the waitkey() the program simply hangs for a bit and crashes if i try to close the window, i'm starting to think there is a problem with codecs or something like that...</p>