04-09-2017 04:33 AM
I'm able to capture picture from IMAQ device, but I only care about the brightness of each pixel, so I set camera to monochrome mode, which returns a U8 grey scale data.
I need to save a lot of frame for later process, but I noticed even if I give a U8 data image reference to Write to AVI sub-vi, the avi file will always 3 times larger then it should be, which suggesting LabVIEW has saved a 24bit uncompressed AVI.
But all I need is a uncompressed 8 bit AVI file. Any idea?
04-09-2017 06:26 AM
04-09-2017 06:59 AM - edited 04-09-2017 07:05 AM
Let's do some calculation:
04-09-2017 11:35 AM
04-10-2017 07:44 AM
Thanks, It works!
One more question: are there any way to install NI Vision codec on a 3rd computer? My coworker need to open it with Matlab, and they don't seems be able to open it. Also, windows media player is not able to play the avi file, says the format is not correct.
09-07-2023 02:21 PM - edited 09-07-2023 02:24 PM
Here it is, a few years later, and this stills seems to be a problem with no solution. Any updates? 🙂
Note: You can play the format in VideoLan (VLC) and transcode, but I would prefer for, say, Matlab to be able to read it directly and import frames.
Thank you!
09-07-2023 03:57 PM
Solutions I would suggest:
Write your own AVI Write routine. I found some C code (search for "avi file write Wischik") that would work pretty well. It looks fairly simple if you eliminate the audio and compression routines. Creating a LabVIEW dll that calls these could be done and debugged in a day or so. I'm not sure how you would convert a LabVIEW U8 image to the format required, since the example only demonstrates loading images from the drive.
Another option would be to use a different file format. I have a system where I use Image to JPEG String to compress each of the images, then concatenate the strings into a single file. Fairly easy to read and convert back into an image. If you don't want compression, you could easily convert the U8 image array into a string - two U32 for the dimensions plus the data. I did find that storing everything in a single file significantly decreases load and save times. The only disadvantage is the inability to read the file using any standard video players.
Bruce
09-07-2023 04:20 PM
I was interested in the subject a few years ago. My understanding is that JPEG compression and Video compression are different.
JPEG is a lossy compression. If you want lossless compresion it is part of the PNG standard.
AVI is doing compression that is based on recording the changes of the next image from the previous image. Usually, the changes are minimal. So, the compresion is part of the standard.
I think it is lossless, but I am not sure. You need to read the standard.
Level of compression depending on the changes between the adjacent images. So, some videos will compress more than others.