forked from Github/frigate
Set User Agent for FFmpeg calls (#4555)
* Set User Agent for FFmpeg calls * Allow to use shell-like string args * Add test for arg as string with space
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import unittest
|
||||
from frigate.config import FrigateConfig
|
||||
from frigate.config import FFMPEG_INPUT_ARGS_DEFAULT, FrigateConfig
|
||||
from frigate.ffmpeg_presets import parse_preset_input
|
||||
|
||||
|
||||
@@ -93,6 +93,16 @@ class TestFfmpegPresets(unittest.TestCase):
|
||||
" ".join(frigate_config.cameras["back"].ffmpeg_cmds[0]["cmd"])
|
||||
)
|
||||
|
||||
def test_ffmpeg_input_args_as_string(self):
|
||||
argsString = " ".join(FFMPEG_INPUT_ARGS_DEFAULT) + ' -some "arg with space"'
|
||||
argsList = FFMPEG_INPUT_ARGS_DEFAULT + ["-some", "arg with space"]
|
||||
self.default_ffmpeg["cameras"]["back"]["ffmpeg"]["input_args"] = argsString
|
||||
frigate_config = FrigateConfig(**self.default_ffmpeg)
|
||||
frigate_config.cameras["back"].create_ffmpeg_cmds()
|
||||
assert set(argsList).issubset(
|
||||
frigate_config.cameras["back"].ffmpeg_cmds[0]["cmd"]
|
||||
)
|
||||
|
||||
def test_ffmpeg_input_not_preset(self):
|
||||
self.default_ffmpeg["cameras"]["back"]["ffmpeg"]["input_args"] = "-some inputs"
|
||||
frigate_config = FrigateConfig(**self.default_ffmpeg)
|
||||
|
||||
Reference in New Issue
Block a user