Friday, August 29, 2008

Compiling VLC in 64 Bit Ubuntu 8.04.1

If you haven't compiled VLC recently then you may be caught off guard by a couple changes made. The --with-ffmpeg-tree is now deprecated because ffmpeg started using the pkg-config system. Also the version of live555 in the Ubuntu repositories is currently too old - you will have to compile that yourself as well.

Hopefully, since you are trying to compile something, you are tech savvy enough to understand a shell script just about as well as my ramblings, so I'll just paste that:


#get dependencies
sudo apt-get install cvs build-essential subversion git git-core automake1.9 libtool libgcrypt-dev libfaad-dev libtwolame-dev libqt4-dev libjack-dev libfaac-dev liblame-dev libxpm-dev libcddb2-dev liblua5.1-0-dev libzvbi-dev libshout-dev wget

#get the latest live555
tar -xzvf live555-latest.tar.gz live
cd live
#modify config.linux to add -fPIC to the first line (for 64bit only)
mv config.linux config.linux.orig
echo `head -1 config.linux.orig` -fPIC > config.linux
tail -16 config.linux.orig >> config.linux
./genMakefiles linux
make -j 8

#get vlc
cd ~
git clone git://
cd vlc/

#git x264
cd ~/vlc/extras/
git clone git://
cd x264
./configure --enable-pic --disable-asm
make -j 8
sudo make install

#ffmpeg (need amr?)
cd ~/vlc/extras/
svn co svn:// ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-postproc --enable-pthreads --enable-libmp3lame --enable-libfaac --enable-swscale --disable-static --enable-shared
make -j 8
sudo make install

# this is for that pkg-config system ffmpeg now uses
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"

cd ~/vlc
mkdir build
cd build

#originally I had this configured for no gui - you may need to play with it.
#watch for warnings - it will still compile with missing functionality if you are missing needed libraries
../configure --prefix=/usr \
--enable-snapshot --enable-debug \
--enable-dbus --enable-dbus-control --disable-musicbrainz \
--enable-shared-libvlc --disable-mozilla \
--enable-lirc \
--enable-x264 --with-x264-tree=../extras/x264 \
--enable-shout --disable-taglib \
--enable-v4l \
--enable-dvb \
--enable-realrtsp --enable-real --disable-xvmc \
--enable-svg --enable-dvdread \
--enable-dc1394 --enable-dv \
--enable-theora --enable-faad \
--enable-twolame --enable-real \
--enable-flac --enable-tremor \
--enable-skins2 --enable-qt4 --enable-x11 --enable-xvideo\
--enable-ncurses \
--enable-aa --enable-caca \
--enable-esd --disable-portaudio \
--enable-jack --disable-xosd \
--enable-galaktos --enable-goom \
--enable-ggi \
--disable-cddax --disable-vcdx \
--disable-qte --disable-quicktime --disable-lua \
--with-live555-tree=~/live \
--enable-libmpeg2 --enable-mkv \
--enable-ogg --enable-vorbis --enable-release --disable-hd1000v > config.out

make -j 8

Note that I use make -j 8 rather than just make because I am compiling with multiple cores (in this case it was 6 - it is usually good to start a couple more threads than the number of cores you have).

I had to add "--disable-static --enable-shared" to the ffmpeg or else it wouldn't compile - I think it had to do with some 64 bit PIC problems.

Notice the --disable-asm in the x264 config. This is BAD. The latest version of yasm in the Ubuntu repositories is not new enough for x264. This will be fixed in the next release of Ubuntu, but if I get around to it I will post an update before then.

No comments: