mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-02-09 00:17:00 +01:00
set min motion frame to 180
This commit is contained in:
parent
09b0068d16
commit
2a41a9d3ff
@ -99,7 +99,7 @@ class RuntimeMotionConfig(MotionConfig):
|
||||
frame_shape = config.get("frame_shape", (1, 1))
|
||||
|
||||
if "frame_height" not in config:
|
||||
config["frame_height"] = frame_shape[0] // 6
|
||||
config["frame_height"] = max(frame_shape[0] // 6, 180)
|
||||
|
||||
mask = config.get("mask", "")
|
||||
config["raw_mask"] = mask
|
||||
|
@ -449,9 +449,34 @@ class TestConfig(unittest.TestCase):
|
||||
assert config == frigate_config.dict(exclude_unset=True)
|
||||
|
||||
runtime_config = frigate_config.runtime_config
|
||||
ffmpeg_cmds = runtime_config.cameras["back"].ffmpeg_cmds
|
||||
assert runtime_config.cameras["back"].detect.max_disappeared == 5 * 5
|
||||
|
||||
def test_motion_frame_height_wont_go_below_180(self):
|
||||
|
||||
config = {
|
||||
"mqtt": {"host": "mqtt"},
|
||||
"cameras": {
|
||||
"back": {
|
||||
"ffmpeg": {
|
||||
"inputs": [
|
||||
{
|
||||
"path": "rtsp://10.0.0.1:554/video",
|
||||
"roles": ["detect"],
|
||||
},
|
||||
]
|
||||
},
|
||||
"height": 480,
|
||||
"width": 640,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
frigate_config = FrigateConfig(**config)
|
||||
assert config == frigate_config.dict(exclude_unset=True)
|
||||
|
||||
runtime_config = frigate_config.runtime_config
|
||||
assert runtime_config.cameras["back"].motion.frame_height >= 180
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(verbosity=2)
|
||||
|
Loading…
Reference in New Issue
Block a user