views:

333

answers:

2

Environment: Windows XP/Vista, VS2008, C#/.NET 2.0, VideoGrabber.

Hi All,

I'm writing an app which captures cameras input and encodes them into a movie file (including sound).

My client suggests I encode the movie using the DivX codec. But it's not installed by default and it's not redistributable: Users would have to download, install and configure it themselves.

Is there a Codec available in default Windows (XP+) installations that I could use to encode video and sound? It must support compression. Ideally, I should be able to programmatically set basic configuration.

Note: I read this question but it doesn't actually address my needs.

TIA,

A: 

Not sure how useful this is to you, but I was trying to answer that very question just recently. This article suggests DIB, I420, or IYUV are supported on all platforms... at least in OpenCV. I had the least trouble with I420.

Mark
+1  A: 

Is there a Codec available in default Windows (XP+) installations that I could use to encode video and sound?

About the best you can hope for is WMV2 (WMV v8). You may be able to encode it using qasf.dll.

The codecs you get for AVI in XP are all woeful efforts from the early days of ‘Multimedia PCs’: things like Cinepak and RLE, which are of zero use for modern full colour/resolution video, and Intel 4:2:0, which is only chroma subsampling, not really actual video compression.

If you need better than that you'll have to start embedding your own codecs, eg. from ffmpeg.

But it's not installed by default and it's not redistributable: Users would have to download, install and configure it themselves.

That's best anyway. Silently installing codecs onto a system is rather antisocial as there are often clashes between them and you could end up messing up other DirectShow applications. For example there are (at least) three different common DirectShow codecs that can handle “DivX” (which is really nothing more than MPEG-4 Advanced Simple Profile video plus MP3 audio in an AVI container): DivX, Xvid and ffdshow. Having more than one installed can be a recipe for bugs.

bobince