mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 09:45:22 +03:00
Disabling Camera for processes, no config changes
This commit is contained in:
parent
4c78b49743
commit
79548ff0dd
@ -250,6 +250,7 @@ class FrigateApp:
|
|||||||
def start_camera_processors(self) -> None:
|
def start_camera_processors(self) -> None:
|
||||||
model_shape = (self.config.model.height, self.config.model.width)
|
model_shape = (self.config.model.height, self.config.model.width)
|
||||||
for name, config in self.config.cameras.items():
|
for name, config in self.config.cameras.items():
|
||||||
|
if self.config.cameras[name].enabled:
|
||||||
camera_process = mp.Process(
|
camera_process = mp.Process(
|
||||||
target=track_camera,
|
target=track_camera,
|
||||||
name=f"camera_processor:{name}",
|
name=f"camera_processor:{name}",
|
||||||
@ -268,9 +269,12 @@ class FrigateApp:
|
|||||||
self.camera_metrics[name]["process"] = camera_process
|
self.camera_metrics[name]["process"] = camera_process
|
||||||
camera_process.start()
|
camera_process.start()
|
||||||
logger.info(f"Camera processor started for {name}: {camera_process.pid}")
|
logger.info(f"Camera processor started for {name}: {camera_process.pid}")
|
||||||
|
else:
|
||||||
|
logger.info(f"Camera processor not started for disabled camera {name}")
|
||||||
|
|
||||||
def start_camera_capture_processes(self) -> None:
|
def start_camera_capture_processes(self) -> None:
|
||||||
for name, config in self.config.cameras.items():
|
for name, config in self.config.cameras.items():
|
||||||
|
if self.config.cameras[name].enabled:
|
||||||
capture_process = mp.Process(
|
capture_process = mp.Process(
|
||||||
target=capture_camera,
|
target=capture_camera,
|
||||||
name=f"camera_capture:{name}",
|
name=f"camera_capture:{name}",
|
||||||
@ -280,6 +284,8 @@ class FrigateApp:
|
|||||||
self.camera_metrics[name]["capture_process"] = capture_process
|
self.camera_metrics[name]["capture_process"] = capture_process
|
||||||
capture_process.start()
|
capture_process.start()
|
||||||
logger.info(f"Capture process started for {name}: {capture_process.pid}")
|
logger.info(f"Capture process started for {name}: {capture_process.pid}")
|
||||||
|
else:
|
||||||
|
logger.info(f"Capture process not started for disabled camera {name}")
|
||||||
|
|
||||||
def start_event_processor(self) -> None:
|
def start_event_processor(self) -> None:
|
||||||
self.event_processor = EventProcessor(
|
self.event_processor = EventProcessor(
|
||||||
|
|||||||
@ -823,10 +823,6 @@ class FrigateConfig(FrigateBaseModel):
|
|||||||
{"name": name, **merged_config}
|
{"name": name, **merged_config}
|
||||||
)
|
)
|
||||||
|
|
||||||
if not camera_config.enabled:
|
|
||||||
config.cameras.pop(name)
|
|
||||||
continue
|
|
||||||
|
|
||||||
# Default max_disappeared configuration
|
# Default max_disappeared configuration
|
||||||
max_disappeared = camera_config.detect.fps * 5
|
max_disappeared = camera_config.detect.fps * 5
|
||||||
if camera_config.detect.max_disappeared is None:
|
if camera_config.detect.max_disappeared is None:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user