Hikvision setup

have you changed your 2nd stream to MJPEG??

No, but if the only solution is using a 4Mpixel camera at 640x480 Iā€™m returning it.

I find that 2nd stream is perfect for HA for me, I used theprimary stream only got recording via QVR on my NASā€¦

but since the last release there is a new Stream function in HA that works perfectly with Hik cameras

Camera streams for everyone

With this release weā€™re getting serious about cameras. @hunterjm has worked months on this and itā€™s finally ready for the first reveal. With the stream component, we will be able to forward streams from cameras in your house and repackage it into formats that your display devices understand. Previously, streaming cameras was limited to 2 frames per second and only in the frontend. For the first version we focused on the HLS format, which is supported by modern browsers and Chromecast. Each camera integration will need to be individually updated, for the first version we have only added support for the generic camera integration.

So what is possible now? You can start streaming your frontdoor feed on your TV when the doorbell rings or you can install a camera in the nursery and turn your Google Home Hub into a babymonitor.

To get started, add stream: to your configuration.yaml, configure the generic cameraand start using the new camera.play_stream service.

Thanks, how do I configure the generic camera to the new stream component?

put

stream:

into you config then create a camera to use it

  - platform: generic
    still_image_url: "http://xxxx:[email protected]:xxx/ISAPI/Streaming/channels/2/picture"
    stream_source: "rtsp://xxxx:[email protected]:xxx"
    authentication: digest
    name: Front Garden stream

edit and i have been testing using the stream when the door bell is pressed

        
- alias: Doorbell_test
  initial_state: 'on'
  trigger:
    platform: event
    event_type: xiaomi_aqara.click
    event_data:
      entity_id: binary_sensor.switch_158d0001a668c0
      click_type: single
  action:
    - service: camera.play_stream
      data:
        entity_id: camera.front_garden_stream
        media_player: media_player.43pus7303_12
1 Like

Close. No preview image for the camera but I do get a live stream eventually. Itā€™s delayed by about 12 seconds (probably a limitation of the pi).

- platform: generic
  still_image_url: "http://myuser:[email protected]:80/ISAPI/Streaming/channels/2/picture"
  stream_source: "rtsp://myuser:[email protected]:554"
  authentication: digest
  name: Rumpus Room

http://myuser:[email protected]:80/ISAPI/Streaming/channels/2/picture does show up in my browser, just not HA.

If I could get that to work Iā€™d use the generic still image camera config. It works well for my Vivotek 5MP cameras (1 second updates full res).

1 Like

I think you might be missing some setting on the camera? I have this set

1 Like

I reckon youā€™re right. I saw a message when I was playing with URLs earlier about cgi not enabled. Stand byā€¦

Hmm. Nope. Still no preview after enabling CGI and ONVIF.

Iā€™ll try the onvif camera now though.

I also have the security settings set as digest/basic on both, cannot get a screen shot of that now

1 Like

Bingo!

That was the problem. Thank you!

Final config:

- platform: generic
  name: Rumpus
  username: !secret camera_user2
  password: !secret camera_password
  authentication: digest
  still_image_url: http://10.1.1.22:80/ISAPI/Streaming/channels/101/picture
5 Likes

Holly Mackrell this actually worked!
Iā€™ve been looking for this for AGES!
THANK YOU!

Check also digest (see if there are other settings and change them on the camera settings).

Edit you found it. Yes I had that problem too some months ago, and solved that way

I was able to view my cameras with my DS-7216HQHI-K2 using the method by pepeEl; but after about one hour the stream stops and only resumes after I restart the NVR.

Iā€™ve tried changing the password, restarting home assistant and the only thing that ā€œworksā€ so far is to restart the NVR untill another hour of continous streaming the transmision falls again.

I have this in my configuration.yaml and a simple picture glance

I had this same sort of problem after I added some newer hikvision cameras. The newer cameras (firmware version?) wouldnā€™t support ā€œBasicā€ authentication and required ā€œdigestā€. This was pretty confusion when I cloned the configuration I had for 3 other Hikvision cameras and it wasnā€™t workingā€¦

Hi guysā€¦so Iā€™ve just updated to 91.2 and thought iā€™d give the stream component a go.

I have a Hikvision NVR model DS-7604NI-K1 / 4P(B) running firmware V3.4.100 build 180310 and a camera model DS-2CD2345FWD-I running firmware V5.5.80 build 180911.

Iā€™ve enabled basic/digest on both the NVR and the camera and also enabled Onvif and the Hik CGI auth on the camera itself.

Iā€™ve added the below to my config yamlā€¦

ffmpeg:

stream:

camera:
- platform: generic
  name: Drive
  username: admin
  password: password
  authentication: digest
  still_image_url: http://192.168.0.196:80/ISAPI/Streaming/channels/101/picture
  stream_source: rtsp://admin:[email protected]:554/Streaming/Channels/101

The still image works fineā€¦seems to update every second or so, but when I try to load the stream, it just ā€œtries to loadā€ constantly but never produces an image.

Looking in the logs i get a ā€œPPS id out of range: 0ā€ message, with the ID number changing.

Also, when i try the RTSP url in VLC, whilst it doesnā€™t complain about authentication, but it also doesnā€™t load the stream.

Does anyone have any ideas?

Iā€™ve seen somewhere that the ā€œverification codeā€ might be causing an issue and i might have to disable the camera encryption?

Those of you who have this working, can you confirm if youā€™re using a verification code within the Hik system and apps etc. and whether this works with HA or not please?

Thanks for any help in advance.

1 Like

If using VLC on Windows, make sure your firewall has port 554 enabledā€¦
Here is a a how to video, showing VLC accessing NVR:

1 Like

I have the same problem. Were you able to resolve?

1 Like

that`s because you are using rtsp://username:password@host when you already have them configured higher up ā€¦

delete the user:pass after rtsp :slight_smile:

Mine works, all camera are activated with verification code done. Will check if my code differ from yours.

I use camera IP directly not the NVR