title: Video playback is a lot faster than expected
body: <p>I know that the <a href="http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html#videowriter-videowriter" rel="nofollow noreferrer"><code>VideoWriter</code></a> object's FPS should match the FPS of my webcam. My webcam is a <a href="http://www.logitech.com/en-ca/product/hd-pro-webcam-c920" rel="nofollow noreferrer">Logitech HD Pro Webcam C920</a> and as you can see, the spec says it has a FPS of 30. Still instead of hardcoding the value, I use <code>cap.get(CV_CAP_PROP_FPS)</code> (which returns 30.0) to be sure to match the FPS.</p>
  
  <pre><code>cap = cv2.VideoCapture(0)
  fourcc = cv2.VideoWriter_fourcc(*'MJPG')
  out = cv2.VideoWriter('output.avi', fourcc, cap.get(CV_CAP_PROP_FPS), (640, 480))
  
  print(cap.get(CV_CAP_PROP_FPS)) # 30.0
  </code></pre>
  
  <p>This is how I capture each frame of the video:</p>
  
  <pre><code>while(cap.isOpened()):
          # Capture frame-by-frame
          ret, frame = cap.read()
          if ret == True:
                  out.write(frame)
  </code></pre>
  
  <p>My problem is that, even with matching FPSs, the output video (<code>output.avi</code>) has a playback speed of about x3 (according to my non-scientific estimation), which is obviously not what I want. I have tried with different codecs, but the same problem occurs.</p>
  
  <p>There are a couple questions on SO that are addressing this same problem:</p>
  
  <p><a href="https://stackoverflow.com/questions/4347580/opencv-captured-video-runs-faster-than-original-camera-video">OpenCV, captured video runs faster than original camera video!</a><br>
  <a href="https://stackoverflow.com/questions/1168214/opencv-video-capture-and-fps-problem">OpenCV Video capture and fps problem</a><br>
  <a href="https://stackoverflow.com/questions/24757271/opencv-video-recording-is-too-fast">OpenCV: Video Recording is too fast</a><br>
  <a href="http://answers.opencv.org/question/16522/video-recording-is-too-fast/" rel="nofollow noreferrer">http://answers.opencv.org/question/16522/video-recording-is-too-fast/</a></p>
  
  <p>Most of which suggest to match the FPS of the writer, with the FPS of the webcam, which I did. If I hardcode the FPS to 10, the video playback seems normal, but I don't want to do that, as it has to work generically with many cameras.</p>
  
  <p>I don't really know what to do at this point, but I'll keep searching until I find the solution. Any insight is appreciated!!</p>