FFMPEG-PHP

Google
Submitted by Ravindra on Sat, 2007-06-16 02:51.


ffmpeg-php is a very useful php extension which provides several methods to query information on the uploaded media. if you are going to do media conversion , you have to know the frame size, frame rate,ect of the input file, and ffmpeg provides those facilities. What ffmpeg-php does is, it provides an PHP interface to ffmpeg tool.
Installing ffmpeg-php is trivial. But make sure you have FFMPEG properly installed , please read the previous post for that

Download the source code from
http://sourceforge.net/project/showfiles.php?group_id=122353&package_id=133626

untar and then

phpize
./configure --enable-ffmpeg-php --with-ffmpeg-php --enable-maintainer-zts --enable-debug --with-php-config=/usr/local/php/bin/php-config

note that --enable-maintainer-zts --enable-debug --with-php-config=/usr/local/php/bin/php-config
options were requird to ensure this extension complies with the PHP installation i have. so you might not need those

make
make install

then

vi /usr/local/php/php.ini
cp /usr/local/php/lib/php/extensions/debug-zts-20060613/ffmpeg.so /usr/local/php/lib/php/extensions/
apache stop
apache start
php -r 'phpinfo();' | grep ffmpeg

you should see
ffmpeg
ffmpeg support (ffmpeg-php) => enabled
ffmpeg-php version => 0.5.0
ffmpeg.allow_persistent => 0 => 0


php -f ext/ffmpeg-php-0.5.0/tests/test_ffmpeg.php

and you should get a page with various info with ffmpeg and ffmpeg formats,ect. You can do further tests by using the media provided by ffmpeg-php source.

Then in order to write your own PHP media conversion code please lookup test_ffmpeg.php as well as http://vexxhost.com/blog/2007/05/20/how-to-convertencode-files-to-flv-using-ffmpeg-php/

and http://blog.go4teams.com/?p=56

 

 

permalink