Compiling Mplayer From SVN

From ArchWiki

Jump to: navigation, search


Contents

Introduction

Much credit goes to andrew.46 from the Ubuntu forums for much of this guide (only slightly adapted for the Arch user).

This guide walks through the steps required to compile Mplayer from source using the Subversion repository, which provides the most up to date version of Mplayer. This is the method recommended by Mplayer and if compiled often, security holes can be kept to a minimum and new features accessed as soon as they are uploaded to the Subversion repository.

The Mplayer release tarballs are available in the [extra] repository can be installed using pacman, which is recommended for those that are after more stability. The bleeding edge nature of the Subversion repository means that bugs and problems can creep in. These pacman packages can also be custom built using the Arch Build System.

The method to compile it with a GUI interface and the OSD menu will be described, but these are optional.

Preparation

Before compilation can begin, there are various steps to take.

Install dependencies

  • These are required during the make command:
pacman -Sy libdca mesa
  • Installing Subversion is not completely necessary as a snapshot can be downloaded directly from the website, but reduces a lot of effort:
pacman -Sy subversion
  • These are required for Mplayer to run with basic functionality (although 'gtk2' can be left out if you compile without a GUI):
pacman -Sy live-media libxxf86dga xorg xorg-apps xorg-utils xorg-font-utils libmad \
           libungif cdparanoia sdl lame libtheora xvidcore libgl x264 faac ttf-dejavu \
           dbus dbus-glib libao gtk2
  • This is an incomplete list of optional dependencies that add extra fuctionality to Mplayer:
jack-audio-connection-kit libcaca libvorbis vorbis-tools flac speex lzo2 libmikmod \
libmad smbclient lirc-utils libpng libjpeg aalib

Setup codecs

These must be downloaded in order to play certain video formats:

cd
wget http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20071007.tar.bz2
su
mkdir -p /usr/local/lib/codecs/
tar -xjvf all-20071007.tar.bz2 
cp all-20071007/* /usr/local/lib/codecs/

Setup default GUI skin

A default skin must be specified if Mplayer is compiled with a GUI. The 'Clearplayer' theme has been used as an example:

cd
wget http://www.mplayerhq.hu/MPlayer/skins/clearplayer-0.9.tar.bz2
tar -xjvf clearplayer-0.9.tar.bz2
cd clearplayer
mkdir -p /usr/local/share/mplayer/skins/
cp * /usr/local/share/mplayer/skins/default/

Setup other GUI skins

Other skins can be placed in the /usr/local/share/mplayer/skins/ directory and selected through the 'Skin Browser' option in the Mplayer menu. These skins can be found on the Mplayer download page.

cd
wget http://www.mplayerhq.hu/MPlayer/skins/foo.tar.bz2
su
tar -xjvf foo.tar.bz2 -C /usr/local/share/mplayer/skins/

Configure font for the On Screen Display

A font must be specified, otherwise Mplayer will break:

mkdir -p ~/.mplayer
ln -s /usr/share/fonts/TTF/DejaVuSans.ttf ~/.mplayer/subfont.ttf

Download Mplayer from Subversion

This shows how you put the files in the folder ~/mplayer/, but you can do this in any directory you choose:

cd
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer

Compilation

Now compilation can begin. Navigate to the folder you placed the files in and compile with whatever options you choose:

  • Navigate to the Subversion directory you downloaded the files to:
cd /home/USER/mplayer/
  • Configure with your own options before the make command:
./configure --enable-gui --enable-menu
  • Any optional dependencies you installed are usually automatically detected. See what other available options there are and which options are automatically detected by running help:
./configure --help
  • For those that want to install Mplayer in '/usr' instead of '/usr/local' ('usr/local' is recommended in order for your own compiled Mplayer to coexist with the pacman package):
./configure --prefix=/usr
  • Complete compilation with the make and make install commands
su
make
make install
make clean

Mplayer can be uninstalled with the 'make uninstall' command:

cd /home/USER/mplayer/
su
make uninstall

Keeping Mplayer up to date

  • Navigate to the source directory and uninstall mplayer (this might not be entirely necessary, but it only takes 5 seconds):
cd /home/USER/mplayer/
su
make uninstall
  • Update any files that are out of date using Subversion (unchanged files need not be redownloaded):
svn update

You can then run the compilation commands again and you have an up to date Mplayer to use. This can be done fairly quickly on a weekly basis.

More resources

Mplayer home page
Browse the Mplayer Subversion repository
Installation steps from Mplayer documentation
Installation steps for Ubuntu

Personal tools