Access live stream from camera direct, through HIKVision NVR?

tech_junkie

Getting comfortable
Joined
Sep 2, 2022
Messages
412
Reaction score
417
Location
South Dakota
I have never been able to figure out a way to directly access the camera behind the NVR and get audio.

I can connect to the RTSP stream, which might be something like but there is no audio. I use several different streaming software packages and connect to the RTSP port via the NVR... just no audio :-(

I know it is somehow possible, because if I use Internet explorer I can get the sound. It is annoying as I would like to get the sound.
Is the encoding for Audio compression box checked in the Cam?
Normally, you access hikvision cameras by using ivms-4200 and use the onvif login (port 8000) that doesn't use the RTSP stream. The web browser is the onvif login at port 80 and 443
 

tech_junkie

Getting comfortable
Joined
Sep 2, 2022
Messages
412
Reaction score
417
Location
South Dakota
Good to know what I have set is correct. :)

I'm actually trying to set up Scrypted on my NAS (within Docker) so I can add my cameras into the Apple Homekit system. For that I need to use an rtsp feed which is viable. I can access the streams on the NVR using a stream such as rtsp:/192.168.1.77/Streaming/Channels/301/ (camera 1, stream 1) (in VLC) but the NVR only supports streams 1 & 2 which do not carry the right resolution. The correct resolution is on stream 3 and to get to that stream I need to access it on the camera directly, and that's when I hit the problem.

VLC is used as a test application to see if the stream can be played back and one that has been validated I know what parameters should be valid to use in Scrypted to get it to work.

