MinGW编译mplayer

参考自:
http://www.mplayerhq.hu/MPlayer/contrib/win32/MPlayer-MinGW-Howto.txt

第一步: Mingw, MSYS 和 MSYS Developer Tool Kit

去这里下载:
http://www.mingw.org/download.shtml

第二步: directx headers

这里:
http://www.mplayerhq.hu/MPlayer/releases/win32-beta/contrib/dx7headers.tgz

解压缩到你的include目录 (c:\mingw\include)
比如,在msys shell里
tar -xvvzf dx7headers.tgz
mv *.h c:/mingw/include

第三步:ogg, vorbis and theora

去这里:
Go to http://downloads.xiph.org/releases/
在ogg, vorbis and theora目录里下载这三个ogg是必需的,后两个可选。

tar -xvvzf libogg-1.1.2.tar.gz
cd libogg-1.1.2

编译libogg:
./configure --prefix=c:/mingw --disable-shared
make
make install
然后回到msys home,编译vorbis
cd ..
tar -xvvzf libvorbis-1.1.1.tar.gz
cd libvorbis-1.1.1
./configure --prefix=c:/mingw --disable-shared
make
make install
cd ..
和theora
tar -xvvzf libtheora-1.0alpha4.tar.gz
cd libtheora-1.0alpha4
./configure --disable-encode --prefix=C:/mingw --disable-shared
make
make install
cd ..

第四步:freetype (osd字体渲染)

下载libiconv:
http://www.gnu.org/software/libiconv/
编译:
tar -xvvzf libiconv-1.9.1.tar.gz
cd libiconv-1.9.1
./configure --prefix=c:/mingw --disable-shared
make
make install
cd..

下载freetype2:
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

第五步:zlib, libregif, libpng, libjpeg

源码在这里:
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..

第六步: lame, xvid and x264

下载nasm源码:
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

装lame:
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

装xvid 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 ..

然后是x264
这里有二进制包:
http://subversion.tigris.org/project_packages.html#binary-packages
解压缩到$PATH/bin比如: c:/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 ..

第七步: 可选,live.com rtsp 流媒体
这里有代码
http://www.live.com/liveMedia/public/
编译
tar -xvvzf live.2005.08.09.tar.gz
cd live
genMakefiles mingw
make
cd ..

第八步:MPlayer
cvs checkout或者daily snapshot皆可

在msys home下:
checkout mplayer
cvs -d:pserver:anonymous@mplayerhq.hu:/cvsroot/mplayer login
cvs -z3 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/mplayer co -P main
密码直接回车。
然后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

好了,准备就绪,编译mplayer
cd main
./configure --enable-runtime-cpudetection --codecsdir=codecs --enable-static --with-livelibdir=/home/username/live
make

一切顺利的话,万能的mplayer.exe就出现了,YAY!
如果嫌自己土制的mplayer不够牛,推荐http://mulder.at.gg/的build

0 comments:

Post a Comment

| More

Twitter Updates