======================
Introduction
=====================
This guide intends to show how to successfully compile the subversion MPlayer under Intrepid Ibex with a full codec pack. It is intended for use by advanced users only. If this advanced guide is really not what you are after perhaps you could try the very popular: Comprehensive Multimedia & Video Howto where Nathan will look after you
========================
Some Preparation
========================
For this guide to succeed you must ensure that you have all of the major Ubuntu Repositories enabled, details of enabling the Universe, Multiverse and Restricted Repositories can be found here.
Compiling, subversion and installation tools are first required and these can be downloaded from the Repositories as follows:
Code:
$ sudo apt-get install build-essential checkinstall subversion git-core yasm
Next to install the codecs:
======================
Set up the Codecs
======================
The codecs are the heart and soul of Mplayer and we will be downloading the 'full' pack, decompressing it and placing it in the appropriate location:
Code:
$ cd $HOME
$ wget ftp://ftp.mplayerhq.hu/MPlayer/releases/codecs/all-20071007.tar.bz2
$ sudo mkdir -pv /usr/local/lib/codecs
$ tar xjvf all-20071007.tar.bz2
$ sudo cp -v $HOME/all-20071007/* /usr/local/lib/codecs
I should mention at this time that it is this codec pack that has caused a bit of discussion concerning copyright, only use it if the laws in your country allow it. But now to source a font for Mplayer:
=============================
Source a Font
=============================
Mplayer needs to know the location of a TrueType Font to show movie subtitles. This can be selected from the commandline but more traditionally a symlink is created to the font of your choice:
Code:
$ sudo apt-get install ttf-bitstream-vera
$ mkdir -v ~/.mplayer
$ ln -sv /usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf ~/.mplayer/subfont.ttf
Feel free to choose your own font but this will certainly do to start with. I suspect this font is part of a default Ubuntu installation but I include directions for its installation anyway, just to be sure!
====================================
Install the x264 Libraries
====================================
The version of x264 in the Ubuntu Repository is too old for MPlayer so we will need to download a copy from the x264 git repository:
Code:
$ cd $HOME
$ git clone git://git.videolan.org/x264.git
$ cd x264
$ ./configure --enable-shared
$ make
$ sudo checkinstall --fstrans=no --install=yes --pakdir "$HOME/Desktop" \
--maintainer "$USER" --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`-0.0ubuntu1" \
--backup=no --deldoc=yes --deldesc=yes --delspec=yes --gzman --default
$ make clean
And now to install the Live555 libraries.
====================================
Install the Live555 Libraries
====================================
The version of the Live555 libraries in Ubuntu (liblivemedia-dev) seems to have trouble with some of the streaming broadcasts that I routinely listen to so I always compile MPlayer against the latest upstream libraries:
Code:
$ cd $HOME
$ wget http://www.live555.com/liveMedia/public/live555-latest.tar.gz
$ tar xvf live555-latest.tar.gz
$ cd live
$ ./genMakefiles linux
$ make
$ sudo cp -r $HOME/live /usr/lib
It is a fairly primitive installation regime but it enables me to listen to my favourite broadcasts and so I think it will make your version of MPlayer a little better as well.
And now to install the libopencore-amr libraries:
====================================
Install the libopencore-amr Libraries
====================================
These libraries enable amr playback for MPlayer:
Code:
$ cd $HOME
$ wget http://transact.dl.sourceforge.net/project/opencore-amr/opencore-amr/0.1.2/opencore-amr-0.1.2.tar.gz
$ tar xvf opencore-amr-0.1.2.tar.gz
$ cd opencore-amr-0.1.2/
$ ./configure --prefix=/usr
$ make
$ sudo checkinstall --fstrans=no --install=yes --pakdir "$HOME/Desktop" \
--maintainer "$USER" --pkgname="libopencore-amr" --pkgversion="0.1.2" \
--backup=no --deldoc=yes --deldesc=yes --delspec=yes --gzman --default
$ make distclean
Now for all the Development files:
====================================
Download the 'Development' Files
====================================
By default Ubuntu does not offer a particularly rich development environment so we need to download the required 'dev' files which are specific to Intrepid Ibex. (These files are loosely modelled on the results of the command 'sudo apt-get build-dep mplayer-nogui', I have removed some files and added others.):
Code:
$ sudo apt-get install em8300-headers gawk gettext html2text intltool-debian \
ladspa-sdk libaa1-dev libartsc0 libartsc0-dev libasound2-dev libatk1.0-dev libaudio-dev \
libaudio2 libaudiofile-dev libavahi-client-dev libavahi-common-dev libcaca-dev \
libcairo2-dev libcdparanoia0-dev libcucul-dev libdbus-1-dev libdbus-glib-1-dev \
libdirectfb-dev libdirectfb-extra libdts-dev libdv4-dev libenca-dev libenca0 \
libesd0-dev libexpat1-dev libfaac-dev libfaac0 libfontconfig1-dev libfreebob0 \
libfreetype6-dev libfribidi-dev libggi-target-x libggi2 libggi2-dev libggimisc2 \
libggimisc2-dev libgif-dev libgii1 libgii1-dev libgii1-target-x libgl1-mesa-dev \
libglu1-mesa-dev libglu1-xorg-dev libgtk2.0-dev libice-dev libschroedinger-dev \
libjack-dev libjack0 libjpeg62-dev liblzo-dev liblzo1 liblzo2-2 liblzo2-dev libmad0 \
libmad0-dev libmail-sendmail-perl libmp3lame-dev libmp3lame0 libmpcdec-dev libmpcdec3 \
libncurses5-dev libogg-dev libopenal-dev libopenal1 libpango1.0-dev libpixman-1-dev \
libpng12-dev libpopt-dev libpthread-stubs0 libpthread-stubs0-dev libpulse-dev \
libpulse-mainloop-glib0 libsdl1.2-dev libslang2-dev libsm-dev libsmbclient-dev \
libspeex-dev libsvga1 libsvga1-dev libsys-hostname-long-perl libsysfs-dev \
libtheora-dev libtwolame-dev libtwolame0 libvorbis-dev libx11-dev libxau-dev \
libxcb-render-util0-dev libxcb-render0-dev libxcb-xlib0-dev libxcb1-dev \
libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev \
libxft-dev libxi-dev libxinerama-dev libxrandr-dev libxrender-dev libxt-dev libxv-dev \
libxvidcore4 libxvidcore4-dev libxvmc-dev libxvmc1 libxxf86dga-dev libxxf86vm-dev \
mesa-common-dev po-debconf sharutils x11proto-composite-dev x11proto-core-dev \
x11proto-damage-dev x11proto-fixes-dev x11proto-input-dev x11proto-kb-dev \
x11proto-randr-dev x11proto-render-dev x11proto-video-dev x11proto-xext-dev \
x11proto-xf86dga-dev x11proto-xf86vidmode-dev x11proto-xinerama-dev \
xtrans-dev zlib1g-dev libstdc++5
This will download about 35 megs of archives from the Ubuntu and Medibuntu Repositories and will give our copy of MPlayer a huge amount of functionality. Feel free to add your own dev files to customise MPlayer to your own taste! Now to download the svn Mplayer itself:
=================================
Download and Compile the svn mplayer
=================================
Finally after all of the preparation it is time to download Mplayer from the subversion repository, compile it and use checkinstall to create a package and install it:
Code:
$ cd $HOME
$ svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
$ cd $HOME/mplayer
$ ./configure
$ make
$ sudo checkinstall -D --install=yes --fstrans=no --pakdir "$HOME/Desktop" \
--pkgname mplayer --backup=no --deldoc=yes --deldesc=yes --delspec=yes --default \
--pkgversion "3:1.0~svn-`grep "#define VERSION" version.h | cut -d"-" -f2`"
$ make distclean
And there you have the cutting edge MPlayer! Return here from time to time to update your copy by using the command 'svn update' and then compiling as before. But this is of course only the commandline version, next to download the best graphical front-end for MPlayer available today:
=========================================
Downloading SMPlayer
=========================================
The default gui for MPlayer is known as gmplayer and it has been out of development for some time. I personally use the amazing SMPLayer in its place and I would advise that you do the same. To download from the Ubuntu Repositories simply:
Code:
$ sudo apt-get install smplayer
Some qt dependencies are brought in with SMPlayer for a total download of about 14 megs but trust me, it is well worthwhile! If you have any trouble with SMPlayer you will find that the developer is quite active on these forums and keen to help with his product. The developer also maintains a Personal Package Archive (PPA) with a newer version of the SMPlayer, details of how to access this can be seen here.
=============================
And in conclusion.....
=============================
And so you have successfully installed the svn MPlayer! You can check the options available for you with the following commands:
- mplayer -vo help : Video output available to mplayer
- mplayer -ao help : Audio output available to mplayer
- mplayer -vc help : Available video codecs
- mplayer -ac help : Available audio codecs
- mencoder -ovc help : Available video codecs
- mencoder-oac help : Available audio codecs
The commandline player is started with the command 'mplayer' in a Terminal window, the encoder with the command 'mencoder' while the gui SMPlayer should appear on your menu. And remember: "Have fun!".
Andrew Strong
March 28th, 2009
Bookmarks