Hikvision Cameras with Virtual Host enabled

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
bibbity
Posts: 10
Joined: Tue Nov 15, 2022 12:38 pm

Hikvision Cameras with Virtual Host enabled

Post by bibbity »

Hi all,

I'm currently running Zoneminder version 1.36.31 (newly installed today), and I'm wondering if anybody has got it working with Hikvision cameras that are running through a Hikvision NVR.

From researching it looks like the way to connect Hik cameras in Zoneminder is using rtsp, but the format of the URL, for Hik cameras, for rtsp is

Code: Select all

rtsp://IP:RTSPPort/Streaming/Channes/ID/?transportmode=unicast
where IP corresponds to the camera IP.

All of the cameras (except one, which is running through a switch) are on the Hik NVRs internal subnet (192.168.254) so Zoneminder can't connect to them.

The "Virtual Host" feature has been enabled on the NVR so I can access the cameras using <NVR IP>:65001, 65002 etc. What I haven't been able to figure out is how to use rtsp with the virtual host feature.

Has anybody done it?
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Hikvision Cameras with Virtual Host enabled

Post by Magic919 »

You can usually get them all from the NVR /Streaming/Channels/301 (101,201 etc) . You don't use the virtual host feature for that.

You can (if you want) grab them direct by using a static route to the 192.168.254.0/24 subnet. No need to, as stated above.
-
bibbity
Posts: 10
Joined: Tue Nov 15, 2022 12:38 pm

Re: Hikvision Cameras with Virtual Host enabled

Post by bibbity »

Thanks for the reply!

Just to clarify, do you mean use the NVR IP and the /Streaming/Channels endpoint instead of the Camera IP? So, if the NVR is running on 192.168.40.101, I should be able to get RTSP working with 192.168.40.101/Streaming/Channels/301 ?
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Hikvision Cameras with Virtual Host enabled

Post by Magic919 »

Yes, where 301 is camera 3. I think 302 might be the lower quality stream, but it's been a while.
-
bibbity
Posts: 10
Joined: Tue Nov 15, 2022 12:38 pm

Re: Hikvision Cameras with Virtual Host enabled

Post by bibbity »

Thanks :)

It doesn't seem to be working, at the moment, with the Hik format

Code: Select all

rtsp://<username>:<password>@<address>:<port>/Streaming/Channels/<id>/
using VLC to test, but I'll keep playing and hopefully I'll figure it out!
bibbity
Posts: 10
Joined: Tue Nov 15, 2022 12:38 pm

Re: Hikvision Cameras with Virtual Host enabled

Post by bibbity »

Nevermind - that one was just me being stupid (forgot I was on a VPN).

That works great now, thank you :)
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Hikvision Cameras with Virtual Host enabled

Post by Magic919 »

That's good.

(You shouldn't really need to tell it the port.)
-
bibbity
Posts: 10
Joined: Tue Nov 15, 2022 12:38 pm

Re: Hikvision Cameras with Virtual Host enabled

Post by bibbity »

Ah yeah, it also works without the port.

Unfortunately it doesn't seem to be working in Zoneminder :cry:
bibbity
Posts: 10
Joined: Tue Nov 15, 2022 12:38 pm

Re: Hikvision Cameras with Virtual Host enabled

Post by bibbity »

Just going to note down the steps I went through to add it with an rtsp stream...

* Name -> Front Door
* Source Type -> Ffmpeg
* Function -> Monitor
* Source Path -> rtsp://<user>:<password>@<IP>/Streaming/Channels/202 (Note: the password does have an exclamation mark, which I had to URL encode to %21)
* Capture Resolution -> 1920 x 1080 (1080p preset)

Everything else is using the defaults
bibbity
Posts: 10
Joined: Tue Nov 15, 2022 12:38 pm

Re: Hikvision Cameras with Virtual Host enabled

Post by bibbity »

I wondered if it was the password having an exclamation mark, so I created a new user, tested it in VLC (it worked) and used that in Zoneminder but it's still not working....
bibbity
Posts: 10
Joined: Tue Nov 15, 2022 12:38 pm

Re: Hikvision Cameras with Virtual Host enabled

Post by bibbity »

And it's working....

In VLC, while I was viewing the rtsp stream, I opened the Media Information (cmd + i) > Codec Details and noted down the Video Resolution. It was a lot lower than what I had inputted (for some reason), so I changed it for Zoneminder.

That still didn't work, so I looked at the logs and saw "Failed to prime capture of initial monitor". Changed from TCP -> UDP and now it's working.
dougmccrary
Posts: 1336
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Hikvision Cameras with Virtual Host enabled

Post by dougmccrary »

Channels/201 May be the HD stream. If that’s what you want.
BTW, I have a camera that defaults to port 8554. I can set it to 554, but it’s less to remember leaving it at 8554, where is does need to be specified.
Thanks for the play by play-interesting.
Post Reply