How to install FFMPEG on cPanel

install ffmpeg
install ffmpeg

Install FFMPEG on cPanel

FFmpeg is a free software project that produces libraries and programs for handling multimedia data. This tutorial will help you to install FFMPEG on cPanel / CensOS server.

Install FFMPEG

Update rpmforge

for 32 bit OS versions:

rpm -ivh rpmforge-release-0.5.2-2.1.el6.i686.rpm

for 64 bit OS versions:

rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

Please click on the button to see how to install rpmforge on other CentOS versions: Here

Install utilities


yum groupinstall -y "Development Tools"


yum install zlib-devel automake autoconf gcc gmake make libcpp libgcc libstdc++ gcc4 gcc4-c++ gcc4-gfortran gcc-c++ mesa-libGL-devel mesa-libGLU-devel libXi-devel libXmu-devel freeglut-devel freeglut libtool ncurses-devel


apt-get install build-essential

Add below entry in /etc/

vim /etc/

add the following:




libogg contains necessary functionality to create, decode, and work with Ogg bitstreams. Ogg is a free, open container format maintained by the Xiph.Org Foundation.

cd /usr/local/src
tar zxvf libogg-1.2.2.tar.gz
cd /usr/local/src/libogg-1.2.2
./configure && make clean && make && make install


Libvorbis is the reference implementation of the Vorbis codec. It is the lowest-level interface to the Vorbis encoder and decoder, working with packets directly.

cd /usr/local/src
tar zxvf libvorbis-1.3.3.tar.gz
cd libvorbis-1.3.3
./configure && make clean && make && make install


Yasm is an assembler and disassembler for the Intel x86 architecture. It can be used to write 16-bit, 32-bit (IA-32) and 64-bit (x86-64) programs.

cd /usr/local/src
tar zfvx yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure && make && make install


x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC compression format, and is released under the terms of the GNU GPL.

cd /usr/local/src
tar jxf last_stable_x264.tar.bz2
cd x264-*
./configure --enable-shared && make clean && make && make install


The Adaptive Multi-Rate (AMR or AMR-NB or GSM-AMR) audio codec is an audio compression format optimized for speech coding. AMR speech codec consists of a multi-rate narrowband speech codec that encodes narrowband (200–3400 Hz) signals at variable bit rates ranging from 4.75 to 12.2 kbit/s with toll quality speech starting at 7.4 kbit/s.

cd /usr/local/src
tar zxf opencore-amr-0.1.2.tar.gz
cd opencore-amr-0.1.2
./configure && make clean && make && make install


neroAacEnc is Improved multichannel encoding and Multipass encoding, Solved issue with very long files and -2pass.

cd /usr/local/src
wget wget
unzip -j
install -m 0755 neroAacEnc /usr/bin/
yum -y install gpac


MediaInfo is a convenient unified display of the most relevant technical and tag data for video and audio files.

cd /usr/local/src
rpm -ivh libzen0-0.4.29-1.x86_64.CentOS_6.rpm
rpm -ivh libmediainfo0-0.7.64-1.x86_64.CentOS_6.rpm
rpm -ivh mediainfo-0.7.64-1.x86_64.CentOS_6.rpm


FAAC or Freeware Advanced Audio Coder is a software project which includes the AAC encoder FAAC and decoder FAAD2. It supports MPEG-2 AAC as well as MPEG-4 AAC.

cd /usr/local/src
tar zxvf faac-1.28.tar.gz
cd /usr/local/src/faac-1.28
./configure && make clean && make && make install

Please note that you may receive an error like below:

mpeg4ip.h:126: error: new declaration ‘char* strcasestr(const char*, const char*)’
/usr/include/string.h:369: error: ambiguates old declaration ‘const char* strcasestr(const char*, const char*)’
make[3]: *** [3gp.o] Error 1
make[3]: Leaving directory `/usr/local/src/faac-1.28/common/mp4v2′
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/faac-1.28/common’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/faac-1.28′
make: *** [all] Error 2

You can resolve it by removing the content “char *strcasestr(const char *haystack, const char *needle);” in the file /usr/local/src/faac-1.28/common/mp4v2/mpeg4ip.h from line 126. Then you need to run the following command again.

./configure && make && make install


LAME is a program which can be used to create compressed audio files. (Lame ain’t an MP3 encoder). These audio files can be played back by popular MP3 players such as mpg123 or madplay.

cd /usr/local/src
tar zxvf lame-3.98.4.tar.gz
cd lame-3.98.4
./configure && make clean && make && make install


FLVTool2 is a manipulation tool for Macromedia Flash Video files (FLV).

cd /usr/local/src
tar -zxvf flvtool2-1.0.6.tgz
cd /usr/local/src/flvtool2-1.0.6/
ruby setup.rb config && ruby setup.rb setup && ruby setup.rb install

If you have not installed ruby on your server, please run following command.

/scripts/installruby (For cPanel)


yamdi stands for Yet Another MetaData Injector. It adds the onMetaData event to your FLV files.

cd /usr/local/src
tar zxvf yamdi-1.9.tar.gz
cd yamdi-1.9
gcc yamdi.c -o yamdi -O2 -Wall -D_FILE_OFFSET_BITS=647
cp yamdi /usr/bin/

Install FFmpeg

FFMPEG is a command line tool that is composed of a collection of free software / open source libraries. It includes libavcodec, an audio/video codec library used by several other projects, and libavformat, an audio/video container mux and demux library.

cd /usr/local/src
mkdir /usr/local/src/tmp
chmod 777 /usr/local/src/tmp
export TMPDIR=/usr/local/src/tmp
tar xzf ffmpeg-0.7.11.tar.gz
cd ffmpeg-0.7.11
make distclean
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-shared --enable-libmp3lame --enable-libx264 --enable-libfaac
make clean && make && make install
make tools/qt-faststart
cp tools/qt-faststart /usr/local/bin/


MENCODER is a free command line video decoding, encoding and filtering tool released under the GNU General Public License.

cd /usr/local/src
tar jxvf all-20110131.tar.bz2
mv /usr/local/src/all-20110131 /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/
mkdir /usr/local/src/tmp
chmod 777 /usr/local/src/tmp
export TMPDIR=/usr/local/src/tmp
tar jxf MPlayer-1.0rc4.tar.bz2
cd MPlayer-1.0rc4
make clean
./configure && make && make install && ldconfig


FFMPEG-PHP is an extension for PHP that adds an easy to use, object-oriented API for accessing and retrieving information from video and audio files.

cd /usr/local/src
tar jxf ffmpeg-php-0.6.0.tbz2
cd ffmpeg-php-0.6.0/
sed -i 's#PIX_FMT_RGBA32#PIX_FMT_RGB32#' ./ffmpeg_frame.c
./configure && make clean && make && make install

If you are getting the error “make: *** [ffmpeg_movie.lo] Error 1”, you need to change the following on the file “ffmpeg_movie.c”

row 311: list_entry *le; to zend_rsrc_list_entry *le;
row 346: list_entry new_le; to zend_rsrc_list_entry new_le;
row 360: hashkey_length+1, (void *)&new_le, sizeof(list_entry), to hashkey_length+1, (void *)&new_le,sizeof(zend_rsrc_list_entry),

Then run the following commands again.

./configure && make clean && make && make install

Add extension of ffmpeg in php.ini file.

vim /usr/local/lib/php.ini

add the following.

The last step is to check all installed modules.

php -m | grep ffmpeg
which php ffmpeg mplayer mencoder flvtool2 yamdi MP4Box neroAacEnc mediainfo

Please post comments if you have any questions regarding this.

That’s it!

If you like the post “Install FFMPEG on cPanel” and wish to receive more articles from us, please like our FB page: Grepitout

Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.

For more details on our services, please drop us an E-mail at


Click here to post a comment