Install ffmpeg-php on CentOS 6 with DirectAdmin

Install FFmpeg

First of all download and install RPMForge repository using the following commands:

user@myVPS:~# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.$(arch).rpm

user@myVPS:~# rpm -Uvh rpmforge-release-0.5.3-1.el6.rf.$(arch).rpm

Now you can install FFmpeg and some additional packages using yum.

user@myVPS:~# yum -y install ffmpeg ffmpeg-devel libogg libvorbis lame flvtool2 mencoder

Install ffmpeg-php

To download and extract the ffmpeg-php tarball, run:

user@myVPS:~# wget https://centos.googlecode.com/files/ffmpeg-php-0.6.0.tbz2

user@myVPS:~# tar -xjf ffmpeg-php-0.6.0.tbz2
user@myVPS:~# cd ffmpeg-php-0.6.0

Run ‘phpize’ to create the necessary build scripts

user@myVPS:~# phpize

If you get an error message “phpize: command not found”, It means that phpize is not in the system PATH. In our case, using PHP FPM version 5.6 the full path to the phpize is ‘/usr/local/php56/bin/phpize’, so we need to run:

user@myVPS:~# /usr/local/php56/bin/phpize

Run “configure” to set the installation options, in our case the command is as follows:

user@myVPS:~# ./configure –with-php-config=/usr/local/php56/bin/php-config

You can find the locations of phpize and php-config binaries using the find command:

user@myVPS:~# find /usr/local/ -type f -name

user@myVPS:~# phpize find /usr/local/ -type f -name php-config

Run make to start the compilation:

user@myVPS:~# make

If you get an error message like make: *** [ffmpeg_movie.lo] Error 1 open the ffmpeg_movie.c file and make the following changes:

user@myVPS:~# vim ffmpeg_movie.c

Change list_entry *le; to zend_rsrc_list_entry *le;
Change list_entry new_le; to zend_rsrc_list_entry new_le;
Change hashkey_length+1, (void *)&new_le, sizeof(list_entry), to hashkey_length+1, (void *)&new_le,sizeof(zend_rsrc_list_entry),

and restart the compilation:

user@myVPS:~# make

to install the binaries run:

user@myVPS:~# make install

Once the installation is complete, open the php.ini file

user@myVPS:~# vim /usr/local/php56/lib/php.ini

change the extension_dir to point to the extension directory, in our case :

extension_dir =”/usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/”

and append the following line to enable the ffmpeg extension

extension=”ffmpeg.so”

Finally restart php-fpm for changes to take effect.

user@myVPS:~# service php-fpm56 restart

If you’re running PHP as an Apache module, then restart apache with the command below:

user@myVPS:~# service httpd restart

That’s it. You have successfully installed the ffmpeg-php extension.

NOT!
EGER PIX_FMT_RGBA32/PIX_FMT_RGB32

ALIRSAN

nano ffmpeg_frame.c

DEDIKTEN SONRA

RGBA32 OLAN SATIRLARI RGB32
YAP