FFMPEG installation in Ubuntu 14.04 LTS

FFmpeg is popular multimedia framework, that allows users to decode, encode, transcode, mux, demux, stream, filter and play almost all codecs that have been created.

Since “Ubuntu 14.04 Trusty” FFmpeg is dropped and its fork adopted ‘libav’ which made a lot of application unusable under Ubuntu 14.10 Utopic/14.04 Trusty. In coming release ‘15.04’ Ubuntu team decided to add FFmpeg again to its repositories, so there won’t be such issues like we have with 14.04/14.10 but there are unofficial FFmpeg PPAs available for Ubuntu 14.10 Utopic/14.04 Trusty. Now unusable applications can be used again on Ubuntu 14.10/14.04 using FFmpeg.

Here I am providing a script which allows us to install ffmpeg from its source. Depending on your computer, it may take some time to execute.

If you are installing opencv after installing ffmpeg, don’t follow this method as this ffmpeg libraries creates some contradiction while installing opencv. In this case go for my next post and follow the steps 5 to 10.


# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 14.04 LTS
# Inspired from https://gist.github.com/faleev/3435377

# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev

# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
sudo apt-get -y install build-essential checkinstall git libfaac-dev libgpac-dev \
 libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev librtmp-dev libtheora-dev \
 libvorbis-dev pkg-config texi2html yasm zlib1g-dev

# Install x264
sudo apt-get -y install libx264-dev
git clone --depth 1 git://git.videolan.org/x264
cd x264
./configure --enable-static
sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | \
 awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes \
 --fstrans=no --default

# Install AAC audio decoder
wget http://downloads.sourceforge.net/opencore-amr/fdk-aac-0.1.0.tar.gz
tar xzvf fdk-aac-0.1.0.tar.gz
cd fdk-aac-0.1.0
sudo checkinstall --pkgname=fdk-aac --pkgversion="0.1.0" --backup=no \
 --deldoc=yes --fstrans=no --default

# Install VP8 video encoder and decoder.
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx 
cd libvpx
sudo checkinstall --pkgname=libvpx --pkgversion="1:$(date +%Y%m%d%H%M)-git" --backup=no \
 --deldoc=yes --fstrans=no --default

# Add lavf support to x264
# This allows x264 to accept just about any input that FFmpeg can handle and is useful if you want to use x264 directly. See a more detailed explanation of what this means.
cd ~/x264
make distclean
./configure --enable-static
sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | \
 awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes \
 --fstrans=no --default

# Installing FFmpeg
git clone --depth 1 git://source.ffmpeg.org/ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb \
 --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis \
 --enable-libvpx --enable-libx264 --enable-nonfree --enable-version3 
sudo checkinstall --pkgname=ffmpeg --pkgversion="5:$(date +%Y%m%d%H%M)-git" --backup=no \
 --deldoc=yes --fstrans=no --default
 hash x264 ffmpeg ffplay ffprobe

# Optional: install qt-faststart
# This is a useful tool if you're showing your H.264 in MP4 videos on the web. It relocates some data in the video to allow playback to begin before the file is completely downloaded. Usage: qt-faststart input.mp4 output.mp4.
cd ~/ffmpeg
make tools/qt-faststart
sudo checkinstall --pkgname=qt-faststart --pkgversion="$(date +%Y%m%d%H%M)-git" --backup=no \
 --deldoc=yes --fstrans=no --default install -Dm755 tools/qt-faststart \

This script will install ffmpeg along with creating a .deb file for the future use.

Courtesy: https://i-mscp.net/index.php/Thread/6780-Install-latest-ffmpeg-on-ubuntu-12-04-or-14-04-Script/


One thought on “FFMPEG installation in Ubuntu 14.04 LTS

  1. […] and install ffmpeg. Here we are not installing ffmpeg version that we have discussed in the previous post as it makes some contradiction in opencv […]

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 )

Google+ photo

You are commenting using your Google+ 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