LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

avi file does not have the same resolution as image file?

I'm using LabView with an IEEE-1394 camera and I set up the camera to record at a resolution of 1280 x 960 and can snap images and save them at that resolution from Measurement and Automation Explorer, but when I record avis using LabView, they have a resolution of 720 x 480 even though the images being written to the avi are 1280 x 960. I have had this same problem trying to make new videos from the original in which I extract a part of the image and write it to a new avi file... even though the extracted image is something like 620 x 300, when I play the avi (or get avi info), it says the avi has resolution of 720 x 480. I've tried creating an IMAQ, then using the set image size sub-VI to set the image to the size I want and the image shows up with the right resolution but the resulting avi has the wrong resolution, so my sub-videos are distorted. Is there some way to set the resolution of the avi other than by writing an image of that resolution? I'm using the compression filter DV Video Encoder... would that make any difference?
Thanks!
Kelly
0 Kudos
Message 1 of 4
(3,069 Views)
Hey Kelly,
 
Have you tried to increase the Max Data Size input on the IMAQ AVI Create.VI? What version of IMAQ and Vision are you using? If you remove the compression, do you still see the same behavior? Could you post the part of your code that does the AVI writing to this discussion forum (with and without the compression), and also include some of your images that are the full 1280x960 so I can recreate what you are seeing. Thanks, and let us know how things go.
 
Regards,
DJ L.

Message Edited by DJ L. on 02-10-2006 07:07 PM

0 Kudos
Message 2 of 4
(3,058 Views)
DJ L.,
Thanks for your help. It looks like the DV Video Encoder was the problem. I tried a bunch of different filters and all of them except DV Video Encoder give me the correct resolution (I haven't tried with the camera, but subsampling a video seems to work fine). The filters that give decent looking video are Cinepak Codec by Radius, Intel IYUV codec, and MJPEG (listed in increasing file size). Is there an advantage to using one or the other of these? I assume the smaller the file size the less information is retained. I'm analyzing individual frames, but large regions of the screen don't change from frame to frame. The microsoft filters seem to blur the individual frames (and have really small file sizes), and it's important for my application to avoid blurring because I'm counting thresholded pixels, but a compression filter that just keeps track of changes in pixel value frame to frame would be fine. What do you recommend?
Thanks,
Kelly
0 Kudos
Message 3 of 4
(3,042 Views)

Hey Kelly,

As far as the different codecs that are available, it all depends on what type of filter you want to use. They vary so widely that it is hard to say that one is better than another. Also, it depends on what type of compression that you want to use will also determine which codec you will want. Some use lossy compression and some use lossless compression. With lossy, you will lose some data when it compresses, but lossless will not. Lossless on the other hand will produce large data files, as it can only compress a certain amount without losing data.

One thing that you might want to consider is using some of the Vision functions to track changes in pixel values from one image to the next. There are a lot of different processing that you can do on your images before you store them to file by using the NI Vision functions. Other than that, you might have to just play around with the different codecs to find which one will work best for you.
 
Let me know if you have any further questions or concerns. Thanks, and have a great day.
 
Regards,
DJ L.
0 Kudos
Message 4 of 4
(3,027 Views)