From ebee204ca06c51b8e7a82b68453c2ecfb226db61 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Fri, 9 Jul 2021 20:21:35 -0500 Subject: [PATCH] ensure default args propogate --- frigate/config.py | 12 ------------ frigate/test/test_config.py | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/frigate/config.py b/frigate/config.py index 7e3426a34..a39cdf134 100644 --- a/frigate/config.py +++ b/frigate/config.py @@ -347,18 +347,6 @@ class CameraInput(BaseModel): class CameraFfmpegConfig(FfmpegConfig): inputs: List[CameraInput] = Field(title="Camera inputs.") - global_args: Union[str, List[str]] = Field( - default_factory=list, title="FFmpeg global arguments." - ) - hwaccel_args: Union[str, List[str]] = Field( - default_factory=list, title="FFmpeg hardware acceleration arguments." - ) - input_args: Union[str, List[str]] = Field( - default_factory=list, title="FFmpeg input arguments." - ) - output_args: FfmpegOutputArgsConfig = Field( - default_factory=FfmpegOutputArgsConfig, title="FFmpeg output arguments." - ) @validator("inputs") def validate_roles(cls, v): diff --git a/frigate/test/test_config.py b/frigate/test/test_config.py index af1c8a593..23f3499d3 100644 --- a/frigate/test/test_config.py +++ b/frigate/test/test_config.py @@ -197,6 +197,32 @@ class TestConfig(unittest.TestCase): assert len(back_camera.objects.filters["dog"].raw_mask) == 2 assert len(back_camera.objects.filters["person"].raw_mask) == 1 + def test_default_input_args(self): + + config = { + "mqtt": {"host": "mqtt"}, + "cameras": { + "back": { + "ffmpeg": { + "inputs": [ + { + "path": "rtsp://10.0.0.1:554/video", + "roles": ["detect"], + }, + ] + }, + "height": 1080, + "width": 1920, + } + }, + } + + frigate_config = FrigateConfig(**config) + assert config == frigate_config.dict(exclude_unset=True) + + runtime_config = frigate_config.runtime_config + assert "-rtsp_transport" in runtime_config.cameras["back"].ffmpeg_cmds[0]["cmd"] + def test_ffmpeg_params_global(self): config = { "ffmpeg": {"input_args": "-re"},