Does that make sense?
you will need two ethernet interfaces on your Mac. One for normal lan the other plugged into a cam port or a switch off the cam network, static at 192.168.254.100 subnet 255.255.255.0 gateway at 192.168.254.1 (which is the NVR's cam network gateway ip)

This way, you can connect your automation without breaking the built in security of separate nets.
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,979
Reaction score
6,802
Location
Scotland
Good to know what I have set is correct.
Not quite ...

you need to configure the cameras to use the NVR PoE interface as the gateway, usually 192.168.254.1
The camera in your screenshot has no IPv4 default gateway.
Fix that, and you will get full access via the NVR LAN interface acting as gateway for the 192.168.254.0/24 segment as specified in the static route on your LAN gateway / router.
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,979
Reaction score
6,802
Location
Scotland
you will need two ethernet interfaces on your Mac. One for normal lan the other plugged into a cam port or a switch off the cam network, static at 192.168.254.100 subnet 255.255.255.0 gateway at 192.168.254.1 (which is the NVR's cam network gateway ip)
This is not necessary when a static route is set to direct packets for 192.168.254.0/24 to the NVR LAN interface as gateway, and when the cameras have the NVR PoE interface (usually 192.168.254.1) correctly set and kept as their default gateway.
And when 'Virtual Host' is enabled on the NVR advanced network settings to create the NATted interface between the NVR's 2 network segments.
 

tekguru

n3wb
Joined
Oct 7, 2022
Messages
26
Reaction score
1
Location
Manchester, UK
Right, so you are saying that
Screenshot 2022-10-07 at 13.54.01.jpg
This should be set to my routers default gateway? That should fix things without breaking the camera?
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,979
Reaction score
6,802
Location
Scotland
No, not to the router address.
Check post 24 and others earlier.
The cameras need to be able to send traffic through the NVR so they need to be configured with the right gateway to be able to do that.
The needed gateway is the NVR PoE interface address, 192.168.254.1
And ensure you have virtual host enabled on the NVR.
 

tekguru

n3wb
Joined
Oct 7, 2022
Messages
26
Reaction score
1
Location
Manchester, UK
Thanks for clarifying, gateway address now set and the virtual host was set already. I can now ping the camera and get responses from PINGing the camera although not ones I'd want:

Code:
dbrewood@Mac-Mini ~ % ping -c 20 192.168.254.4
PING 192.168.254.4 (192.168.254.4): 56 data bytes
Request timeout for icmp_seq 0
92 bytes from 192.168.1.254: Redirect Host(New addr: 192.168.1.77)
Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
 4  5  00 0054 fed5   0 0000  3f  01 fbab 192.168.1.210  192.168.254.4

Request timeout for icmp_seq 1
92 bytes from 192.168.1.254: Redirect Host(New addr: 192.168.1.77)
Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
 4  5  00 0054 66d1   0 0000  3f  01 93b0 192.168.1.210  192.168.254.4

Request timeout for icmp_seq 2
92 bytes from 192.168.1.254: Redirect Host(New addr: 192.168.1.77)
Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
 4  5  00 0054 5f4b   0 0000  3f  01 9b36 192.168.1.210  192.168.254.4

Request timeout for icmp_seq 3
92 bytes from 192.168.1.254: Redirect Host(New addr: 192.168.1.77)
Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
 4  5  00 0054 b565   0 0000  3f  01 451c 192.168.1.210  192.168.254.4

Request timeout for icmp_seq 4
92 bytes from 192.168.1.254: Redirect Host(New addr: 192.168.1.77)
Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
 4  5  00 0054 fc32   0 0000  3f  01 fe4e 192.168.1.210  192.168.254.4

Request timeout for icmp_seq 5
Request timeout for icmp_seq 6
92 bytes from 192.168.1.254: Redirect Host(New addr: 192.168.1.77)
Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
 4  5  00 0054 6023   0 0000  3f  01 9a5e 192.168.1.210  192.168.254.4

Request timeout for icmp_seq 7
Request timeout for icmp_seq 8
Request timeout for icmp_seq 9
92 bytes from 192.168.1.254: Redirect Host(New addr: 192.168.1.77)
Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
 4  5  00 0054 d28e   0 0000  3f  01 27f3 192.168.1.210  192.168.254.4

Request timeout for icmp_seq 10
Request timeout for icmp_seq 11
Request timeout for icmp_seq 12
Request timeout for icmp_seq 13
Request timeout for icmp_seq 14
Request timeout for icmp_seq 15
92 bytes from 192.168.1.254: Redirect Host(New addr: 192.168.1.77)
Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
 4  5  00 0054 bdb7   0 0000  3f  01 3cca 192.168.1.210  192.168.254.4

Request timeout for icmp_seq 16
Request timeout for icmp_seq 17
Request timeout for icmp_seq 18

--- 192.168.254.4 ping statistics ---
20 packets transmitted, 0 packets received, 100.0% packet loss
That is timing out all the time..... so I'm still missing something somewhere. Any further suggestions or info you need from me?
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,979
Reaction score
6,802
Location
Scotland
The DNS setting won't affect the network routing.
Is the static route set for the host (individual camera) or the network?
Best for the network.
 

tekguru

n3wb
Joined
Oct 7, 2022
Messages
26
Reaction score
1
Location
Manchester, UK
Yep I set the default gateway and the camera is still working LOL

The static route is set as follows:
Screenshot 2022-10-07 at 22.27.55.jpg
I still can't connect to the camera though. If I try to ping it from my Mac I get:

Screenshot 2022-10-08 at 10.37.59.jpg
 

tech_junkie

Getting comfortable
Joined
Sep 2, 2022
Messages
412
Reaction score
417
Location
South Dakota
Set as per this, I'm wondering should the DNS server be set to my router?
yes, the gateway of 192.168.254.1 and the DNS of 8.8.8.8 and alternative DNS 8.8.4.4 are good default entries for the cam

DNS entry is only used during platform access. So if you are not using the app, its not a big deal if its in there or not. Its the common DNS between the cloud phone app and media server (NVR) when it makes its vpn connection between the phone and the NVR. Setting it to the router might cause remote viewing connection issues.


Thanks for clarifying, gateway address now set and the virtual host was set already. I can now ping the camera and get responses from PINGing the camera although not ones I'd want:.....

That is timing out all the time..... so I'm still missing something somewhere. Any further suggestions or info you need from me?
That would be typical pinging a camera from the LAN network.
The NVR is a device with two Ethernet interfaces, one the is the LAN connection, the other connected to a built in POE switch.
So the only thing you will see is the arp table advertisement the NVR will send to discovery software and os utilities when you are connected LAN network.

That is why I suggest that your computer that you want to run your home automation software from have two ethernet interfaces, one connected to the internet network at 192.168.1.X and another assigned a static at 192.168.254.100 and directly connected to a cam port on the NVR.

Depending on the Hikvision NVR you have, you can access your cameras from your computer (that only has one Ethernet connection) connected at 192.168.1.77 but you have to temporarily change the network setting, and assign it a static address of 192.168.254.100 or something not already getting used by the NVR CAM list (except 192.168.254.1 because that is the NVR's static CAM network address). But you only can log into the cams and the internet and rest of the network is not accessible. But this only works with some NVRs that have a built in switch between its two interfaces.

So since macs usually have two network interfaces, connect your wifi to the internet network, and connect the mac to a cam port of the NVR by ethernet cable and static assign it a network address in the cam network.

If this is an excessive wire run back to the NVR and you are able to reach it by static address the mac and are able to plug into the LAN closer, you can do that instead of the cam port, but it may effect LAN performance due to the 100Mb network traffic running on the 1Gb LAN network.
 
Last edited:

tekguru

n3wb
Joined
Oct 7, 2022
Messages
26
Reaction score
1
Location
Manchester, UK
Right I'm with you now. I think I'll have to give up on the project then. The NVR is upstairs in the wife's home office and we had external trunking installed to link that via Ethernet to the cameras and round the house to a network port I've connected to the router. So there is no way physically to connect that additional Ethernet cable. Plus I'd be looking to connect that additional Ethernet cable to the NAS which runs Docker which in turn hosts Scrypted.

I guess the only possible other solution is to reconfigure the cameras to be on the main network, but still record to the NVR. That would work I think, but I'm not sure how much work would be involved to achieve that. Or would going that route stop the HIK Connect app / system working?

Primarily we do use HIK Connect and that works well enough, it's my techie nerdness that wants to see the cameras in the Apple Home system and having the ability to run shortcuts based on movement detection etc. My good lady is gully convinced we don't need it :)
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,979
Reaction score
6,802
Location
Scotland
That network configuration usually works fine for Hikvision NVR PoE connected cameras.
Odd how the ping is not succeeding.
Presumably you've tested other protocols to connect directly to the camera native IP address such as via a browser or VLC?
 

tech_junkie

Getting comfortable
Joined
Sep 2, 2022
Messages
412
Reaction score
417
Location
South Dakota
Right I'm with you now. I think I'll have to give up on the project then. The NVR is upstairs in the wife's home office and we had external trunking installed to link that via Ethernet to the cameras and round the house to a network port I've connected to the router. So there is no way physically to connect that additional Ethernet cable. Plus I'd be looking to connect that additional Ethernet cable to the NAS which runs Docker which in turn hosts Scrypted.

I guess the only possible other solution is to reconfigure the cameras to be on the main network, but still record to the NVR. That would work I think, but I'm not sure how much work would be involved to achieve that. Or would going that route stop the HIK Connect app / system working?

Primarily we do use HIK Connect and that works well enough, it's my techie nerdness that wants to see the cameras in the Apple Home system and having the ability to run shortcuts based on movement detection etc. My good lady is gully convinced we don't need it :)
You would have to reboot the NVR, and phones for a network change with hik-connect afterwards if you wanted to do that but:

If you set your subnet mask to 255.255.0.0 on the NVR, local network, and the cameras, they will all accessible. If not, you just add a switch between the cam port and LAN connection at the NVR.

But there might be other ways too
On the MAC that is hosting your NAS:

System Preferences -> Network
Select your networking interface
Using the "Gear" icon at the bottom of the list select "Duplicate"
Now configure that duplicate interface to the static ip in the cam network.
Now the ethernet port has been assigned two networks on the same media.
 

tech_junkie

Getting comfortable
Joined
Sep 2, 2022
Messages
412
Reaction score
417
Location
South Dakota
That network configuration usually works fine for Hikvision NVR PoE connected cameras.
Odd how the ping is not succeeding.
Presumably you've tested other protocols to connect directly to the camera native IP address such as via a browser or VLC?
Not always.
if he sets his mac's network interface's MAC address to 255.255.0.0 it would ping (on some NVRs)
if it doesn't ping, then install a switch between a CAM port and the LAN port of the NVR.
but this method above, or adding another ip address to the ethernet address of the computer will work.
I would just run a wire, but that is because Its less invasive than having a mixed network.
But it shouldn't be a big deal unless there is something really network intensive.
 

tekguru

n3wb
Joined
Oct 7, 2022
Messages
26
Reaction score
1
Location
Manchester, UK
That network configuration usually works fine for Hikvision NVR PoE connected cameras.
Odd how the ping is not succeeding.
Presumably you've tested other protocols to connect directly to the camera native IP address such as via a browser or VLC?
I can connect to the camera's web portal with no problems at ll using a web browser, VLC won't connect to any stream I've tried to configure.

You would have to reboot the NVR, and phones for a network change with hik-connect afterwards if you wanted to do that but:

If you set your subnet mask to 255.255.0.0 on the NVR, local network, and the cameras, they will all accessible. If not, you just add a switch between the cam port and LAN connection at the NVR.
Okay so the NVR is set as:

Screenshot 2022-10-08 at 12.20.11.jpg

Are you saying changing the Subnet Mask from 255.255.255.0 to 255.255.0.0 would allow the NVR and the cameras (192.168.254,4, etc), to be available from the main network?


But there might be other ways too
On the MAC that is hosting your NAS:
System Preferences -> Network
Select your networking interface
Using the "Gear" icon at the bottom of the list select "Duplicate"
Now configure that duplicate interface to the static ip in the cam network.
Now the ethernet port has been assigned two networks on the same media.
I don't think that would work as the change here would have to be on the NAS that is hosting the system and that doesn't havd that functionality
 

tech_junkie

Getting comfortable
Joined
Sep 2, 2022
Messages
412
Reaction score
417
Location
South Dakota
I can connect to the camera's web portal with no problems at ll using a web browser, VLC won't connect to any stream I've tried to configure

Are you saying changing the Subnet Mask from 255.255.255.0 to 255.255.0.0 would allow the NVR and the cameras (192.168.254,4, etc), to be available from the main network?

I don't think that would work as the change here would have to be on the NAS that is hosting the system and that doesn't havd that functionality
yes if the NVR, cameras, and computer's netmask is set to 255.255.0.0 they will talk to each other without issues. If they don't you put a simple network switch between the cam and lan ports at the NVR.

otherwise you add an ip address to the computers network interface, as all computers have a way of doing that (including synology NAS appliances)

Just depends if you just want to change a bunch of things or just that computer's configuration and maybe a switch.
 

tekguru

n3wb
Joined
Oct 7, 2022
Messages
26
Reaction score
1
Location
Manchester, UK
So just to double-check, if the subnet mask was changed to 255.255.0.0 on the main home network (192.168.1.xxx) the routers in the mesh network, NAS, Mac, phones, etc would all still work fine. The NVR / camera network (192.168.254.xxx) would all be able to talk to one another.
If that did work (you know more than me here) I assume I'd also have to rebuild all the Apple Home system as that will be using the current WiFi network, that is a big job. I guess some deep thought is needed here before deciding if it is worth it all.
 

tech_junkie

Getting comfortable
Joined
Sep 2, 2022
Messages
412
Reaction score
417
Location
South Dakota
So just to double-check, if the subnet mask was changed to 255.255.0.0 on the main home network (192.168.1.xxx) the routers in the mesh network, NAS, Mac, phones, etc would all still work fine. The NVR / camera network (192.168.254.xxx) would all be able to talk to one another.
If that did work (you know more than me here) I assume I'd also have to rebuild all the Apple Home system as that will be using the current WiFi network, that is a big job. I guess some deep thought is needed here before deciding if it is worth it all.
Just the devices you wanted to talk to each other. Cameras, NVR, computer.
The routers and wifi mesh doesn't have to be configured.
I think its easier to add another ip address to the wifi connection. Because its one device. and its not a big deal to do.
What is the Mac computer & OS version?

Its kind of a bummer its on WIFI as that limits its abilities especially with bandwidth hungry cameras.
 
Last edited:

tech_junkie

Getting comfortable
Joined
Sep 2, 2022
Messages
412
Reaction score
417
Location
South Dakota
On newer MacOS:
  • Open System Preferences.
  • Click on Net
  • Click on the ‘+’ button on the lower-left corner of your screen.
1 UPqfAZp5qwoUaBwNm0Jfeg.png

  • Choose the type of interface you want to add:
1 Y-Q0Az2nqpYqej8lpfoj9g.png
  • Once you click ‘Create’ on the above screen your new virtual interface is ready to be used.
By default, it will try to acquire its address by a DHCP server, however, since this is a virtual interface sharing the same MAC address with the underlying physical interface you should switch it to ‘Manually’ settings and assign it a CAM ip pool address not taken (like 192.168.254.100)
 

Attachments

Top