This post guides you to install ffmpeg on ubuntu server.

Let’s update all the repo’s on the host.

apt-get update

 

Install the required package using apt-get install.

apt-get -y --force-yes install autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texi2html zlib1g-dev yasm libx264-dev unzip libopus-dev libmp3lame-dev

Create a ffmpeg installation directory.

mkdir /usr/local/src/ffmpeg

cd /usr/local/src/ffmpeg

 

Download and install.

wget -O fdk-aac.zip https://github.com/mstorsjo/fdk-aac/zipball/master

unzip fdk-aac.zip

cd mstorsjo-fdk-aac*

autoreconf -fiv

./configure --prefix="$HOME/ffmpeg_build" --disable-shared

make

make install

 

Install libpvx package.

wget http://webm.googlecode.com/files/libvpx-v1.3.0.tar.bz2

tar xjvf libvpx-v1.3.0.tar.bz2

cd libvpx-v1.3.0

PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --disable-examples

PATH="$HOME/bin:$PATH" make

make install

 

Install libogg package.

curl -O http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz

tar xzvf libogg-1.3.2.tar.gz

cd libogg-1.3.2

./configure --prefix="$HOME/ffmpeg_build" --disable-shared

make

make install

Install ffmpeg package.

wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2

tar xjvf ffmpeg-snapshot.tar.bz2

cd ffmpeg

PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include"  --extra-ldflags="-L$HOME/ffmpeg_build/lib"  --bindir="$HOME/bin"  --enable-gpl  --enable-libass  --enable-libfdk-aac   --enable-libfreetype  --enable-libmp3lame  --enable-libopus   --enable-libtheora  --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree

PATH="$HOME/bin:$PATH" make

make install

Copy the binary to executable path

cp /usr/local/src/ffmpeg /usr/sbin

 

Leave a Reply