FalkTannhaeuser / python-onvif-zeep

ONVIF Client Implementation in Python 2+3 (using https://github.com/mvantellingen/python-zeep instead of suds as SOAP client)
MIT License
428 stars 140 forks source link

Examples do not work #18

Open slowmathematician opened 6 years ago

slowmathematician commented 6 years ago

I installed the latest version of the python-onvif-zeep, but examples from repository do not work. I am faced with the following problem:

Traceback (most recent call last): File "examples/continuous_move.py", line 85, in <module> continuous_move() File "examples/continuous_move.py", line 56, in continuous_move request.ConfigurationToken = media_profile.PTZConfiguration._token File "/usr/lib/python2.7/site-packages/zeep-2.5.0-py2.7.egg/zeep/xsd/valueobjects.py", line 142, in __getattribute__ self.__class__.__name__, key)) AttributeError: PTZConfiguration instance has no attribute '_token'

Similarly for Python3.4:

Traceback (most recent call last): File "examples/continuous_move.py", line 85, in <module> continuous_move() File "examples/continuous_move.py", line 56, in continuous_move request.ConfigurationToken = media_profile.PTZConfiguration._token File "/usr/lib/python3.4/site-packages/zeep-2.5.0-py3.4.egg/zeep/xsd/valueobjects.py", line 142, in __getattribute__ self.__class__.__name__, key)) AttributeError: PTZConfiguration instance has no attribute '_token'

In this regard, I have to correct the relevant places in the code: Object._token --> Object.token, to eliminate these errors. Please, tell me where does this bug come from?

jmiguel99 commented 5 years ago

I got over the _token deal changing it to just token, but I have an error with the request that says the attribute is None. Have you encountered the same error??

THHHomas commented 5 years ago

@jmiguel99 I have encountered the same problem. Do you know how to solve this problem?

Traceback (most recent call last): File "streaming.py", line 67, in media_profile_configuration() File "streaming.py", line 55, in media_profile_configuration options.Extension.H264[0].BitrateRange[0].Min[0] TypeError: 'NoneType' object is not subscriptable

alemamm commented 5 years ago

I got over the _token deal changing it to just token, but I have an error with the request that says the attribute is None. Have you encountered the same error??

I got stuck at the same point - did you find a solution, @THHHomas ?

hua1024 commented 5 years ago

@jmiguel99 I have encountered the same problem. Do you know how to solve this problem?

Traceback (most recent call last): File "streaming.py", line 67, in media_profile_configuration() File "streaming.py", line 55, in media_profile_configuration options.Extension.H264[0].BitrateRange[0].Min[0] TypeError: 'NoneType' object is not subscriptable

I got stuck at the same point - did you find a solution, @slowmathematician ?

bonsaibobob commented 3 years ago

The "Extension" attribute for options for my camera was virtually empty, all the values for extension under options were "None". Not sure how to fix the extension values, but hard coding "video_encoder_configuration.RateControl.BitrateLimit" to equal a int will allow this example to work. Mine is personally set to "video_encoder_configuration.RateControl.BitrateLimit = 6144"

EduardoRonchi commented 2 years ago

Any update in this issue? changing "video_encoder_configuration.RateControl.BitrateLimit = 6144" like @bonsaibobob did allowed me to run the streaming.py, but nothing happens. I want to get the video stream of the camera.