mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-01 17:41:13 +03:00
skip new-object frame cache write when current_frame is unavailable
This commit is contained in:
parent
0495d995f5
commit
39f4bd61c8
@ -332,14 +332,18 @@ class CameraState:
|
|||||||
current_detections[id],
|
current_detections[id],
|
||||||
)
|
)
|
||||||
|
|
||||||
# add initial frame to frame cache
|
# Skip caching when the frame buffer isn't readable — e.g.
|
||||||
logger.debug(
|
# frame_manager.get returned None because the SHM segment was
|
||||||
f"{self.name}: New object, adding {frame_time} to frame cache for {id}"
|
# unlinked or hasn't been recreated yet during a camera
|
||||||
)
|
# add/remove cycle.
|
||||||
self.frame_cache[frame_time] = {
|
if current_frame is not None:
|
||||||
"frame": np.copy(current_frame), # type: ignore[arg-type]
|
logger.debug(
|
||||||
"object_id": id,
|
f"{self.name}: New object, adding {frame_time} to frame cache for {id}"
|
||||||
}
|
)
|
||||||
|
self.frame_cache[frame_time] = {
|
||||||
|
"frame": np.copy(current_frame),
|
||||||
|
"object_id": id,
|
||||||
|
}
|
||||||
|
|
||||||
# save initial thumbnail data and best object
|
# save initial thumbnail data and best object
|
||||||
thumbnail_data = {
|
thumbnail_data = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user