Skip to content

Instantly share code, notes, and snippets.

@hawkeye217
Last active March 20, 2025 18:44
Show Gist options
  • Save hawkeye217/152a1d4ba80760dac95d46e143d37112 to your computer and use it in GitHub Desktop.
Save hawkeye217/152a1d4ba80760dac95d46e143d37112 to your computer and use it in GitHub Desktop.
Check if an ONVIF-capable IP PTZ camera supports RelativeMove with FOV
# This script can help you determine if your PTZ is capable of
# working with Frigate NVR's autotracker.
#
# Cameras with a "YES" printed for each parameter at the end of
# the output will likely be supported by Frigate.
#
# Make sure you're using python3 with the onvif-zeep package
# Update the values for your camera below, then run:
# pip3 install onvif-zeep
# python3 ./fovtest.py
from onvif import ONVIFCamera
# UPDATE the IP address, ONVIF port, "admin" and "password" with your camera's details.
mycam = ONVIFCamera('192.168.1.100', 80, 'admin', 'password', '/etc/onvif/wsdl/')
print('Connected to ONVIF camera')
# Create media service object
media = mycam.create_media_service()
print('Created media service object')
print
# Get target profile
media_profiles = media.GetProfiles()
print('Media profiles')
print(media_profiles)
for key, onvif_profile in enumerate(media_profiles):
if (
not onvif_profile.VideoEncoderConfiguration
or onvif_profile.VideoEncoderConfiguration.Encoding != "H264"
):
continue
# Configure PTZ options
if onvif_profile.PTZConfiguration:
if onvif_profile.PTZConfiguration.DefaultContinuousPanTiltVelocitySpace is not None:
media_profile = onvif_profile
token = media_profile.token
print('Chosen token')
print(token)
print
# Create ptz service object
print('Creating PTZ object')
ptz = mycam.create_ptz_service()
print('Created PTZ service object')
print
# Get PTZ configuration options for getting option ranges
request = ptz.create_type("GetConfigurations")
configs = ptz.GetConfigurations(request)[0]
print('PTZ configurations:')
print(configs)
print()
request = ptz.create_type('GetConfigurationOptions')
request.ConfigurationToken = media_profile.PTZConfiguration.token
ptz_configuration_options = ptz.GetConfigurationOptions(request)
print('PTZ configuration options:')
print(ptz_configuration_options)
print()
print('PTZ service capabilities:')
request = ptz.create_type('GetServiceCapabilities')
service_capabilities = ptz.GetServiceCapabilities(request)
print(service_capabilities)
print()
print('PTZ status:')
request = ptz.create_type("GetStatus")
request.ProfileToken = token
status = ptz.GetStatus(request)
print(status)
pantilt_space_id = next(
(
i
for i, space in enumerate(
ptz_configuration_options.Spaces.RelativePanTiltTranslationSpace
)
if "TranslationSpaceFov" in space["URI"]
),
None,
)
zoom_space_id = next(
(
i
for i, space in enumerate(
ptz_configuration_options.Spaces.RelativeZoomTranslationSpace
)
if "TranslationGenericSpace" in space["URI"]
),
None,
)
def find_by_key(dictionary, target_key):
if target_key in dictionary:
return dictionary[target_key]
else:
for value in dictionary.values():
if isinstance(value, dict):
result = find_by_key(value, target_key)
if result is not None:
return result
return None
if find_by_key(vars(service_capabilities), "MoveStatus"):
print("YES - GetServiceCapabilities shows that the camera supports MoveStatus.")
else:
print("NO - GetServiceCapabilities shows that the camera does not support MoveStatus.")
# there doesn't seem to be an onvif standard with this optional parameter
# some cameras can report MoveStatus with or without PanTilt or Zoom attributes
pan_tilt_status = getattr(status.MoveStatus, "PanTilt", None)
zoom_status = getattr(status.MoveStatus, "Zoom", None)
if pan_tilt_status is not None and pan_tilt_status == "IDLE" and (
zoom_status is None or zoom_status == "IDLE"
):
print("YES - MoveStatus is reporting IDLE.")
# if it's not an attribute, see if MoveStatus even exists in the status result
if pan_tilt_status is None:
pan_tilt_status = getattr(status.MoveStatus, "MoveStatus", None)
# we're unsupported
if pan_tilt_status is None or (isinstance(pan_tilt_status, str) and pan_tilt_status not in [
"IDLE",
"MOVING",
]):
print("NO - MoveStatus not reporting IDLE or MOVING.")
if pantilt_space_id is not None and configs.DefaultRelativePanTiltTranslationSpace is not None:
print("YES - RelativeMove Pan/Tilt (FOV) is supported.")
else:
print("NO - RelativeMove Pan/Tilt is unsupported.")
if zoom_space_id is not None:
print("YES - RelativeMove Zoom is supported.")
else:
print("NO - RelativeMove Zoom is unsupported.")
@hawkeye217
Copy link
Author

A user recently posted above this with a similar error on a low-end Dahua. I bet yours is similar in that it does not have the necessary features to support autotracking.

@klipper-vp
Copy link

klipper-vp commented Aug 29, 2024

How is this script implemented on the frigate?
Or is it just to see if the camera is compatible with the frigate NVR? I tested it on my camera and everything went well, but I don't know how to make it work on the frigate..

exe log:
PTZ status:
{
'Position': {
'PanTilt': {
'x': 1998.7,
'y': 60.0,
'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace'
},
'Zoom': {
'x': 1.0,
'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace'
}
},
'MoveStatus': {
'PanTilt': 'IDLE',
'Zoom': 'IDLE'
},
'Error': None,
'UtcTime': datetime.datetime(2024, 8, 29, 20, 52, 16, tzinfo=<isodate.tzinfo.Utc object at 0xf46df310>), '_value_1': None, '_attr_1': None } YES - GetServiceCapabilities shows that the camera supports MoveStatus.
YES - MoveStatus is reporting IDLE.
YES - RelativeMove Pan/Tilt (FOV) is supported.
YES - RelativeMove Zoom is supported.

@hawkeye217
Copy link
Author

See the Frigate docs. This script just tests for the correct ONVIF support for Frigate's autotracking.

@klipper-vp
Copy link

Muito obrigado mesmo, pelo logs da minha camera e para funcionar?
Thank you very much indeed, for the logs of my camera and for it to work?

@CancunManny
Copy link

When I run the script I get the following response, does that mean my camera wouldn't work, or does it mean code not working prpoperly? I didn't get any yes or no;s.

Traceback (most recent call last):
  File "/home/manny/Downloads/./fovtest.py", line 15, in <module>
    mycam = ONVIFCamera('http://10.69.69.10', 80, 'myuser', 'mypw', '/etc/onvif/wsdl/')
  File "/usr/local/lib/python3.10/dist-packages/onvif/client.py", line 216, in __init__
    self.update_xaddrs()
  File "/usr/local/lib/python3.10/dist-packages/onvif/client.py", line 223, in update_xaddrs
    self.devicemgmt  = self.create_devicemgmt_service()
  File "/usr/local/lib/python3.10/dist-packages/onvif/client.py", line 333, in create_devicemgmt_service
    return self.create_onvif_service('devicemgmt', from_template)
  File "/usr/local/lib/python3.10/dist-packages/onvif/client.py", line 312, in create_onvif_service
    xaddr, wsdl_file, binding_name = self.get_definition(name, portType)
  File "/usr/local/lib/python3.10/dist-packages/onvif/client.py", line 292, in get_definition
    raise ONVIFError('No such file: %s' % wsdlpath)
