LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IP Camera

hello,

i have a IP camera. i want to view it in Labview. I know Labview IQMAX only support 2 manufactured brands. I just wanted to know the way i can view and take IP camera stream in labview. Can anyone share code if done previously on same issue. 

Secondly, i want to encrypt and decrypt that IP camera stream in Labview. Can anyone suggest on this as well?

Thanks 

0 Kudos
Message 1 of 9
(217 Views)

It depends from the Brand of the camera.

For example, in my recent project I've used the Axis M1065-L/M1075-L cameras, which have SDK (needs to be downloaded and installed separately), where ActiveX was provided, then to get images on the Front Panel in LabVIEW was as simple as following snippet (obviously the camera wasn't appeared in NI MAX):

Screenshot 2024-04-30 13.19.55.png

Which type of the cam exactly do you have?

0 Kudos
Message 2 of 9
(198 Views)

i have Hikvision camera.

0 Kudos
Message 3 of 9
(138 Views)

you can also guide me in a way that how i can get IP packet? as i need to process it and then send it to USB port or Ethernet port?

0 Kudos
Message 4 of 9
(136 Views)

@sundas wrote:

you can also guide me in a way that how i can get IP packet? as i need to process it and then send it to USB port or Ethernet port?


No, again, it is "too common" question.

All what you need first is to download SDK 

Screenshot 2024-05-02 07.00.06.png

Then take a look into Documentation and Demo:

Screenshot 2024-05-02 07.00.46.png

Then you should use SDK in LabVIEW in similar way as in Demo app.

I see - there are C++ and C# examples, so you can use one of this.

If you will follow C++ way, then you might need a Wrapper (LabVIEW cannot call C++). For .net probably slightly easier, but this way also have some pros and cons. Anyway first you have to learn connectivity — how to call external code in LabVIEW.

0 Kudos
Message 5 of 9
(130 Views)

Thanks Andrey for your response. i will give it a try.

I have installed and  "IP camera adapter" application after that i can see the camera in NI-MAX. I tried to grab the camera stream but its showing"connecting to camera". Similar is happening in code.

I have attached the screenshots for the reference.

If anyone can help in this? i will be grateful. 

Download All
0 Kudos
Message 6 of 9
(84 Views)

@sundas wrote:

Thanks Andrey for your response. i will give it a try.

I have installed and  "IP camera adapter" application after that i can see the camera in NI-MAX. I tried to grab the camera stream but its showing"connecting to camera". Similar is happening in code.

I have attached the screenshots for the reference.

If anyone can help in this? i will be grateful. 


Those IP Camera adapters are fairly complex software components to develop. Most of what you can find online is based on some Microsoft examples that they released in the beginning when they introduced DirectShow and later the WDM driver architecture. These examples generally work, under certain conditions, if hold by the hand, petted and softly talked too but fail quickly on all kind of things. And that is ok, they are meant to show what APIs are getting used and how to generally do it. All the error handling, fine tuning and specific features such as different IP camera technology endpoints are if at all only rudimentary present.

There are several categories of such drivers.

- the free ones, usually a recompilation of one of those examples with minor improvements to make it work for a certain device or setup

- many paid ones that are often just as mediocre as the first category, and quite often abandoned as there is little money to gain with such products even if they are actually more decent than the first category.

- some professional ones that you can get as part of other paid software suites

 

They all can fail with a certain client such as NI-MAX. In the old days most such cheap camera drivers were declared working when you could get an image to be shown in MSN and later Skype. Any more effort than that was generally lost time. 😁

 

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 9
(66 Views)

Thanks for the elaboration. 

I think i better change the camera manufacturer rather than wasting time on Hikvision.  

0 Kudos
Message 8 of 9
(56 Views)

HikVision has an extensive SDK you can download. The problem with that is that it is an external software component that you need to interface through the Call Library Node.

 

This thread on LavaG: https://lavag.org/topic/22531-using-the-dll-files-of-an-application-compiled-with-c-with-labview/ details some of the problems. And if you do not have any C programming knowledge, (actually you need more than a basic understanding of this) it is pretty much not an option to use.

 

Many other cameras have the same problem. They provide some sort of standard that can be interfaced to with their own software and with specific drivers for other software but seldom are general purpose. NI-MAX/IMAQdx only support cameras that provide a fairly complete interface according to:

 

USB-3: AIA USB3 Vision Specification

GigE: AIA GigE Vision Specification

CameraLink: camera needs to be fully CameraLink conformant 

IEEE-1394 FireWire: only supported in NI-IMAQdx 19.6 and earlier, camera must be fully IIDC (DCAM) compatible

IP Cameras: Only Basler and Axis models and other cameras providing MJPEG images are supported 

USB 2.0 and USB 3.0 non AIA cameras: NI-IMAQmx can access them if they have a DirectShow driver

Other cameras including IP Cameras not from Basler and Axis: Again they can only be accessed with a DirectShow compatible driver

 

However DirectShow is an old legacy driver framework. Most modern cameras do not even come with a driver for that. They may come with a more modern Windows camera device driver, and DirectShow has a bridge driver that can access such modern drivers, but this driver over driver layering gets quite complicated and brittle and it's very easy to end up in a situation where NI-IMAQ might trigger a certain request from DirectShow that this bridge driver translates into something in the other driver that the developers of that driver deemed an optional and unnecessary feature, causing the function to report an error and NI-IMAQ considering the device as unworkable.

 

HikVision cameras generally support an RTSP streaming interface. And while RTSP may sound like a standard, it is only the actual protocol envelop that is defined by RTSP. The actual binary compression of video streams is not fixed as it allows pretty much any compression scheme a camera manufacturer may want to use.

 

IP Cameras may sound like a single standard but that is far from true. The only common thing they have is that they are accessed through TCP/IP. How a client can discover them, how it can enumerate the possible endpoints on them and how the actual video data is encoded and streamed is very variable. Especially the last part is making everything very complicated. Some cameras use specific compression algorithms that are often patent encumbered and can't be just incorporated in a driver framework like IMAQdx without paying someone, somewhere substantial royalties.

Rolf Kalbermatter
My Blog
0 Kudos
Message 9 of 9
(52 Views)