02-04-2009 06:20 AM - edited 02-04-2009 06:22 AM
02-05-2009 03:47 AM
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
02-05-2009 05:02 AM
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
02-05-2009 06:44 AM
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
02-05-2009 08:35 AM
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
02-09-2009 02:10 AM
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
02-09-2009 03:38 AM
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
02-09-2009 04:31 AM
02-09-2009 05:10 AM
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.
02-09-2009 05:32 AM
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