From 5a9e82c4b0d922ab7fb0c80979d698cd08395d82 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Mon, 8 Nov 2021 07:32:29 -0600 Subject: [PATCH] create ffmpeg commands on startup --- frigate/config.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frigate/config.py b/frigate/config.py index e911f76cd..8126ecfcc 100644 --- a/frigate/config.py +++ b/frigate/config.py @@ -489,6 +489,7 @@ class CameraConfig(FrigateBaseModel): timestamp_style: TimestampStyleConfig = Field( default_factory=TimestampStyleConfig, title="Timestamp style configuration." ) + _ffmpeg_cmds: List[Dict[str, List[str]]] = PrivateAttr() def __init__(self, **config): # Set zone colors @@ -505,6 +506,8 @@ class CameraConfig(FrigateBaseModel): super().__init__(**config) + self._ffmpeg_cmds = self._create_ffmpeg_cmds() + @property def frame_shape(self) -> Tuple[int, int]: return self.detect.height, self.detect.width @@ -515,6 +518,9 @@ class CameraConfig(FrigateBaseModel): @property def ffmpeg_cmds(self) -> List[Dict[str, List[str]]]: + return self._ffmpeg_cmds + + def _create_ffmpeg_cmds(self) -> List[Dict[str, List[str]]]: ffmpeg_cmds = [] for ffmpeg_input in self.ffmpeg.inputs: ffmpeg_cmd = self._get_ffmpeg_cmd(ffmpeg_input)