forked from Github/frigate
Support Controlling PTZ Cameras Via WebUI (#4715)
* Add support for ptz commands via websocket * Fix startup issues * Fix bugs * Set config manually * Add more commands * Add presets * Add zooming * Fixes * Set name * Cleanup * Add ability to set presets from UI * Add ability to set preset from UI * Cleanup for errors * Ui tweaks * Add visual design for pan / tilt * Add pan/tilt support * Support zooming * Try to set wsdl * Fix duplicate logs * Catch auth errors * Don't init onvif for disabled cameras * Fix layout sizing * Don't comment out * Fix formatting * Add ability to control camera with keyboard shortcuts * Disallow user selection * Fix mobile pressing * Remove logs * Substitute onvif password * Add ptz controls ot birdseye * Put wsdl back * Add padding * Formatting * Catch onvif error * Optimize layout for mobile and web * Place ptz controls next to birdseye view in large layout * Fix pt support * Center text titles * Update tests * Update docs * Write camera docs for PTZ * Add MQTT docs for PTZ * Add ptz info docs for http * Fix test * Make half width when full screen * Fix preset panel logic * Fix parsing * Update mqtt.md * Catch preset error * Add onvif example to docs * Remove template example from main camera docs
This commit is contained in:
@@ -125,6 +125,13 @@ class MqttConfig(FrigateBaseModel):
|
||||
return v
|
||||
|
||||
|
||||
class OnvifConfig(FrigateBaseModel):
|
||||
host: str = Field(default="", title="Onvif Host")
|
||||
port: int = Field(default=8000, title="Onvif Port")
|
||||
user: Optional[str] = Field(title="Onvif Username")
|
||||
password: Optional[str] = Field(title="Onvif Password")
|
||||
|
||||
|
||||
class RetainModeEnum(str, Enum):
|
||||
all = "all"
|
||||
motion = "motion"
|
||||
@@ -607,6 +614,9 @@ class CameraConfig(FrigateBaseModel):
|
||||
detect: DetectConfig = Field(
|
||||
default_factory=DetectConfig, title="Object detection configuration."
|
||||
)
|
||||
onvif: OnvifConfig = Field(
|
||||
default_factory=OnvifConfig, title="Camera Onvif Configuration."
|
||||
)
|
||||
ui: CameraUiConfig = Field(
|
||||
default_factory=CameraUiConfig, title="Camera UI Modifications."
|
||||
)
|
||||
@@ -939,6 +949,15 @@ class FrigateConfig(FrigateBaseModel):
|
||||
for input in camera_config.ffmpeg.inputs:
|
||||
input.path = input.path.format(**FRIGATE_ENV_VARS)
|
||||
|
||||
# ONVIF substitution
|
||||
if camera_config.onvif.user or camera_config.onvif.password:
|
||||
camera_config.onvif.user = camera_config.onvif.user.format(
|
||||
**FRIGATE_ENV_VARS
|
||||
)
|
||||
camera_config.onvif.password = camera_config.onvif.password.format(
|
||||
**FRIGATE_ENV_VARS
|
||||
)
|
||||
|
||||
# Add default filters
|
||||
object_keys = camera_config.objects.track
|
||||
if camera_config.objects.filters is None:
|
||||
|
||||
Reference in New Issue
Block a user