How to access the video streams of a camera or NVR?

aster1x

Getting the hang of it
Joined
Jul 8, 2014
Messages
400
Reaction score
87
I have a 2332 connected to the PoE switch of an NVR 7604NI/SEP. I can access the web interface of the camera through the virtual host feature (192.168.1.XXX:65001)
How can we access the video streams with VLC or browser of a camera or NVR without going through the web interface?
 

Michelin Man

Getting the hang of it
Joined
Jul 22, 2015
Messages
430
Reaction score
46
Location
Australia
I don't believe you are able to view the stream directly off the camera if it's on the NVRs POE ports.

I have the same question regarding viewing the NVR on VLC, I have a feeling it doesn't work as it doesn't know which stream to show.
 

Dreamboat

Getting the hang of it
Joined
Jun 24, 2015
Messages
110
Reaction score
27
You can't access video streams directly from the camera (or at least I don't know how), so you should go through the NVR using the following syntax (in VLC):

rtsp://admin:12345@192.0.0.64:554/PSIA/streaming/channels/101 - main stream of camera 1

rtsp://admin:12345@192.0.0.64:554/PSIA/streaming/channels/502 - sub stream of camera 5.. etc

rtsp://admin:12345@192.0.0.64:554/PSIA/streaming/channels/001 - channel zero
 

Michelin Man

Getting the hang of it
Joined
Jul 22, 2015
Messages
430
Reaction score
46
Location
Australia
I just found out how to do it.

Basically for VLC its:

rtsp://NVR-IP-ADDRESS/Streaming/Channels/101

The 101 at the end means:

x01 - where x equals channel number
1xx - where xx equals 01 is Main Stream and 02 is Substream

e.g.

rtsp://192.168.0.253/Streaming/Channels/101 - Channel 1 Main Stream


^Beat me to it. With VLC you don't need to put the username and password in the URL, (I probably would prefer not to, cause you can see the password in the URL.) However, it does make it easier and quicker to open the stream.
 
Last edited by a moderator:

Dreamboat

Getting the hang of it
Joined
Jun 24, 2015
Messages
110
Reaction score
27
^Beat me to it. With VLC you don't need to put the username and password in the URL, (I probably would prefer not to, cause you can see the password in the URL.) However, it does make it easier and quicker to open the stream.
Yes, you're right. If the security is an issue the user/password information could be removed from the link like this:

rtsp://192.0.0.64:554/PSIA/streaming/channels/101
 

aster1x

Getting the hang of it
Joined
Jul 8, 2014
Messages
400
Reaction score
87
Thanks @michelin

With VLC the following are working
rtsp://NVRIP:554/PSIA/Streaming/Channels/101
rtsp://NVRIP:554/Streaming/Channels/101
rtsp://NVRIP/Streaming/Channels/101
rtsp://NVRIP/PSIA/Streaming/Channels/101

In all cases I was requested to enter both username and password twice. Probably because the first request of user and password comes from the NVR and the second request of username and password comes form the camera.

The test conditions are: camera 2cd2332 European with 5.1.6 build 140612 firmware with basic authentication for RTSP, NVR: 7604NI/SEP European with 3.0.9 build 10928 firmware.

However none of the above work with Internet Explorer. Any solution for the browsers?
 

Michelin Man

Getting the hang of it
Joined
Jul 22, 2015
Messages
430
Reaction score
46
Location
Australia
Is your NVR password different to the camera password?

I didn't know you could open RTSP in a browser without using a plugin or like realplayer and etc.
 

aster1x

Getting the hang of it
Joined
Jul 8, 2014
Messages
400
Reaction score
87
The usernames and passwords are the same in the NVR and the camera.
 

Michelin Man

Getting the hang of it
Joined
Jul 22, 2015
Messages
430
Reaction score
46
Location
Australia
That's odd. I have the same password for both as well and I just need to enter the username and password once.

