Browse Source

default periodic checks to never

Blake Blackshear 3 years ago
parent
commit
c6445898ce
2 changed files with 6 additions and 7 deletions
  1. 2 6
      frigate/config.py
  2. 4 1
      frigate/video.py

+ 2 - 6
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)

+ 4 - 1
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