LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

other avi codecs?

I am recording video from an IEEE-1394 camera and have tried all the codecs available but none seem to work well. The problem with most of them is that the video is jerky, I think the time to compress the video is longer than the frame rate so it's missing some images. The only compression filter that works well is DV Video Encoder, however, the videos end up with 720 x 480 resolution no matter what the resolution on the camera is set to. I need to have higher resolution videos that are good quality. I tried Microsoft RLE with the highest quality set but the video is jerky and the files are huge (lower quality images are pixely). Can I download other codecs that would work with LabView? I'm using LabView 7.1.1. Would upgrading to LabView 8 help? Part of the problem is that my camera is 8-bit grayscale but the AVIs are RGB, so the files are really big. Can LabView 8 make grayscale AVIs?
Thanks!
0 Kudos
Message 1 of 8
(5,988 Views)
Have you tried divX?  It reduces avi size quite lot.

George Zou
http://gtoolbox.yeah.net

George Zou
0 Kudos
Message 2 of 8
(5,970 Views)
Hello,
There are a few things that we can look at.  To answer your question about codecs, I have a few suggestions and questions.  What is your frame rate and at what resolution?  Is the video less "jerky" if you do not compress the video?  How many frames are you trying to acquire and save?
 
A quick search about the DV Video Encoder confirms that this particular filter does have a resolution specification which is why your resolution is being limited.  The codecs that you can use with the write avi functions are DirectShow compatible, so it is possible that you may be able to download other codecs that may work.  The codecs are not related to the version of LabVIEW you are using, so I do not believe changing LabVIEW versions would affect this.  The AVI VIs are included with Vision.  I do not think there is a way to save an AVI with only 8-bit depth, this is one of the specifications of an AVI.
 
I hope this helps to answer your questions.  Let me know if you have any other questions about this issue.
Regards,
Angela M.
Applications Engineer
NI
 
 
0 Kudos
Message 3 of 8
(5,970 Views)

Thanks for the replies. I'm taking high resolution (1280 x 960 or 1024 x 768) images at 7.5 frames/sec. I generally record about 5 minute video sequences, so if I don't use a compression filter, the files get very large very fast and eventually freeze LabView.  I have tried several more codecs that I downloaded and they all seem to be jerky or they just freeze LabView (with DivX the program froze after one frame). The best one I've found so far is FastCodec by VideoSoft.org... I think it's a little jerky when I record and I tried reading and writing frames to a new AVI using that codec and then playing it back and it played fine at half speed but was jerky at full speed. I'm not sure if the problem is that I just haven't found a fast enough codec to keep up with the frame rate or if my computer isn't fast enough. I'm using Windows XP on a 4 year old laptop with a 1.6 GHz processor and 512 MB memory. Can anyone recommend a fast codec for recording high resolution video?

Thanks!

0 Kudos
Message 4 of 8
(5,943 Views)
I've used Huffyuv, which is quite fast and has the benefit of being lossless. It will probably only give you slightly better than a 2:1 compression ratio, so disk IO may become a bottleneck. I've never used it with Labview, though.

0 Kudos
Message 5 of 8
(5,923 Views)

Thanks for the Huffyuv site... that codec seems to work well. The problem I'm having now is that the videos play correctly in windows media player, but in LabView (using Read AVI Example), they are playing too slow (takes about 1.5 times as long as it should) and a little jerky. The same thing is happening when I use FastCodec as well. Videos that are uncompressed or compressed using DV Video Encoder play well in LabView. Any idea what's wrong?

Thanks!

0 Kudos
Message 6 of 8
(5,911 Views)
I've never worked with AVIs in Labview, so I can't really comment on that. The fact that the movie plays back correctly outside of Labview suggests to me that your problem is not a disk IO or CPU bottleneck involved in playing back the movie.  You might also give XviD a try. It's similar to DivX, so it's lossy, but you might get better compression and smaller file sizes.

0 Kudos
Message 7 of 8
(5,879 Views)
Hi,
 
I've stuggled with this problem for a few years. The best option I have found for high quality video with relatively small size is a unique version of DIVX using the ffdshow video encoder. Essentially ffdshow allows you to adjust the encoder properties of any codec (as they were meant to be adjusted). LabVIEW has never developed a vi to be able to adjust the codec parameters properly. Anyhow, if you download the Cole2K media encoder pack (here) and install it. It will allow you to select and adjust any codec you have on your computer and adjust it's parameters through the start/programs/cole2k media-codec pack/ffdshow VFW. I would suggest using the mpeg4, divx, one=pass constant quality (~85) setting from the generic menu. (yields >= dvd quality video with ~1.5Gb/hr compression)
 
You will be able to record very fast (I've tested up to 25 fps for 640 by 480, and 10 fps for 1200 by 1600) video with very good quality and compression. However, the recorded file may not load in IMAQ AVI Read.vi. This has to do with the fact it will try to use the ffdshow video decoder instead of the proper codec (i.e. DivX in the example setting). I hope this helps you and anyone else interested in video codecs and compression.
 
The ultimate solution to your problem lies in the fact that a *.vi was never designed to access and adjust the video codec encoder parameters. This is a solution I would suggest advising to any supporting NI applications engineers. It appears in almost every video editing software I have ever run across, so I would suspect it would be easy to access and adjust (perhaps even active X in the case of divx or some of the other more popular codecs.)
 
Good luck, hope this helps,
 
Josh Meisner
0 Kudos
Message 8 of 8
(5,796 Views)