Sunday, 5 July 2015

Building FFMPEG and VLC from sources on Debian Jessie

Debian does not come with ffmpeg. Instead, it comes with libav, which is a fork from ffmpeg. But there are situations when you find yourself in need of ffmpeg. In this case, you have to install it yourself. And it's far easier than you may think.

Start by upgrading your packages and installing build-essential:
sudo apt-get update
sudo apt-get install build-essential

Download ffmpeg and vlc:
mkdir -p $HOME/sources/software
cd $HOME/sources/software
wget http://ffmpeg.org/releases/ffmpeg-2.7.1.tar.gz
wget http://get.videolan.org/vlc/2.2.0/vlc-2.2.0.tar.xz

Install packages ffmpeg depends on during compilation:
sudo apt-get install libmp3lame-dev libvorbis-dev libtheora-dev \
    libspeex-dev yasm pkg-config libfaac-dev libopenjpeg-dev \
    libx264-dev libass-dev

Compile and install ffmpeg:
tar xpf ffmpeg-2.7.1.tar.gz
cd ffmpeg-2.7.1/
./configure --enable-gpl --enable-postproc --enable-swscale \
    --enable-avfilter --enable-libmp3lame --enable-libvorbis \
    --enable-libtheora --enable-libx264 --enable-libspeex \
    --enable-shared --enable-pthreads --enable-libopenjpeg \
    --enable-libfaac --enable-nonfree --enable-libass
make
sudo make install
sudo /sbin/ldconfig

Install packages vlc depends on during compilation:
sudo apt-get build-dep vlc

Compile and install vlc:

./configure --prefix=/usr/local --with-ffmpeg-tree=/usr/local \
  --enable-x11 --enable-xvideo --disable-gtk \
  --enable-sdl --enable-ffmpeg --with-ffmpeg-mp3lame \
  --enable-mad --enable-libdvbpsi --enable-a52 --enable-dts \
  --enable-libmpeg2 --enable-dvdnav --enable-faad \
  --enable-vorbis --enable-ogg --enable-theora --enable-faac\
  --enable-mkv --enable-freetype --enable-fribidi \
  --enable-speex --enable-flac --enable-livedotcom \
  --with-livedotcom-tree=/usr/lib/live --enable-caca \
  --enable-skins --enable-skins2 --enable-alsa --disable-kde\
  --disable-qt --enable-wxwindows --enable-ncurses \
  --enable-release
make
sudo make install

Profit! I told you that it would be easy!

Remember that now you have 2 versions of vlc installed in your system. Despite they apparently are the same version, the version which comes with Debian was still a RC (release candidate) at the time it was built. The version we installed is an official release of vlc, not a release candidate.

More than that, the version of vlc we installed employs ffmpeg under the hood from /usr/local, whilst the version which comes with Debian employs libav.



No comments:

Post a Comment