Mplayer build - Noah.org

Mplayer build

From Noah.org

Jump to: navigation, search

shell script to build mplayer

This is intended for an Ubuntu system, but might work on others. This pretty much automates everything. It will download the source code, codecs, and fonts from mplayerhq.hu and install everything. Normally I use Ubuntu packages, but in this instance I find that building from source works better. It's easier and I get every single codec that is available from mplayerhq.hu.

Download mplayer_build.sh

#!/bin/sh
 
# This builds mplayer from source. It assumes a fresh install of Ubuntu. As a
# side effect this will install dev tools and libs. If you already have these
# tools then this shouldn't matter to you.
#
# $Id: mplayer_build.sh 232 2008-04-05 06:02:39Z noah $
 
HOME=`pwd`
 
echo
echo "Downloading source files for MPlayer, all codecs, and a subtitle font"
wget -o /dev/null --continue http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc2.tar.bz2
#wget -o /dev/null --continue http://www.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
wget -o /dev/null --continue http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20071007.tar.bz2
wget -o /dev/null --continue http://www.mplayerhq.hu/MPlayer/releases/fonts/font-arial-iso-8859-1.tar.bz2
 
echo
echo "Installing required Ubuntu packages"
aptitude -q -y install libpng-dev libsvga1-dev zlib1g-dev
aptitude -q -y install libgtk1.2-common libglib1.2 libgtk1.2 libgtk-dev
aptitude -q -y install x-window-system-dev libx11-dev libxv-dev
aptitude -q -y install lame liblame-dev libtwolame-dev libavcodec-dev
 
echo
echo "Installing codecs to /usr/local/lib/codecs/"
mkdir /usr/local/lib/codecs
#tar xjf all-20061022.tar.bz2
tar xjf all-20071007.tar.bz2
cp all-20071007/* /usr/local/lib/codecs/*
#echo "YOU SHOULD ADD THIS TO /etc/fstab"
#mkcramfs all-20061022 codecs.img
#mount codecs.img /usr/local/lib/codecs
 
echo
echo "Installing MPlayer"
tar xjf MPlayer-1.0rc2.tar.bz2
cd MPlayer-1.0rc2
 
#Minimal: ./configure --enable-largefiles --enable-vesa
#Minimal X11: ./configure --enable-largefiles --enable-x11
# Not sure why/if --enable-xinerama is necessary. Weirdly, it made my build work
# when running under X11. Without xinerama only vesa mode would work -- I could
# not view video in a Window. New version of mplayer seems to work without it.
# It might be REQUIRED IFF you are running a multimonitor Xinerama system.
# Probably don't need Xinerama anymore. ./configure --enable-largefiles --enable-vesa --enable-xv --enable-svga --enable-x11 --enable-xinerama --enable-gui
# I couldn't get --enable-vesa to work on 1.0rc2  Thu Jan  3 16:12:30 PST 2008
#./configure --disable-ass --enable-largefiles --enable-xv --enable-svga --enable-x11 --disable-ass
./configure --disable-ass --enable-largefiles --enable-x11 --enable-xv --enable-svga
make
make install
 
cd $HOME
# --disable-gcc-checking
# --enable-freetype
# Not sure if --enable-freetype gets rid of the need to install subtitle fonts.
 
# --enable-aa would be neat (useless), but it spits out syntax errors.
# Maybe I have the wrong library/headers installed.
#
# This works almost everywhere:
# very basic VESA
#./configure --confdir=/etc/mplayer --enable-largefiles --enable-vesa
 
# mkdir /etc/mplayer
# echo "Default vo=vesa" > /etc/mplayer/config
# chmod -R a+r /etc/mplayer
 
echo
echo "Installing subtitle font to /usr/local/share/mplayer/font/."
mkdir -p /usr/local/share/mplayer/font
tar jxf font-arial-iso-8859-1.tar.bz2
cp font-arial-iso-8859-1/font-arial-18-iso-8859-1/* /usr/local/share/mplayer/font/.
-->