title: Unable to get OpenCV 3.1 FPS over ~15 FPS
body: <p>I have some extremely simple performance testing code below for measuring the FPS of my webcam with OpenCV 3.1 + Python3 on a Late 2011 Macbook Pro:</p>
  
  <pre><code>cap = cv2.VideoCapture(0)
  count = 0
  start_time = time.perf_counter()
  end_time = time.perf_counter()
  while (start_time + 1) &gt; end_time:
      count += 1
      cap.read()
      # Attempt to force camera FPS to be higher
      cap.set(cv2.CAP_PROP_FPS, 30)
      end_time = time.perf_counter()
  print("Got count", count)
  </code></pre>
  
  <p>Doing no processing, not even displaying the image or doing this in another thread, I am only getting around 15 FPS. </p>
  
  <p>Trying to access the FPS of the camera with cap.get(cv2.CAP_PROP_FPS) I get 0.0.</p>
  
  <p>Any ideas why?</p>
  
  <p>I've already searched the internet a fair amount for answers, so things I've thought about:</p>
  
  <ul>
  <li><p>I build OpenCV with release flags, so it shouldn't be doing extra debugging logic</p></li>
  <li><p>Tried manually setting the FPS each frame (see above)</p></li>
  <li><p>My FPS with other apps (e.g. Camera toy in Chrome) is 30FPS</p></li>
  <li><p>There is no work being done in the app on the main thread, so putting the video capture logic in another thread as most other posts suggest shouldn't make a difference</p></li>
  </ul>
  
  <p>** EDIT ** 
  Additional details: it seems like the first frame I capture is quick, then subsequent frames are slower; seems like this could be a buffer issues (i.e. the camera is being paused after the first frame because a new buffer must be allocated to write to?)</p>
  
  <p>Tweaked the code to calculate the average FPS so far after each read:</p>
  
  <pre><code> cap = cv2.VideoCapture(0)
  cap.set(cv2.CAP_PROP_CONVERT_RGB, False)
  cap.set(cv2.CAP_PROP_FPS, 30)
  start_time = time.perf_counter()
  count = 0
  cv2.CAP_PROP_FPS
  end_time = time.perf_counter()
  while True:
      count += 1
      ret, frame = cap.read()
      end_time = time.perf_counter()
      print("Reached FPS of: ", count / (end_time - start_time))
  </code></pre>
  
  <p>And I get one frame around 30FPS, and then subsequent frames are slower:</p>
  
  <p>Reached FPS of:  27.805818385257446</p>
  
  <p>Reached FPS of:  19.736237223924398</p>
  
  <p>Reached FPS of:  18.173748156583795</p>
  
  <p>Reached FPS of:  17.214809956810114</p>
  
  <p>Reached FPS of:  16.94737657138959</p>
  
  <p>Reached FPS of:  16.73624509452099</p>
  
  <p>Reached FPS of:  16.33156408530572</p>
  
  <p>** EDIT ** 
  Still no luck as of 10/20. My best bet is there are some issues with memory transfer since the camera itself can definitively capture at 30 FPS based on the ability of other apps.</p>