Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Vision won't create large AVI File

Solved!
Go to solution

Good catch, Eric.  I am no codec hero but we can be sure that some of them come with unexpected limitations ...

0 Kudos
Message 11 of 34
(4,911 Views)

Use the attached VI to experiment.  You can either use the built in random image, or drop in your image acquisition in the lower loop.

 

On my i7, the write avi loop runs at about 6 fps, versus the acquire loop, which runs at 250 fps.  With this large of a discrepancy, you run out of memory very quickly due to the queue filling up.

 

If may be that you need to bypass writing to AVI and just write raw data, leaving the AVI conversion for later.  Even there, 250 FPS catches up very quickly with the write.

Machine Vision, Robotics, Embedded Systems, Surveillance

www.movimed.com - Custom Imaging Solutions
0 Kudos
Message 12 of 34
(4,906 Views)

Hi John,

 

I did look back at your earlier post, thanks for the link.

In that post, you indicate that the image and the codec have to agree.

I'm capaturing (storing) grayscale (U8) images, and using the Y800 uncompressed grayscale codec, so I think they agree.

 

In a reply to your post, BlueCheese indicated that if the application is storing a grayscale image with the Y800 codec, the leak doesn't exist.

 

I'll continue investigating.

 

Thanks for the thoughts,
Jeff

0 Kudos
Message 13 of 34
(4,906 Views)

Hi Eric,

 

Thanks for the suggestion, I ran a couple of tests.

 

After checking that I was defining the IMAQ image as U8 Grayscale, I ran my image capture routine.

I ran the routine for 30 seconds each time, and specified a different codec for each run.


The Microsoft Video 1 codec, and the YUV 4:2:0 planar codec, clearly have memory leaks when trying to save the grayscale image.

The Y800 codec runs at a slim 120 MB of RAM, and not increasing.

Also, the Y800 runs at the needed 277 - 280 fps, while none of the others exceeded 140 fps.

 

FYI,

Jeff

 

0 Kudos
Message 14 of 34
(4,906 Views)
Solution
Accepted by topic author DMJeff

 

Thank you to everyone for their input, I appreciate it.

 

After trying a number of your suggestions, I couldn't get the AVI functions to store all the data I need.

I pulled all that out, and I'm using the standard file funtions, Write Binary File and Read Binary File.

I still have to verify that I can do everything I want with the images I read back.

I created a 1 minute long file at 280 fps, approximately 4 GB in size.

When I read it back, I displayed it on the screen, and I can see all 60 seconds of it.

 

Thanks for the input,

Jeff

 

 

Message 15 of 34
(4,894 Views)

 

FYI,

 

While running another test, I was writing data to an AVI file, and got the following error message:

"IMAQ Vision:  (Hex 0xBFF604C3) The AVI file has reached its maximum size of 2 Gigabytes."

 

This was running 64-bit LabVIEW 2013.

I guess there really is a 2 GB limit for AVI files in the vision module.

 

Jeff

0 Kudos
Message 16 of 34
(4,881 Views)

The latest version of the Vision module has a 2GB limit, but the older versions do not. You can access and use the older version (even in 2013) by opening the llb directly. They're here:

 

"\vi.lib\vision\Avi1.llb" 

 

You can find some more information about AVI2 vs original AVI functions in LabVIEW poking around the forums. From what I can tell, the new AVI2 functions are a rewrite and are still pretty limited/incomplete. Eventually they should be better, but for now the Avi1.llb functions are much better.

 

-Jody 

Message 17 of 34
(4,772 Views)

Thank you for the notice about the 2 GB file size  limitation AVI2 suite of routines.  We routinely record avi files that range between 10 and 200 GB of uncompress U8 images so we will not be migrating to AVI2 soon.Smiley Happy   Has a CAR been submitted regarding the limited image file size?

 

BTW AVI 2 should also be avoided if ther is need to imbed data into image frame.  It a nice way to synchronize captured data with captured images.

 

 

0 Kudos
Message 18 of 34
(4,677 Views)

There's a LOT of different threads on the 2GB limitation of AVI2. I'm not sure there's an official CAR, bu the NI Developers should be aware of it.

 

I also generate larger AVI files, but not nearly as big as you guys. Out of curiousity, what are you using for compression? I've had great luck with Lagarith Lossless (http://en.wikipedia.org/wiki/Lagarith) and the AVI1 toolkit.

 

-Jody

0 Kudos
Message 19 of 34
(4,667 Views)

We do not compress the  images at all.  We perform remote visual inspections and do not want any image degradation  from the compression.  Also we have had problem with our customer not being to view the images if they did not have the appropriate codex. 

 

Typically we write to ablank SSD drive using a temporary file.  Once the recording is complete we copy the file with its appropriate file nmae it to a large spinning disk for storage and futher distribution.  The temporary file stays on the SSD until the next recording in case there is a problem with the transfer. (We have very good results with Thundebolt external drives)

 

We set up the SSD so that absolutly clean, the Windows seacrh indexing is off, the Trash does not save discarded files,and format the drive with the larges allocation unit size (64k).  In this configuration we have writeen to an avi file at sustained rates of 50 MB/s.

 

BTW If anyone is interested, I have a method for in LabVIEW producing a file tranfer progress bar in Windows 7.  (in XP you could periodically read the file size as the file was being written, in W7 the file size is set to the same size a source file)

 

Paul

0 Kudos
Message 20 of 34
(4,660 Views)