Fix birdseye opening and not closing frames (#13553)

This commit is contained in:
Nicolas Mowen 2024-09-04 08:25:00 -06:00 committed by GitHub
parent ddf9163c47
commit 055f0dfc22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View File

@ -357,8 +357,9 @@ class BirdsEyeFrameManager:
frame = None
channel_dims = None
else:
frame_id = f"{camera}{frame_time}"
frame = self.frame_manager.get(
f"{camera}{frame_time}", self.config.cameras[camera].frame_shape_yuv
frame_id, self.config.cameras[camera].frame_shape_yuv
)
if frame is None:
@ -375,6 +376,8 @@ class BirdsEyeFrameManager:
channel_dims,
)
self.frame_manager.close(frame_id)
def camera_active(self, mode, object_box_count, motion_box_count):
if mode == BirdseyeModeEnum.continuous:
return True
@ -716,7 +719,6 @@ class Birdseye:
def __init__(
self,
config: FrigateConfig,
frame_manager: SharedMemoryFrameManager,
stop_event: mp.Event,
websocket_server,
) -> None:
@ -736,6 +738,7 @@ class Birdseye:
self.broadcaster = BroadcastThread(
"birdseye", self.converter, websocket_server, stop_event
)
frame_manager = SharedMemoryFrameManager()
self.birdseye_manager = BirdsEyeFrameManager(config, frame_manager, stop_event)
self.config_subscriber = ConfigSubscriber("config/birdseye/")

View File

@ -76,7 +76,7 @@ def output_frames(
preview_write_times[camera] = 0
if config.birdseye.enabled:
birdseye = Birdseye(config, frame_manager, stop_event, websocket_server)
birdseye = Birdseye(config, stop_event, websocket_server)
websocket_thread.start()