Skip to content

Instantly share code, notes, and snippets.

@bigsnarfdude
Created January 14, 2019 05:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bigsnarfdude/906af9bf6e0ba94f47708d827e7831e8 to your computer and use it in GitHub Desktop.
Save bigsnarfdude/906af9bf6e0ba94f47708d827e7831e8 to your computer and use it in GitHub Desktop.
setting fps in cv2
def grab(cam, queue, width, height, fps):
global running
capture = cv2.VideoCapture(cam)
capture.set(cv2.CAP_PROP_FRAME_WIDTH, width)
capture.set(cv2.CAP_PROP_FRAME_HEIGHT, height)
capture.set(cv2.CAP_PROP_FPS, fps)
while(running):
frame = {}
capture.grab()
retval, img = capture.retrieve(0)
frame["img"] = img
frame["1"] = config["1"]
frame["2"] = config["2"]
blur = get_blur(img, 0.05)
frame["blur"] = blur
if queue.qsize() < 10:
queue.put(frame)
else:
print(queue.qsize())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment