NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
Add more debug logs for preview and output (#14833)
Nicolas Mowen2eb5fbf1126f
diff --git a/frigate/output/output.py b/frigate/output/output.pyindex 7d5b6d39a8..1859ebd69f 100644--- a/frigate/output/output.py+++ b/frigate/output/output.py@@ -63,6 +63,7 @@ def output_frames(birdseye: Optional[Birdseye] = Nonepreview_recorders: dict[str, PreviewRecorder] = {}preview_write_times: dict[str, float] = {}+ failed_frame_requests: dict[str, int] = {}move_preview_frames("cache")@@ -99,7 +100,16 @@ def output_frames(if frame is None:logger.debug(f"Failed to get frame {frame_id} from SHM")+ failed_frame_requests[camera] = failed_frame_requests.get(camera, 0) + 1++ if failed_frame_requests[camera] > config.cameras[camera].detect.fps:+ logger.warning(+ f"Failed to retrieve many frames for {camera} from SHM, consider increasing SHM size if this continues."+ )+continue+ else:+ failed_frame_requests[camera] = 0# send camera frame to ffmpeg process if websockets are connectedif any(diff --git a/frigate/output/preview.py b/frigate/output/preview.pyindex a8915f688a..9eae6b7dea 100644--- a/frigate/output/preview.py+++ b/frigate/output/preview.py@@ -154,6 +154,7 @@ class PreviewRecorder:self.start_time = 0self.last_output_time = 0self.output_frames = []+if config.detect.width > config.detect.height:self.out_height = PREVIEW_HEIGHTself.out_width = (@@ -274,7 +275,7 @@ class PreviewRecorder:return False- def write_frame_to_cache(self, frame_time: float, frame) -> None:+ def write_frame_to_cache(self, frame_time: float, frame: np.ndarray) -> None:# resize yuv framesmall_frame = np.zeros((self.out_height * 3 // 2, self.out_width), np.uint8)copy_yuv_to_position(@@ -303,7 +304,7 @@ class PreviewRecorder:current_tracked_objects: list[dict[str, any]],motion_boxes: list[list[int]],frame_time: float,- frame,+ frame: np.ndarray,) -> bool:# check for updated record config_, updated_record_config = self.config_subscriber.check_for_update()@@ -332,6 +333,10 @@ class PreviewRecorder:self.output_frames,self.requestor,).start()+ else:+ logger.debug(+ f"Not saving preview for {self.config.name} because there are no saved frames."+ )# reset frame cacheself.segment_end = (