I need to get a snapshot from an IP camera (ONVIF library for 2.7). The code and error is as follows:
cam = ONVIFCamera('192.168.22.19', 80, '***', '***') media = cam.create_media_service() media.GetSnapshotUri() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/onvif/client.py", line 31, in wrapped raise ONVIFError(err) onvif.exceptions.ONVIFError: Profile token does not exist Tried to get a token through GetVideoEncoderConfigurations , and an error pops up:
token = media.GetVideoEncoderConfigurations() media.GetSnapshotUri(token[0]._token) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/onvif/client.py", line 31, in wrapped raise ONVIFError(err) onvif.exceptions.ONVIFError: Unknown error: Method instance argument after ** must be a mapping, not Text How to get this token or another way to get a snapshot?
DECISION:
media.Func() via media.Func() should set the parameter type __dict__ with a named key: {"ProfileToken" : token}
UPD
It is necessary to read the documentation (((