title: Any way to reduce the camera lag in python OpenCV?
body: <p>On running the script, the camera works and I am able to get the video, but the video output is very slow.
  There's very much time difference in between the frames causing a laggy video output on the screen.</p>
  
  <p>Is there any way to reduce the lag and increase the Frame Rate?</p>
  
  <p>Here's the code I'm using: </p>
  
  <pre><code>import cv2
  import time
  
  t = time.time()
  frames = 0
  while True:
      frames += 1
      video = cv2.VideoCapture(0)
      check, frame = video.read()
  
      print(frame)
  
      frame = cv2.flip(frame, 1, 0)
      gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
      cv2.imshow("LIVE", gray)
      key = cv2.waitKey(1)
      if key == ord('q'):
          break
  
  video.release()
  print("Frame Rate = ", end="")
  print((time.time()-t) / frames)
  </code></pre>
  
  <p>I expected a frame rate of around 24-25, but I am getting frame rate of around 1.76 .</p>