Sunday, November 24, 2013

THREADED MODE | LINEAR MODE FFMPEG & FFMPEG-PHP CENTOS 5, 6 EASY INSTALL

########First way#########

Download the installer

Code:

wget http://9xhost.net/scripts/ffmpeg.sh


run the installer

Code:

sh ffmpeg.sh


The make install command will show PHP extensions path where ffmpeg PHP extension is installed:

Code:

root@server [~/ffmpeg-php-0.6.0]# make install
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/


Now edit php.ini file

Code:

nano /usr/local/lib/php.ini


Add following line at end of php.ini and this will enable ffmpeg PHP extension:

Code:

extension="ffmpeg.so"


Restart Apache to make this change effective:

Code:

/scripts/restartsrv_httpd


You can verify the status of ffmpeg extension on a PHP info web page or from command line as given below:

Code:

root@server [~]# php -i | grep ffmpeg
ffmpeg
ffmpeg-php version => 0.6.0-svn
ffmpeg-php built on => Jun 2 2012 20:48:04
ffmpeg-php gd support => enabled
ffmpeg libavcodec version => Lavc52.123.0
ffmpeg libavformat version => Lavf52.111.0
ffmpeg swscaler version => SwS0.14.1
ffmpeg.allow_persistent => 0 => 0
ffmpeg.show_warnings => 0 => 0
OLDPWD => /root/ffmpeg-php-0.6.0
_SERVER["OLDPWD"] => /root/ffmpeg-php-0.6.0
_ENV["OLDPWD"] => /root/ffmpeg-php-0.6.0


6. Installation paths

Following are the file system paths of tools that we installed:

Code:

ffmpeg: /usr/bin/ffmpeg


Now open yum.conf

Code:

nano /etc/yum.conf


and add ffmpeg* in exclude line.

===============================
#######Second way##########

Create and open a new file called /etc/yum.repos.d/dag.repo

Code:

nano /etc/yum.repos.d/dag.repo


Add the following text to the file:

Code:

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


then run

Code:

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


Now we are ready to install ffmpeg

First run

Code:

yum update


then

Code:

yum install ffmpeg ffmpeg-devel ffmpeg-libpostproc


Now ffmpeg is installed

Preparing for ffmpeg-php
download the latest ffmpeg-php package:

Code:

wget http://downloads.sourceforge.net/ffmpeg-php/ffmpeg-php-0.6.0.tbz2


Untar this package, build and install it with following commands:

Code:

tar xjf ffmpeg-php-0.6.0.tbz2



Code:

cd ffmpeg-php-0.6.0


sed -i ‘s/PIX_FMT_RGBA32/PIX_FMT_RGB32/g’ ffmpeg_frame.c ####copy paste it too##

Code:

phpize



Code:

./configure



Code:

make



Code:

make install


The make install command will show PHP extensions path where ffmpeg PHP extension is installed:

Code:

root@server [~/ffmpeg-php-0.6.0]# make install
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/


Now edit php.ini file

Code:

nano /usr/local/lib/php.ini


and make sure that value of extension_dir is set to PHP extension directory as given by above make install command:

Code:

extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"


Add following line just below extension_dir and this will enable ffmpeg PHP extension:

Code:

extension="ffmpeg.so"


Restart Apache to make this change effective:

Code:

/scripts/restartsrv_httpd


You can verify the status of ffmpeg extension on a PHP info web page or from command line as given below:

Code:

root@server [~]# php -i | grep ffmpeg
ffmpeg
ffmpeg-php version => 0.6.0-svn
ffmpeg-php built on => Jun 2 2012 20:48:04
ffmpeg-php gd support => enabled
ffmpeg libavcodec version => Lavc52.123.0
ffmpeg libavformat version => Lavf52.111.0
ffmpeg swscaler version => SwS0.14.1
ffmpeg.allow_persistent => 0 => 0
ffmpeg.show_warnings => 0 => 0
OLDPWD => /root/ffmpeg-php-0.6.0
_SERVER["OLDPWD"] => /root/ffmpeg-php-0.6.0
_ENV["OLDPWD"] => /root/ffmpeg-php-0.6.0


6. Installation paths

Following are the file system paths of tools that we installed:

Code:

ffmpeg: /usr/bin/ffmpeg


Now open yum.conf

Code:

nano /etc/yum.conf


and add ffmpeg* in exclude line.
-------------------
Error 1

Code:

/root/ffmpeg/ffmpeg-php-0.7.0/ffmpeg_movie.c: In function 'zim_ffmpeg_movie___construct':
/root/ffmpeg/ffmpeg-php-0.7.0/ffmpeg_movie.c:318: error: 'list_entry' undeclared (first use in this function)
/root/ffmpeg/ffmpeg-php-0.7.0/ffmpeg_movie.c:318: error: (Each undeclared identifier is reported only once
/root/ffmpeg/ffmpeg-php-0.7.0/ffmpeg_movie.c:318: error: for each function it appears in.)
/root/ffmpeg/ffmpeg-php-0.7.0/ffmpeg_movie.c:318: error: 'le' undeclared (first use in this function)
/root/ffmpeg/ffmpeg-php-0.7.0/ffmpeg_movie.c:353: error: expected ';' before 'new_le'
/root/ffmpeg/ffmpeg-php-0.7.0/ffmpeg_movie.c:363: error: 'new_le' undeclared (first use in this function)
 


No comments:

Post a Comment