From 3809904ea8189070991be9a28cf86b12fc351b9d Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Fri, 1 May 2026 09:58:43 -0500 Subject: [PATCH] openvino log message and preview directory checks --- frigate/detectors/plugins/openvino.py | 6 ++++++ frigate/output/output.py | 7 +++++++ frigate/output/preview.py | 9 ++++++--- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/frigate/detectors/plugins/openvino.py b/frigate/detectors/plugins/openvino.py index f73b7cb0c..1e9fb1ab1 100644 --- a/frigate/detectors/plugins/openvino.py +++ b/frigate/detectors/plugins/openvino.py @@ -52,6 +52,12 @@ class OvDetector(DetectionApi): self.h = detector_config.model.height self.w = detector_config.model.width + logger.info( + "Loading OpenVINO model %s on device %s", + detector_config.model.path, + detector_config.device, + ) + self.runner = OpenVINOModelRunner( model_path=detector_config.model.path, device=detector_config.device, diff --git a/frigate/output/output.py b/frigate/output/output.py index 265c22621..79ef349c8 100644 --- a/frigate/output/output.py +++ b/frigate/output/output.py @@ -349,6 +349,13 @@ def move_preview_frames(loc: str) -> None: if not os.path.exists(preview_holdover): return + if not os.access(preview_holdover, os.R_OK | os.W_OK): + logger.error( + "Insufficient permissions on preview restart cache at %s", + preview_holdover, + ) + return + shutil.move(preview_holdover, preview_cache) except shutil.Error: logger.error("Failed to restore preview cache.") diff --git a/frigate/output/preview.py b/frigate/output/preview.py index 389a3c207..bf3c4bc7e 100644 --- a/frigate/output/preview.py +++ b/frigate/output/preview.py @@ -361,14 +361,17 @@ class PreviewRecorder: small_frame, cv2.COLOR_YUV2BGR_I420, ) - cv2.imwrite( - get_cache_image_name(self.camera_name, frame_time), + cache_path = get_cache_image_name(self.camera_name, frame_time) + + if not cv2.imwrite( + cache_path, small_frame, [ int(cv2.IMWRITE_WEBP_QUALITY), PREVIEW_QUALITY_WEBP[self.config.record.preview.quality], ], - ) + ): + logger.error("Failed to write preview frame to %s", cache_path) def write_data( self,