Install the php extension ffmpeg-php

1. Add warehouse import key environment: centos6.5 php5.4.29

vi /etc/yum.repos.d/dag.repo
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://www.mirrorservice.org/sites/apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1

导入签名认证
rpm --import http://www.mirrorservice.org/sites/apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -ivh http://www.mirrorservice.org/sites/apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

2. Install ffmpeg

yum install ffmpeg ffmpeg-devel

If you encounter this error

Error: Package: librtmp-2.3-1.el6.rf.x86_64 (rpmforge)
            Require: libgnutls.so.26()(64bit)
Error: Package: librtmp-2.3-1.el6.rf.x86_64 (rpmforge)
            Require: libgnutls.so.26(GNUTLS_1_4)(64bit)

Solution

yum -y install epel-release
rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
yum -y install ffmpeg ffmpeg-devel

https://serverfault.com/questions/682153/how-install-libgnutls-so-26-on-centos-7-1

3. Download ffmpeg-fpm-0.6.0 If there is no svn, first yum install svn

svn co svn://svn.code.sf.net/p/ffmpeg-php/code/branches/ffmpeg-php/ffmpeg-php-0.6.0/   /usr/local/src/ffmpeg-php-0.6.0

4. Installation

cd /usr/local/src/ffmpeg-php-0.6.0 
/usr/bin/phpize
./configure  --enable-skip-gd-check   (不启用此选项的话 安装完会显示 ffmpeg-php gd support  => disabled)
make

It will report an error here, as follows
Enter image description

make: *** [ffmpeg_movie.lo] 错误 1

Solution:

vim ffmpeg_movie.c
row 311: list_entry *le; 改为zend_rsrc_list_entry *le;
row 346: list_entry new_le;改为 zend_rsrc_list_entry new_le;
row 360: hashkey_length+1, (void *)&new_le, sizeof(list_entry),改为hashkey_length+1, (void *)&new_le,sizeof(zend_rsrc_list_entry),

remake

The error is as follows:
Enter image description

Solution:

sed -i  's/PIX_FMT_RGBA32/PIX_FMT_RGB32/g'    ffmpeg_frame.c

Re make make install
5. Add the PHP configuration file

echo  "extension = ffmpeg.so"  /etc/php.d/ffmpeg.ini

Reference: http://www.cnblogs.com/chenjiahe/p/6188140.html

The second time I used cenos7, I can't install it with the above method. I can install ffmpeg with the source code.

Reference source installation http://www.jb51.net/article/107173.htm

There is an error Error: operand type mismatch for `cmp'

Solution http://blog.csdn.net/xygl2009/article/details/14000483

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325860427&siteId=291194637