Merge branch 'bitrate-controls' into 'master'
Added stream bitrate controls See merge request openflexure/openflexure-microscope-server!105
This commit is contained in:
commit
6e1383d1c4
4 changed files with 49 additions and 16 deletions
|
|
@ -1,3 +1,10 @@
|
|||
# [v2.9.1](https://gitlab.com/openflexure/openflexure-microscope-server/compare/v2.9.0...v2.9.1) (2020-12-07)
|
||||
|
||||
|
||||
* Server: Added mjpeg bitrate to settings ([3e2f876](https://gitlab.com/openflexure/openflexure-microscope-server/commit/3e2f876))
|
||||
* JS Client: Replaced MJPEG quality setting with MJPEG bitrate ([42e0dfd](https://gitlab.com/openflexure/openflexure-microscope-server/commit/42e0dfd))
|
||||
|
||||
|
||||
# [v2.9.0](https://gitlab.com/openflexure/openflexure-microscope-server/compare/v2.8.0...v2.9.0) (2020-12-07)
|
||||
|
||||
## Developer changes
|
||||
|
|
|
|||
|
|
@ -53,18 +53,19 @@
|
|||
<h4>Image quality</h4>
|
||||
|
||||
<div class="uk-child-width-1-2" uk-grid>
|
||||
<div v-if="mjpeg_quality !== undefined">
|
||||
<div v-if="mjpeg_bitrate !== undefined">
|
||||
<label class="uk-form-label" for="form-stacked-text"
|
||||
>Web stream quality (%)</label
|
||||
>Web stream bitrate</label
|
||||
>
|
||||
<div class="uk-form-controls">
|
||||
<input
|
||||
v-model="mjpeg_quality"
|
||||
class="uk-input uk-form-small"
|
||||
type="number"
|
||||
step="1"
|
||||
/>
|
||||
</div>
|
||||
<select v-model="mjpeg_bitrate" class="uk-select uk-form-small">
|
||||
<option
|
||||
v-for="option in bitrateOptions"
|
||||
:key="option.value"
|
||||
:value="option.value"
|
||||
>
|
||||
{{ option.text }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div v-if="jpeg_quality !== undefined">
|
||||
|
|
@ -81,6 +82,16 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span
|
||||
v-if="
|
||||
mjpeg_bitrate !== undefined &&
|
||||
mjpeg_bitrate < 17000000 &&
|
||||
mjpeg_bitrate != -1
|
||||
"
|
||||
class="uk-text-danger uk-margin-top-small"
|
||||
>This stream bitrate may impact fast autofocus performance</span
|
||||
>
|
||||
</div>
|
||||
|
||||
<button
|
||||
|
|
@ -123,8 +134,15 @@ export default {
|
|||
analog_gain: undefined,
|
||||
digital_gain: undefined
|
||||
},
|
||||
mjpeg_quality: undefined,
|
||||
jpeg_quality: undefined
|
||||
mjpeg_bitrate: undefined,
|
||||
jpeg_quality: undefined,
|
||||
bitrateOptions: [
|
||||
{ text: "Maximum", value: -1 },
|
||||
{ text: "High", value: 25000000 },
|
||||
{ text: "Normal", value: 17000000 },
|
||||
{ text: "Low", value: 5000000 },
|
||||
{ text: "Very low", value: 2500000 }
|
||||
]
|
||||
};
|
||||
},
|
||||
|
||||
|
|
@ -145,7 +163,7 @@ export default {
|
|||
.then(response => {
|
||||
const cameraSettings = response.data.camera;
|
||||
// Get base camera settings
|
||||
this.mjpeg_quality = cameraSettings.mjpeg_quality;
|
||||
this.mjpeg_bitrate = cameraSettings.mjpeg_bitrate;
|
||||
this.jpeg_quality = cameraSettings.jpeg_quality;
|
||||
// Get Pi Camera settings if they exist
|
||||
if (cameraSettings.picamera) {
|
||||
|
|
@ -164,7 +182,7 @@ export default {
|
|||
// make the numbers be strings... TypeScript would solve this...
|
||||
var payload = {
|
||||
camera: {
|
||||
mjpeg_quality: parseInt(this.mjpeg_quality),
|
||||
mjpeg_bitrate: parseInt(this.mjpeg_bitrate),
|
||||
jpeg_quality: parseInt(this.jpeg_quality),
|
||||
picamera: {
|
||||
shutter_speed: parseFloat(this.picamera.shutter_speed),
|
||||
|
|
|
|||
|
|
@ -94,6 +94,13 @@ 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 +147,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 +417,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,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ build-backend = "poetry.masonry.api"
|
|||
|
||||
[tool.poetry]
|
||||
name = "openflexure-microscope-server"
|
||||
version = "2.9.0"
|
||||
version = "2.9.1"
|
||||
description = "Python module, and Flask-based web API, to run the OpenFlexure Microscope."
|
||||
|
||||
authors = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue