From 3e2f8766276584d39a0495ac9ec54f75ca0570b9 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Mon, 7 Dec 2020 16:49:00 +0000 Subject: [PATCH 1/4] Added mjpeg bitrate to settings --- openflexure_microscope/camera/pi.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/openflexure_microscope/camera/pi.py b/openflexure_microscope/camera/pi.py index 9f3bf1cd..0be4e2dc 100644 --- a/openflexure_microscope/camera/pi.py +++ b/openflexure_microscope/camera/pi.py @@ -94,6 +94,14 @@ class PiCameraStreamer(BaseCamera): self.jpeg_quality: int = 100 #: int: JPEG quality self.mjpeg_quality: int = 75 #: int: MJPEG quality + self.mjpeg_bitrate: int = -1 #: int: MJPEG quality + # Solid bitrate options: + # -1: Maximum + # 25000000: High + # 17000000: Normal + # 5000000: Low (may impact fast AF) + # 2500000: Very low (may impact fast AF) + # Start stream recording (and set resolution) self.start_stream() @@ -140,6 +148,7 @@ class PiCameraStreamer(BaseCamera): "numpy_resolution": self.numpy_resolution, "jpeg_quality": self.jpeg_quality, "mjpeg_quality": self.mjpeg_quality, + "mjpeg_bitrate": self.mjpeg_bitrate, "picamera": {}, } @@ -409,7 +418,7 @@ class PiCameraStreamer(BaseCamera): self.stream, format="mjpeg", quality=self.mjpeg_quality, - bitrate=-1, # RWB: disable bitrate control + bitrate=self.mjpeg_bitrate, # RWB: disable bitrate control # (bitrate control makes JPEG size less good as a focus # metric) splitter_port=1, From 42e0dfd39cbc13ef305cc3d3ccee8d036d5d4e90 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Mon, 7 Dec 2020 17:05:56 +0000 Subject: [PATCH 2/4] Replaced MJPEG quality setting with MJPEG bitrate --- .../settingsComponents/cameraSettings.vue | 46 +++++++++++++------ 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/cameraSettings.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/cameraSettings.vue index 9a5aa29f..7e705482 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/cameraSettings.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/cameraSettings.vue @@ -53,18 +53,19 @@

Image quality

-
+
Web stream bitrate -
- -
+
@@ -81,6 +82,16 @@
+ + This stream bitrate may impact fast autofocus performance