Trouble using Hikvision SDK in C# Application

andrepaulo

n3wb
Jul 29, 2020
2
0
Portugal
Hello!

I have a Hikvision DS-2CD2625FWD-IZS, and I was trying to integrate the SDK into my C# WinForms application (.NET Framework)

All I need is 2 features, show the live preview in my application, and have a button to take a snapshot and save it to a file.
I was able to take the snapshot using http://192.168.10.2/Streaming/channels/1/picture and from there save the picture into the file. But I'm having issues with the live preview part.

I managed to do it using WebBrowser element, and navigate to the page, inject javascript code to login and make the preview "full screen", but this isn't the best solution.
I was looking to use the SDK and have an element that just display the live preview. I do not want to use RSTP because it's rather slow.

Is it possible to use the SDK to display the live preview in my application?
If not, I'm navigating to http://192.168.10.2/doc/page/login.asp, do login, and get redirected to http://192.168.10.2/doc/page/preview.asp, where I need to remove a few elements from the page, is there a different page with only the preview?
 
I think the only way the SDK would be able to do a live preview is via RTSP or maybe by a proprietary streaming protocol of theirs (likely with no tangible benefits). But yes I think it should be possible to do the live preview using their SDK.

There's no simpler live viewing web page that I know of.

It is unclear what you mean when you say RTSP is rather slow. Are you talking about video delay? If so that is basically unavoidable. If your problem is the time it takes to get to the first frame, you can improve that by reducing the i-frame interval in the camera. If it uses too much CPU, that isn't RTSP's fault, but the fault of the video decoder not being efficient enough. Or maybe whatever you have rendering the video isn't very efficient. WinForms picturebox for example isn't a very efficient thing to use for video output. If it is a CPU performance problem, using a sub stream would be a cheap way to work around it.
 
Last edited:
  • Like
Reactions: djernie
Nevermind, consider this one solved.

I just realized that I was downloading the wrong file from Hikvision's page.
I was downloading Player SDK (for Windows 64-bit) when I needed the file Device Network SDK (for Windows 64-bit)