How to install FFMPEG CentOS?

ffmpeg is the most popular opensource video streaming software and its being used on many servers, websites who are offering video based streaming services. We have often seen many users facing lots of difficulties installing ffmpeg. So here is something i will show the most easiest way to get ffmpeg installed on a centos 6. 3 or 6.4 server using the yum package command line. This article Install FFMPEG CentOS only describes the steps on our tested centos based server and its works like charm.

1. First lets check the correct version of your server - cat /etc/redhat-release

2. Then install the correct repo from rpmforge through which we will install ffmpeg packages via yum. Take note its 64bit packages.
rpm -Uhv

3. Alright, Lets begin with installing ffmpeg and other necessary packages required. This should take approx 20 to 30 mins.

yum install glibc gcc gcc-c++ autoconf automake libtool git make nasm pkgconfig

yum install SDL-devel a52dec a52dec-devel alsa-lib-devel faac faac-devel faad2 faad2-devel
yum install freetype-devel giflib gsm gsm-devel imlib2 imlib2-devel lame lame-devel libICE-devel libSM-devel libX11-devel
yum install libXau-devel libXdmcp-devel libXext-devel libXrandr-devel libXrender-devel libXt-devel
yum install libogg libvorbis vorbis-tools mesa-libGL-devel mesa-libGLU-devel xorg-x11-proto-devel zlib-devel
yum install libtheora theora-tools
yum install ncurses-devel
yum install libdc1394 libdc1394-devel
yum install amrnb-devel amrwb-devel opencore-amr-devel

4. All done, Now lets install the other external tools like xvidlibogg,libvorbis,libtheora and x264 etc. We will use /usr/local/src for source compilations.

I. Install xvid
cd /usr/local/src
tar xzvf xvidcore-1.3.2.tar.gz
cd xvidcore/build/generic
./configure --prefix="$HOME/ffmpeg_build"
make install

II. Install LibOgg
cd /usr/local/src
tar xzvf libogg-1.3.1.tar.gz
cd libogg-1.3.1
./configure –disable-shared
make install

III. Install LibVorbis
cd /usr/local/src
tar xzvf libvorbis-1.3.4.tar.gz
cd libvorbis-1.3.4
./configure –disable-shared
make install

IV. Install Libtheora
cd /usr/local/src
tar xzvf libtheora-1.1.1.tar.gz
cd libtheora-1.1.1
./configure --prefix="$HOME/ffmpeg_build" --with-ogg="$HOME/ffmpeg_build" --disable-examples --disable-shared --disable-sdltest --disable-vorbistest
make install

V. Install Aacenc
cd /usr/local/src
tar xzvf vo-aacenc-0.1.2.tar.gz
cd vo-aacenc-0.1.2
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make install

VI. Install Yasm
cd /usr/local/src
tar xzfv yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
make install
export "PATH=$PATH:$HOME/bin"

VII. Install Libvpx
cd /usr/local/src
git clone
cd libvpx
git checkout tags/v.1.3.0
./configure –disable-examples
make install

VIII. Install X264
cd /usr/local/src
git clone git://
cd x264
./configure –enable-static
make install

Time to configure the libraries path -

export LD_LIBRARY_PATH=/usr/local/lib/
echo /usr/local/lib >> /etc/
Configure ffmpeg - ( Note ./configure parameters should be one single line)
cd /usr/local/src
git clone git://
cd ffmpeg
git checkout release/2.5
./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" \
--extra-libs=-ldl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-libfaac \
--enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libvo-aacenc --enable-libxvid --disable-ffplay \
--enable-gpl --enable-postproc --enable-nonfree --enable-avfilter --enable-pthreads
make install

That's it, You are done now. Test the ffmpeg command on server and you should see the output as shown below -

ffmpeg version 2.2 Copyright (c) 2000-2014 the FFmpeg developers
built on Mar 28 2014 01:28:21 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-4)
configuration: –enable-version3 –enable-libopencore-amrnb –enable-libopencore-amrwb –enable-libvpx –enable-libfaac –enable-libmp3lame –enable-libtheora –enable-libvorbis –enable-libx264 –enable-libvo-aacenc –enable-libxvid –disable-ffplay –enable-shared –enable-gpl –enable-postproc –enable-nonfree –enable-avfilter –enable-pthreads –extra-cflags=-fPIC
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libswscale 2. 5.102 / 2. 5.102
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…

Some basic issues may arise which you can test by making sure which libaries are missing -
ldd `which ffmpeg`

Once you have the path for any missing library simply add it to /etc/ and issue a "ldconfig" command.

Thats all! Do let us know if you have any issues with the installation. We will be happy to assist you.

Was this answer helpful?

 Print this Article

Also Read

How to install Imagic?

1. # yum install ImageM* netpbm gd gd-* libjpeg libexif gcc coreutils make 2.  # cd...

How to setup a WordPress website on plain Centos server?

The following steps have been successfully tested on a plain centos server. Now lets start with...

How to install MariaDB on CentOS 7?

Insatll MariaDB on server -  #yum install mariadb-server OR #yum install -y mariadb...

How to perform LAMP installation on CentOS?

LAMP stands for Linux, Apache, MySQL, and PHP. It is nothing but Linux operating system with...

How to install phpMyAdmin with Apache on a CentOS 7 server?

phpMyAdmin used to provide graphical user interface for your databases. Accessing or performing...

Powered by WHMCompleteSolution