However, at the same time. I do believe we should only need to enter the credentials for the NVR as that is what we are accessing. The camera at this point should not be in the equation.
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,115
Reaction score
5,979
Location
Scotland
You can't access video streams directly from the camera (or at least I don't know how), so you should go through the NVR using the following syntax (in VLC):
If the 'Virtual host' is active, or 'IP forwarding' has been enabled in the NVR, and the camera's default gateway is set to the IP address of the NVR PoE interface, the stream can be pulled from the camera.
However - the NVR will have more resources to support streams from its own encoders than the camera, they are generally running fairly near their limit, unlike the NVRs which have dual-core fast CPUs and lots of RAM.
For those NVRs that still provide ONVIF services (firmware dependant), you can see what streams are offered by using the very good Windows open-source tool 'ONVIF Device Manager' from sourceforge.net, and looking at the 'Receivers' page.

Sample below:

 

Attachments

aster1x

Getting the hang of it
Joined
Jul 8, 2014
Messages
400
Reaction score
87
@michelin

I tried myprevious tests from another computer and I was prompted only once for the username and password. So you may be right. I can not explain why on my other computer I am prompted twice. Anyway....

@Alastair
So if I understand correct, the left image comes from the camera connected to the PoE switch of your NVR with internal IP 192.168.254.14:554 and the right image comes from the NVR with IP 192.168.1.211:554.

Well I tried on my 7604NI/SEP and I cannot get the camera stream from the camera internal IP (as your left image).

In the ONVIF manager I get the four streams like rtsp://NVRIP:554/Streaming/channels/101 upto 401. Is there something else we can with the ONVIF manager?
 
Last edited by a moderator:

Dreamboat

Getting the hang of it
Joined
Jun 24, 2015
Messages
110
Reaction score
27
If the 'Virtual host' is active, or 'IP forwarding' has been enabled in the NVR, and the camera's default gateway is set to the IP address of the NVR PoE interface, the stream can be pulled from the camera.
I think in case there's no wired connection between the NVRs "WAN" port and the PoE ports, itsn't possible to call directly camera IP address or I'm wrong?
In normal situation only the "WAN" port is connected to the network, while the PoE ports are only connected to the powered IP cameras. I call it "WAN" but it's actually the single LAN part.
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,115
Reaction score
5,979
Location
Scotland
So if I understand correct, the left image comes from the camera connected to the PoE switch of your NVR with internal IP 192.168.254.14:554 and the right image comes from the NVR with IP 192.168.1.211:554.
Yes, that is correct.
But in order to do this, I enabled 'IP forwarding' on the NVR, via the Linux command line. It's not for everyone to do, as it's a bit 'techy' but it's worth mentioning in case anyone wants to make use of the facility. I find it useful to allow another NVR (motion alerts only) and QNAP Surveillance Station (continuous and motion recording) to access the same cameras.
http://www.ipcamtalk.com/showthread.php/1604-Hikvision-POE-LAN-segment-access-to-cameras-without-virtual-host-or-extra-wiring?highlight=extra+wiring
One day I may update the firmware on the 7816N-E2/8P NVR that does continuous recording to find which version enables 'Virtual Host', unless anyone knows for sure?

I think in case there's no wired connection between the NVRs "WAN" port and the PoE ports, itsn't possible to call directly camera IP address or I'm wrong?
With 2 network interfaces such as an NVR with PoE ports, the embedded Linux has the capability to route traffic between those 2 interfaces, but by default that facility is disabled in the uImage as-compiled configuration. It can be activated if you can get to a command line, though it's a 'running' change only, it will revert on a reboot. Having said that, my NVR has not once rebooted since power-on last October, amazingly stable.
 

aster1x

Getting the hang of it
Joined
Jul 8, 2014
Messages
400
Reaction score
87
@Dreamboat We agree on your terminology of the IP ports. However Alastair has clearly demonstrated that he can pull the camera stream video by calling the camera internal IP 192.168.254.XXX. So is there anybody else who can verify Alastair's demostration. If there is no one else then it is true that not all NVR firmware are the same.
 
