06-05-2008 04:11 AM
06-06-2008 06:17 AM
02-26-2010 02:04 PM
We have large AVI files that we post process. Right now that processing is very slow, about 130msec per frame. Since our AVI's may be thousands of frames long, the processing takes way longer than we'd like.
When we eliminate the processing and just read each frame of the AVI file, it takes about 90msec just for the IMAQ AVI Read Frame.vi to execute. According to the knowledge base link that Nick_CH provided, the slowness of IMAQ AVI Read Frame.vi is due to the CPU having to do the work usually done by the graphics CPU to display the image on the PC monitor.
In our case, we don't need to display the images on the monitor during post processing, we just need to run intensity calculations on the AVI images. Is there any way we can speed up the AVI frame reading during our post processing?
Hans
03-01-2010 01:35 AM
Hi Laurent and Hans,
your problem seems highly related to the codec you are using for video compression/decompression.
Uncompressed is not always the best mehod. Try e.g. the huffYUF Codec. This one is very fast.
Greets Christian
03-03-2010 11:16 AM
One correction to my prior post - for longer AVIs, I'm seeing AVI frame read times that average about 30 msec.
Hmm... We are using uncompressed AVIs since we do not want any compression losses and since we don't want delays when writing frames. At first it is counterintuitive that it would take longer to read an uncompressed AVI frame than to read and uncompress a compressed AVI frame. It does make sense that it would take longer to transfer an uncompressed and hence bigger frame from a hard drive, but it's surprising that it should take about 30 msec to read 1.4Mbytes from disk.
Then again, for a 7200rpm hard drive read rate of about 480Mbit/sec = 60 Mbyte/sec you'd expect a read time of 1.4/60 seconds = 23 msec, so Christian you may well be correct - the main factor on AVI frame read times could be hard drive transfer time which would be reduced for smaller compressed files.
Another clue that hard drive transfer time is the key is that when I loop thru my AVI reading the frames one after the other, my CPU usage is only about 10%.
Hans
10-04-2010 01:44 PM
Hi hans17,
Sorry to dig this thread up (and duplicate post by the way) but I am having difficulties when reading AVIs of 2000 images only. I get a CPU load error.
How do you manage to read multiple thousands images? The Read AVI example failed to open mine... I am starting to think that it may be a codec error.
Thanks
Christophe
10-04-2010 10:59 PM
Hi Christophe,
We were just reading the AVI one frame at a time into the same image reference. We write the AVIs one frame at a time, then read and process one frame at a time. If you can't do that it could be a codec problem. You could try a different codec, or uncompressed.
Hans