tchellomello / python-amcrest

A Python 2.7/3.x module for Amcrest and Dahua Cameras using the SDK HTTP API.
GNU General Public License v2.0
216 stars 76 forks source link

Authentication issue with ip5m-T119ew #171

Open AvidDabbler opened 3 years ago

AvidDabbler commented 3 years ago

I am working with the ip5m-T119ew and was able to get it the screenshot up and running no problem, but having an issue with the streaming video.

I have tried it a couple different ways for the initial call of AmcrestCamera:

camera = AmcrestCamera(host=f'111.111.1.1', port=80, user=admin, password=password, protocol='rtsp').camera
camera = AmcrestCamera(host=f'{admin}:{password}@192.168.1.124', port=80, user=admin, password=password).camera
camera = AmcrestCamera(host=f'@192.168.1.124', port=80, user=admin, password=password).camera

When I try to connect with protocol="rtsp" this is the error that I get:

amcrest.exceptions.CommError: No connection adapters were found for 'rtsp://admin:admin@111.111.1.1:554/cgi-bin/magicBox.cgi?action=getMachineName'

When I try to connect with protocol="http" this is the error that I get: amcrest.exceptions.CommError: 400 Client Error: Bad Request for url: http://111.111.1.1:80/cgi-bin/realmonitor.cgi?action=getStream&channel=1&subtype=1

was able to get this to work with cv2: cv2.VideoCapture('rtsp://admin:admin@111.111.1.1:80/cam/realmonitor?channel=1&subtype=0') => works on any port