diff --git a/frigate/config.py b/frigate/config.py index 71cf27c9e..39b856277 100644 --- a/frigate/config.py +++ b/frigate/config.py @@ -171,8 +171,9 @@ class DetectConfig(FrigateBaseModel): title="Maximum number of frames the object can dissapear before detection ends." ) stationary_interval: Optional[int] = Field( + default=0, title="Frame interval for checking stationary objects.", - ge=1, + ge=0, ) @@ -763,11 +764,6 @@ class FrigateConfig(FrigateBaseModel): if camera_config.detect.max_disappeared is None: camera_config.detect.max_disappeared = max_disappeared - # Default stationary_interval configuration - stationary_interval = camera_config.detect.fps * 10 - if camera_config.detect.stationary_interval is None: - camera_config.detect.stationary_interval = stationary_interval - # FFMPEG input substitution for input in camera_config.ffmpeg.inputs: input.path = input.path.format(**FRIGATE_ENV_VARS) diff --git a/frigate/video.py b/frigate/video.py index 0f84442bf..fb0b95b60 100755 --- a/frigate/video.py +++ b/frigate/video.py @@ -515,7 +515,10 @@ def process_frames( # if there hasn't been motion for 10 frames if obj["motionless_count"] >= 10 # and it isn't due for a periodic check - and obj["motionless_count"] % detect_config.stationary_interval != 0 + and ( + detect_config.stationary_interval == 0 + or obj["motionless_count"] % detect_config.stationary_interval != 0 + ) # and it hasn't disappeared and object_tracker.disappeared[obj["id"]] == 0 # and it doesn't overlap with any current motion boxes