Я загрузил FFmpeg (версия 2.2.3) и составлено с —Disable-Yasm а также —включить совместно используемый настройка и установка.
Я тогда скачал FFmpeg-PHP расширение отсюда — http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/
Я был в состоянии phpize и успешно настроить.
выход phpize:
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
выход php —version:
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
Но, когда я пытаюсь установить мое расширение ffmpeg-php после успешной настройки, я получаю следующую ошибку.
Журнал ошибок:
/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, которую можно использовать для извлечения всех метаданных видео, таких как битрейт, частота кадров и т. Д.?
Задача ещё не решена.
Других решений пока нет …