default periodic checks to never

This commit is contained in:
Blake Blackshear 2022-02-05 07:19:15 -06:00
parent f1ddd0e6f7
commit c6445898ce
2 changed files with 6 additions and 7 deletions

View File

@ -171,8 +171,9 @@ class DetectConfig(FrigateBaseModel):
title="Maximum number of frames the object can dissapear before detection ends." title="Maximum number of frames the object can dissapear before detection ends."
) )
stationary_interval: Optional[int] = Field( stationary_interval: Optional[int] = Field(
default=0,
title="Frame interval for checking stationary objects.", 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: if camera_config.detect.max_disappeared is None:
camera_config.detect.max_disappeared = max_disappeared 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 # FFMPEG input substitution
for input in camera_config.ffmpeg.inputs: for input in camera_config.ffmpeg.inputs:
input.path = input.path.format(**FRIGATE_ENV_VARS) input.path = input.path.format(**FRIGATE_ENV_VARS)

View File

@ -515,7 +515,10 @@ def process_frames(
# if there hasn't been motion for 10 frames # if there hasn't been motion for 10 frames
if obj["motionless_count"] >= 10 if obj["motionless_count"] >= 10
# and it isn't due for a periodic check # 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 it hasn't disappeared
and object_tracker.disappeared[obj["id"]] == 0 and object_tracker.disappeared[obj["id"]] == 0
# and it doesn't overlap with any current motion boxes # and it doesn't overlap with any current motion boxes