title: Why is Python OpenCV camera read in Ubuntu slower than Windows?
body: <p>I have a really simple code to view video from web-cam (Microsoft HD LifeCam Studio) as follow:</p>
  
  <pre><code>import cv2
  from imutils.video import FPS
  
  cap = cv2.VideoCapture(0)
  cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
  cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
  fps = FPS().start()
  
  while cap.isOpened():
      _,frame = cap.read()
      cv2.imshow('frame',frame)
      if cv2.waitKey(1) &amp; 0xFF == ord('q'):
          break
      fps.update()
  fps.stop()
  print("{}".format(fps.fps()))
  
  cap.release()
  cv2.destroyAllWindows()
  </code></pre>
  
  <p>The code will print out the FPS when the program ends. </p>
  
  <p>When running this code on Windows, I receive 30 FPS. However, when running on Ubuntu, I only receive 10 FPS.</p>
  
  <p>I have tried <code>cap.set(cv2.cv.CV_CAP_PROP_FPS, 30)</code> but it does not work.</p>
  
  <p>Does anyone experience the same situation? Is there any solution for this problem? </p>
  
  <p>I'm running Windows 10 and Ubuntu 16.04
  Python 3.5.2 
  OpenCV 3.4.0</p>