1. Andrew's Corner :

Compile vlc-git under the latest Ubuntu release...

This guide details how to install the development version of vlc using both 32 bit and 64 bit versions of the latest Ubuntu release, it owes a huge debt to the vlc Slackbuild of Eric Hameleers, otherwise known as alienBOB. This guide will be periodically updated for each new stable Ubuntu version.

  1. Some Preparation: Install -dev files, compilers & create a build area..
    1. Compiling libfdk-aac: Compile and install the best aac encoding library available to Linux.
    2. Building x264: Install the latest x264 so vlc can produce h.264 streams.
    3. Compiling live555: Install a recent live555 so vlc can read some streams.
    4. Building FFmpeg: Compiling and installing a recent copy of FFmpeg, the cornerstone of vlc's versatility!
  2. Compiling vlc: Download, compile and install vlc-git. Also instructions to periodically update.
  3. Latest successful compile: Details of the latest git and date successfully compiled with this guide.

I emphasise at the outset that this development version of vlc will be broken at times and should only ever be installed by those willing to experiment a little, people who are used to running alpha or beta version software. The preferred method to build and test vlc-git is from within a Virtual Machine dedicated to this purpose alone, this is my own model in writing and testing this guide and I strongly recommend this method to all who follow the guide.

Preparation: Xenial Xerus..

As a first step it is a good idea to remove all previous vlc packages using either the Terminal, Synaptic or the Software Centre. Then some basic tools are required for compiling and we will also create the build location, the following is a single command which can simply be copied from here and pasted into a Terminal window:

sudo apt-get -y install build-essential git-core checkinstall \
automake yasm cmake && mkdir -pv $HOME/vlc_build

A considerable volume of 'development' files is also required which can be installed with a single command:

sudo apt-get -y install liba52-0.7.4-dev libaa1-dev libasound2-dev libass-dev \
libavahi-client-dev libcaca-dev libcairo2-dev libcddb2-dev libcdio-dev libdca-dev \
libdvbpsi-dev libebml-dev libfaad-dev libflac-dev libfreetype6-dev libfribidi-dev \
libgcrypt11-dev libgl1-mesa-dev libglib2.0-0 libgnutls28-dev libid3tag0-dev \
libjack-jackd2-dev libkate-dev liblircclient-dev liblua5.1-0-dev libmad0-dev \
libmatroska-dev libmodplug-dev libmpcdec-dev libmpeg2-4-dev libmtp-dev \
libncursesw5-dev libnotify-dev libogg-dev liboggkate-dev libpango1.0-dev \
libpng12-dev libprojectm-dev libprojectm-qt-dev libproxy-dev libpulse-dev \
libqt4-dev libraw1394-dev librsvg2-dev libschroedinger-dev libsdl-image1.2-dev \
libsdl1.2-dev libshout3-dev libsmbclient-dev libspeex-dev libsqlite3-dev \
libsysfs-dev libtag1-dev libtar-dev libgme-dev libtheora-dev libtool \
libtwolame-dev libudev-dev libupnp-dev libv4l-dev libvcdinfo-dev libvorbis-dev \
libva-dev libvpx-dev libx11-dev libx11-xcb-dev libxcb-composite0-dev libx265-dev \
libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shm0-dev libxcb-xv0-dev libxcb-xvmc0-dev \
libxcb1-dev libxext-dev libxml2-dev libxpm-dev libxt-dev libxv-dev libzvbi-dev lua5.1 \
qt4-qtconfig libspeexdsp-dev libsamplerate0-dev libvdpau-dev libxpm-dev libxinerama-dev \
libtar-dev libgtk2.0-dev libdc1394-22-dev libopus-dev libmpg123-dev protobuf-c-compiler \
libdvdnav-dev libdvdnav4 libdvdread-dev libdvdread4

And then to setup the installation of libdvdcss to enable playback of encrypted DVDs. The following downloads, compiles and installs libdvdcss2 and libdvdcss2-dev:

sudo apt-get install libdvd-pkg
sudo dpkg-reconfigure libdvd-pkg

Now to add the libraries for fdk-aac which vlc will use (via FFmpeg) for aac encoding:

libfdk-aac...

libfdk-aac is in the Ubuntu Repositories but still under Xenial there is only version 1.3 and since 1.4 has some substantial fixes in place we will be compiling the newer version:

Installing libfdk-aac:

if [ "$(uname -m)" = "x86_64" ]; then
  ARCHOPTS="--with-pic"
 else
  ARCHOPTS=""
