LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Record video from Ethernet camera

I made the attached VI to save a video from ad Ethernet camera. The problem is that the video has not a standard format and for instance I'm not able to load it with the other VI I attach here.
Message Edited by Pier Paolo on 02-04-2009 06:22 AM
0 Kudos
Message 1 of 14
(4,660 Views)

You should have a look at the examples provided by LabVIEW. There is one to read and display AVI files.

Within your VI to read the AVI....well there are to many wrong things to explain, so please use the example finder and see for the read avi example.

 

Christian 

0 Kudos
Message 2 of 14
(4,625 Views)

Dear Christian, 

Thanks for you fast replay.

I had a look to the examples and I cold do even another VI to read the video (it is attached). Both the old and the new work with a standard avi file. The problem is that when I save the file the format is not standard. I have tried to play  the saved avi and only one player was able to show the video.

Thanks

Pier Paolo 

0 Kudos
Message 3 of 14
(4,615 Views)

Hey,

 

Using the Example Finder you will find two examples, "Grab and Save to AVI.vi" where you will need to replace the IMAQ functions with the equivalent IMAQdx functions due to the fact you are using an GigE Cam. The second example "Read AVI Example.vi" can be used without changes.

I would suggest you to run and test this two examples.

 

Thanks,

Christian 

0 Kudos
Message 4 of 14
(4,604 Views)

Hi Christian, 

Thanks for the suggestions but still the AVI generated from the attached VI is not standard and I can't open it with, for instance, "Read AVI Example.vi". 

As you can see in the attached VI first I fill an array of images, then I try to write the images of the array in an AVI file. I've to pass from the image array because I need it to interface this VI with another one that take the image array as input. 

To conclude I think that the real problem is how to write correcly an array of images in an AVI file.

I hope you can help me.

Thanks

Pier Paolo 

0 Kudos
Message 5 of 14
(4,597 Views)

Hey,

 

You said "To conclude I think that the real problem is how to write correcly an array of images in an AVI file."

So why don't you open the example "Grap and Save to AVI" which showes you how to correctly write an AVI?

Then you just need to compare the example with your code and you hopfully will see whats wrong!

 

Christian 

0 Kudos
Message 6 of 14
(4,566 Views)

Dear Christian, 

In the "Grab and Save to AVI.vi" it is not implemented "how to write correctly an array of images in an AVI file": they write the image in the AVI file frame by frame without before filling a full array with all the images and then writing all them in the file.

I can't really see why my VI doesn't work properly because I think to have followed the way of the example you suggest me. May you find the error in my VI that due to save a non standard AVI? And why my AVI is not standard?

Thanks for the patience but on this side we are not so expert 🙂

Best regards

Pier Paolo 

0 Kudos
Message 7 of 14
(4,557 Views)
Here I attach the implementation that has the same problem (non standard AVI file generation) that use as much as possible the solution of the example.
0 Kudos
Message 8 of 14
(4,546 Views)

Pier,

 

At the beginning, you should understand, that there are no "non a standard formats" exists. Every format (even "non-standard") described somewhere.

What you should clear understand - the only two things:

First - which image format (I mean bit depth) deleivered from your camera. It can be 8 bit image, or RGB image, or 16 bit gray image, etc.

Second - when you try to save sequence of the images into AVI file you should choose right codec (or "filter" in NI terms). You can use here IMAQ AVI Get Filter Names VI for obtain list of available filters. Then you should understand (or simply try it) that not every codec will support every image format. Most codecs will support RGB image. Some codecs will support 8 bit image as well, in most cases with autoconversion to RGB. And there are no support for 16 bit image as far as I know.

 

hope it helps,

Andrey.

 

0 Kudos
Message 9 of 14
(4,537 Views)

Hey,

 

Andrey is right. I was able to run your example and then read the AVI without problems. So you should check if you get any errors when writing the frames to the AVI.

 

Christian 

0 Kudos
Message 10 of 14
(4,533 Views)