mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
handle onvif connection failure in autotrack init (#8838)
* handle onvif connection failure in autotrack init * remove whitespace and add consistency * error message consistency * more consistency
This commit is contained in:
parent
f27025aef3
commit
cc5297f180
@ -238,32 +238,40 @@ class PtzAutoTracker:
|
|||||||
self.move_queues[camera] = queue.Queue()
|
self.move_queues[camera] = queue.Queue()
|
||||||
self.move_queue_locks[camera] = threading.Lock()
|
self.move_queue_locks[camera] = threading.Lock()
|
||||||
|
|
||||||
if not self.onvif.cams[camera]["init"]:
|
# handle onvif constructor failing due to no connection
|
||||||
if not self.onvif._init_onvif(camera):
|
if camera not in self.onvif.cams:
|
||||||
logger.warning(f"Unable to initialize onvif for {camera}")
|
logger.warning(
|
||||||
|
f"Disabling autotracking for {camera}: onvif connection failed"
|
||||||
|
)
|
||||||
camera_config.onvif.autotracking.enabled = False
|
camera_config.onvif.autotracking.enabled = False
|
||||||
self.ptz_metrics[camera]["ptz_autotracker_enabled"].value = False
|
self.ptz_metrics[camera]["ptz_autotracker_enabled"].value = False
|
||||||
|
return
|
||||||
|
|
||||||
|
if not self.onvif.cams[camera]["init"]:
|
||||||
|
if not self.onvif._init_onvif(camera):
|
||||||
|
logger.warning(
|
||||||
|
f"Disabling autotracking for {camera}: Unable to initialize onvif"
|
||||||
|
)
|
||||||
|
camera_config.onvif.autotracking.enabled = False
|
||||||
|
self.ptz_metrics[camera]["ptz_autotracker_enabled"].value = False
|
||||||
return
|
return
|
||||||
|
|
||||||
if "pt-r-fov" not in self.onvif.cams[camera]["features"]:
|
if "pt-r-fov" not in self.onvif.cams[camera]["features"]:
|
||||||
camera_config.onvif.autotracking.enabled = False
|
|
||||||
self.ptz_metrics[camera]["ptz_autotracker_enabled"].value = False
|
|
||||||
logger.warning(
|
logger.warning(
|
||||||
f"Disabling autotracking for {camera}: FOV relative movement not supported"
|
f"Disabling autotracking for {camera}: FOV relative movement not supported"
|
||||||
)
|
)
|
||||||
|
camera_config.onvif.autotracking.enabled = False
|
||||||
|
self.ptz_metrics[camera]["ptz_autotracker_enabled"].value = False
|
||||||
return
|
return
|
||||||
|
|
||||||
movestatus_supported = self.onvif.get_service_capabilities(camera)
|
movestatus_supported = self.onvif.get_service_capabilities(camera)
|
||||||
|
|
||||||
if movestatus_supported is None or movestatus_supported.lower() != "true":
|
if movestatus_supported is None or movestatus_supported.lower() != "true":
|
||||||
camera_config.onvif.autotracking.enabled = False
|
|
||||||
self.ptz_metrics[camera]["ptz_autotracker_enabled"].value = False
|
|
||||||
logger.warning(
|
logger.warning(
|
||||||
f"Disabling autotracking for {camera}: ONVIF MoveStatus not supported"
|
f"Disabling autotracking for {camera}: ONVIF MoveStatus not supported"
|
||||||
)
|
)
|
||||||
|
camera_config.onvif.autotracking.enabled = False
|
||||||
|
self.ptz_metrics[camera]["ptz_autotracker_enabled"].value = False
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.onvif.cams[camera]["init"]:
|
if self.onvif.cams[camera]["init"]:
|
||||||
|
Loading…
Reference in New Issue
Block a user