无法在Ubuntu 14.04上安装ffmpeg php
我下载了FFmpeg(2.2.3版)并使用--禁用yasm和--启用共享配置编译并安装 然后我从这里下载了ffmpeg-php扩展- 我能够成功地进行phpize和配置 phpize输出:无法在Ubuntu 14.04上安装ffmpeg php,php,ubuntu,video,ffmpeg,Php,Ubuntu,Video,Ffmpeg,我下载了FFmpeg(2.2.3版)并使用--禁用yasm和--启用共享配置编译并安装 然后我从这里下载了ffmpeg-php扩展- 我能够成功地进行phpize和配置 phpize输出: Configuring for: PHP Api Version: 20121113 Zend Module Api No: 20121212 Zend Extension Api No: 220121212 PHP 5.5.9-1ubuntu4.4 (cli) (built:
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
PHP 5.5.9-1ubuntu4.4 (cli) (built: Sep 4 2014 06:56:34)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
/bin/bash /tmp/ffmpeg-php-0.6.0/libtool --mode=compile cc -I. -I/tmp/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/tmp/ffmpeg-php-0.6.0/include -I/tmp/ffmpeg-php-0.6.0/main -I/tmp/ffmpeg-php-0.6.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /tmp/ffmpeg-php-0.6.0/ffmpeg-php.c -o ffmpeg-php.lo
libtool: compile: cc -I. -I/tmp/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/tmp/ffmpeg-php-0.6.0/include -I/tmp/ffmpeg-php-0.6.0/main -I/tmp/ffmpeg-php-0.6.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /tmp/ffmpeg-php-0.6.0/ffmpeg-php.c -fPIC -DPIC -o .libs/ffmpeg-php.o
In file included from /usr/include/x86_64-linux-gnu/sys/stat.h:105:0,
from /usr/include/php5/main/php_streams.h:28,
from /usr/include/php5/main/php.h:396,
from /tmp/ffmpeg-php-0.6.0/ffmpeg-php.c:40:
/usr/include/x86_64-linux-gnu/bits/stat.h:91:21: error: field 'st_atim' has incomplete type
struct timespec st_atim; /* Time of last access. */
^
/usr/include/x86_64-linux-gnu/bits/stat.h:92:21: error: field 'st_mtim' has incomplete type
struct timespec st_mtim; /* Time of last modification. */
^
/usr/include/x86_64-linux-gnu/bits/stat.h:93:21: error: field 'st_ctim' has incomplete type
struct timespec st_ctim; /* Time of last status change. */
^
/usr/include/x86_64-linux-gnu/bits/stat.h:152:21: error: field 'st_atim' has incomplete type
struct timespec st_atim; /* Time of last access. */
^
/usr/include/x86_64-linux-gnu/bits/stat.h:153:21: error: field 'st_mtim' has incomplete type
struct timespec st_mtim; /* Time of last modification. */
^
/usr/include/x86_64-linux-gnu/bits/stat.h:154:21: error: field 'st_ctim' has incomplete type
struct timespec st_ctim; /* Time of last status change. */
^
In file included from /usr/include/php5/main/php_streams.h:28:0,
from /usr/include/php5/main/php.h:396,
from /tmp/ffmpeg-php-0.6.0/ffmpeg-php.c:40:
/usr/include/x86_64-linux-gnu/sys/stat.h:365:31: error: array type has incomplete element type
const struct timespec __times[2],
^
/usr/include/x86_64-linux-gnu/sys/stat.h:372:54: error: array type has incomplete element type
extern int futimens (int __fd, const struct timespec __times[2]) __THROW;
^
In file included from /usr/include/php5/main/php.h:402:0,
from /tmp/ffmpeg-php-0.6.0/ffmpeg-php.c:40:
/usr/include/php5/TSRM/tsrm_virtual_cwd.h:218:2: error: unknown type name 'time_t'
time_t expires;
^
/usr/include/php5/TSRM/tsrm_virtual_cwd.h:246:86: error: unknown type name 'time_t'
CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_len, time_t t TSRMLS_DC);
^
/tmp/ffmpeg-php-0.6.0/ffmpeg-php.c: In function 'zm_startup_ffmpeg':
/tmp/ffmpeg-php-0.6.0/ffmpeg-php.c:94:5: warning: implicit declaration of function 'avcodec_init' [-Wimplicit-function-declaration]
avcodec_init();
^
make: *** [ffmpeg-php.lo] Error 1
php——版本输出:
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
PHP 5.5.9-1ubuntu4.4 (cli) (built: Sep 4 2014 06:56:34)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
/bin/bash /tmp/ffmpeg-php-0.6.0/libtool --mode=compile cc -I. -I/tmp/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/tmp/ffmpeg-php-0.6.0/include -I/tmp/ffmpeg-php-0.6.0/main -I/tmp/ffmpeg-php-0.6.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /tmp/ffmpeg-php-0.6.0/ffmpeg-php.c -o ffmpeg-php.lo
libtool: compile: cc -I. -I/tmp/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/tmp/ffmpeg-php-0.6.0/include -I/tmp/ffmpeg-php-0.6.0/main -I/tmp/ffmpeg-php-0.6.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /tmp/ffmpeg-php-0.6.0/ffmpeg-php.c -fPIC -DPIC -o .libs/ffmpeg-php.o
In file included from /usr/include/x86_64-linux-gnu/sys/stat.h:105:0,
from /usr/include/php5/main/php_streams.h:28,
from /usr/include/php5/main/php.h:396,
from /tmp/ffmpeg-php-0.6.0/ffmpeg-php.c:40:
/usr/include/x86_64-linux-gnu/bits/stat.h:91:21: error: field 'st_atim' has incomplete type
struct timespec st_atim; /* Time of last access. */
^
/usr/include/x86_64-linux-gnu/bits/stat.h:92:21: error: field 'st_mtim' has incomplete type
struct timespec st_mtim; /* Time of last modification. */
^
/usr/include/x86_64-linux-gnu/bits/stat.h:93:21: error: field 'st_ctim' has incomplete type
struct timespec st_ctim; /* Time of last status change. */
^
/usr/include/x86_64-linux-gnu/bits/stat.h:152:21: error: field 'st_atim' has incomplete type
struct timespec st_atim; /* Time of last access. */
^
/usr/include/x86_64-linux-gnu/bits/stat.h:153:21: error: field 'st_mtim' has incomplete type
struct timespec st_mtim; /* Time of last modification. */
^
/usr/include/x86_64-linux-gnu/bits/stat.h:154:21: error: field 'st_ctim' has incomplete type
struct timespec st_ctim; /* Time of last status change. */
^
In file included from /usr/include/php5/main/php_streams.h:28:0,
from /usr/include/php5/main/php.h:396,
from /tmp/ffmpeg-php-0.6.0/ffmpeg-php.c:40:
/usr/include/x86_64-linux-gnu/sys/stat.h:365:31: error: array type has incomplete element type
const struct timespec __times[2],
^
/usr/include/x86_64-linux-gnu/sys/stat.h:372:54: error: array type has incomplete element type
extern int futimens (int __fd, const struct timespec __times[2]) __THROW;
^
In file included from /usr/include/php5/main/php.h:402:0,
from /tmp/ffmpeg-php-0.6.0/ffmpeg-php.c:40:
/usr/include/php5/TSRM/tsrm_virtual_cwd.h:218:2: error: unknown type name 'time_t'
time_t expires;
^
/usr/include/php5/TSRM/tsrm_virtual_cwd.h:246:86: error: unknown type name 'time_t'
CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_len, time_t t TSRMLS_DC);
^
/tmp/ffmpeg-php-0.6.0/ffmpeg-php.c: In function 'zm_startup_ffmpeg':
/tmp/ffmpeg-php-0.6.0/ffmpeg-php.c:94:5: warning: implicit declaration of function 'avcodec_init' [-Wimplicit-function-declaration]
avcodec_init();
^
make: *** [ffmpeg-php.lo] Error 1
但是,当我在成功配置之后尝试安装我的ffmpeg php扩展时,我得到了以下错误
错误日志:
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
PHP 5.5.9-1ubuntu4.4 (cli) (built: Sep 4 2014 06:56:34)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
/bin/bash /tmp/ffmpeg-php-0.6.0/libtool --mode=compile cc -I. -I/tmp/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/tmp/ffmpeg-php-0.6.0/include -I/tmp/ffmpeg-php-0.6.0/main -I/tmp/ffmpeg-php-0.6.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /tmp/ffmpeg-php-0.6.0/ffmpeg-php.c -o ffmpeg-php.lo
libtool: compile: cc -I. -I/tmp/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/tmp/ffmpeg-php-0.6.0/include -I/tmp/ffmpeg-php-0.6.0/main -I/tmp/ffmpeg-php-0.6.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /tmp/ffmpeg-php-0.6.0/ffmpeg-php.c -fPIC -DPIC -o .libs/ffmpeg-php.o
In file included from /usr/include/x86_64-linux-gnu/sys/stat.h:105:0,
from /usr/include/php5/main/php_streams.h:28,
from /usr/include/php5/main/php.h:396,
from /tmp/ffmpeg-php-0.6.0/ffmpeg-php.c:40:
/usr/include/x86_64-linux-gnu/bits/stat.h:91:21: error: field 'st_atim' has incomplete type
struct timespec st_atim; /* Time of last access. */
^
/usr/include/x86_64-linux-gnu/bits/stat.h:92:21: error: field 'st_mtim' has incomplete type
struct timespec st_mtim; /* Time of last modification. */
^
/usr/include/x86_64-linux-gnu/bits/stat.h:93:21: error: field 'st_ctim' has incomplete type
struct timespec st_ctim; /* Time of last status change. */
^
/usr/include/x86_64-linux-gnu/bits/stat.h:152:21: error: field 'st_atim' has incomplete type
struct timespec st_atim; /* Time of last access. */
^
/usr/include/x86_64-linux-gnu/bits/stat.h:153:21: error: field 'st_mtim' has incomplete type
struct timespec st_mtim; /* Time of last modification. */
^
/usr/include/x86_64-linux-gnu/bits/stat.h:154:21: error: field 'st_ctim' has incomplete type
struct timespec st_ctim; /* Time of last status change. */
^
In file included from /usr/include/php5/main/php_streams.h:28:0,
from /usr/include/php5/main/php.h:396,
from /tmp/ffmpeg-php-0.6.0/ffmpeg-php.c:40:
/usr/include/x86_64-linux-gnu/sys/stat.h:365:31: error: array type has incomplete element type
const struct timespec __times[2],
^
/usr/include/x86_64-linux-gnu/sys/stat.h:372:54: error: array type has incomplete element type
extern int futimens (int __fd, const struct timespec __times[2]) __THROW;
^
In file included from /usr/include/php5/main/php.h:402:0,
from /tmp/ffmpeg-php-0.6.0/ffmpeg-php.c:40:
/usr/include/php5/TSRM/tsrm_virtual_cwd.h:218:2: error: unknown type name 'time_t'
time_t expires;
^
/usr/include/php5/TSRM/tsrm_virtual_cwd.h:246:86: error: unknown type name 'time_t'
CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_len, time_t t TSRMLS_DC);
^
/tmp/ffmpeg-php-0.6.0/ffmpeg-php.c: In function 'zm_startup_ffmpeg':
/tmp/ffmpeg-php-0.6.0/ffmpeg-php.c:94:5: warning: implicit declaration of function 'avcodec_init' [-Wimplicit-function-declaration]
avcodec_init();
^
make: *** [ffmpeg-php.lo] Error 1
我怎样才能解决这个问题?或者是否有其他php库可用于提取视频的所有元数据,如比特率、帧速率等?ffmpeg php是一个死项目,自2008年以来从未更新过。它应该如何与2014年6月发布的FFmpeg 2.2.3配合使用?你甚至需要一个PHP扩展吗?为什么不从脚本中执行
ffmpeg
本身?另见。最后,不建议禁用Yasm支持;没有它,某些事情会变得更慢。