mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-12-23 19:11:14 +01:00
make watchdog timeout configurable per camera (fixes #95)
This commit is contained in:
parent
169603d3ff
commit
1198c29dac
@ -99,6 +99,12 @@ cameras:
|
||||
################
|
||||
take_frame: 1
|
||||
|
||||
################
|
||||
# The number of seconds frigate will allow a camera to go without sending a frame before
|
||||
# assuming the ffmpeg process has a problem and restarting.
|
||||
################
|
||||
# watchdog_timeout: 300
|
||||
|
||||
################
|
||||
# Camera level object config. This config is merged with the global config above.
|
||||
################
|
||||
|
@ -65,7 +65,7 @@ class CameraWatchdog(threading.Thread):
|
||||
# wait a bit before checking
|
||||
time.sleep(10)
|
||||
|
||||
if self.camera.frame_time.value != 0.0 and (datetime.datetime.now().timestamp() - self.camera.frame_time.value) > 300:
|
||||
if self.camera.frame_time.value != 0.0 and (datetime.datetime.now().timestamp() - self.camera.frame_time.value) > self.camera.watchdog_timeout:
|
||||
print(self.camera.name + ": last frame is more than 5 minutes old, restarting camera capture...")
|
||||
self.camera.start_or_restart_capture()
|
||||
time.sleep(5)
|
||||
@ -151,6 +151,7 @@ class Camera:
|
||||
camera_objects_config = config.get('objects', {})
|
||||
|
||||
self.take_frame = self.config.get('take_frame', 1)
|
||||
self.watchdog_timeout = self.config.get('watchdog_timeout', 300)
|
||||
self.regions = self.config['regions']
|
||||
self.frame_shape = get_frame_shape(self.ffmpeg_input)
|
||||
self.frame_size = self.frame_shape[0] * self.frame_shape[1] * self.frame_shape[2]
|
||||
|
Loading…
Reference in New Issue
Block a user