Mencoder is a command-line tool for creating multimedia files. It allows you to convert video from one format to another. When used together with OGMRip, mencoder helps you to rip DVD into a video file that's convenient to watch on computers. Note that the instruction herein explains how to compile Mencoder for the Windows platform, not Linux.
MinGW must be installed first (Look here for how). Once you have MinGW, launch MSYS (rxvt) from the Start menu and type the following commands.
PNG and JPEG
PNG depends on zlib compression library. Download the zlib source from zlib.net and compile as follows:
tar xzvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure --prefix=/mingw
make
make installNow get the PNG library here and compile it as follows:
tar xzvf libpng-1.2.34.tar.gz
cd libpng-1.2.34/
./configure --prefix=/mingw --disable-shared
make
make installDownload the source for JPEG library, compile and install JPEG as follows:
tar xzvf jpegsrc.v7.tar.gz
cd jpeg-7
./configure --prefix=/mingw
make
make installlibdca Library
Download the libdca source from videolan.org and compile it like this:
tar xjvf libdca-0.0.5.tar.bz2
cd libdca-0.0.5
./configure --prefix=/mingw
make
make installOGG, Vorbis and Theora
The source for these libraries can be obtained from xiph.org. Compile them like this:
./configure --prefix=/mingw --disable-shared
make
make installLibcdio Library
Download the libcdio source from here. Compile and install libcdio as follows:
tar xzvf libcdio-0.81.tar.gz
cd libcdio-0.81
./configure --prefix=/mingw --disable-shared
make
make installLive555 library
The Live555 library is used to decode streaming media. Get the live555 source from here and compile it as follows:
cd /mingw/lib
tar xzvf live.2009.07.28.tar.gz
cd live
./genMakefiles mingw
makeLAME
LAME is an MP3 encoder. This library allows Mencoder to encode DVD sound into MP3 audio. Download LAME from lame.sf.net and compile it as follows.
./configure --prefix=/mingw --enable-expopt=full
make
make installTwoLame
TwoLAME is an MP2 audio encoder. Get the source from twolame.org and compile it:
./configure --prefix=/mingw CPPFLAGS='-DLIBTWOLAME_STATIC'
make
make installXviD
In case you didn't know, XviD is the most popular video encoder used in creating movie files found on the P2P networks. With this library, mencoder can rip a DVD into XviD video. Get the XviD source from xvid.org and compile as follows:
tar xzvf xvidcore-1.2.2.tar.gz
cd xvidcore/build/generic
./configure --prefix=/mingw
make
make installIn addition, change to the /mingw/bin directory and copy xvidcore.a to libxvidcore.a.
cd /mingw/lib
cp xvidcore.a libxvidcore.aFAAC
FAAC is an MPEG-4 AAC audio encoder. Get the source (faac-1.28.tar.gz) and unpack the package. Then, edit Makefile.am:
SUBDIRS = include libfaac
Also, edit the line beginning with AC_OUTPUT in the file configure.in:
AC_OUTPUT(libfaac/Makefile include/Makefile Makefile)
Then, compile FAAC like this
sh bootstrap
./configure --prefix=/mingw --enable-static --disable-shared
make
make installx264
x264 is yet another good video encoder. x264 requires YASM to build an optimized executable. So get yasm and save it as /mingw/bin/yasm.exe. Then, compile x264 like this:
sh configure --prefix=/mingw --extra-cflags="-DX264_VERSION=20090608"
make
make installCompiling Mencoder
Now you're ready to compile mencoder. Download the MPlayer source snapshot from mplayerhq.hu and unpack it. Then, type the following commands into the MSYS window to produce the executable
mencoder.exe
.CPPFLAGS='-DHAVE_INT32_T -DLIBTWOLAME_STATIC'./configure --prefix=/mingw --enable-runtime-cpudetection --enable-static --enable-theora --yasm=/mingw/bin/yasm
make mencoder
strip *.exe
mv -iv mencoder.exe /c/WindowsThis produces a static executable
mencoder.exe
and copies it into theC:\WINDOWS
folder.
If you'd like to try my mencoder build, download it from here. Its filename is MPlayer-svn-r30521-snapshot-3.4.5.zip.
Hmmh, this used to work great in my previous Win2000 machine, but the current (November 2011) build using Win2003 and multicore CPU does not work. The old version of mencoder (snapshot mplayer-export-2010-04-02) does not generate mencoder.exe and does not show any error... the make just exits withoug generating any exe files. A new snapshot of mplayer doesn't compile (it stops when it does not find git to get new ffmpeg snapshot or something)
ReplyDeleteSuccess! Version 1.0rc4 (MPlayer-1.0rc4.tar.gz 23-Jan-2011 15:24 12M from mplayerhq.hu) compiles successfully with these instructions on my new Win2003 machine! I used MinGW-5.1.6.exe to install MinGW.
ReplyDelete