mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-01-02 00:07:11 +01:00
ensure default args propogate
This commit is contained in:
parent
1a3567c5d0
commit
ebee204ca0
@ -347,18 +347,6 @@ class CameraInput(BaseModel):
|
|||||||
|
|
||||||
class CameraFfmpegConfig(FfmpegConfig):
|
class CameraFfmpegConfig(FfmpegConfig):
|
||||||
inputs: List[CameraInput] = Field(title="Camera inputs.")
|
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")
|
@validator("inputs")
|
||||||
def validate_roles(cls, v):
|
def validate_roles(cls, v):
|
||||||
|
@ -197,6 +197,32 @@ class TestConfig(unittest.TestCase):
|
|||||||
assert len(back_camera.objects.filters["dog"].raw_mask) == 2
|
assert len(back_camera.objects.filters["dog"].raw_mask) == 2
|
||||||
assert len(back_camera.objects.filters["person"].raw_mask) == 1
|
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):
|
def test_ffmpeg_params_global(self):
|
||||||
config = {
|
config = {
|
||||||
"ffmpeg": {"input_args": "-re"},
|
"ffmpeg": {"input_args": "-re"},
|
||||||
|
Loading…
Reference in New Issue
Block a user