Explorar el Código

handle exception when missing frame

Blake Blackshear hace 3 años
padre
commit
19115fb828
Se han modificado 1 ficheros con 10 adiciones y 3 borrados
  1. 10 3
      frigate/output.py

+ 10 - 3
frigate/output.py

@@ -159,9 +159,16 @@ class BirdsEyeFrameManager:
             frame = None
             channel_dims = None
         else:
-            frame = self.frame_manager.get(
-                f"{camera}{frame_time}", self.config.cameras[camera].frame_shape_yuv
-            )
+            try:
+                frame = self.frame_manager.get(
+                    f"{camera}{frame_time}", self.config.cameras[camera].frame_shape_yuv
+                )
+            except FileNotFoundError:
+                # TODO: better frame management would prevent this edge case
+                logger.warning(
+                    f"Unable to copy frame {camera}{frame_time} to birdseye."
+                )
+                return
             channel_dims = self.cameras[camera]["channel_dims"]
 
         copy_yuv_to_position(