Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with AVI_Write.vi

I urgently have to make a AVI file from a stack of 8 bit monochrome images that I have already read in: The single images are correcty displayed in the loop using AVI_Write. No error is indicated, but the result is an avi file much too small (11 kb for 284 images with 150 x 150 resolution). The media player cannot play it (ClassFactory cannot supply the desired class; error=80040111)0111)
What is wrong?
Best regards
D. Hof
0 Kudos
Message 1 of 6
(4,338 Views)
D. Hof -

I am unable to open the attached VI file - there are a few VIs that are used in it that I don't have on my system (Path Global.vi, AVI_Write.vi, AVI_Init_Write.vi, AVI_Close.vi) - can you save all of these, as well as the original, in an .llb file and attach that?

Also, what version of LabVIEW and IMAQ Vision are you currently using?

Greg Stoll
IMAQ R & D
National Instruments
Greg Stoll
LabVIEW R&D
Message 2 of 6
(4,338 Views)
The AVI routines are taken from an AVI.llb that I found on NI's WEB page: "IMAQ AVI Read Write Example"
(written by Imagemill)
I included all in a llb file. The image stack ImStack with NImages images is normally provided by the main program. I had to introduce a constant "IMAQ Session In" because the routine "AVI Init Write" awaits one. In their example images coming from a framegrabber card are stored as AVI file but they say it should also work with images from other sources, and they can be 8 bit monochrome.
0 Kudos
Message 3 of 6
(4,338 Views)
I forgot to mention: My LV is 6.02, my IMAQ Vision 6.0
0 Kudos
Message 4 of 6
(4,338 Views)
Thanks for the extra information!

First of all, IMAQ Vision 7.0 has builtin support for reading and writing AVIs with compression, as well as support for attaching data to each frame of an AVI, so you might want to take a look at that if speed/size is an issue here or you have data you'd like to store in the AVI.

It looks like the problem is that the AVI_Init_Write.vi assumes that you're writing images from the IMAQ Session, and so uses properties of the session to determine the width, height, and bits per pixel of the images to write. Since you passed in a constant session, these are probably all being set to 0, which explains why the output file is so small.

You can change the AVI_Init_Write.vi file to not take in an AVI session, and make
the three properties it gets from the session (image width, image height, bits per pixel) inputs to the VI. Then, just pass those in (bits per pixel will be 8 for your monochrome images), and see what happens.

Let me know how this works!

Greg Stoll
IMAQ R & D
National Instruments
Greg Stoll
LabVIEW R&D
0 Kudos
Message 5 of 6
(4,338 Views)
No, it does not work. The vi AVI_Init_Write seeems to be the problem. As shown in its circuit diagram it accepts only 8 bit and 32 bit per pixel. For an RGB image I provide 32, then it hangs up. (see my test routine as attachment)
0 Kudos
Message 6 of 6
(4,338 Views)