【问题标题】:FFMpeg with PHP-7.0 on Ubuntu在 Ubuntu 上使用 PHP-7.0 的 FFMpeg
【发布时间】:2019-03-30 09:58:48
【问题描述】:

我有一个带有 PHP-7.0 的 NGINX 服务器,我想安装 ffmpeg-php 扩展。几天来我一直在尝试很多方面。

目前有效的方法是手动编译 ffmpeg (https://ffmpeg.org/releases/ffmpeg-4.0.2.tar.bz2),但是在尝试编译 ffmpeg-php (https://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6. 0 / ffmpeg-php-0.6.0.tbz2 / 下载)我遇到以下错误消息:

root@zumbiserver-mercury:~/php7-ffmpeg# make /bin/bash

/root/php7-ffmpeg/libtool --mode=compile cc -I. -I/root/php7-ffmpeg -DPHP_ATOM_INC -I/root/php7-ffmpeg/include -I/root/php7-ffmpeg/main -I/root/php7-ffmpeg -I/usr/include/php/20151012 -I/usr/include/php/20151012 /main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/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 /root/php7-ffmpeg/ffmpeg-php.c -o ffmpeg-php.lo libtool:编译:cc -一世。 -I/root/php7-ffmpeg -DPHP_ATOM_INC -I/root/php7-ffmpeg/include -I/root/php7-ffmpeg/main -I/root/php7-ffmpeg -I/usr/include/php/20151012 -I /usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr /include/php/20151012/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 /root/php7-ffmpeg /ffmpeg-php.c -fPIC -DPIC -o .libs/ffmpeg-php.o 在 从 /usr/include/x86_64-linux-gnu/sys/stat.h:104:0 包含的文件, 来自/usr/include/php/20151012/Zend/zend_stream.h:28, 来自 /usr/include/php/20151012/Zend/zend.h:41, 来自/usr/include/php/20151012/main/php.h:36, 来自 /root/php7-ffmpeg/ffmpeg-php.c:40:/usr/include/x86_64-linux-gnu/bits/stat.h:91:21:错误:字段 ‘st_atim’ 的类型不完整 结构 timespec st_atim; /* 上次访问时间。 / ^ /usr/include/x86_64-linux-gnu/bits/stat.h:92:21:错误:字段 “st_mtim”的类型不完整 结构时间规范 st_mtim; / 最后修改时间。 / ^ /usr/include/x86_64-linux-gnu/bits/stat.h:93:21:错误:字段 “st_ctim”的类型不完整 结构 timespec st_ctim; / 上次状态更改的时间。 / ^ /usr/include/x86_64-linux-gnu/bits/stat.h:152:21:错误:字段 ‘st_atim’ 的类型不完整 结构 timespec st_atim; / 上次访问时间。 / ^ /usr/include/x86_64-linux-gnu/bits/stat.h:153:21:错误:字段 “st_mtim”的类型不完整 结构时间规范 st_mtim; / 最后修改时间。 / ^ /usr/include/x86_64-linux-gnu/bits/stat.h:154:21:错误:字段 “st_ctim”的类型不完整 结构 timespec st_ctim; / 上次状态更改的时间。 / ^ 在 /usr/include/php/20151012/Zend/zend_stream.h:28:0 包含的文件中, 来自 /usr/include/php/20151012/Zend/zend.h:41, 来自/usr/include/php/20151012/main/php.h:36, 从 /root/php7-ffmpeg/ffmpeg-php.c:40: /usr/include/x86_64-linux-gnu/sys/stat.h:364:31: 错误:数组类型有 不完整的元素类型‘struct timespec’ const struct timespec __times[2], ^ /usr/include/x86_64-linux-gnu/sys/stat.h:371:54:错误:数组类型有 不完整的元素类型‘struct timespec’ extern int futimens (int __fd, const struct timespec __times[2]) __THROW; ^ 在 /usr/include/php/20151012/main/php.h:395:0 包含的文件中, 来自 /root/php7-ffmpeg/ffmpeg-php.c:40: /usr/include/php/20151012/Zend/zend_virtual_cwd.h:218:2: 错误: 未知类型名称‘time_t’ time_t 过期;
^ /usr/include/php/20151012/Zend/zend_virtual_cwd.h:248:86: 错误: 未知类型名称‘time_t’ CWD_API realpath_cache_bucket
realpath_cache_lookup(const char *path, int path_len, time_t t); ^ /root/php7-ffmpeg/ffmpeg-php.c:在函数“zm_startup_ffmpeg”中: /root/php7-ffmpeg/ffmpeg-php.c:108:5:警告:隐式声明 函数‘avcodec_init’[-Wimplicit-function-declaration] avcodec_init(); ^ /root/php7-ffmpeg/ffmpeg-php.c:111:5: 警告:'av_register_all' 已弃用 [-Wdeprecated-declarations] av_register_all(); ^ 在 /root/php7-ffmpeg/ffmpeg-php.c:43:0 中包含的文件中:/usr/local/include/libavformat/avformat.h:2025:6:注意:在此处声明 void av_register_all(void);

  ^ Makefile:194: recipe for target 'ffmpeg-php.lo' failed make: *** [ffmpeg-php.lo] Error 1

谁能给我一盏灯?我不知道还能做什么!

【问题讨论】:

  • 为什么要使用像 7.0 这样过时的 PHP 版本?如果不是 7.2,我希望至少 7.1。

标签: php ffmpeg


【解决方案1】:

那个 ffmpeg-php 是一个早已死去的项目,已经 10 年没有更新了。不要浪费你的时间。如果您必须使用包装器,请参阅 FFmpegPHPPHP-FFMpeg,它们似乎目前正在积极维护中。

你还需要一个包装器吗?也许您可以直接在脚本中使用ffmpeg 工具。见FFmpeg Wiki: PHP

【讨论】:

    猜你喜欢
    • 2018-02-13
    • 2019-01-18
    • 2017-12-04
    • 1970-01-01
    • 2016-11-04
    • 2017-06-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多