Steps to install FFMpeg & related modules

Steps for installing-ffmpeg-ffmpeg-php-mplayer-mencoder-flvtool2-libogg-libvorbis-lame-mp3:

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

2. Insert the following to enable ‘dag’ repository:

====
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1
====

Given below are few errors & solution which you may face during installation:

Error 1: If you get any error while running yum with key then install the gpg key
using the following command,

====
rpm –import http://apt.sw.be/RPM-GPG-KEY.dag.txt
====

If you are still getting the error then you can try “gpgcheck=1” with “gpgcheck=0” in /etc/yum.repos.d/dag.repo (not recommended)

Error 2:

====
http://apt.sw.be/redhat/el6Server/en/i386/dag/repodata/repomd.xml:
[Errno 14] HTTP Error 404 :
http://apt.sw.be/redhat/el6Server/en/i386/dag/repodata/repomd.xml
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository:
dag. Please verify its path and try again
===

Solution:

====
Change the URL in ‘/etc/yum.repos.d/dag.repo’. You can find the correct path for the required release by going to : http://apt.sw.be/redhat. For the above error, changing the URL to ‘http://apt.sw.be/redhat/el6/en/i386/dag/’ worked.
====

3. yum update (Optional/not required)

4. yum install ffmpeg*

5. yum install mplayer*

6. yum install mencoder*

7. yum install ruby ruby-libs ruby-devel amr* (flvtool needs it)

(Note : Libogg + Libvorbis + Lame mp3 will be installed automatically
for dependencies.)

8. Installing flvtool2

————————-
# wget http://rubyforge.org/frs/download.php/9225/flvtool2_1.0.5_rc6.tgz
# tar -xzf flvtool2_1.0.5_rc6.tgz
# cd flvtool2_1.0.5_rc6/
# ruby setup.rb config
# ruby setup.rb setup
# ruby setup.rb install
————————-

9. Installing FFmpeg-PHP
————————-
# wget http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2
# tar -xjf ffmpeg-php-0.6.0.tbz2
# cd ffmpeg-php-0.6.0/
# phpize
# ./configure
# make
# make install
————————-

Put the below two lines at the end of the php.ini file

===
[ffmpeg]
extension=ffmpeg.so
===

10. Restart apache.

===
/etc/init.d/httpd restart
===

Make sure the extention was installed correctly and if not then add the extension correctly in php.ini and restart httpd.

Put a php info page to check whether ffmpeg-php loaded correctly (or)

====
# php -r ‘phpinfo();’ | grep ffmpeg
ffmpeg
ffmpeg-php version => 0.6.0-svn
ffmpeg-php built on => May 11 2011 18:09:17
ffmpeg-php gd support => enabled
ffmpeg libavcodec version => Lavc52.72.2
ffmpeg libavformat version => Lavf52.64.2
ffmpeg swscaler version => SwS0.11.0
ffmpeg.allow_persistent => 0 => 0
ffmpeg.show_warnings => 0 => 0
====

Errors that may occur during installation:
*********************************************
====
[root@theplanet ffmpeg-php-0.6.0]# phpize
-bash: phpize:

phpize command needs php-devel
====

Solution:

====
yum install php-devel
====

If the above command fails with below error, install the rpm for correct php-devel version:
——–
php-devel-5.1.6-27.el5_5.3.i386 from base has depsolving problems
–> Missing Dependency: php = 5.1.6-27.el5_5.3 is needed by package
php-devel-5.1.6-27.el5_5.3.i386 (base)
Error: Missing Dependency: php = 5.1.6-27.el5_5.3 is needed by package
php-devel-5.1.6-27.el5_5.3.i386 (base)

for the above error install rpm
———
rpm -ivh
http://www.soft30.com/rpmdownload/redhatrpm/php-devel-5.1.6-23.el5.i386.rpm
———

Error while configuring ffmpeg-php

====
….error ‘PIX_FMT_RGBA32’ undeclared…
====

Solution:

Goto the the ffmpeg-php-0.x.0 directory and edit the ffmpeg_frame.c file

#vi ffmpeg_frame.c

replace every instance of ? PIX_FMT_RGBA32 ? with ? PIX_FMT_RGB32 ? in
the file by executing

:%s/PIX_FMT_RGBA32/PIX_FMT_RGB32

OR

replace ?PIX_FMT_RGBA32 ? ?PIX_FMT_RGB32 ? ? ffmpeg_frame.c

Save the file and compile ?ffmpeg-php? again using the following steps

————-
#make clean
#./configure
#make
#make install
————-

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: