From 9ac64888340714c5a30c59b7be939431248d5a32 Mon Sep 17 00:00:00 2001 From: Nathan Janeczko Date: Tue, 10 Jul 2018 16:36:47 +0200 Subject: [PATCH] use variables from config.ini frame_height frame_width for camera resolution --- src/cli/add.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cli/add.py b/src/cli/add.py index 4a45ab3..2d82c06 100644 --- a/src/cli/add.py +++ b/src/cli/add.py @@ -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()