0
0
Fork 0
mirror of https://github.com/boltgolt/howdy.git synced 2024-09-19 09:51:19 +02:00

use variables from config.ini frame_height frame_width for camera resolution

This commit is contained in:
Nathan Janeczko 2018-07-10 16:36:47 +02:00
parent 7e896de2cb
commit 9ac6488834

View file

@ -85,6 +85,13 @@ video_capture = cv2.VideoCapture(int(config.get("video", "device_id")))
if config.get("video", "force_mjpeg") == "true":
video_capture.set(cv2.CAP_PROP_FOURCC, 1196444237)
# Set the frame width and height if requested
if int(config.get("video", "frame_width")) != -1:
video_capture.set(cv2.CAP_PROP_FRAME_WIDTH, int(config.get("video", "frame_width")))
if int(config.get("video", "frame_height")) != -1:
video_capture.set(cv2.CAP_PROP_FRAME_HEIGHT, int(config.get("video", "frame_height")))
# Request a frame to wake the camera up
video_capture.read()