1_0_howto_20060728-rojinsong.txt

(7 KB) Pobierz
HOWTO COMPILE MPLAYER ON WINDOWS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*** 
 This is a work in progress, you've been warned.
***

It _is_ possible to compile Mplayer on windows using either MinGW or Cygwin.
This HOWTO focuses on Cygwin since my Mplayer builds on MinGW just "did not
work".

The actually process is pretty simple. There are only a couple of pitfalls
that usually render compiled mplayers unoperational. The three main steps
are:
 I.   Instaling Cygwin binary packages using Cygwin setup,
 II.  Fetching and compiling remaining 3rd party libraries manually and
 III. Fetching FFmpeg and Mplayer from SVN and compiling them.

***
 NOTE!! I messed up with --prefix stuff. you need tomanually copy
 files from /usr/local/lib to /lib, /usr/local/bin to /usr/bin and
 /usr/local/include to /usr/include.. i'll fix this at some point!

 NOTE #2: ftell64 and fseeko64 seem to make x264 go mad. Probably
 64bit support isn't enable by default in cygwin etc. i need to study
 this a bit more.

 UPDATE 07-09-2006 (mm-dd-yyyy): I will update this howto as soon as
 i have time, so be patient! (ETA 3 weeks, meanwhile browse mailinglist
 for upcoming changes/updates)
***

STEP I, Cygwin
~~~~~~~~~~~~~~
1. Goto <http://www.cygwin.com/> and download latest Cygwin using setup.exe
   <http://www.cygwin.com/setup.exe>.

   Run setup.exe and provide setup with details it likes to know. As Root
   Directory you may use any directory you like since you may move compiled
   mplayer.exe to another directory afterward.
   Install following packages that are available directly from Cygwin package
   tree but are not automatically selected.
  
     - gcc-core (3.4.4-1)
     - g++ (3.4.4-1)
     - make (3.8.0-1)
     - subversion (1.3.0-1)

     - libfreetype26 and libfreetype-devel (2.1.9-1)
     - libiconv (1.9.2-2)
     - libjpeg6b (6b-8)
     - libpng12 (1.2.8-2)
     - libvorbis and libvorbis-devel (1.1.1-1)
     - libogg and libogg-devel (1.1.2-1)
     - nasm (0.98.39-1)

   Install dependencies if found any. Note: Cygwin Setup will automatically
   selecs dependencies etc. when you select packages. You should not remove
   those automatically selected ones unless you know what you are doing.

2. Run cygwin.bat from <Root Directory>\cygwin.bat. If Cygwin won't start
   check that you have no previous Cygwin installation (Setup exited with
   message "Update done", "Nothing to install" etc.)

STEP II, REMAINING 3RD PARTY LIBRARIES
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Get DirectX headers from <http://www.mplayerhq.hu/MPlayer/releases/win32-beta/contrib/dx7headers.tgz>
   and copy those to /usr/include. You may use tar (tar -xzf <package.tar.gz>)
   or eg. WinRAR/7-Zip. In the latter case you need to extract files to
   <Root Directory>/usr/include.

2. Get libtheora (1.0alpha6) from <http://downloads.xiph.org/releases/theora/>.
   At this point you should make a new directory, eg. /install and extract
   sources to that directory. After that, run at libtheora directory: (libtheora-<version number>)

     ./configure --with-ogg-libraries=/lib
     make
     make install

   You may want to chain those commands so that the whole package will be
   installed without waiting one command to complete like this:

     ./configure --with-ogg-libraries=/lib && make && make install

   Note that installation will not continue in case of error so there'll
   be no situation where eg. make install starts if make fails.

   Note: Make sure you provide --with-ogg-librariess=/lib argument! Otherwise
   libtheora won't compile!
   
