From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Writing to AVI - Add more codecs

Hi,

 

I have a GigE camera that is recording images at 25 FPS (I'm using IMAQdx to do this). I need to then save the video to an AVI file (I will be running the program for 8-10 hours a day, and creating new files when the file size reach 2GB). I am having problem finding a codec that will work well; the ones that are included with NI's vision acquisition package are not providing good enough quality at a low-enough data size (NI's MJPEG is the best so far, but the quality is too poor). I've tried installing ffpmotion and several other codecs, but non of them will appear with the AVI2 Get Codec Names VI (I've tried running this vi in both 32 and 64 bit version of labview). If anyone can help with instructions to install the codec so it will appear in labview it would be VERY helpful! Even better, if someone can suggest a specific codec to use!!

 

Thanks,

William

0 Kudos
Message 1 of 5
(4,166 Views)

Hi William,

 

Our software will recognize any codecs that are compatible with Microsoft's Video Compression Manager. 

 

If you have installed a codec, you can check to see if it is compatible and that it has been installed correctly using Windows Media Player. This Microsoft Support document includes instructions to find which codecs are installed under the "How can I find which codecs are installed on my PC?".

 

If you see the codec in that list, it should show up in LabVIEW. If it shows up in Windows Media Player but not in LabVIEW, post some screenshots and we can take another look. 

 

-----------------------------------------------
Brandon Grey
Certified LabVIEW Architect

0 Kudos
Message 2 of 5
(4,096 Views)

here you go....

this is on windows 10, with labview 2017 SP1 32 bit. I installed the x264 codec; it's visible in windows media player, and it doesn't show up in the avi2 codec list

codecs from avi2 get codec namescodecs from avi2 get codec namescodecs from WMP helpcodecs from WMP help

0 Kudos
Message 3 of 5
(3,260 Views)

OK looking at the avi codec comparison example, I figured out the issue. It's not documented at all, so I'm putting this up for anyone else googling.

 

The AVI2 get codec command is sensitive to what you wire to "image input." If you leave it unwired, you'll see the codecs that can take whatever the default type is (possibly u8 grayscale?). If you want to see the h264 codec, you need to wire a u32 rgb image (IMAQ create image), and you additionally have to set the image size (IMAQ set image size). 

0 Kudos
Message 4 of 5
(3,256 Views)

Thanks for that tip.

You might also try a x265 codec, an upgrade to x264.  Not that I've played with codecs in a long time but did read an interesting article recently - https://medium.com/netflix-techblog/a-large-scale-comparison-of-x264-x265-and-libvpx-a-sneak-peek-2e...

 

 

0 Kudos
Message 5 of 5
(3,250 Views)