This and that about computer stuff…

Random useful stuff for the computer guys…

Compiling x264, FFMpeg & XBMC on Ubuntu

So here the other day, I was doing some updates on my media center (Acer Revo box), running Ubuntu 10.04, when I found out that there wasn’t any XBMC packages for PAE anymore. So I had to compile my own.

The following is just a compilation of the various steps I took, and is gathered from different sites around the web.

First, make a directory to have all the source code in, and change to it. I use ~/Source
Then do:

sudo apt-get update
sudo apt-get install build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev
git clone git://git.videolan.org/x264.git
git clone git://review.webmproject.org/libvpx.git
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
svn co https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk/ xbmc

And you’ll also need the build deps for XBMC. The code block below is one command:
sudo apt-get install debhelper quilt python-support cmake autotools-dev automake unzip libboost-dev libgl1-mesa-dev libglu-dev libglew-dev libmad0-dev libjpeg-dev libsamplerate-dev libogg-dev libvorbis-dev libvorbisenc2 libfreetype6-dev libfontconfig-dev libbz2-dev libfribidi-dev libsqlite3-dev libmysqlclient-dev libasound-dev libpng-dev libpcre3-dev liblzo2-dev libcdio-dev libsdl-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libenca-dev libjasper-dev libxt-dev libxtst-dev libxmu-dev libxinerama-dev libcurl3 libcurl4-openssl-dev libdbus-1-dev libhal-storage-dev libhal-dev libpulse-dev libavahi-common-dev libavahi-client-dev libxrandr-dev libavcodec-dev libavformat-dev libavutil-dev libpostproc-dev libswscale-dev liba52-dev libdts-dev libfaad-dev libmpeg2-4-dev libass-dev libflac-dev libwavpack-dev python-dev gawk gperf nasm libcwiid1-dev libbluetooth-dev zlib1g-dev libmms-dev libsmbclient-dev libtiff4-dev libiso9660-dev libssl-dev libmicrohttpd-dev libmodplug-dev libssh-dev gettext cvs libtool libvdpau-dev

Ok, so now we have all the source files, and hopefully all the deps needed. Let’s start compiling.
First, we’re gonna do x264:

cd x264
./configure
make
sudo checkinstall --pkgname=x264 --pkgversion "2:0.`grep X264_BUILD x264.h -m1 | cut -d' ' -f3`.`git rev-list HEAD | wc -l`+git`git rev-list HEAD -n 1 | head -c 7`" --backup=no --default

Ok, x264 is installed, now let’s do libvpx:

cd ..
cd libvpx
./configure
make
sudo checkinstall --pkgname=libvpx --pkgversion="`date +%Y%m%d%H%M`-git" --backup=no --default

Then, FFMpeg:

cd ..
cd ffmpeg
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
make
sudo checkinstall --pkgname=ffmpeg --pkgversion "4:SVN-r`svn info | grep Revision | awk '{ print $NF }'`" --backup=no --default
hash x264 ffmpeg ffplay
make tools/qt-faststart
sudo checkinstall --pkgname=qt-faststart --pkgversion "4:SVN-r`svn info | grep Revision | awk '{ print $NF }'`" --backup=no --default install -D -m755 tools/qt-faststart /usr/local/bin/qt-faststart

And then, XBMC (this takes about 1 hour on my Acer Revo):

cd ..
cd xbmc
./bootstrap
./configure --enable-external-libraries
make
sudo checkinstall --pkgname=xbmc --pkgversion="`date +%Y%m%d%H%M`-git" --backup=no --default

And there you go. Now you’ll have the latest x264, FFMpeg and XBMC :)

Sources:
http://ubuntuforums.org/showthread.php?t=786095
http://wiki.xbmc.org/index.php?title=HOW-TO_compile_XBMC_for_Linux_on_Debian/Ubuntu

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.