Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem reading video frame from Axis IP camera - variant data buffer confusion.

Solved!
Go to solution

Hi There;

 

I"m writing a VI for an Axis IP camera.  It's party working, but I need to extract individual frames from the video feed so I can overlay text using the IMAQ text overlay functions.

 

The trick, is when I grab a frame using the Axis dll library (GetCurrentFrame), it returns a buffer size and a variant type, which represents the frame data.  The data is = 921,640 bytes which represents a 40 byte header, then 640x480x3 of frame data.  When I run the vi, I get a correct value for the buffer size (921,640) so I know this is working.

 

What I don't understand is the video frame is placed into a buffer of type variant.   I'm not at all sure how to extract the raster data from the 'buffer' data type which is a variant type.  Apologies, I'm a bit ignorant in how to handle 'variant' types.

Anyone have a suggestion?

Here's the VI

0 Kudos
Message 1 of 11
(7,125 Views)

Have you tried using IMAQdx (part of the latest Vision Acquisition package) to acquire from the camera instead? As of the recent versions we now support native acquisition from Axis IP cameras.

 

Eric 

0 Kudos
Message 2 of 11
(7,120 Views)

Thanks, good suggestion.

I"m downloading IMAQdx now and I'll give it a try.  I'll post back with the results.

Cheers

Peter

 

0 Kudos
Message 3 of 11
(7,114 Views)

Ok, tried the IMAQdx toolkit and no luck.

 

The problem seems to be in IMAQdx discover ethernet cameras.

 

I see that IMAQdx supposedly supports Axis IP cameras, but IMAQdx discover ethernet cameras does not seem to work.  It just times out.

 

Double checked with a web browser that the IP address of the axis camera is correct, and it is.  Camera is working properly for sure.

 

Are there any examples of Vi's that detect Axis (or other IP video cameras), and grab frames?  I'm not 100% sure that I have my vi configred correctly.

 

Comments, rants appreciated

Peter

 

 

 

0 Kudos
Message 4 of 11
(7,101 Views)

CORRECTION:  Are there any examples that use IMAQdx to discover and grab frames from an Axis or other IP cameras.  Can't seem to find much info on Axis camera support on IMAQdx.

Peter

 

0 Kudos
Message 5 of 11
(7,099 Views)
Solution
Accepted by PeterGross

Hi Peter,

 

Just to confirm, what version of IMAQdx are you using?  You want to get the 2010.3 version as that is the latest: http://joule.ni.com/nidu/cds/view/p/id/1641/lang/en

 

The next issue would be that the Discover Ethernet Cameras is unnecessary and is only used for GigE Vision cameras. The VI was named before IP camera support was added and the name is unfortunately confusing now. In any case, discovery of cameras takes place in the background and is automatic. The Enumerate VI should list your camera. It may be worthwhile to simply try seeing if the camera shows up in MAX first. Note that the IP camera must reside on your local subnet for it to be discovered.

 

As for examples, pretty much any of the IMAQdx examples included in the Help->Find Examples should work.

 

Eric 

0 Kudos
Message 6 of 11
(7,098 Views)

Yes, that solved the problem!   I had an older version of IMAQdx and once I changed it to the new version it all works really well.    IMAQdx Enumerate Camera and Open Camera worked perfectly, even without me telling IMAQ the IP address of the camera.


Excellent!!!

 

Here's the working vi that grabs frames from the Axis IP camera (a 214 PTZ) in case anyone else is interested.

Peter

 

0 Kudos
Message 7 of 11
(7,063 Views)

Hi guy ...
What about other IP Cameras ?
I have an IP Camera. How can I get frames from it ?

0 Kudos
Message 8 of 11
(6,903 Views)
Which camera is that?
0 Kudos
Message 9 of 11
(6,900 Views)
What ??
This is a IP Camera
0 Kudos
Message 10 of 11
(6,886 Views)