NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
Lower timeout in object processing (#17970)
Josh Hawkins96d89eb50c04
diff --git a/frigate/const.py b/frigate/const.pyindex cf04ce7b2c..183506a04b 100644--- a/frigate/const.py+++ b/frigate/const.py@@ -129,3 +129,7 @@ AUTOTRACKING_ZOOM_EDGE_THRESHOLD = 0.05JWT_SECRET_ENV_VAR = "FRIGATE_JWT_SECRET"PASSWORD_HASH_ALGORITHM = "pbkdf2_sha256"++# Queues++FAST_QUEUE_TIMEOUT = 0.00001 # secondsdiff --git a/frigate/record/maintainer.py b/frigate/record/maintainer.pyindex 9f08f88a90..25783965c1 100644--- a/frigate/record/maintainer.py+++ b/frigate/record/maintainer.py@@ -27,6 +27,7 @@ from frigate.config import FrigateConfig, RetainModeEnumfrom frigate.const import (CACHE_DIR,CACHE_SEGMENT_FORMAT,+ FAST_QUEUE_TIMEOUT,INSERT_MANY_RECORDINGS,MAX_SEGMENT_DURATION,MAX_SEGMENTS_IN_CACHE,@@ -38,8 +39,6 @@ from frigate.util.services import get_video_propertieslogger = logging.getLogger(__name__)-QUEUE_READ_TIMEOUT = 0.00001 # seconds-class SegmentInfo:def __init__(@@ -536,7 +535,7 @@ class RecordingMaintainer(threading.Thread):# empty the object recordings info queuewhile True:(topic, data) = self.detection_subscriber.check_for_update(- timeout=QUEUE_READ_TIMEOUT+ timeout=FAST_QUEUE_TIMEOUT)if not topic:diff --git a/frigate/track/object_processing.py b/frigate/track/object_processing.pyindex 35bca4d5e9..702df32bd9 100644--- a/frigate/track/object_processing.py+++ b/frigate/track/object_processing.py@@ -28,7 +28,7 @@ from frigate.config import (RecordConfig,SnapshotsConfig,)-from frigate.const import UPDATE_CAMERA_ACTIVITY+from frigate.const import FAST_QUEUE_TIMEOUT, UPDATE_CAMERA_ACTIVITYfrom frigate.events.types import EventStateEnum, EventTypeEnumfrom frigate.models import Event, Timelinefrom frigate.track.tracked_object import TrackedObject@@ -682,7 +682,9 @@ class TrackedObjectProcessor(threading.Thread):# cleanup event finished queuewhile not self.stop_event.is_set():- update = self.event_end_subscriber.check_for_update(timeout=0.01)+ update = self.event_end_subscriber.check_for_update(+ timeout=FAST_QUEUE_TIMEOUT+ )if not update:break