RecentChanges TextFormattingRules AllWikiTopics OrphanedWikiTopics ToDoWikiTopics WikiLockList RSS Export2HTML WikiSearch SetUsername StartingPoints Home |
Mplayer:build on MinGW @Dec 17, 2007 3:46:11 PM
How to build MPlayer on MinGW using the MSYS shell.
12th February 2007 - Mark Himsley Last updated - 16-Dec-2007 This tutorial will build a static version of MPlayer with many formats included. It is based on the tutorial at: http://www1.mplayerhq.hu/MPlayer/releases/win32/contrib/MPlayer-MinGW-Howto.txt !!Install MinGW, MSYS and MSYS Developer Tool Kit Download MinGW, MSYS and MSYS Developer Tool Kit to a temporary location http://prdownloads.sf.net/mingw/MinGW-5.1.3.exe?download http://prdownloads.sf.net/mingw/MSYS-1.0.10.exe?download http://prdownloads.sf.net/mingw/msysDTK-1.0.1.exe?download Linked from: http://www.mingw.org/download.shtml Run MinGW-5.1.3.exe and install the current versions of: MinGW base bools g++ MinGW make into C:\MinGW Run MSYS-1.0.10.exe and install into C:\msys\1.0. After the install finishes a cmd shell opens and asks: "Do you wish to continue with the post install? [yn ]" press y and return The next question is: "Do you have MinGW installed? [yn ]" press y and return and enter the path MinGW was installed into: c:/MinGW (NOTE the forward slash) The next question is: Do you wish for me to add mount bindings for c:/MinGW to /mingw? [yn ] press y and return Run msysDTK-1.0.1.exe and install into C:\msys\1.0 After installing MinGW, MSYS and MSYS Developer Tool Kit, open a msys shell from the short-cut on your desktop. !!Install SVN client tools Download binary client tools. http://subversion.tigris.org/files/documents/15/32473/svn-win32-1.3.2.zip Linked from: http://subversion.tigris.org/project_packages.html#binary-packages Use 7-Zip or another zip archive managed to unpack the contents and put them into your path, for instance C:\mingw\bin !!Patch MinGW for long file pointers Download w32api-3.6.tar.gz and mingw-runtime-3.11 source into your msys home directory. http://prdownloads.sf.net/mingw/w32api-3.6.tar.gz?download http://prdownloads.sf.net/mingw/mingw-runtime-3.11-20061202-1-src.tar.gz?download Linked from: http://www.mingw.org/download.shtml and also download a patch file http://oss.netfarm.it/mplayer/misc/file64_mingw.diff In your msys home directory create a new directory called w32api and extract w32api-3.6.tar.gz into it. $ cd $ mkdir w32api $ tar -zxf w32api-3.6.tar.gz -C w32api Extract the mingw-runtime archive, patch it, build it and install it $ cd $ tar -zxf mingw-runtime-3.11-20061202-1-src.tar.gz $ cd mingw-runtime-3.11 $ patch -p1 -u -i../file64_mingw.diff $ ./configure prefix=c:/mingw $ make $ make install !!Install DirectX headers Download the DirectX headers to your msys home directory. http://www.mplayerhq.hu/MPlayer/releases/win32-beta/contrib/dx7headers.tgz Extract the headers and copy them into MinGWs include directory. $ cd $ mkdir dx7headers $ tar -zxf dx7headers.tgz -C dx7headers $ cd dx7headers $ cp -a *.h c:/mingw/include !!Install ogg, vorbis and theora libraries MPlayer can already play vorbis audio but requires libthora to play thora video. Building libtheora requires libogg and libvorbis to be installed. Download the latest version of ogg, vorbis and therora to your msys home directory http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz http://downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz http://downloads.xiph.org/releases/theora/libtheora-1.0alpha5.tar.gz Linked from: http://downloads.xiph.org/releases/ Extract the libogg archive, build it and install it. $ cd $ tar -zxf libogg-1.1.3.tar.gz $ cd libogg-1.1.3 $ ./configure prefix=c:/mingw disable-shared $ make $ make install Extract the libvorbis archive, build it and install it. $ cd $ tar -zxf libvorbis-1.1.2.tar.gz $ cd libvorbis-1.1.2 $ ./configure prefix=c:/mingw disable-shared $ make $ make install Extract the libtheora archive, build it and install it. $ tar -zxf libtheora-1.0alpha5.tar.gz $ cd libtheora-1.0alpha5 $ ./configure disable-encode prefix=C:/mingw disable-shared $ make $ make install !!Install freetype for On Screen Display font rendering Download libiconv to your msys home directory. http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.11.tar.gz Linked from: http://www.gnu.org/software/libiconv/ Extract the libiconv archive, build it and install it. $ cd $ tar -zxf libiconv-1.11.tar.gz $ cd libiconv-1.11 $ ./configure prefix=c:/mingw disable-shared $ make $ make install Download freetype2 to your msys home directory. http://prdownloads.sf.net/freetype/freetype-2.3.1.tar.gz?download Linked from: http://sourceforge.net/project/showfiles.php?group_id=3157 $ cd $ tar -zxf freetype-2.3.1.tar.gz $ cd freetype-2.3.1 $ ./configure prefix=c:/mingw disable-shared $ make $ make install !!Install 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/ $ cd !!Install lame, xvid and x264 Get the nasm sources from http://sourceforge.net/project/showfiles.php?group_id=6208 $ cd Now get http://www.xvid.org/downloads.html $ cd !!Install x264 Get svn checkout from videolan.org. $ cd =--- stream/stream_dvd.c (revision 25424) +++ stream/stream_dvd.c (working copy) -24,8 +24,9 #include <sys/ioctl.h> #endif -#include <libgen.h> +//#include <libgen.h> #include <errno.h> +#define basename(s) (strrchr((s),'/')==NULL?(char*)(s):(strrchr((s),'/')+1)) #define FIRST_AC3_AID 128 #define FIRST_DTS_AID 136 -46,6 +47,16 int dvd_angle=1; int dvd_speed=0; /* 0 => don't touch speed */ +char* dirname(char* s) { + if(strrchr((s),'/')==NULL) { + return ""; + } + char* t = strdup(s); + char* u = strrchr((t),'/') ; + *u = (char) NULL; + return t; +} + static void dvd_set_speed(char *device, unsigned speed) { #if defined(linux) && defined(SG_IO) && defined(GPCMD_SET_STREAMING) |