Skip to content

NVR with realtime local object detection for IP cameras

Always save previews in UTC offset (#11629)

Nicolas Mowen9fc22efa2d57
diff --git a/frigate/output/preview.py b/frigate/output/preview.py
index c64591b6eb..7b89a07e04 100644
--- a/frigate/output/preview.py
+++ b/frigate/output/preview.py
@@ -180,6 +180,7 @@ class PreviewRecorder:
# end segment at end of hour
self.segment_end = (
(datetime.datetime.now() + datetime.timedelta(hours=1))
+ .astimezone(datetime.timezone.utc)
.replace(minute=0, second=0, microsecond=0)
.timestamp()
)
@@ -192,6 +193,7 @@ class PreviewRecorder:
# check for existing items in cache
start_ts = (
datetime.datetime.now()
+ .astimezone(datetime.timezone.utc)
.replace(minute=0, second=0, microsecond=0)
.timestamp()
)
@@ -300,6 +302,7 @@ class PreviewRecorder:
# reset frame cache
self.segment_end = (
(datetime.datetime.now() + datetime.timedelta(hours=1))
+ .astimezone(datetime.timezone.utc)
.replace(minute=0, second=0, microsecond=0)
.timestamp()
)