mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-01 19:17:41 +03:00
Dynamically set extra config pieces
This commit is contained in:
parent
3f6969fe3f
commit
427fe05bac
@ -277,7 +277,9 @@ class FrigateApp:
|
|||||||
"synchronous": "NORMAL", # Safe when using WAL https://www.sqlite.org/pragma.html#pragma_synchronous
|
"synchronous": "NORMAL", # Safe when using WAL https://www.sqlite.org/pragma.html#pragma_synchronous
|
||||||
},
|
},
|
||||||
timeout=max(
|
timeout=max(
|
||||||
60, 10 * len([c for c in self.config.cameras.values() if c.enabled])
|
60,
|
||||||
|
10
|
||||||
|
* len([c for c in self.config.cameras.values() if c.enabled_in_config]),
|
||||||
),
|
),
|
||||||
load_vec_extension=self.config.semantic_search.enabled,
|
load_vec_extension=self.config.semantic_search.enabled,
|
||||||
)
|
)
|
||||||
@ -307,7 +309,9 @@ class FrigateApp:
|
|||||||
|
|
||||||
def init_embeddings_client(self) -> None:
|
def init_embeddings_client(self) -> None:
|
||||||
genai_cameras = [
|
genai_cameras = [
|
||||||
c for c in self.config.cameras.values() if c.enabled and c.genai.enabled
|
c
|
||||||
|
for c in self.config.cameras.values()
|
||||||
|
if c.enabled_in_config and c.genai.enabled
|
||||||
]
|
]
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
"""Create and maintain camera processes / management."""
|
"""Create and maintain camera processes / management."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import multiprocessing as mp
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import threading
|
import threading
|
||||||
@ -115,12 +116,23 @@ class CameraMaintainer(threading.Thread):
|
|||||||
|
|
||||||
return shm_frame_count
|
return shm_frame_count
|
||||||
|
|
||||||
def __start_camera_processor(self, name: str, config: CameraConfig) -> None:
|
def __start_camera_processor(
|
||||||
config = self.config.cameras[name]
|
self, name: str, config: CameraConfig, runtime: bool = False
|
||||||
|
) -> None:
|
||||||
if not config.enabled_in_config:
|
if not config.enabled_in_config:
|
||||||
logger.info(f"Camera processor not started for disabled camera {name}")
|
logger.info(f"Camera processor not started for disabled camera {name}")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if runtime:
|
||||||
|
self.detection_out_events[name] = mp.Event()
|
||||||
|
self.camera_metrics[name] = CameraMetrics()
|
||||||
|
self.ptz_metrics[name] = PTZMetrics(autotracker_enabled=False)
|
||||||
|
self.region_grids[name] = get_camera_regions_grid(
|
||||||
|
name,
|
||||||
|
config.detect,
|
||||||
|
max(self.config.model.width, self.config.model.height),
|
||||||
|
)
|
||||||
|
|
||||||
camera_process = FrigateProcess(
|
camera_process = FrigateProcess(
|
||||||
target=track_camera,
|
target=track_camera,
|
||||||
name=f"camera_processor:{name}",
|
name=f"camera_processor:{name}",
|
||||||
@ -192,7 +204,9 @@ class CameraMaintainer(threading.Thread):
|
|||||||
|
|
||||||
for update_type, update_config in updates:
|
for update_type, update_config in updates:
|
||||||
if update_type == GlobalConfigUpdateEnum.add_camera:
|
if update_type == GlobalConfigUpdateEnum.add_camera:
|
||||||
self.__start_camera_processor(update_config.name, update_config)
|
self.__start_camera_processor(
|
||||||
|
update_config.name, update_config, runtime=True
|
||||||
|
)
|
||||||
self.__start_camera_capture(update_config.name, update_config)
|
self.__start_camera_capture(update_config.name, update_config)
|
||||||
elif update_type == GlobalConfigUpdateEnum.debug_camera:
|
elif update_type == GlobalConfigUpdateEnum.debug_camera:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user