How do Hikvision sub-streams work?

kwtrading

Young grasshopper
Joined
Oct 28, 2014
Messages
53
Reaction score
7
I see that typical Hikvision cams such as the 2032 and 2132 support a 'main' stream and a 'sub' stream but the documentation doesn't fully explain how this works. Can someone explain or link to an good explanation?

I'd like to be able to record locally in 1080p in Blue Iris but view remotely at 720p on an iPhone app.

Thanks,
Chris
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,966
Reaction score
6,795
Location
Scotland
The app that's connecting to the camera video stream will as part of the request dialogue specify what stream it wants to connect to. Usually after requesting a list of capabilities. And sometimes after adjusting the required configuration settings for the stream, eg frame rate or quality.
It's all done as part of the RTSP (or equivalent stream setup protocol) dialogue down at a network level by the client that's connecting to the camera.

If you want to explore further - download and install the Windows open-source tool 'ONVIF Device Manager' from sourceforge.net
When you have ONVIF supporting cameras, like those you mentioned, you can see and change lots of aspects of the camera that don't appear in any user manuals. And can find out some of the parameters that you might need when configuring a client such as an NVR to connect to a camera.
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,680
Reaction score
14,041
Location
USA
Some apps don't support ONVIF because ONVIF is absurdly complex.

Here you can find a huge list of URLs for video streams from Hikvision products. I believe

rtsp://IPADDRESS:554/Streaming/Channels/2

is the address you can use to get the sub stream from a Hikvision camera.

I don't think Hikvision will do resolutions as high as 1280x720 for the sub stream. Go look in the camera's web interface to configure the main and sub streams.
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,966
Reaction score
6,795
Location
Scotland
Here is a sample set of substream resolutions as seen via the Hik NVR 'camera settings' interface for a DS-2CD2032-I
NVR_1.jpg
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
you dont need 720p for an iphone viewing (you couldn't distinguish any extra pixels on that small screen), its more important to make sure the bandwidth requirements dont exceed your upload speeds or else your remote sessions will be full of dropped frames.
 

kwtrading

Young grasshopper
Joined
Oct 28, 2014
Messages
53
Reaction score
7
thanks everyone for the replies. I was able to get the sub stream going on a Hikvision 2532 and my LiveCams Pro iphone app. Pretty simple once I figured out that all I needed to do was change the camera settings in the app to Channel 2 to see the sub stream! works like a charm.

however, when using Blue Iris, I didn't see the option to choose between the two if I wanted to? maybe I'm missing something if someone can advise. I'm not saying I need this capability today but there could be an application for it say if I wanted to record a remote camera that's not on my home network and I wanted to record the lower resolution sub stream.

i also noticed that the sub stream only supports lower resolutions than 720p so that's kind of a bummer.
@nayr - i would disagree with you regarding not needing a 720p stream on an iPhone. when compared to say 640 x 480, the difference is noticeable. especially when you turn you phone sideways. even an iPhone 4 in landscape is 960 x 640 and an iPhone 6 is 1334 x 750 giving you a full 720p.
 
Last edited by a moderator:

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
D1 (704x576) Resolution, the highest resolution your sub-stream can do... compared to a 720p main stream on any iphone wont be noticeable from any normal viewing distances... I never said anything about 640x480 but there is nothing wrong with that for phone viewing.. yes it would be noticeable at that point but quantitivly the difference will still be minimal.

My Nexus 7 with 1920 x 1200 resolution and 323ppi and a 7in screen is hardly noticeable between full 3MP and D1 resolution, other than the 3MP stream uses a ton more wifi bandwidth and is more likely to drop frames... If i hold it really close to my face I can see some difference but its not as large as you'd think.. anywase I was suggesting you worry more about bandwidth for substreams than resolution... I would take a lower resolution video that was smooth and not dropping frames compared to a higher resolution video that was hanging and dropping frames... especially if you want to view more than 1 camera at a time remotely.

A 640x480 stream at 1Mbit will look alot better than a 720p stream at 1Mbit, quality of the lower resolution will exceed the higher resolution at the same bitrates.

If your recording the main stream then the detail quality of the substream is hardly important, if you ever need the extra detail you can always check the recordings.. a smooth wireless streaming experience should be your primary concern of tuning the substream settings.. take into consideration the more bandwidth required to stream your cameras to your phone the more battery power and data will be required for it... I am sure we'd all like to see a 1080p 30fps video when viewing on a mobile device, but its simply not practical..
 
Last edited by a moderator:

duotronic

n3wb
Joined
Oct 22, 2015
Messages
7
Reaction score
7
Some apps don't support ONVIF because ONVIF is absurdly complex.

Here you can find a huge list of URLs for video streams from Hikvision products. I believe

rtsp:/IPADDRESS:554/Streaming/Channels/2

is the address you can use to get the sub stream from a Hikvision camera.

I don't think Hikvision will do resolutions as high as 1280x720 for the sub stream. Go look in the camera's web interface to configure the main and sub streams.
Very helpful. Adding
/554/Streaming/Channels/2
enabled substream on blue iris 5.3.6
Thank you!
 
Top