Categories

How to install FFmpeg, FFmpeg-PHP, Lame, Libogg, Libvorbis, FLVtool2, Mplayer, and Mencoder…

After spending countless hours trying to figure out how to install FFmpeg on various linux machines I decided to post some lessons I learned that I hope will help other linux tinkerers, like me.

1) Do not install PHPMotion on Ubuntu unless you are very familiar with linux, and the limitations of php-gd, Mencoder, and FFmpeg. After spending many hours searching forums I uncovered that php-gd (as of Dec 2008) that comes packaged with Ubuntu does not have certain functionality that allows you to rotate images, which renders the security image in PHPmotion unusable. There is a way to recompile php5 with bundled support for gd on ubuntu but this will not solve all your problems. After you fix this issue you will find out that mencoder and ffmpeg are not compiled to work with certain file types, such as wmv. You will post a video to phpmotion and the sound / video will be out of sync and it will drive you crazy trying to figure out why. That is when I stopped messing w/ Ubuntu (which by the way I love using) and switched to Centos 5.2. All my problems were solved…..

2) There are many ways to install the required packages for Phpmotion. In summary, you can either compile the packages yourself or use a script to do the dirty work for you. I was successful using both methods. I came across this blog – FFmpeg, FFmpeg-PHP, Lame, Libogg, Libvorbis, FLVtool2, Mplayer, Mencoder, AMR Installation which describes how to compile each package and install them separately. Or, you can cheat and use a great script that is freely available on sourceforge.net. Here is the web site – ffmpeginstall. As I write this blog I’m installing ffmpeg on a centos machine with this great script. It takes about 30 minutes and it is fully automated. One thing they don’t tell you, however, is that before you run the script make sure to execute the following command

yum install php-devel

I don’t know why the installer script does not get this automatically, but it doesn’t as of Dec 2008. php-devel is required to compile ffmpeg-php. If you don’t have php-devel installed before you run the ffmpeginstall script you will get an ffmpeg.so error message when you run:

php -i|grep php.ini

The error message will look something like:

FfmpegInstall PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/ffmpeg.so'

  • Share/Bookmark

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

2 comments to How to install FFmpeg, FFmpeg-PHP, Lame, Libogg, Libvorbis, FLVtool2, Mplayer, and Mencoder…

  • what is the output of these commands

    php-config –extension-dir

    php -r ‘phpinfo();’ | grep ffmpeg

  • paste the compplete error message like this

    [root@130 /]# php -r ‘phpinfo();’ | grep ffmpeg
    PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/ffmpeg.so’ – /usr/lib/php/modules/ffmpeg.so: undefined symbol: img_resample in Unknown on line 0

    also provide the output of php -v

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>