IP Camera: Hikvision NVR

Greetings,

This IP Camera Binding is doing my head in :slight_smile:

I have a Hikvision NVR (DS-7608NI) and a Hikvision PTX Camera (DS-2DE4425IW) connected to it.

I only want simple functionality…I want to receive alarms for Intrusion and Line Detection. And I also want to be able to Live View a HD stream in OpenHAB.

What I have tried so far…If I create a IPCamera Binding thing, and hit scan it picks up the NVR as an ONVIF Camera. I configure this, and it allows me to receive the alarms I want, and also a HD snapshot and mjpeg no issues. I problem is, once I add more cameras to the NVR, can I select which camera’s feed I want to see via the binding?

I also tried configuring the IPCamera Binding thing as a Hikvision Camera with API. Again the alarms work no drama, but the snapshot is horrible res, and the mjpeg results in an error in the logs below:

2022-11-13 09:00:11.978 [WARN ] [ipcamera.internal.MyNettyAuthHandler] - 403 Forbidden: Check camera setup or has the camera activated the illegal login lock?

What would you suggest is the correct way to configure this combination of NVR and Camera? ONVIF or Hikvision with API?

Any help on getting it working would be awesome!

Hikvision cameras will lock out all attempts to reach the camera if you try 2-3 times with the wrong password. This can get tripped if you add the camera and dont provide the user and password, so to fix it just restart the camera after you have given the binding the correct user/pass. You can also turn this feature off in the camera.

You can manually supply the snapshot URL that you want the binding to use. Check the cameras URL directly in a web browser to check the resolution and if this is simply the camera is giving you a low res picture. The cameras setting page can be adjusted and you may just need to tell it to increase the res.

The HIK NVRs also have the abiliity to reach each camera directly on a sub port, and this should unlock more abilities then simply setting up each camera with the same settings and just changing the NVR channel config.

Thanks matt1,

Since posting I had a few breakthroughs :slight_smile:

My thing config is below:

Thing ipcamera:hikvision:drivewayPTZ "Driveway PTZ"
[
    ipAddress="192.168.1.2",
    username="user",
    password="password",
    onvifport=80,
    port=65001,
    ptzContinuous=true,
    pollTime=1000,
    nvrChannel=1,
    mjpegOptions="-q:v 5 -r 2 -vf scale=704:-2 -update 1",
    ffmpegLocation="/usr/bin/ffmpeg",
    snapshotOptions="-an -vsync vfr -q:v 2 -update 1"
] {
    Channels:
        Switch : fieldDetectionAlarm "Intrusion Detection Alarm"
        Switch : lineCrossingAlarm "Line Crossing Alarm"       
}

Once I changed port from the NVR HTTP Port, to the Camera Virtual Host everything started to work as expected.

Thanks for your feedback