handle exception when missing frame

This commit is contained in:
Blake Blackshear 2021-07-16 07:28:30 -05:00
parent 16ef432228
commit 19115fb828

View File

@ -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(