php扩展安装ffmpeg
#运行环境
CentOS7-X64
php-5.6
ffmpeg-3.4
ffmpeg-php-0.7.0
#软件下载地址
https://www.ffmpeg.org/download.html
https://github.com/AEGEGE/ae-php-ffmpeg #找了好久才找到能用的版本,自己传了一个留档
#安装ffmpeg-3.4
tar jxf ffmpeg-3.4.tar.bz2 cd ffmpeg-3.4/ ./configure --disable-x86asm --enable-shared make && make install
#编辑lib库变量
vi /etc/ld.so.conf.d/ffmpeg.conf /usr/local/lib ldconfig
#查看安装是否成功
ffmpeg -version ffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4) configuration: --disable-x86asm --enable-shared libavutil 55. 78.100 / 55. 78.100 libavcodec 57.107.100 / 57.107.100 libavformat 57. 83.100 / 57. 83.100 libavdevice 57. 10.100 / 57. 10.100 libavfilter 6.107.100 / 6.107.100 libswscale 4. 8.100 / 4. 8.100 libswresample 2. 9.100 / 2. 9.100
#扩展安装php-ffmpeg
git clone https://github.com/AEGEGE/ae-php-ffmpeg cd ae-php-ffmpeg /usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config make && make install echo "extension=ffmpeg.so" >> /etc/php.ini
#重新启动php进程
/etc/init.d/php reload
#查看安装是否成功
php -i | grep ffmpeg -i ffmpeg ffmpeg-php version => 0.7.0 ffmpeg-php built on => Nov 20 2017 10:43:41 ffmpeg-php gd support => disabled ffmpeg libavcodec version => Lavc57.107.100 ffmpeg libavcodec license => LGPL version 2.1 or later ffmpeg libavformat version => Lavf57.83.100 ffmpeg libavformat license => LGPL version 2.1 or later ffmpeg swscaler version => SwS4.8.100 ffmpeg swscaler license => LGPL version 2.1 or later