NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
Use review item thumbnail for export (#12998)
Nicolas Mowen2cb81ef1160c
diff --git a/frigate/api/export.py b/frigate/api/export.pyindex 92313addee..0993a3a876 100644--- a/frigate/api/export.py+++ b/frigate/api/export.py@@ -55,6 +55,8 @@ def export_recording(camera_name: str, start_time, end_time):401,)+ existing_image = json.get("image_path")+recordings_count = (Recordings.select().where(@@ -78,6 +80,7 @@ def export_recording(camera_name: str, start_time, end_time):current_app.frigate_config,camera_name,friendly_name,+ existing_image,int(start_time),int(end_time),(diff --git a/frigate/record/export.py b/frigate/record/export.pyindex d3eefc9b25..feb96f01f8 100644--- a/frigate/record/export.py+++ b/frigate/record/export.py@@ -10,6 +10,7 @@ import subprocess as spimport threadingfrom enum import Enumfrom pathlib import Path+from typing import Optionalfrom peewee import DoesNotExist@@ -49,7 +50,8 @@ class RecordingExporter(threading.Thread):self,config: FrigateConfig,camera: str,- name: str,+ name: Optional[str],+ image: Optional[str],start_time: int,end_time: int,playback_factor: PlaybackFactorEnum,@@ -58,6 +60,7 @@ class RecordingExporter(threading.Thread):self.config = configself.camera = cameraself.user_provided_name = name+ self.user_provided_image = imageself.start_time = start_timeself.end_time = end_timeself.playback_factor = playback_factor@@ -72,6 +75,12 @@ class RecordingExporter(threading.Thread):def save_thumbnail(self, id: str) -> str:thumb_path = os.path.join(CLIPS_DIR, f"export/{id}.webp")+ if self.user_provided_image is not None and os.path.isfile(+ self.user_provided_image+ ):+ shutil.copy(self.user_provided_image, thumb_path)+ return thumb_path+if (self.start_time< datetime.datetime.now(datetime.timezone.utc)diff --git a/web/src/views/events/EventView.tsx b/web/src/views/events/EventView.tsxindex f3b2395f83..3ca187a38b 100644--- a/web/src/views/events/EventView.tsx+++ b/web/src/views/events/EventView.tsx@@ -190,7 +190,7 @@ export default function EventView({axios.post(`export/${review.camera}/start/${review.start_time - REVIEW_PADDING}/end/${endTime}`,- { playback: "realtime" },+ { playback: "realtime", image_path: review.thumb_path },).then((response) => {if (response.status == 200) {