Merge pull request #52 from janecz-n/master

Use variables from config.ini frame_height frame_width for camera res
This commit is contained in:
boltgolt 2018-07-11 10:11:00 +02:00 committed by GitHub
commit b5c715df9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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()