tags:

views:

51

answers:

3

I saw, in an application from a major software vendor a dll called "DivXDecoder.dll" - which intrigued me as (a) it implies the existence of an easy to use divx library, and (b) I'd rather like to play divx compressed movies in a product I work on.

The DivX project itself seems to concentrate on making Codecs and tools for end users. Are there any C/C++ friendly projects that make playback of divx content in Win32 or Cocoa apps possible?

A: 

Look at mplayer sources - it uses the ffmpeg library that handles decoding from a number of formats.

diciu
A: 

DivX is a compressor that conforms to MPEG-4 Part 2. XviD and some versions of Windows Media are also implementations of the standard. So anything that can decompress MPEG-4 Part 2 should be able to handle things compressed with DivX.

As for actual decompression libraries, I'd recommend libavcodec. It's widely-used (= good support), cross-platform, and open-source (LGPL, so can be used in commercial apps). It's also fairly easy to use from it's C binding. It can open and play many different codecs (and with libavformat, handle many different wrappers i.e. avi, mkv, etc.).

If it's Windows-only, using the OS-provided Video For Windows might be a better option if you just want to play MPEG since you wouldn't need to ship it with your app and you avoid potential license issues. Be warned, though, that this requires the user to have certain codecs installed. On Win7 (and Vista I think) the MPEG codecs required to play DivX/XviD are installed by default, however they're not on XP...

Robert Fraser
A: 

Don't waste your time trying to implement DivX playback in a Cocoa application. Use QTKit. If someone wants to playback DivX content in your app they will install a DivX QuickTime plug-in.

Mike Abdullah