Introduction
This guide intends to show how to successfully compile a
fully featured svn mplayer with
all the codecs and with the GUI player gmplayer. It is designed for the Ubuntu distro Gutsy Gibbon but will work with Dapper, Edgy or Feisty with adjustments to the required dev files, but this is not covered in this 'Howto'. Mplayer is a bit of a difficult one to compile so first make yourself a cup of tea and then get your keyboard ready!!
Note:
Downloading mplayer using subversion means that you will get the very latest version of this amazing software with all the latest features. But it also exposes you to the newest bugs and problems. If you value safety and stability in your system rather than access to cutting edge versions use the Ubuntu Repository mplayer instead.
First of the Downloads
Still with me? Firstly install subversion + compiling tools and then download the svn mplayer plus the full codec pack:
Code:
$ sudo apt-get install build-essential subversion
$ cd Desktop
$ svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
$ wget http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20071007.tar.bz2
So far so good? Next to decompress the codec package and copy all them to the appropriate location. Make sure you are still on the Desktop and:
Code:
$ sudo mkdir -v /usr/local/lib/codecs
$ tar xjvf all-20071007.tar.bz2
$ sudo cp -v all-20071007/* /usr/local/lib/codecs
All the dev files
Next comes quite a large download of development files, about 50 megs. These are required so that when mplayer is compiled you will pick up a huge amount of functionality. Don't be surprised if more are suggested, or if you already have some on your system.
Note: These dev files are specific to Gutsy Gibbon, there will be different requirements, not covered in this guide, for Feisty, Edgy and Dapper.
Code:
$ sudo apt-get install avifile-divx-plugin avifile-xvid-plugin gawk \
libxcursor-dev ladspa-sdk liba52-0.7.4 liba52-0.7.4-dev libaa1-dev libartsc0 \
libartsc0-dev libasound2-dev libatk1.0-dev libaudiofile-dev libavcodec1d libavcodec-dev \
libavformat1d libavformat-dev libavifile-0.7c2 libavifile-0.7-dev libavutil1d \
libavutil-dev libcaca-dev libcairo2-dev libcdparanoia0-dev libcucul-dev libdv4-dev \
libdirectfb-dev libdirectfb-extra libdbus-1-dev libdbus-glib-1-dev libdc1394-13 \
libdc1394-13-dev libdfb++-0.9-25 libdfb++-dev libdts-dev libdvdnav4 libdvdnav-dev \
libdvdread3 libdvdread-dev libebml0 libebml-dev libenca0 libenca-dev libesd0-dev \
libexpat1-dev libfaac0 libfaac-dev libfaad2-0 libfaad2-dev libfame-0.9 libfame-dev \
libflac++6 libflac-dev libflac++-dev libfontconfig1-dev libfontenc-dev libfreetype6-dev \
libfribidi-dev libgdk-pixbuf2 libgdk-pixbuf-dev libgii1 libgii1-dev libgii1-target-x \
libgl1-mesa-dev libglib1.2 libglib1.2-dev libglib2.0-dev libglu1-mesa-dev \
libglu1-xorg-dev libgsm1 libgsm1-dev libgtk1.2 libgtk1.2-common libgtk1.2-dev \
libgtk2.0-dev libice-dev libggi2 libggi2-dev libggimisc2 libggimisc2-dev libggiwmh0 \
libggiwmh0-dev libjpeg62-dev liblame0 liblame-dev liblivemedia-dev liblzo1 liblzo-dev \
liblzo2-2 liblzo2-dev libmad0 libmad0-dev libmatroska0 libmatroska-dev libmikmod2 \
libmikmod2-dev libmp4v2-0 libmp4v2-dev libmpcdec3 libmpcdec-dev libncurses5-dev \
libogg-dev libpango1.0-dev libpng12-dev libpopt-dev libpostproc1d libpostproc-dev \
libraw1394-dev libsdl1.2-dev libslang2-dev libsmbclient-dev libsm-dev libspeex-dev \
libsvga1 libsvga1-dev libsysfs-dev libtheora-dev libungif4-dev libungif4g \
libvorbis-dev libx11-dev libx264-54 libx264-dev libxau-dev libxcomposite-dev \
libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxfont-dev libxft-dev \
libxi-dev libxinerama-dev libxrandr-dev libxrender-dev libxsharp-dev libxv-dev \
libxvidcore4 libxvidcore4-dev libxvmc1 libxvmc-dev libxxf86dga-dev libxxf86vm-dev \
mesa-common-dev pnet-interpreter sharutils toolame ttf-bitstream-vera \
x11proto-composite-dev x11proto-core-dev x11proto-damage-dev \
x11proto-fixes-dev x11proto-fonts-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 \
xlibs-static-dev xtrans-dev zlib1g-dev
Optional Step: H264
If you are keen to use
H.264 encoding at some stage you would be best to also compile the latest x264 source code
before compiling mplayer. To do this the following commands will log you onto the Videolan x264 subversion repository, download the source code and compile it:
Code:
$ cd Desktop
$ svn co svn://svn.videolan.org/x264/trunk x264
$ cd x264
$ ./configure
$ make
$ sudo make install
mplayer will pick this up automatically during its configure process and H.264 encoding will then be available to you. Remember this is an optional step and mplayer will run quite happily without it. As well it is a step that that can be added in at a later stage as long as you follow the sequence:
- Compile and install H.264 source code
- Compile and install mplayer source code
Installation
The next task is to compile the svn mplayer, setup a font for the OSD and organise a skin for the GUI:
Code:
$ cd $HOME/Desktop/mplayer
$ ./configure \
--prefix=/usr/local \
--enable-largefiles \
--enable-gui \
--codecsdir=/usr/local/lib/codecs
$ make
$ sudo make install
The next step is to place a symbolic link to a font for the OSD (On Screen Display) and subtitles. At the same time we will create the directory structure for the mplayer skin:
Code:
$ cd $HOME
$ mkdir -pv .mplayer/skins/default
$ ln -sv /usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf ~/.mplayer/subfont.ttf
And finally to set up a skin for the GUI. Can I say that I rarely use the GUI but in the spirit of generosity, Gentle Reader, I have included the directions on this page for a basic skin and access to gmplayer, the GUI version of mplayer. So, you now need to download a skin, decompress it and then place it in the appropriate directory:
Code:
$ cd Desktop
$ wget http://www.mplayerhq.hu/MPlayer/skins/Blue-1.7.tar.bz2
$ tar xjvf Blue-1.7.tar.bz2
$ cp -Rv $HOME/Desktop/Blue/* $HOME/.mplayer/skins/default
And 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
- mencoder -ovc help : Video encoding available to mencoder
- mencoder -oac help : Audio encoding available to mencoder
Start both from the command line, the CLI version with the command
mplayer, the GUI with
gmplayer and the movie encoder with
mencoder. And remember: "Have fun!".
Andrew
Bookmarks