title: What is the optimal fps to record an OpenCV video at?
body: <p>I'm tinkering around with OpenCV and I'm having some trouble figuring out what fps I should be recording webcam footage. When I record it at <code>15 fps</code> the recorded footage goes much faster than "real life". I was wondering if there is an "optimal" fps at which I can record such that the recording will be <strong>exactly</strong> as long as the time it took to shoot the video?</p>
  
  <p>Here's the program I'm running (though I think that's irrelevant to the question):</p>
  
  <pre><code>import cv2
  
  cap = cv2.VideoCapture(0)
  
  # Define the codec and create VideoWriter object
  fourcc = cv2.VideoWriter_fourcc('m', 'p', '4', 'v')
  fps = 15.0  # Controls the fps of the video created: todo look up optimal fps for webcam
  out = cv2.VideoWriter()
  
  success = out.open('../assets/output.mp4v',fourcc, fps, (1280,720),True)
  
  while(cap.isOpened()):
      ret, frame = cap.read()
      if ret==True:
          frame = cv2.flip(frame,1)
          # write the flipped frame
          out.write(frame)
          cv2.imshow('frame',frame)
  
          # If user presses escape key program terminates
          userInput = cv2.waitKey(1)
          if userInput == 27:
              break
      else:
          break
  
  # Release everything if job is finished
  cap.release()
  out.release()
  cv2.destroyAllWindows()
  </code></pre>