MissiaL / hikvision-client

Client for Hikvision devices
MIT License
209 stars 43 forks source link

Remote end closed connection without response #37

Closed coder-maddy closed 8 months ago

coder-maddy commented 8 months ago

Hello,

I am capturing images from hikvision camera using this client. For of most of the camera's I am able to capture the image but however for couple of camera it's failing. It is giving below error.

image

Here is code ` def camera_capture_cred(camera_ip,username,password,name,capturepath): try: cam = Client('http://'+camera_ip, username, password, timeout=10)

Get and save picture from camera

    response = cam.Streaming.channels[102].picture(method='get', type='opaque_data')
    path = os.path.join(capturepath, name).replace('\\', '/')
    print(path)
    with open(path, 'wb') as f:
        for chunk in response.iter_content(chunk_size=1024):
            if chunk:
                f.write(chunk)
    return path
except Exception as ex:
    return "-1"

`

It would be great if someone can provide me insights about this issue.

coder-maddy commented 8 months ago

Port issue, closing it