1. 准备工作
(1)build tool
sudo apt-get -y install build-essential subversion checkinstall git-core \
docbook-xml docbook-xsl xsltproc libxml2-utils && \
mkdir -pv $HOME/mplayer_build
(2)升级yasm
cd $HOME/mplayer_build && \
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz && \
tar xvf yasm-1.2.0.tar.gz && cd yasm-1.2.0 && \
./configure && make -j 2 && \
mkdir -vp doc-pak && \
cp -v Artistic.txt AUTHORS COPYING doc-pak && \
sudo checkinstall --pakdir "$HOME/mplayer_build" --backup=no --deldoc=yes \
--pkgname yasm --pkgversion "1.2.0" --fstrans=no \
--deldesc=yes --delspec=yes --default && \
make distclean
(3)依赖库
sudo apt-get -y install libaa1-dev libasound2-dev libcaca-dev libcdparanoia-dev libdca-dev \
libdirectfb-dev libggi-target-fbdev libenca-dev libesd0-dev libfontconfig1-dev libfreetype6-dev \
libfribidi-dev libgif-dev libgl1-mesa-dev libjack-jackd2-dev libopenal1 libpulse-dev \
libsdl1.2-dev libsvga1-dev libvdpau-dev libxinerama-dev libxv-dev libxvmc-dev libxxf86dga-dev \
libxxf86vm-dev librtmp-dev libsctp-dev libass-dev libfaac-dev libsmbclient-dev libtheora-dev \
libogg-dev libxvidcore-dev libspeex-dev libvpx-dev libschroedinger-dev libdirac-dev libdv4-dev \
libopencore-amrnb-dev libopencore-amrwb-dev libmp3lame-dev liblivemedia-dev libtwolame-dev \
libmad0-dev libgsm1-dev libbs2b-dev liblzo2-dev ladspa-sdk libopenjpeg-dev libfaad-dev \
libmpg123-dev libopus-dev libbluray-dev libaacs-dev
(4)解码器
cd $HOME/mplayer_build && \
sudo mkdir -pv /usr/local/lib/codecs && \
if [ "$(uname -m)" = "x86_64" ]; then
wget http://www.mplayerhq.hu/MPlayer/releases/codecs/essential-amd64-20071007.tar.bz2
tar xjvf essential-amd64-20071007.tar.bz2
sudo cp -v essential-amd64-20071007/* /usr/local/lib/codecs
else
wget http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20110131.tar.bz2
tar xjvf all-20110131.tar.bz2
sudo cp -v all-20110131/* /usr/local/lib/codecs
fi
(5)x264
if [ "$(uname -m)" = "x86_64" ]; then
ARCHOPTS="--enable-pic"
else
ARCHOPTS=""
fi && \
cd $HOME/mplayer_build && \
git clone git://git.videolan.org/x264.git --depth 1 && \
cd x264 && \
./configure --prefix=$HOME/mplayer_build/mplayer_deps/usr \
--enable-static --disable-cli $ARCHOPTS && \
make && make install
2. 编译Mplayer
cd $HOME/mplayer_build && \
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer && \
cd mplayer && \
PKG_CONFIG_PATH="$HOME/mplayer_build/mplayer_deps/usr/lib/pkgconfig" \
./configure \
--extra-cflags="-I$HOME/mplayer_build/mplayer_deps/usr/include" \
--extra-ldflags="-L$HOME/mplayer_build/mplayer_deps/usr/lib" \
--confdir=/etc/mplayer \
--codecsdir=/usr/local/lib/codecs && \
make -j 2 && make html-chunked && \
mkdir -vp doc-pak && \
cp -v DOCS/HTML/*/* AUTHORS Changelog LICENSE README doc-pak && \
sudo checkinstall -D --install=yes --fstrans=no --pakdir "$HOME/mplayer_build" \
--pkgname mplayer --backup=no --deldoc=yes --deldesc=yes --delspec=yes --default \
--pkgversion "2:1.0~svn$(LC_ALL=C svn info 2> /dev/null | \
grep Revision | cut -d' ' -f2)" --provides "mplayer,mencoder" && \
make distclean && sudo ldconfig
3. 安装Smplayer
sudo add-apt-repository ppa:rvm/smplayer && \
sudo apt-get update && sudo apt-get -y install smplayer smtube