You are on page 1of 4

FFMPEG installation on CentOS

FFMPEG is an open source application and developed in Linux which allows to convert
the audio and video files easily in different formats. It supports most of the codec
and converts from one file format to another. It includes libavcodec, a leading
audio/video codec library.

yum, rpm, wget commands must be configured on your server and you must know
how to use these commands. These installation process worked well for me and my
colleges. But I suggest you totake backup of your systemfiles, before modifying
them.

Installation Process

Before installing FFMPEG, install all external codec libraries. Now, connect to your
server with the help of any SSH client like putty by providing hostname of the
server, username and password.

Quote:

#cd /usr/local/src/

Create a directory for all further steps.

Quote:

#mkdir installation

#cd installation

Install LAME MP3 Encoder

You need to download LAME MP3 Encoder from here;

Quote:

#wget http://biznetnetworks.dl.sourceforge...-3.98.4.tar.gz

Untar the lame file by using

Quote:

#tar zxvf lame-3.98.4.tar.gz

Assign 777 permission to the lame directory

Quote:

#chmod 777 lame -R

Now move to lame directory

Quote:

#cd lame

#./configure
#make

#make install

Adding the DAG repository.

Create and edit a new file

Quote:

#vi /etc/yum.repos.d/dag.repo

Add the following lines to the mentioned file

Quote:

[dag]
name=DAG RPM Repository
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1

Save and quit from the file.

To use DAG repository with command yum successfully, you need to add
GPG Key. Failure to do so result in an error:

Quote:

warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 6b8d79e6


Public key for faac.x86_64.1.26-1.el5.rf.rpm is not installed

To add the the GPG Keyfor DAG, execute following command;

Quote:

rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

If you don't want to validate the GPG Key, edit the file /etc/yum.repos.d/dag.repo
and change gpgcheck=1 to gpgcheck=0.

Now, update all packages on server

Quote:

#yum update

Now, your server is ready to install FFMPEG with yum. First, we will search available
packages of FFmpeg.

Quote:

#yum search ffmpeg

In result, I get three packages to be installed. Packages are as follows"ffmpeg,


ffmpeg-devel, and ffmpeglibpostproc"

Quote:

#yum install ffmpeg ffmpeg-devel ffmpeg-libpostproc


Install supporting packages 'mplayer, mencoder, flvtool2"

Quote:

#yum -y install mplayer mencoder flvtool2

In order to work FFMPEG with PHP, we need to install following packages;

Quote:

ffmpeg-0.4.9_pre1 or higher
php-4.3.0 or higher
gd-2.0 or higher
php-devel

And to install above packages, execute below commands;

Quote:

#yum install php-gd

Now, you are ready to install FFMPEG-PHP;

Download latest avalible package for ffmpeg-php

Quote:

#wget http://biznetnetworks.dl.sourceforge...php-0.6.0.tbz2

Untar the package file

Quote:

#tar -xjf ffmpeg-php-0.6.0.tbz2

Move into ffmpeg-php-0.6.0 directory

Quote:

#cd ffmpeg-php-0.6.0

#phpize

#./configure && make

#make install

With the help of above, ffmpeg.so module will copy to default location of php
modules. Now, you need to add the ffmpeg.so in php.ini of the server to enable it.
And add following line in it.

Quote:

#vi /usr/local/lib/php.ini
extension=ffmpeg.so

To get effective the changes, you need to restart the apache service on the server.

Quote:

#/etc/init.d/httpd restart

And to confirm that ffmpeg module is listed in php configuration of server.


Quote:

#php -m | grep ffmpeg

That's all you are done.

You might also like