Last edited by a moderator:

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,115
Reaction score
5,979
Location
Scotland
Is there something else we can with the ONVIF manager?
Lots have found 'ONVIF Device Manager' a really useful tool to tell you things about the cameras that are usually not covered in a camera user manual, not just familiar brand names, but those low-cost but quite good Chinese small brand cameras that are almost invariably ONVIF compliant in some way.
But I don't think you can use it for more than just an information source.
VLC is a very capable tool, with an amazing array of command-line options to both receive streams and re-transmit and record them.
 

DemonicHawk

Young grasshopper
Joined
Sep 8, 2015
Messages
78
Reaction score
37
Location
Canada
I can confirm alastairstevenson's claims, with virtual-host enabled and the proper configuration, I can access my cameras through (for example) 192.168.1.150:65001 as well as 192.168.254.2. I've been meaning to write about this given the amount of misinformation floating around.

I investigated this quite a bit and you DO NOT want to connect a cable from your NVR Camera port to your LAN. This causes all your camera traffic to go through your LAN and you can verify this by looking at the NVR LAN traffic*. This is not ideal, as you want the camera traffic to go straight to the NVR and not bog down your network unnecessarily - especially if you have a lot of cameras.

All you need is a firmware that supports virtual-host. Here's what you do:

On your NVR network settings:
1) Set up a static IP - this can be done easily on your router (sometimes called DHCP reservation) or by simply disabling DHCP and ensuring that the IP address, Subnet mask, Gateway, and DNS server are correct.
2) Take note of the IPv4 Address (i.e. 192.168.1.X), IPv4 Default Gateway (i.e. 192.168.1.1) , and Internal NIC Address** (by default its 192.168.254.1)
3) Enable Virtual-Host, you will find the option under Network Settings -> Advanced (if you have it)
4) You should now have access to your cameras through your NVR through http://192.168.1.X:6500Y where Y is the camera number. The links are also provided in the "Camera Management" page.

On your cameras:
1) Login to the camera - the credentials will either be the same as your NVR, or admin/12345
2) Go into the Network configuration and change the IPv4 Default Gateway to your NVR Internal NIC Address (i.e. 192.168.254.1)
3) Save and reboot (as prompted)
4) Your cameras should now have access to the internet (they can send email alerts, upload to FTP, etc..)

On your router (this is the tricky part):
1) You want to set up a "Static Route" (Google is your friend) - Different routers will likely have different specific terms, so the following is for a Linksys router
2) Set the "Destination LAN IP" to your NVR internal NIC address, but instead of the ending with a 1, it will end with a 0. So if your Internal NIC Address is 192.168.254.1, you want to set it to 192.168.254.0.
3) Set the "Subnet Mask" to be the same as on your NVR (likely 255.255.255.0)
4) Set the "Gateway" to your NVR IPv4 Address
5) You should now be able to access your cameras through their internal IP addresses (i.e. 192.168.254.X)

And that's it!

So for example, I can now access my cameras using:
192.168.1.150:65001 OR 192.168.254.2
192.168.1.150:65002 OR 192.168.254.3
192.168.1.150:65003 OR 192.168.254.4
(They don't match up because the NVR is on 192.168.254.1)

Doing this also means you can add each camera individually to iVMS-4500 and get push notifications directly from the camera. Why would you want to do that? No idea, but I originally investigated this method for getting VCA push alerts. Though I quickly realized that I would always get motion alerts too since I needed to "notify surveillance center" on motion to ensure the NVR records.


*I should note that if you plug the cameras in when the NVR LAN is unplugged, and then plug in the NVR LAN cable afterwards, the camera traffic will still be direct to the NVR, but upon rebooting the NVR the traffic will once again default to going through the NVR LAN port.

**If you are configuring through your browser, you can determine the Internal NIC Address by looking at the "Camera Management" page which shows the "IP Camera Address". They will all have the same first three groups of digits with a varying fourth group (i.e. they all start with 192.168.254.X). Your Internal NIC Address will have the same first three groups of digits with the last group being "1".
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,115
Reaction score
5,979
Location
Scotland
Thanks for that clear and detailed explanation.
And an interesting point about the camera traffic flow on a 'bridged' arrangement - I don't think that's been mentioned before, and not something I'd thought of. That could certainly be a bit of a bottleneck depending on router/switch speeds and a lot of cameras.
2) Go into the Network configuration and change the IPv4 Default Gateway to your NVR Internal NIC Address (i.e. 192.168.254.1)
Just one caveat on the above - and I'm not sure if it actually is the case but I suspect it may be - if the PoE port configuration is left as 'Plug&Play' the NVR may overwrite the camera default gateway setting if the camera was power-cycled, or maybe even on a timed basis as it refreshes the camera IP configuration.
No problem when the PoE port is on 'Manual' which keeps the NVR out of the picture for that part of the camera config.
 

aster1x

Getting the hang of it
Joined
Jul 8, 2014
Messages
400
Reaction score
87
@DemonicHawk
This is exactly how I have configured my camera, NVR and router. However I am looking for a way to accessing the camera video stream (not the camera web interface) from VLC in the same way a Alastair has demonstrated in the left image in his post. This does not work in my setup. So obviously my firmware does not bridge the rtsp protocol from the camera LAN through the NVR LAN port.

How can we confirm which protocols are bridged and which ones are not?
 
Last edited by a moderator:

DemonicHawk

Young grasshopper
Joined
Sep 8, 2015
Messages
78
Reaction score
37
Location
Canada
Just one caveat on the above - and I'm not sure if it actually is the case but I suspect it may be - if the PoE port configuration is left as 'Plug&Play' the NVR may overwrite the camera default gateway setting if the camera was power-cycled, or maybe even on a timed basis as it refreshes the camera IP configuration.
No problem when the PoE port is on 'Manual' which keeps the NVR out of the picture for that part of the camera config.
I actually have all my cameras on PnP (out of laziness really) and haven't had the gateway overwritten by the NVR even after multiple reboots of the NVR/Camera/Both. Though I agree that manual would be the safest bet to ensure everything is working 100%.

This is exactly how I have configured my camera, NVR and router. However I am looking for a way to accessing the camera video stream (not the camera web interface) from VLC in the same way a Alastair has demonstrated in the left image in his post. This does not work in my setup. So obviously my firmware does not bridge the rtsp protocol from the camera LAN through the NVR LAN port.

How can we confirm which protocols are bridged and which ones are not?
That's interesting, I can open up the camera stream the exact same way that alastairstevenson did using rtsp://192.168.254.X:554. So just to clarify, you're saying you cannot access rtsp://192.168.254.X:554 (the stream) but you can access the camera web interface using http://192.168.254.X:80?

Have you checked that your RTSP on the camera is actually 554? I've seen some cases where it was set to 10544 for some reason. Otherwise, maybe it could be your router? You could rule that out by connecting your computer directly to one of the camera ports, changing your computer ip to 192.168.254.128 and trying to open the stream at rtsp://192.168.254.X:554. Those two points considered, it may actually be that Hikvision changed their implementation of Virtual-Host between firmwares and that your version actually doesn't bridge the 554 port.
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,115
Reaction score
5,979
Location
Scotland
The Linux kernel IP routing capability is at a lower level than RTSP or HTTP so should not be port selective.
However I have wondered how the Virtual Host is implemented (I don't have an NVR with it that I could investigate) - is it a simple NAT arrangement, or something more capable like a proxy? Either would fulfil the requirement to masquerade the native camera address while providing access from the NVR LAN segment, avoiding the need for the user to change their network capability. @aster1x - do you have a telnet feature on your NVR that gives access to a command prompt (not the 'psh' shell)?
If so - check the result of this command:
dvrdvs login: root
Password:

BusyBox v1.16.1 (2014-05-19 09:41:10 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.
can not change to guest!
[root@dvrdvs /] # cat /proc/sys/net/ipv4/ip_forward
1
[root@dvrdvs /] #
 
Top