fi && \
cd $HOME/vlc_build && \
wget --content-disposition https://github.com/mstorsjo/fdk-aac/archive/v0.1.4.tar.gz && \
tar xvf fdk-aac-0.1.4.tar.gz && cd fdk-aac-0.1.4 && \
autoreconf -fiv && \
./configure --prefix=$HOME/vlc_build/vlcdeps/usr \
            $ARCHOPTS \
            --disable-shared \
            --enable-static && \
make && make install && make distclean

Removing libfdk-aac:

To remove all traces of libfdk-aac, including the installed libraries, the expanded source and the downloaded source archive use the following:

rm -rfv $HOME/vlc_build/vlcdeps/usr/include/fdk-aac && \
rm -v $HOME/vlc_build/vlcdeps/usr/lib/libfdk-aac* && \
rm -v $HOME/vlc_build/vlcdeps/usr/lib/pkgconfig/fdk-aac.pc && \
rm -rfv $HOME/vlc_build/fdk-aac-0.1.4 && rm $HOME/vlc_build/fdk-aac-0.1.4.tar.gz

Now by default vlc-git will use libfdk-aac (via FFmpeg) to produce all aac audio, producing very reasonable results according to my ears.

x264...

Now for x264, we will a install a local copy of the latest x264 which vlc will use for directly transcoding to h.264 (it does not use FFmpeg for this). The use of a local copy is to avoid the mire of dependencies and conflicting version requirements involved with a system installation under Ubuntu.

Installing x264:

if [ "$(uname -m)" = "x86_64" ]; then
  ARCHOPTS="--enable-pic"
 else
  ARCHOPTS=""
fi && \
cd $HOME/vlc_build && \
git clone git://git.videolan.org/x264.git --depth 1 && \
cd x264 && \
./configure --prefix=$HOME/vlc_build/vlcdeps/usr \
            --enable-static \
            --disable-cli \
            $ARCHOPTS && \
make && make install

Removing x264:

Removing the installed files is reasonably straightforward and the following syntax should be enough:

rm -v $HOME/vlc_build/vlcdeps/usr/include/x264* && \
rm -v $HOME/vlc_build/vlcdeps/usr/lib/libx264.a && \
rm -v $HOME/vlc_build/vlcdeps/usr/lib/pkgconfig/x264.pc

Updating x264:

x264 is updated fairly regularly so I would suggest returning here from time to time and updating the libraries as follows:

if [ "$(uname -m)" = "x86_64" ]; then
  ARCHOPTS="--enable-pic"
 else
  ARCHOPTS=""
fi && \
cd $HOME/vlc_build/x264 && git pull && \
./configure --prefix=$HOME/vlc_build/vlcdeps/usr \
            --enable-static \
            --disable-cli \
            $ARCHOPTS && \
make && make install

Note that these instructions do not actually create an x264 executable although it is a simple matter to do this as well...

live555...

vlc uses live555 for reading some streams and the following single command sets up a local copy following alienBOB's (and the vlc contrib rules.mak) syntax very closely, this copy of live555 courtesy of the videolan servers.

Installing live555:

cd $HOME/vlc_build && sudo apt-get -y remove liblivemedia-dev && \
wget http://download.videolan.org/pub/contrib/live555/live.2015.06.24.tar.gz && \
tar xvf live.2015.06.24.tar.gz && chmod -R u+w live && cd live && \
if [ "$(uname -m)" = "x86_64" ]; then
  ./genMakefiles linux-64bit && make
else 
  ./genMakefiles linux && make
 fi && \
