avi2divx and mpeg2divx

These are some tools I hacked up that are able to convert all(?) AVI and MPEG files to AVIs with DivX ;-) video and MP3 audio.

They are based on two great libraries that enabled me to complete the first version of mpeg2divx in one long night and avi2divx within an hour or so.

avifile allows you to use Windows AVI codecs under Linux/i386 and is just as powerful as undocumented.

libmpeg3 enables you to decode just about every kind of MPEG stream with a minimum of effort.
 

News

2001/01/01:
new release 0.7a
This release doesn't actually have anything new other than that it now builds against avifile 0.53.1. If you're using version 0.51 I strongly recommend to upgrade since 0.51 has some serious bugs that also affect x2divx.

2000/12/15:
new release 0.7
OK, here's the release that works with (and only with) avifile 0.51. There's also a new patch that solves a problem 0.51 is having with the Morgan MJPEG codec. Apply it if avifile keeps saying that the codec doesn't support 16 bit output (which you don't need for avi2divx).

2000/12/13:
about avifile 0.51
x2divx currently does not work with the new version 0.51 as it's missing some important methods (namely SetDirection() and SetBitDepth()). I'll look into it as soon as I find some free time.

2000/12/09:
bugfix release 0.6a
another fix for encoding single audio channel MPEGs with mpeg2divx (sound plays too fast). Thanks to Marcel Ritter for pointing out that issue.

2000/11/28:
new release 0.6
includes fix for bug reported by Morten Berg and others that breaks audio on input MPEGs with more than two channels
new feature allows to specify an offset for black border clipping

2000/11/12:
bugfix release 0.5a
mpeg2divx should be able to handle input files with more than two audio channels now. Also, encoding of video-only streams is now possible. No changes to avi2divx.

2000/11/04:

new version 0.5
Added basic picture scaling, fixed default MP3 bitrate as the old, fixed setting caused problems with aviplay and xtheater.

2000/11/01:

Morgan MJPEG codec has expired today
The shareware version of the MJPEG codec contained in binaries.zip has expired today. Since Morgan Multimedia does not offer a new version for download yet, I have made a little patch for avifile that makes all codecs think it's 1999. Get it from the download section, apply it, rebuild and reinstall avifile and everything should work again.

bugfix release 0.4a
avi2divx should now be able to encode single-channel audio properly. Thanks to Marc Lavallée for reporting this.

2000/10/28:

release 0.4
This version adds two new features:


2000/10/27:

bugfix release 0.3a
There's a stupid bug in 0.3 that makes avi2divx occasionally abort with "pure virtual method called" when encoding more than one input file. This release should fix that. mpeg2divx is not affected.

2000/10/26:

new version 0.3
So here's another new version. This one features the possibility to give several input files which will be encoded sequentially into the output DivX ;-) AVI.

2000/10/25:

new version 0.2
This one adds a few commandline options for choosing the codec, setting bitrates etc. Download below.

bug in avifile library
avifile 0.50 (and older versions, too, I guess) has a bug that prevents setting the bitrate for the DivX ;-) fast-motion encoder. I've made a fix you can download below. Apply the patch before building the library. It may also be a good idea to delete the .registry file in your home directory if you have used avifile before.
 

Important note for Pentium III and Celeron/Coppermine users:

The DivX ;-) codec used by avifile autodetects the type of CPU you have and tries to use SSE instructions if available. This, however, is only supported by 2.4 kernels, so you'll probably have to upgrade to get my tools working. With a 2.2 kernel you'll get an "Illegal instruction" error.
 

On MJPEG AVIs

Version 0.50 of avifile comes with a proof-of-concept open-source MJPEG codec which is extremely buggy. I suggest you delete it (libavi_mjpeg.so) from /usr/lib/win32 so avifile will use the Morgan Windows codec instead. Note that for this to work m3jpeg32.dll has to have the right permissions, so if it doesn't work, do a "chmod 644 /usr/lib/win32/m3jpeg32.dll".

You should also know that the version of m3jpeg32.dll contained in binaries.zip has expired on 2000/11/01. If you want to use it you need the shareware workaround patch for avifile 0.50 and up from the download section.

For avifile 0.51 and up you also need the 16 bit patch.

License

Both tools are licensed under the GNU Public License v2.
 

Download

x2divx-0.7a sources

x2divx-0.7a binaries

Patch for bitrate problem in avifile 0.50 and 0.51; not necessary for current versions

Shareware workaround patch for avifile 0.50 to 0.53.1. This should make the Morgan MJPEG shareware codec run 'til judgement day.

Patch removing 16 bit output check in avifile 0.51 to 0.53.1 that makes the MJPEG codec (and maybe others) fail even if you don't need 16 bit.

Other stuff you need

The avifile library. Don't forget to download and install the Win32 codec binaries, too.

libmpeg3 is statically linked to the binaries and included in the source distribution, so you don't need to download it separately. Anyway, here's the libmpeg3 homepage.
 

Stuff you probably want to have

The "Linux Animation and Movie Player" (lamp) is a great video player, the only one I've been able to find that plays most kinds of media (including DivX ;-) AVIs and even some ASFs) at full frame rate (at least on my machine).

Another good player is Xtheater which has a nice GUI, DND and all that stuff. I prefer lamp, but that's probably a matter of taste.
 

Contact me if you have any suggestions or patches or want to give general feedback.
 

Back to emulinks.de