fix crash when dynamically adding cameras

depending on where we are in the update loop, camera configs might not be updated yet and we are receiving detections already
This commit is contained in:
Josh Hawkins 2025-12-24 08:10:04 -06:00
parent 8b7cc127bf
commit 0f9f9bc443
2 changed files with 5 additions and 3 deletions

View File

@ -633,7 +633,7 @@ class EmbeddingMaintainer(threading.Thread):
camera, frame_name, _, _, motion_boxes, _ = data
if not camera or len(motion_boxes) == 0:
if not camera or len(motion_boxes) == 0 or camera not in self.config.cameras:
return
camera_config = self.config.cameras[camera]

View File

@ -139,9 +139,11 @@ class OutputProcess(FrigateProcess):
if CameraConfigUpdateEnum.add in updates:
for camera in updates["add"]:
jsmpeg_cameras[camera] = JsmpegCamera(
cam_config, self.stop_event, websocket_server
self.config.cameras[camera], self.stop_event, websocket_server
)
preview_recorders[camera] = PreviewRecorder(
self.config.cameras[camera]
)
preview_recorders[camera] = PreviewRecorder(cam_config)
preview_write_times[camera] = 0
if (