cp -v \
groupsock/libgroupsock.a liveMedia/libliveMedia.a UsageEnvironment/libUsageEnvironment.a \
BasicUsageEnvironment/libBasicUsageEnvironment.a $HOME/vlc_build/vlcdeps/usr/lib/ && \
cp -v \
groupsock/include/*.hh groupsock/include/*.h liveMedia/include/*.hh UsageEnvironment/include/*.hh \
BasicUsageEnvironment/include/*.hh $HOME/vlc_build/vlcdeps/usr/include/

Removing live555:

The following removes the installed live555 libraries, the expanded source and the original archived source:

rm -v $HOME/vlc_build/vlcdeps/usr/include/{*.hh,NetCommon.h} && \
rm -v $HOME/vlc_build/vlcdeps/usr/lib/{libgroupsock.a,libliveMedia.a,\
libUsageEnvironment.a,libBasicUsageEnvironment.a} && \
rm -rfv $HOME/vlc_build/live && \
rm -v $HOME/vlc_build/live.*.tar.gz

FFmpeg...

Next to install a local snapshot of a recent version of FFmpeg which will avoid disturbing system settings of either avconv or FFmpeg..

Installing FFmpeg:

sudo apt-get -y install libmp3lame-dev zlib1g-dev && \
cd $HOME/vlc_build && \
wget http://ffmpeg.org/releases/ffmpeg-3.0.2.tar.bz2 && \
tar xvf ffmpeg-3.0.2.tar.bz2 && cd ffmpeg-3.0.2 && \
if [ "$(uname -m)" = "x86_64" ]; then
  ARCHOPTS="--enable-pic"
 else
  ARCHOPTS=""
fi && \
CPPFLAGS="-I$HOME/vlc_build/vlcdeps/usr/include" \
LDFLAGS="-L$HOME/vlc_build/vlcdeps/usr/lib" \
PKG_CONFIG_PATH="$HOME/vlc_build/vlcdeps/usr/lib/pkgconfig" \
./configure --prefix=$HOME/vlc_build/vlcdeps/usr \
            $ARCHOPTS \
            --enable-gpl \
            --enable-version3 \
            --enable-nonfree \
            --enable-libmp3lame \
            --enable-libvpx \
            --enable-libfdk-aac \
            --enable-libx265 \
            --disable-programs \
            --disable-doc \
            --disable-filters \
            --disable-avdevice \
            --disable-devices \
            --disable-avfilter \
            --disable-avresample && \
make -j 8 && make install-libs install-headers && make distclean

Removing FFmpeg:

To remove the installed libraries, the expanded source and the original archived source use the following:

rm -rfv $HOME/vlc_build/vlcdeps/usr/include/{libav*,libpostproc,libsw*} && \
rm -v $HOME/vlc_build/vlcdeps/usr/lib/{libav*.a,libpostproc.a,libsw*.a} && \
rm -v $HOME/vlc_build/vlcdeps/usr/lib/pkgconfig/{libav*.pc,libpostproc.pc,libsw*.pc} && \
rm -rfv $HOME/vlc_build/ffmpeg-*

And now to come to grips the vlc source code:

Building vlc-git..

Finally we download the vlc-git source code and build it:

Install vlc-git:

cd $HOME/vlc_build && git clone git://git.videolan.org/vlc.git --depth 1 && \
cd $HOME/vlc_build/vlc && ./bootstrap && \
CPPFLAGS="-I$HOME/vlc_build/vlcdeps/usr/include" \
LDFLAGS="-L$HOME/vlc_build/vlcdeps/usr/lib" \
PKG_CONFIG_PATH="$HOME/vlc_build/vlcdeps/usr/lib/pkgconfig" \
./configure --prefix=/usr/local && \
make -j 8 && \
mkdir -vp doc-pak && cp -v AUTHORS COPYING INSTALL NEWS README THANKS doc-pak && \
sudo checkinstall --pakdir "$HOME/vlc_build" --backup=no --deldoc=yes --pkgname vlc \
                  --pkgversion "3.0.0-git~$(git rev-parse --short HEAD)" \
                  --fstrans=no --deldesc=yes --delspec=yes --default && \
make distclean && sudo ldconfig

And this should give you a working copy of vlc-git!

Updating vlc-git...

You should return from time to time to update your copy of vlc-git, the following single command will accomplish this:

cd $HOME/vlc_build/vlc && git pull && ./bootstrap && \
CPPFLAGS="-I$HOME/vlc_build/vlcdeps/usr/include" \
LDFLAGS="-L$HOME/vlc_build/vlcdeps/usr/lib" \
PKG_CONFIG_PATH="$HOME/vlc_build/vlcdeps/usr/lib/pkgconfig" \
./configure --prefix=/usr/local && \
make -j 8 && \
mkdir -vp doc-pak && cp -v AUTHORS COPYING INSTALL NEWS README THANKS doc-pak && \
sudo checkinstall --pakdir "$HOME/vlc_build" --backup=no --deldoc=yes --pkgname vlc \
                  --pkgversion "3.0.0-git~$(git rev-parse --short HEAD)" \
                  --fstrans=no --deldesc=yes --delspec=yes --default && \
make distclean && sudo ldconfig

This completes the setup of vlc-git for this guide and I wish you all the best with your continued exploration of the development version of this great media player!

Latest compile...

Latest successful compile is here:

andrew@athens:~$ cvlc --version | head -n 2
VLC media player 3.0.0-git Vetinari (revision b42ce73)
VLC version 3.0.0-git Vetinari (b42ce73)
Compiled by andrew on athens (May 11 2016 17:47:11)
andrew@athens:~$ 

This is my first compile on Xenial Xerus and there were absolutely no problems encountered compiling or testing playback. I will test the installation from time to time and respond to updated libraries and any breakages, have fun with the latest and greatest vlc :).

And in conclusion...

I have had an incredible amount of fun compiling and running the latest development version of vlc under Ubuntu and I hope that you will also enjoy this process! If you have any queries about the material presented on this page please use the email link at the base of this page.