3. Get libregif (4.1.7 from <http://armory.nicewarrior.org/projects/libregif/>
   Install it as usual:

     ./configure && make && make install

4. Get Lame (3.97) from <http://lame.sourceforge.net/download/download.html>
   and install it:

     ./configure && make && make install
     
5. Get Xvidcore (1.1.0) from <http://www.xvid.org/downloads.html> and
   install it. At build/generic directory say:

     ./configure && make && make install cp mv /usr/local/lib/xvidcore.a /lib/libxvidcore.a
        
6. Fetch current x264 trunk from SVN. At your /install directory say:

     svn co svn://svn.videolan.org/x264/trunk x264

   A "x264" directory will be created (or whatever you type after svn://
   address). At that directory say:

     ./configure --enable-avis-input --enable-pthread

   After that remove from config.h references to ftello64 and fseek64 and
   -mno-cygwin references from config.Mak and run:

     make && make install
   
7. Last but not least, get Live (2006.05.17) from <http://www.live555.com/liveMedia/public/>.
   Note: tar might tell you there's something wrong with the tar file but that's
   just too bad. So no worries. The next part is a bit tricky. Open groupsock/GroupsockHelper.cpp
   in your favourite text editor and go to line 456 and comment following
   _preprocessor_ (leave struct intact!) blocks out:

     /* #ifndef IP_ADD_SOURCE_MEMBERSHIP <-- Starting from this one..
     #ifdef LINUX
     #define IP_ADD_SOURCE_MEMBERSHIP   39
     #define IP_DROP_SOURCE_MEMBERSHIP 40
     #else
     #define IP_ADD_SOURCE_MEMBERSHIP   67
     #define IP_DROP_SOURCE_MEMBERSHIP 68
     #endif */                          <-- ..to that one.

     struct ip_mreq_source {
       struct  in_addr imr_multiaddr;  /* IP multicast address of group */
       struct  in_addr imr_sourceaddr; /* IP address of source */
       struct  in_addr imr_interface;  /* local IP address of interface */
     };
     // #endif <- This one, too!

   After you've done that run following command:

     ./genMakefiles cygwin && make

   Make sure you don't use MinGW makefile under Cygwin, it won't work
   even it does compile!

8. Get binary codecs from <http://www1.mplayerhq.hu/MPlayer/releases/codecs/>.
   Download either all-<date> or essential-<date> and extract codecs to
   /usr/local/codecs.

STEP III, Compile Mplayer!
~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Fetch Mplayer (and FFMpeg) from SVN by running following command at
   your /install directory:

     svn co svn://svn.mplayerhq.hu/mplayer/trunk mplayer

   FFMpeg will be automatically fetched too, so you don't need to worry
   about libav* and postproc. At mplayer/ directory say:

     ./configure --enable-static --disable-mencoder --disable-tv \
       -with-livelibdir=/install/live --with-codecsdir=/usr/local/codecs
     make

   For other compiling options see ./configure --help. And after that:

     mplayer.exe <your favourite file>

AFTERWORD
~~~~~~~~~
You may move your mplayer.exe to another directory. However, cygwin1.dll
must be at the same directory! Config files etc. are fetched through Cygwin
so mplayer will search them from <Root Directory>/home/you/.mplayer unless
you tell configure something else.

Cygwin's binary versions might not be the newest ones but they at least
work. For example I wasn't able to build libogg and libvorbis myself.

PS. Libogg seems to be not working properly and I have no idea why. Videos
with Vorbis track play without any problems but .ogg files don't.

APPENDIX
~~~~~~~~

TROUBLESHOOTING:
 - Do not run Filemon while compiling packages. For some reason it seems
   to cause "permission denied" errors with some libtools.
 - If libtheora fails to find libogg.a provide a directory
   containing libogg.a for configure with --with-ogg-libraries=<dir>.
 - Run "make clean" after an unsuccessful build. It removes all files
   compiled or otherwise created. (At least it should.) Note: running
   make clean after an unsuccessful Mplayer build doesn't help always:
   you need to remove .o and .a files from subdirectories, too! This
   should do it:

     rm -f **/*.a **/*.o

 - Linker pops up with "undefined reference to `__errno'" messages?
   Stop mixing MinGW and Cygwin binaries. That won't work!

VERSION HISTORY:
 - 4.6.2006 - First "dunno, that worked for me" version.


(This document is Public Domain. Please feel free to
distribute/modify/etc. it.)

Zgłoś jeśli naruszono regulamin