1. Enable RPM Fusion yum repository
The CentOS rpm packages of ffmpeg, mplayer, mencoder and MP4Box are available on RPM Fusion YUM repository. RPM Fusion repo depends on packages from EPEL repo. So enable these repositories by installing following RPM packages:
Note: for following ‘yum‘ commands, use the switch –exclude “*.i386″ on 64-bit systems so as to avoid installing both 64-bit and 32-bit packages. Of course, DO NOT use this switch on 32-bit systems
2. Install ffmpeg, mplayer and mencoder
Install these packages using following yum command:
This will also install various dependency packages like libtheora, libvorbis, libogg, lame, opencore-amr, x264, xvidcore etc
3. Install flvtool2
This rpm package is available on RPM Fusion repo. But it also requires ruby rpms. However, it is not recommend to install ruby rpms on a cpanel server. Cpanel has its own ruby installer script. So install ruby using following cpanel script
Flvtool2 is available as a Ruby Gems package. Use following gem command to install flvtool2:
4. Install MP4Box
MP4Box is provided by gpac package. Install gpac and its library packages:
5. Install ffmpeg-php
Ffmpeg-php requires ffmpeg development package. Install this package using yum:
Now download the latest ffmpeg-php package:
Untar this package, build and install it with following commands:
Common errors:
During ./configure step if you get an error like “ffmpeg headers not found. Make sure ffmpeg is compiled as shared libraries using the –enable-shared option”, then run following three commands and after that re-run ./configure:
The make install command will show PHP extensions path where ffmpeg PHP extension is installed:
root@server [~/ffmpeg-php-0.6.0]# make install
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
Now edit php.ini file (/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:
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:
extension=”ffmpeg.so”
Restart Apache to make this change effective:
You can verify the status of ffmpeg extension on a PHP info web page or from command line as given below:
6. Installation paths
Following are the installation paths of tools that we installed:
Thats all!
No comments:
Post a Comment