Mohamed Mansour's Personal Website
How-To compile MPlayer under Windows
Posted on July 15, 2007, 5:32 pm EST
How-To install the newest build of MPlayer in Windows directly from SVN. Since MPlayer does not compile the binary every time, the binary version which is downloaded from their website is outdated. So one time, I was going to dump a live RTSP stream from the net, but it was stuck at 2.5% and the dumpstream size was only 16K, which was totally incorrect. The reason why it doesn't work in windows is there is a bug for RealPlayer codecs. As discussed on their webpage (http://www.mplayerhq.hu/DOCS/HTML/en/win dows.html), "If you have a Pentium 4 and are experiencing a crash using the RealPlayer codecs, you may need to disable hyperthreading support." So we have to disable runtime CPU detection when compiling it. So we have to recompile the binaries without the '--enable-runtime-cpudetection' parameter flag. So I will explain how to compile MPlayer in Windows. Compiling it on Linux is relatively simple, look at my previous post
Download MPlayer from SVN (newest build)
- Download SVN utility for Windows. Download it from http://tortoisesvn.tigris.org/ . And Install it!
- Lets create a directory to install the source code of MPlayer. Create a new directory anywhere, and go inside that directory.
- Right click inside that directory and choose 'Checkout'. Enter this Url of Repository: 'svn://svn.mplayerhq.hu/mplayer/trunk'. Press ok and wait till finishes.
Download MinGW and MSYS
MinGW as stated on the website is "A collection of freely available and freely distributable Windows specific header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs."
- Download MinGW from http://sourceforge.net/project/showfiles.php?group_id=2435 By selecting the 'Current' Package then the 'MinGW' Release.
- Install it to 'C:\'
- Now we need to load the DirectX header files. Download the tar from http://www.mplayerhq.hu/MPlayer/releases/win32/contrib/dx7headers.tgz
- Extract the contents of the tar to 'C:\MinGW\include'
- We are done installing MinGW
MSYS as stated on the website is "A Minimal systems to provide POSIX/Bourne configure scripts the ability to execute and create a Makefile used by make."
- Download MinGW from http://sourceforge.net/project/showfiles.php?group_id=2435 By selecting the 'Current' Package then the 'MSYS' Release.
- Install MSYS by just running the installer
- It will tell you if you want to 'postinstall', select 'yes'
- It will tell you where MinGW is installed, type 'c:/mingw'
- That is it! MSYS is installed!
Now, MPlayer told us that "MOV compressed header support requires zlib, which MinGW does not provide by default. Configure it with --prefix=/mingw and install it before compiling MPlayer." Let us do that now.
- Download zlib from http://www.zlib.net/zlib-1.2.3.tar.gz
- Move 'zlib-1.2.3.tar.gz' to 'C:\msys\1.0\home\[username]', where [username] is the name of the computer, in my case it is 'Mohamed Mansour'
- Run MSYS by going to clicking on 'START -> All Programs -> MinGW -> MSYS -> msys
- Now in the MSYS window, type 'ls'. You will see 'zlib-1.2.3.tar.gz'. Great!
- Untar the archive:
CODE:$ tar xvfz zlib-1.2.3.tar.gz
- Now change to the zlib directory:
CODE:$ CD zlib-1.2.3
- Configure zlib with mingw:
CODE:$ ./configure --prefix=/mingw
- Build zlib:
CODE:$ make && make install
- We are done compiling zlip into mingw!
Now it is time to compile MPlayer :) Yaay. Now MOVE the MPlayer folder from where we downloaded at Step one (SVN) to 'C:\msys\1.0\home\[username]'
- If CD into the 'mplayer' directory.
- Now we need to configure without the runtime cpu detection flag type in:
- Now we need to build it by:
- Now what you could do, is download the binary from the website and skip one huge step, and just overwrite mplayer.exe and mencoder.exe from current directory. And it will work fine :) Or you could follow this huge txt of how to compile codecs from this website HOW-TO
So we are done! Just download the MPlayer directly from http://www.mplayerhq.hu/design7/dload.html and overwrite 'mplayer.exe' and 'mencoder.exe' from what we compiled! And here you have it, a full working Windows Compiled version of MPlayer :)
I hope it helped you as much it helped me!
Download compiled MPlayer Binary without runtime cpudetection
- Version: MPlayer dev-SVN-rUNKNOWN-3.4.2. DOWNLOAD [mplayer-custom-no-runtime-cpudetection.zip]