From 23113dfc6fe7f266c21d39f50280a28fc91864f5 Mon Sep 17 00:00:00 2001 From: spacebares <57186372+spacebares@users.noreply.github.com> Date: Fri, 23 Jun 2023 13:59:01 -0400 Subject: [PATCH] configurable ffmpeg healthcheck interval rename timeout to healthcheck_interval only grab config value once --- frigate/config.py | 2 +- frigate/video.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frigate/config.py b/frigate/config.py index 2f07e7189..b570dbf37 100644 --- a/frigate/config.py +++ b/frigate/config.py @@ -463,7 +463,7 @@ class FfmpegConfig(FrigateBaseModel): default_factory=FfmpegOutputArgsConfig, title="FFmpeg output arguments per role.", ) - timeout: float = Field( + healthcheck_interval: float = Field( default=10.0, title="Time in seconds in-between ffmpeg health checks." ) diff --git a/frigate/video.py b/frigate/video.py index 09c80344b..171ef72c0 100755 --- a/frigate/video.py +++ b/frigate/video.py @@ -232,6 +232,7 @@ class CameraWatchdog(threading.Thread): self.frame_shape = self.config.frame_shape_yuv self.frame_size = self.frame_shape[0] * self.frame_shape[1] self.stop_event = stop_event + self.sleeptime = self.config.ffmpeg.healthcheck_interval def run(self): self.start_ffmpeg_detect() @@ -251,9 +252,8 @@ class CameraWatchdog(threading.Thread): } ) - sleeptime = self.config.ffmpeg.timeout - time.sleep(sleeptime) - while not self.stop_event.wait(sleeptime): + time.sleep(self.sleeptime) + while not self.stop_event.wait(self.sleeptime): now = datetime.datetime.now().timestamp() if not self.capture_thread.is_alive():