diff --git a/backend/app/classes/SettingsManager.py b/backend/app/classes/SettingsManager.py index 74989873f..df5d5978f 100644 --- a/backend/app/classes/SettingsManager.py +++ b/backend/app/classes/SettingsManager.py @@ -123,6 +123,13 @@ class SettingsManager(metaclass=Singleton): self.usb_cameras[camera_name].setExposureManual(dic["exposure"]) if "resolution" in dic: + video_mode: VideoMode = self.usb_cameras[camera_name].enumerateVideoModes()[int(dic["resolution"])] + self.cams[camera_name]["video_mode"] = { + "fps": video_mode.fps, + "width": video_mode.width, + "height": video_mode.height, + "pixel_format": str(video_mode.pixelFormat).split('.')[1] + } self.usb_cameras[camera_name].setVideoMode(self.usb_cameras[camera_name].enumerateVideoModes()[int(dic["resolution"])]) # Access methods diff --git a/backend/settings/cams/USB Camera-B4.09.24.1.json b/backend/settings/cams/USB Camera-B4.09.24.1.json index d9db1abbb..128e2c3fc 100644 --- a/backend/settings/cams/USB Camera-B4.09.24.1.json +++ b/backend/settings/cams/USB Camera-B4.09.24.1.json @@ -1 +1 @@ -{"pipelines": {"pipeline0": {"exposure": 99, "brightness": 0, "orientation": "Inverted", "resolution": 14, "hue": [50, 58], "saturation": [65, 76], "value": [63, 79], "erode": false, "dilate": false, "area": [0, 100], "ratio": [0, 20], "extent": [0, 100], "is_binary": "Normal"}}, "path": "/dev/v4l/by-path/pci-0000:02:03.0-usb-0:1:1.0-video-index0", "video_mode": {"fps": 187, "width": 320, "height": 240, "pixel_format": "kYUYV"}} \ No newline at end of file +{"pipelines": {"pipeline0": {"exposure": 50, "brightness": 50, "orientation": "Normal", "resolution": 14, "hue": [0, 100], "saturation": [0, 100], "value": [0, 100], "erode": false, "dilate": false, "area": [0, 100], "ratio": [0, 20], "extent": [0, 100], "is_binary": "Normal"}}, "path": "/dev/v4l/by-path/pci-0000:02:03.0-usb-0:1:1.0-video-index0", "video_mode": {"fps": 15, "width": 640, "height": 480, "pixel_format": "kYUYV"}} \ No newline at end of file