Download the latest ffmpeg-php. You can download it using
# wget http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2/download
# tar -xvjf ffmpeg-php-0.6.0.tbz2
# phpize
# ./configure --enable-shared
# make
# make install
Once the installation is completed, you need to add the ffmpeg.so file in your php.ini
Locate you php.ini using
# php -i | grep php.ini
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini
# vi /usr/local/lib/php.ini
add the following line to your php.ini file.
extension=”ffmpeg.so”
restart apache
#/etc/init.d/http restart
You can check the ffmpeg-php module using the command
# php -m | grep ffmpeg
ffmpeg
Common issues in installing ffmpeg-php
1. While running make, you will get an error
# wget http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2/download
# tar -xvjf ffmpeg-php-0.6.0.tbz2
# phpize
# ./configure --enable-shared
# make
# make install
Once the installation is completed, you need to add the ffmpeg.so file in your php.ini
Locate you php.ini using
# php -i | grep php.ini
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini
# vi /usr/local/lib/php.ini
add the following line to your php.ini file.
extension=”ffmpeg.so”
restart apache
#/etc/init.d/http restart
You can check the ffmpeg-php module using the command
# php -m | grep ffmpeg
ffmpeg
Common issues in installing ffmpeg-php
1. While running make, you will get an error
make: *** [ffmpeg_frame.lo] Error 1
Fix: Copy the file ffmpeg_frame.loT to ffmpeg_frame.lo
#cp ffmpeg_frame.loT ffmpeg_frame.lo
This should fix the above issue.
2. After enabling ffmpeg in php.ini, you can get an error
php: symbol lookup error: /usr/local/lib/php/extensions/no-debug-non-zts-
20060613/ffmpeg.so: undefined symbol: register_ffmpeg_frame_class
Fix : Goto ffmpeg-php installation folder and open the file ffmpeg_frame.c and replace all
PIX_FMT_RGBA32 with PIX_FMT_RGB32
cd /usr/local/src/ffmpeg-php
# vi ffmpeg_frame.c
:%s/PIX_FMT_RGBA32/PIX_FMT_RGB32
:wq!
then you need to compile ffmpeg
#./configure --enable-shared
#make
#make install
Hope this will help you in installing ffmpeg-php in your server.
No comments:
Post a Comment