Hi,
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 to
take backup of your system files, 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.
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;
Untar the lame file by using
Quote:
|
#tar zxvf lame-3.98.4.tar.gz
|
Assign 777 permission to the lame directory
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;
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
Now, your server is ready to install FFMPEG with yum. First, we will search available packages of 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;
Now, you are ready to install
FFMPEG-PHP;
Download latest avalible package for ffmpeg-php
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.
That's all you are done.