Closed zqingxi closed 5 years ago
That most likely means that the camera isn't at that address.
That most likely means that the camera isn't at that address.
Thank you very much. The problem is solved. It is the network problem. After run following command:
from onvif import ONVIFCamera
mycam = ONVIFCamera('192.168.0.112', 80, 'admin', '12345')
mycam.devicemgmt.GetHostname()
the output is:
(HostnameInformation){
FromDHCP = False
Name = "Hikvision"
}
so the address is correct. Then run :
media = mycam.create_media_service()
ptz = mycam.create_ptz_service()
media_profile = media.GetProfiles()[0]
it output :
Traceback (most recent call last):
File "<ipython-input-7-46373cee5b14>", line 1, in <module>
media_profile = media.GetProfiles()[0]
File "/usr/local/lib/python2.7/dist-packages/onvif-0.2.0-py2.7.egg/onvif/client.py", line 32, in wrapped
raise ONVIFError(err)
ONVIFError: Unknown error: <urlopen error timed out>
then I put the camera and my computer in the same router, run the code once again (PS: change the IP and port ), no error, it succeed. Thanks @ssieb
Hello Guys, I get this error when I am trying to run the GetProfiles funtion:
I am using python2.7, the code is :
Any help will be appreciated, thanks.