2008-05-02

MPlayer from source with 3GP support on Ubuntu

Everyone knows MPlayer - The Movie Player, but because licensing issues 3GP support cant be included. So please before proceeding read the "Legal Notice" at the 3GP (AMR) for Linux site.

We need to compile the AMR codecs (first) and (then) MPlayer from source, plus benefit is that Linux distributions (in general) ships MPlayer with broken patches and disabled stuff in it such as codecs.

* Download the required packages .
# sudo apt-get build-dep mplayer
# sudo apt-get install subversion

* Download MPlayer, MPlayer skin (for the gui), 3GP AMR codecs.
NOTE: we will get the current sources of MPlayer not the stable RC2. It has more features, bugfixes.

# svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
# wget http://www.mplayerhq.hu/MPlayer/skins/Blue-1.7.tar.bz2
# wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.1.tar.bz2
# wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.2.tar.bz2

* Extract the files.
# tar xvjf amrnb-7.0.0.1.tar.bz2
# tar xvjf amrwb-7.0.0.2.tar.bz2
# tar xvjf Blue-1.7.tar.bz2

* Compile and install amrnb
# cd amrnb-7.0.0.1
# ./configure --prefix=/usr
# make
# sudo make install

Note: we need to specify --prefix=/usr because: see my previous post

* Compile and install amrwb
# cd ../amrwb-7.0.0.2/
# ./configure --prefix=/usr
# make
# sudo make install

* We can now compile MPlayer.
# cd ../mplayer
If you need GMPlayer (GUI) please use --enable-gui.
For more configuration options see:
# ./configure --help

I will enable GUI this time because I want to show how we can install Skins for it.
# ./configure --enable-gui
After this you can read what will be enabled and disabled, what you will see will be enough.

Now we can compile and install it:
# make
# sudo make install

NOTE: it seems that the current Makefile is broken so the GUI wont be installed we need to execute:
# sudo make install-gui

* Install the Skin and Font.
# cd ..

This will copy the Blue directory recursively to /usr/local/share/mplayer/skins
# sudo cp -R Blue /usr/local/share/mplayer/skins

We need to create a symlink because else MPlayer won't recognize it:
# sudo ln -s /usr/local/share/mplayer/skins/Blue /usr/local/share/mplayer/skins/default

For subtitles and menus we need a font:
So, we create a symlink.
# ln -s /usr/share/fonts/truetype/freefont/FreeSans.ttf ~/.mplayer/subfont.ttf

* Remove the "working directry".
# cd ..
# rm -rf ~/build
NOTE: You can keep this time at least the mplayer directory if you want to weekly checkout the sources and rebuild it.

Now you can enjoy your movies :)

PS: if something is not clean or it fails somewhere, please leave a comment or:
- you can subscribe to MPlayer mailing lists at the MPlayer site
- you can enter #MPlayer at Freenode
mplayervbox

2 comments:

Anonymous said...

Cannot open anything, DVD does not play, wants to re-compile. Have hardy x64. I give up on MPlayer. Please give me detailed steps on how to uninstall, as your build/install does not show up in synaptic, so I have no idea how to get rid of it. Please leave advise/comment here. I'll check daily. I did all the steps, no good. Your xmms steps were perfect bytheway.

Anonymous said...

Did all the steps, works perfect with the nasty .3gp files, thanks a lot for the detailed instructions.

Post a Comment