title: OpenCV, captured video runs faster than original camera video!
body: <p>I am using openCV to capture video from camera and store to and avi file, the problem is that when i finish capturing and run the avi file, the video stream looks awkwardly fast...</p>
  
  <p>here is the code</p>
  
  <pre><code>void main( )
  {
  CvCapture *capture = cvCaptureFromCAM( 0 );
  
  int width = ( int )cvGetCaptureProperty( capture, CV_CAP_PROP_FRAME_WIDTH );
  int height = ( int )cvGetCaptureProperty( capture, CV_CAP_PROP_FRAME_HEIGHT );
  CvVideoWriter *writer = cvCreateVideoWriter( "myCamCapture.avi",
  -1,30, cvSize(  width, height ) );
  cvNamedWindow("d", CV_WINDOW_AUTOSIZE);
  IplImage *frame = 0;
  
  
  while( 1 )
  {
      frame = cvQueryFrame( capture );
  
      cvShowImage("d",frame);
      cvWriteFrame( writer, frame );
      char c = cvWaitKey( 33 );
      if( c == 27 ) break;
  }
  
  cvReleaseCapture( &amp;capture );
  cvReleaseVideoWriter( &amp;writer );
  cvDestroyWindow( "d" );
  
  
      }
  </code></pre>
  
  <p>please help</p>