mirror of
https://github.com/boltgolt/howdy.git
synced 2024-09-19 09:51:19 +02:00
Add configurable device frame rate
This commit is contained in:
parent
538569921e
commit
d6e35cfd1d
2 changed files with 12 additions and 0 deletions
|
@ -86,6 +86,12 @@ force_mjpeg = false
|
||||||
# OPENCV only.
|
# OPENCV only.
|
||||||
exposure = -1
|
exposure = -1
|
||||||
|
|
||||||
|
# Specify frame rate of the capture device.
|
||||||
|
# Some IR emitters will not function properly at the default framerate.
|
||||||
|
# Use qv4l2 to determine an appropriate value.
|
||||||
|
# OPENCV only.
|
||||||
|
device_fps = -1
|
||||||
|
|
||||||
# Rotate captured frames so faces are upright.
|
# Rotate captured frames so faces are upright.
|
||||||
# 0 Check landscape orientation only
|
# 0 Check landscape orientation only
|
||||||
# 1 Check both landscape and portrait orientation
|
# 1 Check both landscape and portrait orientation
|
||||||
|
|
|
@ -124,6 +124,12 @@ class VideoCapture:
|
||||||
self.config.get("video", "device_path"),
|
self.config.get("video", "device_path"),
|
||||||
cv2.CAP_V4L
|
cv2.CAP_V4L
|
||||||
)
|
)
|
||||||
|
# Set the capture frame rate
|
||||||
|
# Without this the first detected (and possibly lower) frame rate is used, -1 seems to select the highest
|
||||||
|
# Use 0 as a fallback to avoid breaking an existing setup, new installs should default to -1
|
||||||
|
self.fps = self.config.getint("video", "device_fps", fallback=0)
|
||||||
|
if self.fps != 0:
|
||||||
|
self.internal.set(cv2.CAP_PROP_FPS, self.fps)
|
||||||
|
|
||||||
# Force MJPEG decoding if true
|
# Force MJPEG decoding if true
|
||||||
if self.config.getboolean("video", "force_mjpeg", fallback=False):
|
if self.config.getboolean("video", "force_mjpeg", fallback=False):
|
||||||
|
|
Loading…
Reference in a new issue