onvif.exceptions.ONVIFError: Unknown error: No such file: /etc/onvif/wsdl/devicemgmt.wsdl```

@hawkeye217
Copy link
Author

You need to specify the correct wsdl directory location, not every installation of python's onvif-zeep package places it in /etc/onvif/wsdl. However, if you don't want to use the script, you can set up autotracking in Frigate according to the docs and the logs will indicate whether your camera is supported or not.

@CancunManny
Copy link

CancunManny commented Sep 21, 2024

@hawkeye217 Thank you for the quick reply. I have an old LaView cam (over 7 years old), which later I found out is a generic camera sold under different brands. Some years back I had zoneminder as my DVR. It took me a while to get the pan/tilt working but if I remember correctly I was able to use hikvision's profile to get it to work.

Today, after I left the comment here I found that I could set up pan/tilt without autotracking. On my config files I added the following

    onvif:
      host: 10.0.10.10
      port: 8000
      user: admin
      password: password

I did put in the correct ip, user and pw. After I restarted frigate it started but buggy. When I went to the pan/tilt camera it would show the controls box underneath the video "loading", but nothing would load. If I clicked on anything to get out of the screen the url on the browser would change, but not the display. I would have to reload the page to be able to get out of that camera view.

I then went into the camera configuration and verified port 8000 was setup as server on the camera. I am guessing that camera isn't onvif compatible, and zoneminder was using a different method to control the camera.

@hawkeye217
Copy link
Author

Most likely zoneminder was using the Hikvision ISAPI, which is different than ONVIF.

@proosth
Copy link

proosth commented Sep 24, 2024

in the frigate web UI with m

Great info. Thank you. I've got the same camera and PTZ is now working in Frigate.

Did you get the "auto tracking" feature working with this PTZ camera in Frigate?

@ltomes
Copy link

ltomes commented Oct 15, 2024

You need to specify the correct wsdl directory location, not every installation of python's onvif-zeep package places it in /etc/onvif/wsdl. However, if you don't want to use the script, you can set up autotracking in Frigate according to the docs and the logs will indicate whether your camera is supported or not.

I'm running into this issue right now, if I compile onvif-zeep will it generate the correct wsdls/directory?
I've tried running this script from a venv in ubuntu, pengwin (wsl), and windows 11 and have not found the proper wsdl directory in any of those hosts yet.

@cm0002
Copy link

cm0002 commented Dec 7, 2024

I have a Panasonic WV-X6531n 40x and ran the script to check the autotrack compatibility and I got 3 Yes' and a No lol

YES - GetServiceCapabilities shows that the camera supports MoveStatus.
YES - MoveStatus is reporting IDLE.
NO - RelativeMove Pan/Tilt is unsupported.
YES - RelativeMove Zoom is supported.

Which seems weird to me, ""RelativeMove Zoom" can be supported without "RelativeMove Pan/Tilt"? Or is something off here? For reference, all manual PTZ control work fine

@hawkeye217
Copy link
Author

Relative zoom is a very different kind of operation to ordinary panning/tilting and even relative zooming. If the script is reporting NO, it's because your camera is reporting that it does not have a specific capability required by the ONVIF standard for Frigate's autotracking to function.

@cm0002
Copy link

cm0002 commented Dec 11, 2024

Thanks @hawkeye217 I double and triple checked, and this camera must definitly supports RelativeMove Pan/Tilt. ONVIF Device Manager lists "default relative pant tilt translation space" and I can move the camera with its built-in RelativeMove commands just fine. The ONVIF Device Test Tool also says the camera supports RelativeMove and the Panasonic docs say its supported as well.

Can you give me some insight on where it's grabbing the capability list from? Thanks!

Full output:

Connected to ONVIF camera
Created media service object
Media profiles
[{
    'Name': 'H26x_1',
    'VideoSourceConfiguration': {
        'Name': 'Video Source Configuration',
        'UseCount': 7,
        'SourceToken': 'VideoSource',
        'Bounds': {
            'x': 64,
            'y': 228,
            'width': 1920,
            'height': 1080
        },
        '_value_1': [
            <Element {http://www.onvif.org/ver10/schema}Extension at 0x7f88bf6c3a80>
        ],
        'Extension': None,
        'token': 'VideoSourceConfig',
        '_attr_1': {
    }
    },
    'AudioSourceConfiguration': {
        'Name': 'AudioSourceConfig',
        'UseCount': 7,
        'SourceToken': 'AudioSource',
        '_value_1': None,
        'token': 'AudioSourceConfig',
        '_attr_1': {
    }
    },
    'VideoEncoderConfiguration': {
        'Name': 'H26x_1_VIDEO',
        'UseCount': 1,
        'Encoding': 'H264',
        'Resolution': {
            'Width': 1920,
            'Height': 1080
        },
        'Quality': 9.0,
        'RateControl': {
            'FrameRateLimit': 30,
            'EncodingInterval': 1,
            'BitrateLimit': 24576
        },
        'MPEG4': None,
        'H264': {
            'GovLength': 1,
            'H264Profile': 'High'
        },
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 0,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(seconds=120),
        '_value_1': None,
        'token': 'h26x_1_video',
        '_attr_1': {
    }
    },
    'AudioEncoderConfiguration': {
        'Name': 'G711',
        'UseCount': 7,
        'Encoding': 'G711',
        'Bitrate': 64,
        'SampleRate': 8,
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 0,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(seconds=120),
        '_value_1': None,
        'token': 'G711',
        '_attr_1': {
    }
    },
    'VideoAnalyticsConfiguration': None,
    'PTZConfiguration': {
        'Name': 'PtzConfGeneral',
        'UseCount': 7,
        'NodeToken': 'PtzNode',
        'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
        'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
        'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
        'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
        'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
        'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
        'DefaultPTZSpeed': None,
        'DefaultPTZTimeout': datetime.timedelta(seconds=60),
        'PanTiltLimits': None,
        'ZoomLimits': None,
        'Extension': None,
        'token': 'PtzConf1',
        '_attr_1': {
    }
    },
    'MetadataConfiguration': None,
    'Extension': None,
    'token': 'def_profile1',
    'fixed': True,
    '_attr_1': {
}
}, {
    'Name': 'H26x_2',
    'VideoSourceConfiguration': {
        'Name': 'Video Source Configuration',
        'UseCount': 7,
        'SourceToken': 'VideoSource',
        'Bounds': {
            'x': 64,
            'y': 228,
            'width': 1920,
            'height': 1080
        },
        '_value_1': [
            <Element {http://www.onvif.org/ver10/schema}Extension at 0x7f88bf6fbe40>
        ],
        'Extension': None,
        'token': 'VideoSourceConfig',
        '_attr_1': {
    }
    },
    'AudioSourceConfiguration': {
        'Name': 'AudioSourceConfig',
        'UseCount': 7,
        'SourceToken': 'AudioSource',
        '_value_1': None,
        'token': 'AudioSourceConfig',
        '_attr_1': {
    }
    },
    'VideoEncoderConfiguration': {
        'Name': 'H26x_2_VIDEO',
        'UseCount': 1,
        'Encoding': 'H264',
        'Resolution': {
            'Width': 1280,
            'Height': 720
        },
        'Quality': 9.0,
        'RateControl': {
            'FrameRateLimit': 15,
            'EncodingInterval': 1,
            'BitrateLimit': 12288
        },
        'MPEG4': None,
        'H264': {
            'GovLength': 1,
            'H264Profile': 'High'
        },
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 0,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(seconds=120),
        '_value_1': None,
        'token': 'h26x_2_video',
        '_attr_1': {
    }
    },
    'AudioEncoderConfiguration': {
        'Name': 'G711',
        'UseCount': 7,
        'Encoding': 'G711',
        'Bitrate': 64,
        'SampleRate': 8,
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 0,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(seconds=120),
        '_value_1': None,
        'token': 'G711',
        '_attr_1': {
    }
    },
    'VideoAnalyticsConfiguration': None,
    'PTZConfiguration': {
        'Name': 'PtzConfGeneral',
        'UseCount': 7,
        'NodeToken': 'PtzNode',
        'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
        'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
        'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
        'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
        'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
        'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
        'DefaultPTZSpeed': None,
        'DefaultPTZTimeout': datetime.timedelta(seconds=60),
        'PanTiltLimits': None,
        'ZoomLimits': None,
        'Extension': None,
        'token': 'PtzConf1',
        '_attr_1': {
    }
    },
    'MetadataConfiguration': None,
    'Extension': None,
    'token': 'def_profile2',
    'fixed': True,
    '_attr_1': {
}
}, {
    'Name': 'H26x_3',
    'VideoSourceConfiguration': {
        'Name': 'Video Source Configuration',
        'UseCount': 7,
        'SourceToken': 'VideoSource',
        'Bounds': {
            'x': 64,
            'y': 228,
            'width': 1920,
            'height': 1080
        },
        '_value_1': [
            <Element {http://www.onvif.org/ver10/schema}Extension at 0x7f88bf6c3e40>
        ],
        'Extension': None,
        'token': 'VideoSourceConfig',
        '_attr_1': {
    }
    },
    'AudioSourceConfiguration': {
        'Name': 'AudioSourceConfig',
        'UseCount': 7,
        'SourceToken': 'AudioSource',
        '_value_1': None,
        'token': 'AudioSourceConfig',
        '_attr_1': {
    }
    },
    'VideoEncoderConfiguration': {
        'Name': 'H26x_3_VIDEO',
        'UseCount': 1,
        'Encoding': 'H264',
        'Resolution': {
            'Width': 320,
            'Height': 180
        },
        'Quality': 6.0,
        'RateControl': {
            'FrameRateLimit': 30,
            'EncodingInterval': 1,
            'BitrateLimit': 2048
        },
        'MPEG4': None,
        'H264': {
            'GovLength': 30,
            'H264Profile': 'High'
        },
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 0,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(seconds=120),
        '_value_1': None,
        'token': 'h26x_3_video',
        '_attr_1': {
    }
    },
    'AudioEncoderConfiguration': {
        'Name': 'G711',
        'UseCount': 7,
        'Encoding': 'G711',
        'Bitrate': 64,
        'SampleRate': 8,
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 0,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(seconds=120),
        '_value_1': None,
        'token': 'G711',
        '_attr_1': {
    }
    },
    'VideoAnalyticsConfiguration': None,
    'PTZConfiguration': {
        'Name': 'PtzConfGeneral',
        'UseCount': 7,
        'NodeToken': 'PtzNode',
        'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
        'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
        'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
        'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
        'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
        'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
        'DefaultPTZSpeed': None,
        'DefaultPTZTimeout': datetime.timedelta(seconds=60),
        'PanTiltLimits': None,
        'ZoomLimits': None,
        'Extension': None,
        'token': 'PtzConf1',
        '_attr_1': {
    }
    },
    'MetadataConfiguration': None,
    'Extension': None,
    'token': 'def_profile3',
    'fixed': True,
    '_attr_1': {
}
}, {
    'Name': 'H26x_4',
    'VideoSourceConfiguration': {
        'Name': 'Video Source Configuration',
        'UseCount': 7,
        'SourceToken': 'VideoSource',
        'Bounds': {
            'x': 64,
            'y': 228,
            'width': 1920,
            'height': 1080
        },
        '_value_1': [
            <Element {http://www.onvif.org/ver10/schema}Extension at 0x7f88bf6fd600>
        ],
        'Extension': None,
        'token': 'VideoSourceConfig',
        '_attr_1': {
    }
    },
    'AudioSourceConfiguration': {
        'Name': 'AudioSourceConfig',
        'UseCount': 7,
        'SourceToken': 'AudioSource',
        '_value_1': None,
        'token': 'AudioSourceConfig',
        '_attr_1': {
    }
    },
    'VideoEncoderConfiguration': {
        'Name': 'H26x_4_VIDEO',
        'UseCount': 1,
        'Encoding': 'H264',
        'Resolution': {
            'Width': 320,
            'Height': 180
        },
        'Quality': 6.0,
        'RateControl': {
            'FrameRateLimit': 30,
            'EncodingInterval': 1,
            'BitrateLimit': 2048
        },
        'MPEG4': None,
        'H264': {
            'GovLength': 30,
            'H264Profile': 'High'
        },
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 0,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(seconds=120),
        '_value_1': None,
        'token': 'h26x_4_video',
        '_attr_1': {
    }
    },
    'AudioEncoderConfiguration': {
        'Name': 'G711',
        'UseCount': 7,
        'Encoding': 'G711',
        'Bitrate': 64,
        'SampleRate': 8,
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 0,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(seconds=120),
        '_value_1': None,
        'token': 'G711',
        '_attr_1': {
    }
    },
    'VideoAnalyticsConfiguration': None,
    'PTZConfiguration': {
        'Name': 'PtzConfGeneral',
        'UseCount': 7,
        'NodeToken': 'PtzNode',
        'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
        'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
        'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
        'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
        'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
        'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
        'DefaultPTZSpeed': None,
        'DefaultPTZTimeout': datetime.timedelta(seconds=60),
        'PanTiltLimits': None,
        'ZoomLimits': None,
        'Extension': None,
        'token': 'PtzConf1',
        '_attr_1': {
    }
    },
    'MetadataConfiguration': None,
    'Extension': None,
    'token': 'def_profile4',
    'fixed': True,
    '_attr_1': {
}
}, {
    'Name': 'JPEG_1',
    'VideoSourceConfiguration': {
        'Name': 'Video Source Configuration',
        'UseCount': 7,
        'SourceToken': 'VideoSource',
        'Bounds': {
            'x': 64,
            'y': 228,
            'width': 1920,
            'height': 1080
        },
        '_value_1': [
            <Element {http://www.onvif.org/ver10/schema}Extension at 0x7f88bf6fe5c0>
        ],
        'Extension': None,
        'token': 'VideoSourceConfig',
        '_attr_1': {
    }
    },
    'AudioSourceConfiguration': {
        'Name': 'AudioSourceConfig',
        'UseCount': 7,
        'SourceToken': 'AudioSource',
        '_value_1': None,
        'token': 'AudioSourceConfig',
        '_attr_1': {
    }
    },
    'VideoEncoderConfiguration': {
        'Name': 'JPEG_1_VIDEO',
        'UseCount': 1,
        'Encoding': 'JPEG',
        'Resolution': {
            'Width': 1920,
            'Height': 1080
        },
        'Quality': 4.0,
        'RateControl': {
            'FrameRateLimit': 5,
            'EncodingInterval': 1,
            'BitrateLimit': 0
        },
        'MPEG4': None,
        'H264': None,
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 0,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(seconds=120),
        '_value_1': None,
        'token': 'jpeg_1_video',
        '_attr_1': {
    }
    },
    'AudioEncoderConfiguration': {
        'Name': 'G711',
        'UseCount': 7,
        'Encoding': 'G711',
        'Bitrate': 64,
        'SampleRate': 8,
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 0,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(seconds=120),
        '_value_1': None,
        'token': 'G711',
        '_attr_1': {
    }
    },
    'VideoAnalyticsConfiguration': None,
    'PTZConfiguration': {
        'Name': 'PtzConfGeneral',
        'UseCount': 7,
        'NodeToken': 'PtzNode',
        'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
        'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
        'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
        'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
        'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
        'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
        'DefaultPTZSpeed': None,
        'DefaultPTZTimeout': datetime.timedelta(seconds=60),
        'PanTiltLimits': None,
        'ZoomLimits': None,
        'Extension': None,
        'token': 'PtzConf1',
        '_attr_1': {
    }
    },
    'MetadataConfiguration': None,
    'Extension': None,
    'token': 'def_profile5',
    'fixed': True,
    '_attr_1': {
}
}, {
    'Name': 'JPEG_2',
    'VideoSourceConfiguration': {
        'Name': 'Video Source Configuration',
        'UseCount': 7,
        'SourceToken': 'VideoSource',
        'Bounds': {
            'x': 64,
            'y': 228,
            'width': 1920,
            'height': 1080
        },
        '_value_1': [
            <Element {http://www.onvif.org/ver10/schema}Extension at 0x7f88bf6ff540>
        ],
        'Extension': None,
        'token': 'VideoSourceConfig',
        '_attr_1': {
    }
    },
    'AudioSourceConfiguration': {
        'Name': 'AudioSourceConfig',
        'UseCount': 7,
        'SourceToken': 'AudioSource',
        '_value_1': None,
        'token': 'AudioSourceConfig',
        '_attr_1': {
    }
    },
    'VideoEncoderConfiguration': {
        'Name': 'JPEG_2_VIDEO',
        'UseCount': 1,
        'Encoding': 'JPEG',
        'Resolution': {
            'Width': 640,
            'Height': 360
        },
        'Quality': 4.0,
        'RateControl': {
            'FrameRateLimit': 5,
            'EncodingInterval': 1,
            'BitrateLimit': 0
        },
        'MPEG4': None,
        'H264': None,
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 0,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(seconds=120),
        '_value_1': None,
        'token': 'jpeg_2_video',
        '_attr_1': {
    }
    },
    'AudioEncoderConfiguration': {
        'Name': 'G711',
        'UseCount': 7,
        'Encoding': 'G711',
        'Bitrate': 64,
        'SampleRate': 8,
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 0,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(seconds=120),
        '_value_1': None,
        'token': 'G711',
        '_attr_1': {
    }
    },
    'VideoAnalyticsConfiguration': None,
    'PTZConfiguration': {
        'Name': 'PtzConfGeneral',
        'UseCount': 7,
        'NodeToken': 'PtzNode',
        'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
        'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
        'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
        'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
        'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
        'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
        'DefaultPTZSpeed': None,
        'DefaultPTZTimeout': datetime.timedelta(seconds=60),
        'PanTiltLimits': None,
        'ZoomLimits': None,
        'Extension': None,
        'token': 'PtzConf1',
        '_attr_1': {
    }
    },
    'MetadataConfiguration': None,
    'Extension': None,
    'token': 'def_profile6',
    'fixed': True,
    '_attr_1': {
}
}, {
    'Name': 'JPEG_3',
    'VideoSourceConfiguration': {
        'Name': 'Video Source Configuration',
        'UseCount': 7,
        'SourceToken': 'VideoSource',
        'Bounds': {
            'x': 64,
            'y': 228,
            'width': 1920,
            'height': 1080
        },
        '_value_1': [
            <Element {http://www.onvif.org/ver10/schema}Extension at 0x7f88bf70c500>
        ],
        'Extension': None,
        'token': 'VideoSourceConfig',
        '_attr_1': {
    }
    },
    'AudioSourceConfiguration': {
        'Name': 'AudioSourceConfig',
        'UseCount': 7,
        'SourceToken': 'AudioSource',
        '_value_1': None,
        'token': 'AudioSourceConfig',
        '_attr_1': {
    }
    },
    'VideoEncoderConfiguration': {
        'Name': 'JPEG_3_VIDEO',
        'UseCount': 1,
        'Encoding': 'JPEG',
        'Resolution': {
            'Width': 320,
            'Height': 180
        },
        'Quality': 4.0,
        'RateControl': {
            'FrameRateLimit': 5,
            'EncodingInterval': 1,
            'BitrateLimit': 0
        },
        'MPEG4': None,
        'H264': None,
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 0,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(seconds=120),
        '_value_1': None,
        'token': 'jpeg_3_video',
        '_attr_1': {
    }
    },
    'AudioEncoderConfiguration': {
        'Name': 'G711',
        'UseCount': 7,
        'Encoding': 'G711',
        'Bitrate': 64,
        'SampleRate': 8,
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 0,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(seconds=120),
        '_value_1': None,
        'token': 'G711',
        '_attr_1': {
    }
    },
    'VideoAnalyticsConfiguration': None,
    'PTZConfiguration': {
        'Name': 'PtzConfGeneral',
        'UseCount': 7,
        'NodeToken': 'PtzNode',
        'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
        'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
        'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
        'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
        'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
        'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
        'DefaultPTZSpeed': None,
        'DefaultPTZTimeout': datetime.timedelta(seconds=60),
        'PanTiltLimits': None,
        'ZoomLimits': None,
        'Extension': None,
        'token': 'PtzConf1',
        '_attr_1': {
    }
    },
    'MetadataConfiguration': None,
    'Extension': None,
    'token': 'def_profile7',
    'fixed': True,
    '_attr_1': {
}
}]
Chosen token
def_profile4
Creating PTZ object
Created PTZ service object
PTZ configurations:
{
    'Name': 'PtzConfGeneral',
    'UseCount': 7,
    'NodeToken': 'PtzNode',
    'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
    'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
    'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
    'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
    'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
    'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
    'DefaultPTZSpeed': None,
    'DefaultPTZTimeout': datetime.timedelta(seconds=60),
    'PanTiltLimits': None,
    'ZoomLimits': None,
    'Extension': None,
    'token': 'PtzConf1',
    '_attr_1': {
}
}

PTZ configuration options:
{
    'Spaces': {
        'AbsolutePanTiltPositionSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
                'XRange': {
                    'Min': 0.0,
                    'Max': 1.0
                },
                'YRange': {
                    'Min': -0.97297,
                    'Max': -0.0
                }
            }
        ],
        'AbsoluteZoomPositionSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
                'XRange': {
                    'Min': 0.0,
                    'Max': 0.09375
                }
            }
        ],
        'RelativePanTiltTranslationSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
                'XRange': {
                    'Min': -1.0,
                    'Max': 1.0
                },
                'YRange': {
                    'Min': -1.0,
                    'Max': 1.0
                }
            }
        ],
        'RelativeZoomTranslationSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
                'XRange': {
                    'Min': -0.09375,
                    'Max': 0.09375
                }
            }
        ],
        'ContinuousPanTiltVelocitySpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
                'XRange': {
                    'Min': -1.0,
                    'Max': 1.0
                },
                'YRange': {
                    'Min': -1.0,
                    'Max': 1.0
                }
            }
        ],
        'ContinuousZoomVelocitySpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
                'XRange': {
                    'Min': -1.0,
                    'Max': 1.0
                }
            }
        ],
        'PanTiltSpeedSpace': [],
        'ZoomSpeedSpace': [],
        'Extension': None,
        '_attr_1': None
    },
    'PTZTimeout': {
        'Min': datetime.timedelta(0),
        'Max': datetime.timedelta(seconds=255)
    },
    '_value_1': None,
    'PTControlDirection': None,
    'Extension': None,
    '_attr_1': None
}

PTZ service capabilities:
{
    '_value_1': None,
    'EFlip': False,
    'Reverse': False,
    'GetCompatibleConfigurations': True,
    '_attr_1': {
        'MoveStatus': 'true',
        'StatusPosition': 'true'
    }
}

PTZ status:
{
    'Position': {
        'PanTilt': {
            'x': 0.06,
            'y': -0.09135,
            'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace'
        },
        'Zoom': {
            'x': 0.0,
            'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace'
        }
    },
    'MoveStatus': {
        'PanTilt': 'IDLE',
        'Zoom': 'IDLE'
    },
    'Error': 'OK',
    'UtcTime': datetime.datetime(2024, 12, 10, 12, 58, 49, tzinfo=<FixedOffset '-07:00'>),
    '_value_1': None,
    '_attr_1': None
}
YES - GetServiceCapabilities shows that the camera supports MoveStatus.
YES - MoveStatus is reporting IDLE.
NO - RelativeMove Pan/Tilt is unsupported.
YES - RelativeMove Zoom is supported.

@hawkeye217
Copy link
Author

@dexiaoniao
Copy link

这是我的输出结果,型号是大华hd-3h3405-adw,请问一下是不支持自动追踪吗?该摄像机已成功连接onvif,PTZ 控制将在摄像机的 WebUI 中可用,期待您的回复
Connected to ONVIF camera
Created media service object
Media profiles
[{
'Name': 'Profile000',
'VideoSourceConfiguration': {
'Name': 'VideoSource000',
'UseCount': 2,
'SourceToken': 'VideoSource000',
'Bounds': {
'x': 0,
'y': 0,
'width': 2048,
'height': 1536
},
'_value_1': None,
'Extension': None,
'token': 'VideoSource000',
'_attr_1': {
}
},
'AudioSourceConfiguration': {
'Name': 'AudioSource000',
'UseCount': 2,
'SourceToken': 'AudioSource000',
'_value_1': None,
'token': 'AudioSource000',
'_attr_1': {
}
},
'VideoEncoderConfiguration': {
'Name': 'VideoEncoder000',
'UseCount': 1,
'Encoding': 'H264',
'Resolution': {
'Width': 2560,
'Height': 1440
},
'Quality': 6.0,
'RateControl': {
'FrameRateLimit': 25,
'EncodingInterval': 1,
'BitrateLimit': 6144
},
'MPEG4': None,
'H264': {
'GovLength': 50,
'H264Profile': 'Main'
},
'Multicast': {
'Address': {
'Type': 'IPv4',
'IPv4Address': '224.1.2.4',
'IPv6Address': None
},
'Port': 40000,
'TTL': 64,
'AutoStart': False,
'_value_1': None,
'_attr_1': None
},
'SessionTimeout': datetime.timedelta(seconds=60),
'_value_1': None,
'token': 'VideoEncoder000',
'_attr_1': {
}
},
'AudioEncoderConfiguration': {
'Name': 'AudioEncoder000',
'UseCount': 1,
'Encoding': 'G711',
'Bitrate': 32,
'SampleRate': 8,
'Multicast': {
'Address': {
'Type': 'IPv4',
'IPv4Address': '224.1.2.4',
'IPv6Address': None
},
'Port': 40002,
'TTL': 64,
'AutoStart': False,
'_value_1': None,
'_attr_1': None
},
'SessionTimeout': datetime.timedelta(seconds=60),
'_value_1': None,
'token': 'AudioEncoder000',
'_attr_1': {
}
},
'VideoAnalyticsConfiguration': {
'Name': 'Analytics000',
'UseCount': 2,
'AnalyticsEngineConfiguration': {
'AnalyticsModule': [
{
'Parameters': {
'SimpleItem': [
{
'Name': 'Sensitivity',
'Value': '70'
}
],
'ElementItem': [
{
'_value_1': <Element {http://www.onvif.org/ver10/schema}CellLayout at 0x111825b40>,
'Name': 'Layout'
}
],
'Extension': None,
'_attr_1': None
},
'Name': 'MyCellMotionEngine',
'Type': 'tt:CellMotionEngine'
},
{
'Parameters': {
'SimpleItem': [
{
'Name': 'Sensitivity',
'Value': '0'
}
],
'ElementItem': [
{
'_value_1': <Element {http://www.onvif.org/ver10/schema}CellLayout at 0x111826780>,
'Name': 'Layout'
}
],
'Extension': None,
'_attr_1': None
},
'Name': 'MyCellMotionEngine',
'Type': 'tt:CellMotionEngine'
},
{
'Parameters': {
'SimpleItem': [
{
'Name': 'Sensitivity',
'Value': '0'
}
],
'ElementItem': [
{
'_value_1': <Element {http://www.onvif.org/ver10/schema}CellLayout at 0x111827140>,
'Name': 'Layout'
}
],
'Extension': None,
'_attr_1': None
},
'Name': 'MyCellMotionEngine',
'Type': 'tt:CellMotionEngine'
},
{
'Parameters': {
'SimpleItem': [
{
'Name': 'Sensitivity',
'Value': '0'
}
],
'ElementItem': [
{
'_value_1': <Element {http://www.onvif.org/ver10/schema}CellLayout at 0x111827ac0>,
'Name': 'Layout'
}
],
'Extension': None,
'_attr_1': None
},
'Name': 'MyCellMotionEngine',
'Type': 'tt:CellMotionEngine'
}
],
'Extension': None,
'_attr_1': None
},
'RuleEngineConfiguration': {
'Rule': [
{
'Parameters': {
'SimpleItem': [
{
'Name': 'MinCount',
'Value': '20'
},
{
'Name': 'AlarmOnDelay',
'Value': '1000'
},
{
'Name': 'AlarmOffDelay',
'Value': '1000'
},
{
'Name': 'ActiveCells',
'Value': '0P8A8A=='
}
],
'ElementItem': [],
'Extension': None,
'_attr_1': None
},
'Name': 'Region1',
'Type': 'tt:CellMotionDetector'
}
],
'Extension': None,
'_attr_1': None
},
'_value_1': None,
'token': 'Analytics000',
'_attr_1': {
}
},
'PTZConfiguration': {
'Name': 'PTZ000',
'UseCount': 2,
'NodeToken': 'PTZ000',
'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
'DefaultAbsoluteZoomPositionSpace': None,
'DefaultRelativePanTiltTranslationSpace': None,
'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
'DefaultPTZSpeed': {
'PanTilt': {
'x': 0.8,
'y': 0.8,
'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace'
},
'Zoom': {
'x': 0.8,
'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace'
}
},
'DefaultPTZTimeout': datetime.timedelta(seconds=10),
'PanTiltLimits': {
'Range': {
'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
},
'YRange': {
'Min': -1.0,
'Max': 1.0
}
}
},
'ZoomLimits': None,
'Extension': None,
'token': 'PTZ000',
'_attr_1': {
'MoveRamp': '0',
'PresetRamp': '0',
'PresetTourRamp': '0'
}
},
'MetadataConfiguration': {
'Name': 'Metadata000',
'UseCount': 1,
'PTZStatus': {
'Status': False,
'Position': False,
'_attr_1': None
},
'Events': {
'Filter': {
'_value_1': [
{
'_value_1': 'tns1:Media/ConfigurationChanged',
'Dialect': 'http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet',
'_attr_1': {
}
}
]
},
'SubscriptionPolicy': None,
'_value_1': None,
'_attr_1': None
},
'Analytics': True,
'Multicast': {
'Address': {
'Type': 'IPv4',
'IPv4Address': '224.1.2.4',
'IPv6Address': None
},
'Port': 40000,
'TTL': 64,
'AutoStart': False,
'_value_1': None,
'_attr_1': None
},
'SessionTimeout': datetime.timedelta(seconds=60),
'_value_1': None,
'AnalyticsEngineConfiguration': None,
'Extension': None,
'token': 'Metadata000',
'_attr_1': {
'CompressionType': 'None',
'GeoLocation': 'false'
}
},
'Extension': {
'_value_1': [
{
'Name': 'AudioOutput000',
'UseCount': 2,
'OutputToken': 'AudioOutput000',
'SendPrimacy': 'www.onvif.org/ver20/HalfDuplex/Auto',
'OutputLevel': 97,
'_value_1': None,
'token': 'AudioOutput000',
'_attr_1': {
}
},
{
'Name': 'AudioDecoder000',
'UseCount': 1,
'_value_1': None,
'token': 'AudioDecoder000',
'_attr_1': {
}
}
],
'AudioOutputConfiguration': None,
'AudioDecoderConfiguration': None,
'Extension': None,
'_attr_1': None
},
'token': 'Profile000',
'fixed': True,
'_attr_1': {
}
}, {
'Name': 'Profile001',
'VideoSourceConfiguration': {
'Name': 'VideoSource000',
'UseCount': 2,
'SourceToken': 'VideoSource000',
'Bounds': {
'x': 0,
'y': 0,
'width': 2048,
'height': 1536
},
'_value_1': None,
'Extension': None,
'token': 'VideoSource000',
'_attr_1': {
}
},
'AudioSourceConfiguration': {
'Name': 'AudioSource000',
'UseCount': 2,
'SourceToken': 'AudioSource000',
'_value_1': None,
'token': 'AudioSource000',
'_attr_1': {
}
},
'VideoEncoderConfiguration': {
'Name': 'VideoEncoder001',
'UseCount': 1,
'Encoding': 'H264',
'Resolution': {
'Width': 704,
'Height': 576
},
'Quality': 6.0,
'RateControl': {
'FrameRateLimit': 25,
'EncodingInterval': 1,
'BitrateLimit': 1024
},
'MPEG4': None,
'H264': {
'GovLength': 50,
'H264Profile': 'Main'
},
'Multicast': {
'Address': {
'Type': 'IPv4',
'IPv4Address': '224.1.2.4',
'IPv6Address': None
},
'Port': 40016,
'TTL': 64,
'AutoStart': False,
'_value_1': None,
'_attr_1': None
},
'SessionTimeout': datetime.timedelta(seconds=60),
'_value_1': None,
'token': 'VideoEncoder001',
'_attr_1': {
}
},
'AudioEncoderConfiguration': {
'Name': 'AudioEncoder001',
'UseCount': 1,
'Encoding': 'G711',
'Bitrate': 32,
'SampleRate': 8,
'Multicast': {
'Address': {
'Type': 'IPv4',
'IPv4Address': '224.1.2.4',
'IPv6Address': None
},
'Port': 40018,
'TTL': 64,
'AutoStart': False,
'_value_1': None,
'_attr_1': None
},
'SessionTimeout': datetime.timedelta(seconds=60),
'_value_1': None,
'token': 'AudioEncoder001',
'_attr_1': {
}
},
'VideoAnalyticsConfiguration': {
'Name': 'Analytics000',
'UseCount': 2,
'AnalyticsEngineConfiguration': {
'AnalyticsModule': [
{
'Parameters': {
'SimpleItem': [
{
'Name': 'Sensitivity',
'Value': '70'
}
],
'ElementItem': [
{
'_value_1': <Element {http://www.onvif.org/ver10/schema}CellLayout at 0x11183aa00>,
'Name': 'Layout'
}
],
'Extension': None,
'_attr_1': None
},
'Name': 'MyCellMotionEngine',
'Type': 'tt:CellMotionEngine'
},
{
'Parameters': {
'SimpleItem': [
{
'Name': 'Sensitivity',
'Value': '0'
}
],
'ElementItem': [
{
'_value_1': <Element {http://www.onvif.org/ver10/schema}CellLayout at 0x11183b380>,
'Name': 'Layout'
}
],
'Extension': None,
'_attr_1': None
},
'Name': 'MyCellMotionEngine',
'Type': 'tt:CellMotionEngine'
},
{
'Parameters': {
'SimpleItem': [
{
'Name': 'Sensitivity',
'Value': '0'
}
],
'ElementItem': [
{
'_value_1': <Element {http://www.onvif.org/ver10/schema}CellLayout at 0x11183bd00>,
'Name': 'Layout'
}
],
'Extension': None,
'_attr_1': None
},
'Name': 'MyCellMotionEngine',
'Type': 'tt:CellMotionEngine'
},
{
'Parameters': {
'SimpleItem': [
{
'Name': 'Sensitivity',
'Value': '0'
}
],
'ElementItem': [
{
'_value_1': <Element {http://www.onvif.org/ver10/schema}CellLayout at 0x11184c6c0>,
'Name': 'Layout'
}
],
'Extension': None,
'_attr_1': None
},
'Name': 'MyCellMotionEngine',
'Type': 'tt:CellMotionEngine'
}
],
'Extension': None,
'_attr_1': None
},
'RuleEngineConfiguration': {
'Rule': [
{
'Parameters': {
'SimpleItem': [
{
'Name': 'MinCount',
'Value': '20'
},
{
'Name': 'AlarmOnDelay',
'Value': '1000'
},
{
'Name': 'AlarmOffDelay',
'Value': '1000'
},
{
'Name': 'ActiveCells',
'Value': '0P8A8A=='
}
],
'ElementItem': [],
'Extension': None,
'_attr_1': None
},
'Name': 'Region1',
'Type': 'tt:CellMotionDetector'
}
],
'Extension': None,
'_attr_1': None
},
'_value_1': None,
'token': 'Analytics000',
'_attr_1': {
}
},
'PTZConfiguration': {
'Name': 'PTZ000',
'UseCount': 2,
'NodeToken': 'PTZ000',
'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
'DefaultAbsoluteZoomPositionSpace': None,
'DefaultRelativePanTiltTranslationSpace': None,
'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
'DefaultPTZSpeed': {
'PanTilt': {
'x': 0.8,
'y': 0.8,
'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace'
},
'Zoom': {
'x': 0.8,
'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace'
}
},
'DefaultPTZTimeout': datetime.timedelta(seconds=10),
'PanTiltLimits': {
'Range': {
'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
},
'YRange': {
'Min': -1.0,
'Max': 1.0
}
}
},
'ZoomLimits': None,
'Extension': None,
'token': 'PTZ000',
'_attr_1': {
'MoveRamp': '0',
'PresetRamp': '0',
'PresetTourRamp': '0'
}
},
'MetadataConfiguration': {
'Name': 'Metadata001',
'UseCount': 1,
'PTZStatus': {
'Status': False,
'Position': False,
'_attr_1': None
},
'Events': {
'Filter': {
'_value_1': [
{
'_value_1': 'tns1:Media/ConfigurationChanged',
'Dialect': 'http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet',
'_attr_1': {
}
}
]
},
'SubscriptionPolicy': None,
'_value_1': None,
'_attr_1': None
},
'Analytics': True,
'Multicast': {
'Address': {
'Type': 'IPv4',
'IPv4Address': '224.1.2.4',
'IPv6Address': None
},
'Port': 40016,
'TTL': 64,
'AutoStart': False,
'_value_1': None,
'_attr_1': None
},
'SessionTimeout': datetime.timedelta(seconds=60),
'_value_1': None,
'AnalyticsEngineConfiguration': None,
'Extension': None,
'token': 'Metadata001',
'_attr_1': {
'CompressionType': 'None',
'GeoLocation': 'false'
}
},
'Extension': {
'_value_1': [
{
'Name': 'AudioOutput000',
'UseCount': 2,
'OutputToken': 'AudioOutput000',
'SendPrimacy': 'www.onvif.org/ver20/HalfDuplex/Auto',
'OutputLevel': 97,
'_value_1': None,
'token': 'AudioOutput000',
'_attr_1': {
}
},
{
'Name': 'AudioDecoder001',
'UseCount': 1,
'_value_1': None,
'token': 'AudioDecoder001',
'_attr_1': {
}
}
],
'AudioOutputConfiguration': None,
'AudioDecoderConfiguration': None,
'Extension': None,
'_attr_1': None
},
'token': 'Profile001',
'fixed': True,
'_attr_1': {
}
}]
Chosen token
Profile001
Creating PTZ object
Created PTZ service object
PTZ configurations:
{
'Name': 'PTZ000',
'UseCount': 2,
'NodeToken': 'PTZ000',
'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
'DefaultAbsoluteZoomPositionSpace': None,
'DefaultRelativePanTiltTranslationSpace': None,
'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
'DefaultPTZSpeed': {
'PanTilt': {
'x': 0.8,
'y': 0.8,
'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace'
},
'Zoom': {
'x': 0.8,
'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace'
}
},
'DefaultPTZTimeout': datetime.timedelta(seconds=10),
'PanTiltLimits': {
'Range': {
'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
},
'YRange': {
'Min': -1.0,
'Max': 1.0
}
}
},
'ZoomLimits': None,
'Extension': None,
'token': 'PTZ000',
'_attr_1': {
'MoveRamp': '0',
'PresetRamp': '0',
'PresetTourRamp': '0'
}
}

PTZ configuration options:
{
'Spaces': {
'AbsolutePanTiltPositionSpace': [],
'AbsoluteZoomPositionSpace': [],
'RelativePanTiltTranslationSpace': [],
'RelativeZoomTranslationSpace': [
{
'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
}
}
],
'ContinuousPanTiltVelocitySpace': [],
'ContinuousZoomVelocitySpace': [
{
'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
}
}
],
'PanTiltSpeedSpace': [],
'ZoomSpeedSpace': [
{
'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace',
'XRange': {
'Min': 0.0,
'Max': 1.0
}
}
],
'Extension': None,
'_attr_1': None,
'_raw_elements': deque([<Element {http://www.onvif.org/ver10/schema}AbsolutePanTiltPositionSpace at 0x111d97600>, <Element {http://www.onvif.org/ver10/schema}ContinuousPanTiltVelocitySpace at 0x111d97640>, <Element {http://www.onvif.org/ver10/schema}PanTiltSpeedSpace at 0x111d97680>])
},
'PTZTimeout': {
'Min': datetime.timedelta(seconds=1),
'Max': datetime.timedelta(seconds=10)
},
'_value_1': None,
'PTControlDirection': None,
'Extension': None,
'_attr_1': None
}

PTZ service capabilities:
{
'_value_1': None,
'EFlip': False,
'Reverse': False,
'GetCompatibleConfigurations': True,
'_attr_1': {
'MoveStatus': 'true',
'StatusPosition': 'true'
}
}

PTZ status:
Traceback (most recent call last):
File "/Users/hp/my_venv/lib/python3.13/site-packages/onvif/client.py", line 23, in wrapped
return func(*args, **kwargs)
File "/Users/hp/my_venv/lib/python3.13/site-packages/onvif/client.py", line 153, in wrapped
return call(params, callback)
File "/Users/hp/my_venv/lib/python3.13/site-packages/onvif/client.py", line 140, in call
ret = func(**params)
File "/Users/hp/my_venv/lib/python3.13/site-packages/zeep/proxy.py", line 46, in call
return self._proxy._binding.send(
~~~~~~~~~~~~~~~~~~~~~~~~~^
self._proxy._client,
^^^^^^^^^^^^^^^^^^^^
...<3 lines>...
kwargs,
^^^^^^^
)
^
File "/Users/hp/my_venv/lib/python3.13/site-packages/zeep/wsdl/bindings/soap.py", line 135, in send
return self.process_reply(client, operation_obj, response)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/hp/my_venv/lib/python3.13/site-packages/zeep/wsdl/bindings/soap.py", line 229, in process_reply
return self.process_error(doc, operation)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
File "/Users/hp/my_venv/lib/python3.13/site-packages/zeep/wsdl/bindings/soap.py", line 391, in process_error
raise Fault(
...<5 lines>...
)
zeep.exceptions.Fault: No such PTZ node

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/hp/Downloads/152a1d4ba80760dac95d46e143d37112-b40ff52c89cf8412dcf3be1635e2f549e36f135c/fovtest.py", line 71, in
status = ptz.GetStatus(request)
File "/Users/hp/my_venv/lib/python3.13/site-packages/onvif/client.py", line 26, in wrapped
raise ONVIFError(err)
onvif.exceptions.ONVIFError: Unknown error: No such PTZ node

@dexiaoniao
Copy link

这是我另一个摄像机tplink tl-ipc48aw-plus 2.0的输出结果,跟上面那个大华一样,PTZ 控制在摄像机的 WebUI 中可用,同时ui界面还有一个启用自动追踪的按钮,但是点击启动后,预览画面就会掉线,请问这个摄像机也是不支持自动追踪吗?还是因为我没有设置好自动追踪的检测对象,因为我在配置文件里还没有具体设置检测对象的大小,只是设置了检测对象为人。
Connected to ONVIF camera
Created media service object
Media profiles
[{
'Name': 'mainStream',
'VideoSourceConfiguration': {
'Name': 'VideoSourceConfig',
'UseCount': 2,
'SourceToken': 'raw_vs1',
'Bounds': {
'x': 0,
'y': 0,
'width': 1280,
'height': 720
},
'_value_1': None,
'Extension': None,
'token': 'vsconf',
'_attr_1': {
}
},
'AudioSourceConfiguration': {
'Name': 'AudioSourceConfig',
'UseCount': 2,
'SourceToken': 'raw_as1',
'_value_1': None,
'token': 'asconf',
'_attr_1': {
}
},
'VideoEncoderConfiguration': {
'Name': 'VideoEncoder_1',
'UseCount': 1,
'Encoding': 'H264',
'Resolution': {
'Width': 3840,
'Height': 2160
},
'Quality': 5.0,
'RateControl': {
'FrameRateLimit': 15,
'EncodingInterval': 1,
'BitrateLimit': 3072
},
'MPEG4': None,
'H264': {
'GovLength': 25,
'H264Profile': 'Main'
},
'Multicast': {
'Address': {
'Type': 'IPv4',
'IPv4Address': '0.0.0.0',
'IPv6Address': None
},
'Port': 0,
'TTL': 0,
'AutoStart': False,
'_value_1': None,
'_attr_1': None
},
'SessionTimeout': datetime.timedelta(seconds=65),
'_value_1': None,
'token': 'main',
'_attr_1': {
}
},
'AudioEncoderConfiguration': {
'Name': 'AudioEncoder_1',
'UseCount': 2,
'Encoding': 'G711',
'Bitrate': 65536,
'SampleRate': 8000,
'Multicast': {
'Address': {
'Type': 'IPv4',
'IPv4Address': '0.0.0.0',
'IPv6Address': None
},
'Port': 0,
'TTL': 0,
'AutoStart': False,
'_value_1': None,
'_attr_1': None
},
'SessionTimeout': datetime.timedelta(seconds=65),
'_value_1': None,
'token': 'microphone',
'_attr_1': {
}
},
'VideoAnalyticsConfiguration': {
'Name': 'VideoAnalyticsName',
'UseCount': 2,
'AnalyticsEngineConfiguration': {
'AnalyticsModule': [
{
'Parameters': {
'SimpleItem': [
{
'Name': 'Sensitivity',
'Value': 'medium'
},
{
'Name': 'Enabled',
'Value': 'off'
}
],
'ElementItem': [
{
'_value_1': <Element {http://www.onvif.org/ver10/schema}CellLayout at 0x107d17bc0>,
'Name': 'Layout'
}
],
'Extension': None,
'_attr_1': None
},
'Name': 'MyCellMotionModule',
'Type': 'tt:CellMotionEngine'
},
{
'Parameters': {
'SimpleItem': [
{
'Name': 'Sensitivity',
'Value': 'medium'
},
{
'Name': 'Enabled',
'Value': 'off'
}
],
'ElementItem': [],
'Extension': None,
'_attr_1': None
},
'Name': 'MyTamperDetecModule',
'Type': 'tt:TamperEngine'
}
],
'Extension': None,
'_attr_1': None
},
'RuleEngineConfiguration': {
'Rule': [
{
'Parameters': {
'SimpleItem': [
{
'Name': 'ActiveCells',
'Value': '0P8A8A=='
},
{
'Name': 'MinCount',
'Value': '5'
},
{
'Name': 'AlarmOnDelay',
'Value': '1000'
},
{
'Name': 'AlarmOffDelay',
'Value': '1000'
}
],
'ElementItem': [],
'Extension': None,
'_attr_1': None
},
'Name': 'MyMotionDetectorRule',
'Type': 'tt:CellMotionDetector'
},
{
'Parameters': None,
'Name': 'MyTamperDetectorRule',
'Type': 'tt:TamperDetector'
}
],
'Extension': None,
'_attr_1': None
},
'_value_1': None,
'token': 'VideoAnalyticsToken',
'_attr_1': {
}
},
'PTZConfiguration': {
'Name': 'PTZ',
'UseCount': 2,
'NodeToken': 'PTZNODETOKEN',
'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
'DefaultAbsoluteZoomPositionSpace': None,
'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
'DefaultRelativeZoomTranslationSpace': None,
'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
'DefaultContinuousZoomVelocitySpace': None,
'DefaultPTZSpeed': None,
'DefaultPTZTimeout': None,
'PanTiltLimits': None,
'ZoomLimits': None,
'Extension': None,
'token': 'PTZTOKEN',
'_attr_1': {
},
'_raw_elements': deque([<Element {http://www.onvif.org/ver10/schema}DefaultAbsoluteZoomPositionSpace at 0x107d1dd40>, <Element {http://www.onvif.org/ver10/schema}DefaultRelativeZoomTranslationSpace at 0x107d1dd80>, <Element {http://www.onvif.org/ver10/schema}DefaultContinuousZoomVelocitySpace at 0x107d1ddc0>, <Element {http://www.onvif.org/ver10/schema}DefaultPTZSpeed at 0x107d1de00>, <Element {http://www.onvif.org/ver10/schema}DefaultPTZTimeout at 0x107d1de40>, <Element {http://www.onvif.org/ver10/schema}PanTiltLimits at 0x107d1de80>, <Element {http://www.onvif.org/ver10/schema}ZoomLimits at 0x107d1dec0>, <Element {http://www.onvif.org/ver10/schema}Extension at 0x107d1df00>])
},
'MetadataConfiguration': None,
'Extension': None,
'token': 'profile_1',
'fixed': True,
'_attr_1': {
}
}, {
'Name': 'minorStream',
'VideoSourceConfiguration': {
'Name': 'VideoSourceConfig',
'UseCount': 2,
'SourceToken': 'raw_vs1',
'Bounds': {
'x': 0,
'y': 0,
'width': 1280,
'height': 720
},
'_value_1': None,
'Extension': None,
'token': 'vsconf',
'_attr_1': {
}
},
'AudioSourceConfiguration': {
'Name': 'AudioSourceConfig',
'UseCount': 2,
'SourceToken': 'raw_as1',
'_value_1': None,
'token': 'asconf',
'_attr_1': {
}
},
'VideoEncoderConfiguration': {
'Name': 'VideoEncoder_2',
'UseCount': 1,
'Encoding': 'H264',
'Resolution': {
'Width': 640,
'Height': 360
},
'Quality': 5.0,
'RateControl': {
'FrameRateLimit': 15,
'EncodingInterval': 1,
'BitrateLimit': 512
},
'MPEG4': None,
'H264': {
'GovLength': 25,
'H264Profile': 'Main'
},
'Multicast': {
'Address': {
'Type': 'IPv4',
'IPv4Address': '0.0.0.0',
'IPv6Address': None
},
'Port': 0,
'TTL': 0,
'AutoStart': False,
'_value_1': None,
'_attr_1': None
},
'SessionTimeout': datetime.timedelta(seconds=65),
'_value_1': None,
'token': 'minor',
'_attr_1': {
}
},
'AudioEncoderConfiguration': {
'Name': 'AudioEncoder_1',
'UseCount': 2,
'Encoding': 'G711',
'Bitrate': 65536,
'SampleRate': 8000,
'Multicast': {
'Address': {
'Type': 'IPv4',
'IPv4Address': '0.0.0.0',
'IPv6Address': None
},
'Port': 0,
'TTL': 0,
'AutoStart': False,
'_value_1': None,
'_attr_1': None
},
'SessionTimeout': datetime.timedelta(seconds=65),
'_value_1': None,
'token': 'microphone',
'_attr_1': {
}
},
'VideoAnalyticsConfiguration': {
'Name': 'VideoAnalyticsName',
'UseCount': 2,
'AnalyticsEngineConfiguration': {
'AnalyticsModule': [
{
'Parameters': {
'SimpleItem': [
{
'Name': 'Sensitivity',
'Value': 'medium'
},
{
'Name': 'Enabled',
'Value': 'off'
}
],
'ElementItem': [
{
'_value_1': <Element {http://www.onvif.org/ver10/schema}CellLayout at 0x107d1ee40>,
'Name': 'Layout'
}
],
'Extension': None,
'_attr_1': None
},
'Name': 'MyCellMotionModule',
'Type': 'tt:CellMotionEngine'
},
{
'Parameters': {
'SimpleItem': [
{
'Name': 'Sensitivity',
'Value': 'medium'
},
{
'Name': 'Enabled',
'Value': 'off'
}
],
'ElementItem': [],
'Extension': None,
'_attr_1': None
},
'Name': 'MyTamperDetecModule',
'Type': 'tt:TamperEngine'
}
],
'Extension': None,
'_attr_1': None
},
'RuleEngineConfiguration': {
'Rule': [
{
'Parameters': {
'SimpleItem': [
{
'Name': 'ActiveCells',
'Value': '0P8A8A=='
},
{
'Name': 'MinCount',
'Value': '5'
},
{
'Name': 'AlarmOnDelay',
'Value': '1000'
},
{
'Name': 'AlarmOffDelay',
'Value': '1000'
}
],
'ElementItem': [],
'Extension': None,
'_attr_1': None
},
'Name': 'MyMotionDetectorRule',
'Type': 'tt:CellMotionDetector'
},
{
'Parameters': None,
'Name': 'MyTamperDetectorRule',
'Type': 'tt:TamperDetector'
}
],
'Extension': None,
'_attr_1': None
},
'_value_1': None,
'token': 'VideoAnalyticsToken',
'_attr_1': {
}
},
'PTZConfiguration': {
'Name': 'PTZ',
'UseCount': 2,
'NodeToken': 'PTZNODETOKEN',
'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
'DefaultAbsoluteZoomPositionSpace': None,
'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
'DefaultRelativeZoomTranslationSpace': None,
'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
'DefaultContinuousZoomVelocitySpace': None,
'DefaultPTZSpeed': None,
'DefaultPTZTimeout': None,
'PanTiltLimits': None,
'ZoomLimits': None,
'Extension': None,
'token': 'PTZTOKEN',
'_attr_1': {
},
'_raw_elements': deque([<Element {http://www.onvif.org/ver10/schema}DefaultAbsoluteZoomPositionSpace at 0x107d28240>, <Element {http://www.onvif.org/ver10/schema}DefaultRelativeZoomTranslationSpace at 0x107d28280>, <Element {http://www.onvif.org/ver10/schema}DefaultContinuousZoomVelocitySpace at 0x107d282c0>, <Element {http://www.onvif.org/ver10/schema}DefaultPTZSpeed at 0x107d28300>, <Element {http://www.onvif.org/ver10/schema}DefaultPTZTimeout at 0x107d28340>, <Element {http://www.onvif.org/ver10/schema}PanTiltLimits at 0x107d28380>, <Element {http://www.onvif.org/ver10/schema}ZoomLimits at 0x107d283c0>, <Element {http://www.onvif.org/ver10/schema}Extension at 0x107d28400>])
},
'MetadataConfiguration': None,
'Extension': None,
'token': 'profile_2',
'fixed': True,
'_attr_1': {
}
}]
Chosen token
profile_2
Creating PTZ object
Created PTZ service object
PTZ configurations:
{
'Name': 'PTZ',
'UseCount': 2,
'NodeToken': 'PTZNODETOKEN',
'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
'DefaultAbsoluteZoomPositionSpace': None,
'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
'DefaultRelativeZoomTranslationSpace': None,
'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
'DefaultContinuousZoomVelocitySpace': None,
'DefaultPTZSpeed': None,
'DefaultPTZTimeout': None,
'PanTiltLimits': None,
'ZoomLimits': None,
'Extension': None,
'token': 'PTZTOKEN',
'_attr_1': {
},
'_raw_elements': deque([<Element {http://www.onvif.org/ver10/schema}DefaultAbsoluteZoomPositionSpace at 0x118971540>, <Element {http://www.onvif.org/ver10/schema}DefaultRelativeZoomTranslationSpace at 0x118971580>, <Element {http://www.onvif.org/ver10/schema}DefaultContinuousZoomVelocitySpace at 0x1189715c0>, <Element {http://www.onvif.org/ver10/schema}DefaultPTZSpeed at 0x118971600>, <Element {http://www.onvif.org/ver10/schema}DefaultPTZTimeout at 0x118971640>, <Element {http://www.onvif.org/ver10/schema}PanTiltLimits at 0x118971680>, <Element {http://www.onvif.org/ver10/schema}ZoomLimits at 0x1189716c0>, <Element {http://www.onvif.org/ver10/schema}Extension at 0x118971700>])
}

PTZ configuration options:
{
'Spaces': {
'AbsolutePanTiltPositionSpace': [
{
'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
},
'YRange': {
'Min': -1.0,
'Max': 1.0
}
}
],
'AbsoluteZoomPositionSpace': [],
'RelativePanTiltTranslationSpace': [
{
'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
},
'YRange': {
'Min': -1.0,
'Max': 1.0
}
}
],
'RelativeZoomTranslationSpace': [],
'ContinuousPanTiltVelocitySpace': [],
'ContinuousZoomVelocitySpace': [],
'PanTiltSpeedSpace': [
{
'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace',
'XRange': {
'Min': 0.0,
'Max': 1.0
}
}
],
'ZoomSpeedSpace': [],
'Extension': None,
'_attr_1': None,
'_raw_elements': deque([<Element {http://www.onvif.org/ver10/schema}ContinuousPanTiltVelocitySpace at 0x1189732c0>, <Element {http://www.onvif.org/ver10/schema}AbsoluteZoomPositionSpace at 0x118973300>, <Element {http://www.onvif.org/ver10/schema}RelativeZoomTranslationSpace at 0x118973340>, <Element {http://www.onvif.org/ver10/schema}ContinuousZoomVelocitySpace at 0x118973380>, <Element {http://www.onvif.org/ver10/schema}ZoomSpeedSpace at 0x1189733c0>])
},
'PTZTimeout': {
'Min': datetime.timedelta(seconds=1),
'Max': datetime.timedelta(seconds=600)
},
'_value_1': [
<Element {http://www.onvif.org/ver10/schema}PTControlDirection at 0x118972b80>
],
'PTControlDirection': None,
'Extension': None,
'_attr_1': None
}

PTZ service capabilities:
{
'_value_1': None,
'EFlip': True,
'Reverse': True,
'GetCompatibleConfigurations': False,
'_attr_1': {
}
}

PTZ status:
{
'Position': {
'PanTilt': {
'x': 0.496787,
'y': 0.943096,
'space': None
},
'Zoom': {
'x': 0.0,
'space': None
}
},
'MoveStatus': {
'PanTilt': 'idle',
'Zoom': 'unknown'
},
'Error': '0',
'UtcTime': datetime.datetime(2024, 12, 22, 9, 31, 8, tzinfo=<isodate.tzinfo.Utc object at 0x1042bae40>),
'_value_1': None,
'_attr_1': None
}
NO - GetServiceCapabilities shows that the camera does not support MoveStatus.
NO - RelativeMove Pan/Tilt is unsupported.
NO - RelativeMove Zoom is unsupported.

@elpeterson
Copy link

elpeterson commented Jan 23, 2025

Hanwha XNP-6400RW

Connected to ONVIF camera
Created media service object
Media profiles
[{
    'Name': 'MJPEG',
    'VideoSourceConfiguration': {
        'Name': 'VideoSourceConfig-01-0',
        'UseCount': 4,
        'SourceToken': 'VideoSourceToken-0',
        'Bounds': {
            'x': 0,
            'y': 0,
            'width': 1920,
            'height': 1080
        },
        '_value_1': None,
        'Extension': None,
        'token': 'VideoSourceConfigToken-01-0',
        '_attr_1': {
    }
    },
    'AudioSourceConfiguration': None,
    'VideoEncoderConfiguration': {
        'Name': 'VideoEncoder-01',
        'UseCount': 1,
        'Encoding': 'JPEG',
        'Resolution': {
            'Width': 1920,
            'Height': 1080
        },
        'Quality': 34.0,
        'RateControl': {
            'FrameRateLimit': 2,
            'EncodingInterval': 1,
            'BitrateLimit': 6144
        },
        'MPEG4': None,
        'H264': None,
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 5,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(seconds=30),
        '_value_1': None,
        'token': 'VideoEncoderToken-01-0',
        '_attr_1': {
    }
    },
    'AudioEncoderConfiguration': None,
    'VideoAnalyticsConfiguration': {
        'Name': 'VideoAnalyticsConfig-0',
        'UseCount': 4,
        'AnalyticsEngineConfiguration': None,
        'RuleEngineConfiguration': None,
        '_value_1': None,
        'token': 'VideoAnalyticsConfigToken-0',
        '_attr_1': {
    }
    },
    'PTZConfiguration': {
        'Name': 'PtzConfig-0',
        'UseCount': 4,
        'NodeToken': 'PtzNodeToken-0',
        'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
        'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
        'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
        'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
        'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
        'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
        'DefaultPTZSpeed': {
            'PanTilt': {
                'x': 1.0,
                'y': 1.0,
                'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace'
            },
            'Zoom': {
                'x': 1.0,
                'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace'
            }
        },
        'DefaultPTZTimeout': datetime.timedelta(seconds=120),
        'PanTiltLimits': {
            'Range': {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace',
                'XRange': {
                    'Min': -1.0,
                    'Max': 1.0
                },
                'YRange': {
                    'Min': -1.0,
                    'Max': 1.0
                }
            }
        },
        'ZoomLimits': {
            'Range': {
                'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpace',
                'XRange': {
                    'Min': 0.0,
                    'Max': 1.0
                }
            }
        },
        'Extension': None,
        'token': 'PtzConfigToken-0',
        '_attr_1': {
    }
    },
    'MetadataConfiguration': {
        'Name': 'MetadataConfig-0',
        'UseCount': 4,
        'PTZStatus': None,
        'Events': None,
        'Analytics': False,
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 0,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(0),
        '_value_1': None,
        'AnalyticsEngineConfiguration': None,
        'Extension': None,
        'token': 'MetadataConfigToken-0',
        '_attr_1': {
    }
    },
    'Extension': None,
    'token': 'DefaultProfile-01-0',
    'fixed': True,
    '_attr_1': {
}
}, {
    'Name': 'H.264',
    'VideoSourceConfiguration': {
        'Name': 'VideoSourceConfig-01-0',
        'UseCount': 4,
        'SourceToken': 'VideoSourceToken-0',
        'Bounds': {
            'x': 0,
            'y': 0,
            'width': 1920,
            'height': 1080
        },
        '_value_1': None,
        'Extension': None,
        'token': 'VideoSourceConfigToken-01-0',
        '_attr_1': {
    }
    },
    'AudioSourceConfiguration': None,
    'VideoEncoderConfiguration': {
        'Name': 'VideoEncoder-02',
        'UseCount': 1,
        'Encoding': 'H264',
        'Resolution': {
            'Width': 1920,
            'Height': 1080
        },
        'Quality': 34.0,
        'RateControl': {
            'FrameRateLimit': 30,
            'EncodingInterval': 1,
            'BitrateLimit': 4096
        },
        'MPEG4': None,
        'H264': {
            'GovLength': 60,
            'H264Profile': 'High'
        },
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 5,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(seconds=30),
        '_value_1': None,
        'token': 'VideoEncoderToken-02-0',
        '_attr_1': {
    }
    },
    'AudioEncoderConfiguration': None,
    'VideoAnalyticsConfiguration': {
        'Name': 'VideoAnalyticsConfig-0',
        'UseCount': 4,
        'AnalyticsEngineConfiguration': None,
        'RuleEngineConfiguration': None,
        '_value_1': None,
        'token': 'VideoAnalyticsConfigToken-0',
        '_attr_1': {
    }
    },
    'PTZConfiguration': {
        'Name': 'PtzConfig-0',
        'UseCount': 4,
        'NodeToken': 'PtzNodeToken-0',
        'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
        'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
        'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
        'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
        'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
        'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
        'DefaultPTZSpeed': {
            'PanTilt': {
                'x': 1.0,
                'y': 1.0,
                'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace'
            },
            'Zoom': {
                'x': 1.0,
                'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace'
            }
        },
        'DefaultPTZTimeout': datetime.timedelta(seconds=120),
        'PanTiltLimits': {
            'Range': {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace',
                'XRange': {
                    'Min': -1.0,
                    'Max': 1.0
                },
                'YRange': {
                    'Min': -1.0,
                    'Max': 1.0
                }
            }
        },
        'ZoomLimits': {
            'Range': {
                'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpace',
                'XRange': {
                    'Min': 0.0,
                    'Max': 1.0
                }
            }
        },
        'Extension': None,
        'token': 'PtzConfigToken-0',
        '_attr_1': {
    }
    },
    'MetadataConfiguration': {
        'Name': 'MetadataConfig-0',
        'UseCount': 4,
        'PTZStatus': None,
        'Events': None,
        'Analytics': False,
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 0,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(0),
        '_value_1': None,
        'AnalyticsEngineConfiguration': None,
        'Extension': None,
        'token': 'MetadataConfigToken-0',
        '_attr_1': {
    }
    },
    'Extension': None,
    'token': 'DefaultProfile-02-0',
    'fixed': True,
    '_attr_1': {
}
}, {
    'Name': 'MOBILE',
    'VideoSourceConfiguration': {
        'Name': 'VideoSourceConfig-01-0',
        'UseCount': 4,
        'SourceToken': 'VideoSourceToken-0',
        'Bounds': {
            'x': 0,
            'y': 0,
            'width': 1920,
            'height': 1080
        },
        '_value_1': None,
        'Extension': None,
        'token': 'VideoSourceConfigToken-01-0',
        '_attr_1': {
    }
    },
    'AudioSourceConfiguration': None,
    'VideoEncoderConfiguration': {
        'Name': 'VideoEncoder-10',
        'UseCount': 1,
        'Encoding': 'H264',
        'Resolution': {
            'Width': 320,
            'Height': 240
        },
        'Quality': 34.0,
        'RateControl': {
            'FrameRateLimit': 10,
            'EncodingInterval': 1,
            'BitrateLimit': 2048
        },
        'MPEG4': None,
        'H264': {
            'GovLength': 20,
            'H264Profile': 'High'
        },
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 5,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(seconds=30),
        '_value_1': None,
        'token': 'VideoEncoderToken-10-0',
        '_attr_1': {
    }
    },
    'AudioEncoderConfiguration': None,
    'VideoAnalyticsConfiguration': {
        'Name': 'VideoAnalyticsConfig-0',
        'UseCount': 4,
        'AnalyticsEngineConfiguration': None,
        'RuleEngineConfiguration': None,
        '_value_1': None,
        'token': 'VideoAnalyticsConfigToken-0',
        '_attr_1': {
    }
    },
    'PTZConfiguration': {
        'Name': 'PtzConfig-0',
        'UseCount': 4,
        'NodeToken': 'PtzNodeToken-0',
        'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
        'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
        'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
        'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
        'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
        'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
        'DefaultPTZSpeed': {
            'PanTilt': {
                'x': 1.0,
                'y': 1.0,
                'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace'
            },
            'Zoom': {
                'x': 1.0,
                'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace'
            }
        },
        'DefaultPTZTimeout': datetime.timedelta(seconds=120),
        'PanTiltLimits': {
            'Range': {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace',
                'XRange': {
                    'Min': -1.0,
                    'Max': 1.0
                },
                'YRange': {
                    'Min': -1.0,
                    'Max': 1.0
                }
            }
        },
        'ZoomLimits': {
            'Range': {
                'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpace',
                'XRange': {
                    'Min': 0.0,
                    'Max': 1.0
                }
            }
        },
        'Extension': None,
        'token': 'PtzConfigToken-0',
        '_attr_1': {
    }
    },
    'MetadataConfiguration': {
        'Name': 'MetadataConfig-0',
        'UseCount': 4,
        'PTZStatus': None,
        'Events': None,
        'Analytics': False,
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': '0.0.0.0',
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 0,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(0),
        '_value_1': None,
        'AnalyticsEngineConfiguration': None,
        'Extension': None,
        'token': 'MetadataConfigToken-0',
        '_attr_1': {
    }
    },
    'Extension': None,
    'token': 'DefaultProfile-04-0',
    'fixed': False,
    '_attr_1': {
}
}]
Chosen token
DefaultProfile-04-0
Creating PTZ object
Created PTZ service object
PTZ configurations:
{
    'Name': 'PtzConfig-0',
    'UseCount': 4,
    'NodeToken': 'PtzNodeToken-0',
    'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
    'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
    'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
    'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
    'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
    'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
    'DefaultPTZSpeed': {
        'PanTilt': {
            'x': 1.0,
            'y': 1.0,
            'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace'
        },
        'Zoom': {
            'x': 1.0,
            'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace'
        }
    },
    'DefaultPTZTimeout': datetime.timedelta(seconds=120),
    'PanTiltLimits': {
        'Range': {
            'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace',
            'XRange': {
                'Min': -1.0,
                'Max': 1.0
            },
            'YRange': {
                'Min': -1.0,
                'Max': 1.0
            }
        }
    },
    'ZoomLimits': {
        'Range': {
            'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpace',
            'XRange': {
                'Min': 0.0,
                'Max': 1.0
            }
        }
    },
    'Extension': None,
    'token': 'PtzConfigToken-0',
    '_attr_1': {
}
}

PTZ configuration options:
{
    'Spaces': {
        'AbsolutePanTiltPositionSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
                'XRange': {
                    'Min': -1.0,
                    'Max': 1.0
                },
                'YRange': {
                    'Min': -1.0,
                    'Max': 1.0
                }
            }
        ],
        'AbsoluteZoomPositionSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
                'XRange': {
                    'Min': 0.0,
                    'Max': 1.0
                }
            }
        ],
        'RelativePanTiltTranslationSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
                'XRange': {
                    'Min': -1.0,
                    'Max': 1.0
                },
                'YRange': {
                    'Min': -1.0,
                    'Max': 1.0
                }
            }
        ],
        'RelativeZoomTranslationSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
                'XRange': {
                    'Min': -1.0,
                    'Max': 1.0
                }
            }
        ],
        'ContinuousPanTiltVelocitySpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
                'XRange': {
                    'Min': -1.0,
                    'Max': 1.0
                },
                'YRange': {
                    'Min': -1.0,
                    'Max': 1.0
                }
            }
        ],
        'ContinuousZoomVelocitySpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
                'XRange': {
                    'Min': -1.0,
                    'Max': 1.0
                }
            }
        ],
        'PanTiltSpeedSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace',
                'XRange': {
                    'Min': 0.0,
                    'Max': 1.0
                }
            }
        ],
        'ZoomSpeedSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace',
                'XRange': {
                    'Min': 0.0,
                    'Max': 1.0
                }
            }
        ],
        'Extension': None,
        '_attr_1': None
    },
    'PTZTimeout': {
        'Min': datetime.timedelta(seconds=1),
        'Max': datetime.timedelta(seconds=120)
    },
    '_value_1': None,
    'PTControlDirection': None,
    'Extension': None,
    '_attr_1': None
}

PTZ service capabilities:
{
    '_value_1': None,
    'EFlip': True,
    'Reverse': False,
    'GetCompatibleConfigurations': True,
    '_attr_1': {
        'StatusPosition': 'true',
        'MoveStatus': 'true'
    }
}

PTZ status:
{
    'Position': {
        'PanTilt': {
            'x': 0.823199987,
            'y': -0.477499992,
            'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace'
        },
        'Zoom': {
            'x': 1.0,
            'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace'
        }
    },
    'MoveStatus': {
        'PanTilt': 'IDLE',
        'Zoom': 'IDLE'
    },
    'Error': None,
    'UtcTime': datetime.datetime(2025, 1, 23, 20, 56, 32, tzinfo=<isodate.tzinfo.Utc object at 0x000001AD55389730>),
    '_value_1': None,
    '_attr_1': None
}
YES - GetServiceCapabilities shows that the camera supports MoveStatus.
YES - MoveStatus is reporting IDLE.
NO - RelativeMove Pan/Tilt is unsupported.
YES - RelativeMove Zoom is supported.

@VeganBiker
Copy link

I'm getting the following for all my cameras:
Connected to ONVIF camera
Created media service object
Media profiles
[{
'Name': 'MainStream',
'VideoSourceConfiguration': {
'Name': 'VideoSourceMain',
'UseCount': 2,
'SourceToken': 'VideoSourceMain',
'Bounds': {
'x': 0,
'y': 0,
'width': 3840,
'height': 2160
},
'_value_1': None,
'Extension': None,
'token': 'VideoSourceMain',
'_attr_1': {
}
},
'AudioSourceConfiguration': {
'Name': 'AudioMainName',
'UseCount': 2,
'SourceToken': 'AudioMainSrcToken',
'_value_1': None,
'token': 'AudioMainToken',
'_attr_1': {
}
},
'VideoEncoderConfiguration': {
'Name': 'VideoEncodeMain',
'UseCount': 1,
'Encoding': 'H264',
'Resolution': {
'Width': 3840,
'Height': 2160
},
'Quality': 100.0,
'RateControl': {
'FrameRateLimit': 20,
'EncodingInterval': 1,
'BitrateLimit': 0
},
'MPEG4': {
'GovLength': 0,
'Mpeg4Profile': 'SP'
},
'H264': {
'GovLength': 20,
'H264Profile': 'High'
},
'Multicast': {
'Address': {
'Type': 'IPv4',
'IPv4Address': '192.168.10.61',
'IPv6Address': None
},
'Port': 0,
'TTL': 0,
'AutoStart': False,
'_value_1': None,
'_attr_1': None
},
'SessionTimeout': datetime.timedelta(seconds=720),
'_value_1': None,
'token': 'VideoEncodeMain',
'_attr_1': {
}
},
'AudioEncoderConfiguration': {
'Name': 'AudioMain',
'UseCount': 2,
'Encoding': 'G711',
'Bitrate': 64000,
'SampleRate': 16000,
'Multicast': {
'Address': {
'Type': 'IPv4',
'IPv4Address': '192.168.10.61',
'IPv6Address': None
},
'Port': 80,
'TTL': 1,
'AutoStart': False,
'_value_1': None,
'_attr_1': None
},
'SessionTimeout': datetime.timedelta(microseconds=60000),
'_value_1': None,
'token': 'G711',
'_attr_1': {
}
},
'VideoAnalyticsConfiguration': {
'Name': 'VideoAnalyticsName',
'UseCount': 3,
'AnalyticsEngineConfiguration': {
'AnalyticsModule': [
{
'Parameters': {
'SimpleItem': [
{
'Name': 'Sensitivity',
'Value': '80'
}
],
'ElementItem': [
{
'_value_1': <Element {http://www.onvif.org/ver10/schema}CellLayout at 0x7f02b19844c0>,
'Name': 'Layout'
}
],
'Extension': None,
'_attr_1': None
},
'Name': 'MyCellMotionModule',
'Type': 'tt:CellMotionEngine'
}
],
'Extension': None,
'_attr_1': None
},
'RuleEngineConfiguration': {
'Rule': [
{
'Parameters': {
'SimpleItem': [
{
'Name': 'MinCount',
'Value': '5'
},
{
'Name': 'AlarmOnDelay',
'Value': '100'
},
{
'Name': 'AlarmOffDelay',
'Value': '100'
},
{
'Name': 'ActiveCells',
'Value': '0P8A8A=='
}
],
'ElementItem': [],
'Extension': None,
'_attr_1': None
},
'Name': 'MyMotionDetectorRule',
'Type': 'tt:CellMotionDetector'
}
],
'Extension': None,
'_attr_1': None
},
'_value_1': None,
'token': 'VideoAnalyticsToken',
'_attr_1': {
}
},
'PTZConfiguration': {
'Name': 'ptz0',
'UseCount': 2,
'NodeToken': 'ptz0',
'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
'DefaultPTZSpeed': {
'PanTilt': {
'x': 1.0,
'y': 1.0,
'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace'
},
'Zoom': {
'x': 1.0,
'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace'
}
},
'DefaultPTZTimeout': datetime.timedelta(seconds=60),
'PanTiltLimits': {
'Range': {
'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
},
'YRange': {
'Min': -1.0,
'Max': 1.0
}
}
},
'ZoomLimits': {
'Range': {
'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
}
}
},
'Extension': None,
'token': 'ptz0',
'_attr_1': {
}
},
'MetadataConfiguration': None,
'Extension': None,
'token': 'MainStream',
'fixed': False,
'_attr_1': {
}
}, {
'Name': 'SubStream',
'VideoSourceConfiguration': {
'Name': 'VideoSourceMain',
'UseCount': 2,
'SourceToken': 'VideoSourceMain',
'Bounds': {
'x': 0,
'y': 0,
'width': 720,
'height': 480
},
'_value_1': None,
'Extension': None,
'token': 'VideoSourceMain',
'_attr_1': {
}
},
'AudioSourceConfiguration': {
'Name': 'AudioMainName',
'UseCount': 2,
'SourceToken': 'AudioMainSrcToken',
'_value_1': None,
'token': 'AudioMainToken',
'_attr_1': {
}
},
'VideoEncoderConfiguration': {
'Name': 'VideoEncodeSub',
'UseCount': 1,
'Encoding': 'H264',
'Resolution': {
'Width': 720,
'Height': 480
},
'Quality': 100.0,
'RateControl': {
'FrameRateLimit': 25,
'EncodingInterval': 1,
'BitrateLimit': 2048
},
'MPEG4': {
'GovLength': 0,
'Mpeg4Profile': 'SP'
},
'H264': {
'GovLength': 20,
'H264Profile': 'High'
},
'Multicast': {
'Address': {
'Type': 'IPv4',
'IPv4Address': '192.168.10.61',
'IPv6Address': None
},
'Port': 0,
'TTL': 0,
'AutoStart': False,
'_value_1': None,
'_attr_1': None
},
'SessionTimeout': datetime.timedelta(seconds=720),
'_value_1': None,
'token': 'VideoEncodeSub',
'_attr_1': {
}
},
'AudioEncoderConfiguration': {
'Name': 'AudioMain',
'UseCount': 2,
'Encoding': 'G711',
'Bitrate': 64000,
'SampleRate': 16000,
'Multicast': {
'Address': {
'Type': 'IPv4',
'IPv4Address': '192.168.10.61',
'IPv6Address': None
},
'Port': 80,
'TTL': 1,
'AutoStart': False,
'_value_1': None,
'_attr_1': None
},
'SessionTimeout': datetime.timedelta(microseconds=60000),
'_value_1': None,
'token': 'G711',
'_attr_1': {
}
},
'VideoAnalyticsConfiguration': {
'Name': 'VideoAnalyticsName',
'UseCount': 3,
'AnalyticsEngineConfiguration': {
'AnalyticsModule': [
{
'Parameters': {
'SimpleItem': [
{
'Name': 'Sensitivity',
'Value': '80'
}
],
'ElementItem': [
{
'_value_1': <Element {http://www.onvif.org/ver10/schema}CellLayout at 0x7f02b1989c40>,
'Name': 'Layout'
}
],
'Extension': None,
'_attr_1': None
},
'Name': 'MyCellMotionModule',
'Type': 'tt:CellMotionEngine'
}
],
'Extension': None,
'_attr_1': None
},
'RuleEngineConfiguration': {
'Rule': [
{
'Parameters': {
'SimpleItem': [
{
'Name': 'MinCount',
'Value': '5'
},
{
'Name': 'AlarmOnDelay',
'Value': '100'
},
{
'Name': 'AlarmOffDelay',
'Value': '100'
},
{
'Name': 'ActiveCells',
'Value': '0P8A8A=='
}
],
'ElementItem': [],
'Extension': None,
'_attr_1': None
},
'Name': 'MyMotionDetectorRule',
'Type': 'tt:CellMotionDetector'
}
],
'Extension': None,
'_attr_1': None
},
'_value_1': None,
'token': 'VideoAnalyticsToken',
'_attr_1': {
}
},
'PTZConfiguration': {
'Name': 'ptz0',
'UseCount': 2,
'NodeToken': 'ptz0',
'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
'DefaultPTZSpeed': {
'PanTilt': {
'x': 1.0,
'y': 1.0,
'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace'
},
'Zoom': {
'x': 1.0,
'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace'
}
},
'DefaultPTZTimeout': datetime.timedelta(seconds=60),
'PanTiltLimits': {
'Range': {
'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
},
'YRange': {
'Min': -1.0,
'Max': 1.0
}
}
},
'ZoomLimits': {
'Range': {
'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
}
}
},
'Extension': None,
'token': 'ptz0',
'_attr_1': {
}
},
'MetadataConfiguration': None,
'Extension': None,
'token': 'SubStream',
'fixed': False,
'_attr_1': {
}
}]
Chosen token
SubStream
Creating PTZ object
Created PTZ service object
PTZ configurations:
{
'Name': 'ptz0',
'UseCount': 2,
'NodeToken': 'ptz0',
'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
'DefaultPTZSpeed': {
'PanTilt': {
'x': 1.0,
'y': 1.0,
'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace'
},
'Zoom': {
'x': 1.0,
'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace'
}
},
'DefaultPTZTimeout': datetime.timedelta(seconds=60),
'PanTiltLimits': {
'Range': {
'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
},
'YRange': {
'Min': -1.0,
'Max': 1.0
}
}
},
'ZoomLimits': {
'Range': {
'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
}
}
},
'Extension': None,
'token': 'ptz0',
'_attr_1': {
}
}

PTZ configuration options:
{
'Spaces': {
'AbsolutePanTiltPositionSpace': [
{
'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
},
'YRange': {
'Min': -1.0,
'Max': 1.0
}
}
],
'AbsoluteZoomPositionSpace': [
{
'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
}
}
],
'RelativePanTiltTranslationSpace': [
{
'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
},
'YRange': {
'Min': -1.0,
'Max': 1.0
}
}
],
'RelativeZoomTranslationSpace': [
{
'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
}
}
],
'ContinuousPanTiltVelocitySpace': [
{
'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
},
'YRange': {
'Min': -1.0,
'Max': 1.0
}
}
],
'ContinuousZoomVelocitySpace': [
{
'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
}
}
],
'PanTiltSpeedSpace': [
{
'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
}
}
],
'ZoomSpeedSpace': [
{
'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace',
'XRange': {
'Min': -1.0,
'Max': 1.0
}
}
],
'Extension': None,
'_attr_1': None
},
'PTZTimeout': {
'Min': datetime.timedelta(seconds=1),
'Max': datetime.timedelta(seconds=60)
},
'_value_1': None,
'PTControlDirection': None,
'Extension': None,
'_attr_1': None
}

PTZ service capabilities:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/onvif/client.py", line 23, in wrapped
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/onvif/client.py", line 153, in wrapped
return call(params, callback)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/onvif/client.py", line 140, in call
ret = func(**params)
^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/zeep/proxy.py", line 46, in call
return self._proxy._binding.send(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/zeep/wsdl/bindings/soap.py", line 135, in send
return self.process_reply(client, operation_obj, response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/zeep/wsdl/bindings/soap.py", line 229, in process_reply
return self.process_error(doc, operation)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/zeep/wsdl/bindings/soap.py", line 391, in process_error
raise Fault(
zeep.exceptions.Fault

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/sdansro/./fovtest.py", line 65, in
service_capabilities = ptz.GetServiceCapabilities(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/onvif/client.py", line 26, in wrapped
raise ONVIFError(err)
onvif.exceptions.ONVIFError: Unknown error:

@hawkeye217
Copy link
Author

Looks like your camera's ONVIF implementation doesn't support a the GetServiceCapabilities call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment