FFmpeg Installation on a cPanel Server

What is FFmpeg?

FFmpeg is a very fast video and audio converter. It can also convert between arbitrary sample rates and resize video on the fly with a high quality polyphase filter.

Installtion

First we need to install dependencies.

wget http://dl.fedoraproject.org/pub/epel/6/i386/yasm-1.2.0-1.el6.i686.rpm

rpm -Uvh yasm-1.2.0-1.el6.i686.rpm

cd /usr/local/src

wget http://easynews.dl.sourceforge.net/sourceforge/lame/lame-3.99.5.tar.gz

wget http://downloads.xiph.org/releases/ogg/libogg-1.3.1.tar.gz

wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz

wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz

wget http://www.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2

wget http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2/download

Untar all the mocules we have downloaded.

tar -zxvf lame-3.99.5.tar.gz
tar -zxvf libogg-1.3.1.tar.gz
tar -zxvf libvorbis-1.3.3.tar.gz
tar -zxvf flvtool2-1.0.6.tgz
tar -jxvf essential-20071007.tar.bz2
tar -jxvf ffmpeg-php-0.6.0.tbz2 

mkdir /usr/local/lib/codecs/

yum -y install gcc gmake make libcpp libgcc libstdc++ gcc4 gcc4-c++ gcc4-gfortran subversion ncurses-devel -y

/scripts/installruby

DOWNLOAD FFMPEG and MPLAYER

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
cd /usr/local/src/mplayer

svn update

cd /usr/local/src/
mv /usr/local/src/essential-20071007/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/

LAME

cd /usr/local/src/lame-3.99.5
./configure
make && make install

LIBOGG

cd /usr/local/src/libogg-1.3.1
./configure --enable-shared && make && make install
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH

LIBVORBIS

cd /usr/local/src/libvorbis-1.3.3
./configure && make && make install

FLVTOOL2

cd /usr/local/src/flvtool2-1.0.6
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install

MPLAYER

cd /usr/local/src/mplayer
./configure && make && make install

FFMPEG

cd /usr/local/src/ffmpeg/
export TMPDIR=~/tmp-ffmpeg
mkdir $TMPDIR
./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared
make
make install
rm -rf $TMPDIR
export TMPDIR=
export LD_LIBRARY_PATH=/usr/local/lib/

ln -s /usr/local/lib/libavformat.so.52.93.0 /usr/lib/libavformat.so.52
ln -s /usr/local/lib/libavcodec.so.52.108.0 /usr/lib/libavcodec.so.52
ln -s /usr/local/lib/libavutil.so.50.36.0 /usr/lib/libavutil.so.50
ln -s /usr/local/lib/libmp3lame.so.0.0.0 /usr/lib/libmp3lame.so.0
ln -s /usr/local/lib/libavformat.so.52.93.0.51 /usr/lib/libavformat.so.52


FFMPEG-PHP

cd /usr/local/src/ffmpeg-php-0.6.0
vi ffmpeg_frame.c
:%s/PIX_FMT_RGBA32/PIX_FMT_RGB32
:wq
phpize
./configure
make
make install

Then add the follwing line to php.ini file. 

extension="/usr/local/lib/php/extensions/no-debug-non-zts-20090626/ffmpeg.so"

RESTART APACHE

/scripts/restartsrv httpd

  • ffmpeg, cpanel ffmpeg
  • 4 Users Found This Useful
Was this answer helpful?

Related Articles

How To Install and Use Docker on Ubuntu 16.04

Introduction Docker is an application that makes it simple and easy to run application processes...

Adding Server Credentials from Client Area

The exchange of passwords in plain text format is not at all a safer way nowadays.  In case if we...

Backup and Restore cPanel Accounts via SSH

a. How to create a backup of a cPanel Account via SSH?   1. Log-in to the SSH as the Root user....

Change Main IP of the server :: Vesta Panel

If we are changing the main IP of a server installed with Vesta panel, we can use the following...

cPanel: Apache-FastCGI Data Timeout Error

If you are using a cPanel server and have FastCGI enabled in Apache, you might be facing the...