From 190f217b1371a0c4e298a6ebe250fab6a4de81a4 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Fri, 11 Feb 2022 07:12:51 -0600 Subject: [PATCH] set stationary_threshold default to 5x fps --- docs/docs/configuration/index.md | 4 ++-- frigate/config.py | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/docs/configuration/index.md b/docs/docs/configuration/index.md index 49164b44c..bed2f113e 100644 --- a/docs/docs/configuration/index.md +++ b/docs/docs/configuration/index.md @@ -162,8 +162,8 @@ detect: # Optional: Frequency for running detection on stationary objects (default: shown below) # When set to 0, object detection will never be run on stationary objects. If set to 10, it will be run on every 10th frame. stationary_interval: 0 - # Optional: Number of frames without a position change for an object to be considered stationary (default: shown below) - stationary_threshold: 10 + # Optional: Number of frames without a position change for an object to be considered stationary (default: 5x the frame rate) + stationary_threshold: 25 # Optional: Object configuration # NOTE: Can be overridden at the camera level diff --git a/frigate/config.py b/frigate/config.py index f7f82e91d..a5f5275a2 100644 --- a/frigate/config.py +++ b/frigate/config.py @@ -178,7 +178,6 @@ class DetectConfig(FrigateBaseModel): ge=0, ) stationary_threshold: Optional[int] = Field( - default=10, title="Number of frames without a position change for an object to be considered stationary", ge=1, ) @@ -771,6 +770,11 @@ class FrigateConfig(FrigateBaseModel): if camera_config.detect.max_disappeared is None: camera_config.detect.max_disappeared = max_disappeared + # Default stationary_threshold configuration + stationary_threshold = camera_config.detect.fps * 5 + if camera_config.detect.stationary_threshold is None: + camera_config.detect.stationary_threshold = stationary_threshold + # FFMPEG input substitution for input in camera_config.ffmpeg.inputs: input.path = input.path.format(**FRIGATE_ENV_VARS)