Skip to content

Commit

Permalink
set stationary_threshold default to 5x fps
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeblackshear committed Feb 19, 2022
1 parent e78662b commit 190f217
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/docs/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion frigate/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -771,6 +770,11 @@ def runtime_config(self) -> FrigateConfig:
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)
Expand Down

0 comments on commit 190f217

Please sign in to comment.