mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
handle exception when frame isnt in cache
This commit is contained in:
parent
e32e69c2d0
commit
bb4f79cdfe
@ -183,7 +183,11 @@ class TrackedObject():
|
|||||||
if self.thumbnail_data is None:
|
if self.thumbnail_data is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
best_frame = cv2.cvtColor(self.frame_cache[self.thumbnail_data['frame_time']], cv2.COLOR_YUV2BGR_I420)
|
try:
|
||||||
|
best_frame = cv2.cvtColor(self.frame_cache[self.thumbnail_data['frame_time']], cv2.COLOR_YUV2BGR_I420)
|
||||||
|
except KeyError:
|
||||||
|
logger.warning(f"Unable to create jpg because frame {self.thumbnail_data['frame_time']} is not in the cache")
|
||||||
|
return None
|
||||||
|
|
||||||
if bounding_box:
|
if bounding_box:
|
||||||
thickness = 2
|
thickness = 2
|
||||||
|
Loading…
Reference in New Issue
Block a user