-
-
Save hawkeye217/152a1d4ba80760dac95d46e143d37112 to your computer and use it in GitHub Desktop.
# 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') | |
# 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) | |
# Create ptz service object | |
print('Creating PTZ object') | |
ptz = mycam.create_ptz_service() | |
print('Created PTZ service object') | |
# 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.") |
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.
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.
See the Frigate docs. This script just tests for the correct ONVIF support for Frigate's autotracking.
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?
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```
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.
@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.
Most likely zoneminder was using the Hikvision ISAPI, which is different than ONVIF.
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?
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.
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
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.
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.
the question is. is it hte code or is that itended