Once finished this should become a howto that will explain the steps necessary to setup the toolchain to compile your own versions of MPlayer on MinGW similar to the one in the packages found at http://www.mplayerhq.hu/MPlayer/releases/win32-beta Step 1 Mingw, MSYS and MSYS Developer Tool Kit Download the latest versions of MinGW, MSYS and the MSYS Developer Tool Kit from http://www.mingw.org/download.shtml The Development Tool Kit is needed for obtaining a cvs checkout (recommended). If other means are used to obtain the sources of MPlayer and libavcodec, one can omit it. (See the description in "Step 8 MPlayer" at the end of this document.) The versions used in this document are MinGW-3.1.0-1.exe MSYS-1.0.10.exe msysDTK-1.0.1.exe Then install MinGW and afterwards MSYS together with it's Development Tool Kit Answer "Do you wish to continue with the post install? [yn ]" and "Do you have MinGW installed? [yn ]" with y and give the path to your mingw dir in the next question. (c:/mingw if you did not alter the path during the mingw setup) To install MSYS Developer Tool Kit, run msysDTK-1.0.1.exe, accept the license and provide the installer with the correct path to your msys directory. After the installation is finished, open a msys shell (you can find an icon for it on your desktop). The following steps assume that you download the packages to your msys home dir, for me that is in c:\msys\home\useranme where username is my windows username. Step 2 directx headers Get the directx header package at http://www.mplayerhq.hu/MPlayer/releases/win32-beta/contrib/dx7headers.tgz As alternative you can also use the modified wine headers reimar posted to the cygwin list. Extract the headers and move them to your mingw inlucde dir (c:\mingw\include) To do this use the following commands in your msys shell tar -xvvzf dx7headers.tgz mv *.h c:/mingw/include Note: In this tutorial I install all packages into the mingw tree, it might probably be better to put all extra libraries and headers into a seperate directory and pass this directory with the --with-extraincdir and --with-extralibdir switches to configure Furthermore I'm using static linking to prevent problems caused by different dll versions. Omitting the --disable-shared from the configure commands will help you to build smaller exes that require the various dlls to be installed. Step 3 ogg, vorbis and theora Newer version of MPlayer already include the necessary sources to play vorbis audio, xiph's audio codec. Xiph's video codec is called theora. Libtheora is needed to play back theora video. For compiling libtheora, libogg and libvorbis must be installed. So if you just want to use vorbis, you can therefore skip this step. Go to http://downloads.xiph.org/releases/ and download the latest library archives (with extension .tar.gz) in the subdirectories ogg, vorbis and theora. (For this HOWTO, libogg-1.1.2.tar.gz, libvorbis-1.1.1.tar.gz and libtheora-1.0alpha4.tar.gz were used.) You need libogg-1.1.2 or later to be able to compile the source under MinGW without having to patch it. extract the archive: tar -xvvzf libogg-1.1.2.tar.gz change to the dir containing the sources: cd libogg-1.1.2 Call configure with your mingw install dir as prefix: ./configure --prefix=c:/mingw --disable-shared compile the sources: make and install them: make install afterwards go back to your msys home dir: cd now install libvorbis in a similar way tar -xvvzf libvorbis-1.1.1.tar.gz cd libvorbis-1.1.1 ./configure --prefix=c:/mingw --disable-shared make make install cd compile libtheora in the same manner tar -xvvzf libtheora-1.0alpha4.tar.gz cd libtheora-1.0alpha4 ./configure --disable-encode --prefix=C:/mingw --disable-shared make make install cd Step 4 freetype (for osd font rendering) First install libiconv from http://www.gnu.org/software/libiconv/ Get the sources then tar -xvvzf libiconv-1.9.1.tar.gz cd libiconv-1.9.1 ./configure --prefix=c:/mingw --disable-shared make make install cd Then get the latest freetype2 source package from http://sourceforge.net/project/showfiles.php?group_id=3157 tar -xvvjf freetype-2.1.9.tar.bz2 cd freetype-2.1.9 ./configure --prefix=c:/mingw --disable-shared make make install cd Step 5 zlib, libregif, libpng, libjpeg zlib is needed for some mov files with compressed headers the others to play/encode png/jpeg/gif files Sources are available from: http://www.gzip.org/zlib/ http://armory.nicewarrior.org/projects/libregif/ http://sourceforge.net/project/showfiles.php?group_id=5624 http://www.ijg.org/ tar -xvvzf zlib-1.2.1.tar.gz cd zlib-1.2.1 ./configure --prefix=c:/mingw make make install cd tar -xvvzf libpng-1.2.8-config.tar.gz cd libpng-1.2.8-config ./configure --prefix=c:/mingw --disable-shared make make install cd tar -xvvzf jpegsrc.v6b.tar.gz cd jpeg-6b ./configure --prefix=/mingw/ --enable-static make cp .libs/libjpeg.a c:/mingw/lib/ cp jpeglib.h jconfig.h jmorecfg.h c:/mingw/include/ cd tar -xvvzf libregif-4.1.6.tar.gz cd libregif-4.1.6 ./configure --prefix=c:/mingw make make install cd Step 6 lame, xvid and x264 Get the nasm sources from http://sourceforge.net/project/showfiles.php?group_id=6208 tar -xvvzf nasm-0.98.38.tar.gz cd nasm-0.98.38 ./configure --prefix=c:/mingw make mkdir c:/mingw/man/man1 make install cd Install lame from http://lame.sourceforge.net/download/download.html tar -xvvzf lame-3.96.1.tar.gz cd lame-3.96.1 ./configure --prefix=c:/mingw --disable-shared --disable-decoder make make install cd Now get http://www.xvid.org/downloads.html tar -xvvzf xvidcore-1.0.3.tar.gz cd xvidcore-1.0.3/build/generic ./configure --prefix=c:/mingw --disable-shared make make install mv c:/mingw/lib/xvidcore.a c:/mingw/lib/libxvidcore.a cd Get x264 svn checkout from videolan.org. Either use cygwin svn client, or download a zipped binary packages for win32 from http://subversion.tigris.org/project_packages.html#binary-packages Unpack and copy all files in /bin somewhere into your PATH, e.g. /mingw/bin svn co svn://svn.videolan.org/x264/trunk x264 cd x264 ./configure --prefix=/mingw --enable-avis-input --enable-pthread make make install cd Step 7 live.com rtsp streaming support Get the sources http://www.live.com/liveMedia/public/ tar -xvvzf live.2005.08.09.tar.gz (got some errors from tar here but the build worked nevertheless) cd live genMakefiles mingw make cd Step 8 MPlayer For my build I'm using a cvs checkout using the cvs client that comes with MSYS Developer Tool Kit, but cvs snapshots, wincvs or release tarballs should work, too. In the msys shell cd to your msys home dir cvs -d:pserver:anonymous@mplayerhq.hu:/cvsroot/mplayer login cvs -z3 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/mplayer co -P main When asked for a password, just hit enter. A directory named main will be created. Now checkout ffmpeg cd main cvs -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg login cvs -z3 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co -Pd libavcodec ffmpeg/libavcodec cvs -z3 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co -Pd libavformat ffmpeg/libavformat cvs -z3 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co -Pd libavutil ffmpeg/libavutil All the sources should be there now. cd main ./configure --enable-runtime-cpudetection --with-codecsdir=codecs --enable-static --with-livelibdir=/home/username/live (make sure you use the right path for the --with-livelibdir option, if you plan to use the executable only on the computer on which you are compiling you can leave out --enable-runtime-cpudetection) make If everything went well your first mplayer.exe can be found in the main dir now. 02.01.2005 Sascha Sommer - initial revision 13.02.2005 Stefan Gürtler - Enhanced step 6 to include building/installing x264 Sascha Sommer - ogg/vorbis step can be skipped, --enable-runtime-cpudetection is only needed when using the executable on different systems other small fixes pointed out by Reimar Döffinger and Wen-King Su 14.08.2005 Stefan Gürtler - Update compiling of x264, live, libogg, libvorbis and libregif, download of libavutil, use MSYS Development Kid for cvs checkout, libtheora