tony2001 / ffmpeg-php Goto Github PK
View Code? Open in Web Editor NEWPHP extension for video editing, wrapping ffmpeg
License: GNU General Public License v2.0
PHP extension for video editing, wrapping ffmpeg
License: GNU General Public License v2.0
PHP extension for ffmpeg ======================== Description ----------- ffmpeg-php is an extension for PHP that adds an easy to use, object-oriented API for accessing and retrieving information from video and audio files. It has methods for returning frames from movie files as images that can be manipulated using PHP's image functions. This works well for automatically creating thumbnail images from movies. ffmpeg-php is also useful for reporting the duration and bitrate of audio files (mp3, wma...). ffmpeg-php can access many of the video formats supported by ffmpeg (mov, avi, mpg, wmv...). Originally hosted at http://ffmpeg-php.sourceforge.net, the project seems to be abandoned right now. So here is a fork of it with minor modifications required to make it work with recent PHP versions.
del
hello ,
ffmpeg-php wont build because of that error
make output ::
/bin/sh /usr/local/src/ffmpeginstaller.7.4/ffmpeg-php/libtool --mode=compile cc -I. -I/usr/local/src/ffmpeginstaller.7.4/ffmpeg-php -DPHP_ATOM_INC -I/usr/local/src/ffmpeginstaller.7.4/ffmpeg-php/include -I/usr/local/src/ffmpeginstaller.7.4/ffmpeg-php/main -I/usr/local/src/ffmpeginstaller.7.4/ffmpeg-php -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/ffmpeginstaller.7.4/ffmpeg-php/ffmpeg_movie.c -o ffmpeg_movie.lo
cc -I. -I/usr/local/src/ffmpeginstaller.7.4/ffmpeg-php -DPHP_ATOM_INC -I/usr/local/src/ffmpeginstaller.7.4/ffmpeg-php/include -I/usr/local/src/ffmpeginstaller.7.4/ffmpeg-php/main -I/usr/local/src/ffmpeginstaller.7.4/ffmpeg-php -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/ffmpeginstaller.7.4/ffmpeg-php/ffmpeg_movie.c -fPIC -DPIC -o .libs/ffmpeg_movie.o
/usr/local/src/ffmpeginstaller.7.4/ffmpeg-php/ffmpeg_movie.c: In function ‘_php_get_codec_name’:
/usr/local/src/ffmpeginstaller.7.4/ffmpeg-php/ffmpeg_movie.c:970: error: ‘AVCodecContext’ has no member named ‘sub_id’
/usr/local/src/ffmpeginstaller.7.4/ffmpeg-php/ffmpeg_movie.c:972: error: ‘AVCodecContext’ has no member named ‘sub_id’
make: *** [ffmpeg_movie.lo] Error 1
ffmpeg-php use old member method "sub_id" which is no longer valid
http://ffmpeg.org/doxygen/trunk/structAVCodecContext.html
. As temporary fix i have comment some line's to force return of mp2 because i cant dig more in code (LAZY :D)
Patch:
--- ffmpeg_movie.c.broken 2013-05-03 23:30:01.659965878 -0400
+++ ffmpeg_movie.c 2013-05-04 06:18:50.932990721 -0400
@@ -967,10 +967,14 @@
if (p) {
codec_name = p->name;
if (decoder_ctx->codec_id == CODEC_ID_MP3) {
+/*
if (decoder_ctx->sub_id == 2)
codec_name = "mp2";
else if (decoder_ctx->sub_id == 1)
codec_name = "mp1";
+*/
codec_name = "mp2";
Now ffmpeg-php build .
Thank you
I have installed ffmpeg ffmpeg-devel by RPMFusion
then
i do
cd ffmpeg-php
./configure
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib64/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking for gawk... gawk
checking for ffmpeg support... yes, shared
checking whether to force gd support in ffmpeg-php... no
checking for ffmpeg headers...
configure: error: ffmpeg headers not found. Make sure ffmpeg is compiled as shared libraries using the --enable-shared option
[root@localhost ffmpeg-php]# find / -name avcodec.h
/usr/include/ffmpeg/libavcodec/avcodec.h
/usr/include/ffmpeg/libavfilter/avcodec.h
/php-7.0.0/ffmpeg-php/ffmpeg_movie.c:1401:5: error: expected expression before 'ff_movie_context'
make: *** [ffmpeg_movie.lo] Error 1
built ffmpeg from git:
ffmpeg version N-54015-gfa125c5 Copyright (c) 2000-2013 the FFmpeg developers
built on Jun 13 2013 09:04:16 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-3)
configuration: --enable-avfilter --enable-libxvid --enable-libx264 --enable-libmp3lame --enable-libfdk_aac --enable-libvpx --enable-libvorbis --enable-libtheora --enable-pthreads --enable-shared --enable-nonfree --enable-gpl --enable-postproc
libavutil 52. 35.101 / 52. 35.101
libavcodec 55. 16.100 / 55. 16.100
libavformat 55. 8.102 / 55. 8.102
libavdevice 55. 2.100 / 55. 2.100
libavfilter 3. 76.101 / 3. 76.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
running make test lists several errors:
issue 1:
SKIP ffmpeg get key frames test [tests/getNextKeyFrame.phpt] reason: gd extension not avaliable. Even though gd gd-devel php-gd installed
issue 2:
FAIL ffmpeg getID3Info() test [tests/getID3Info.phpt]
Even though libmp3lame installed
issue 3:
FAIL ffmpeg persistent movie test [tests/persistentMovie.phpt]
Tried to build it against ffmpeg 1.0.3 on CentOS 6.3 x86_64:
/bin/sh /root/ffmpeg-php/libtool --mode=compile cc -I. -I/root/ffmpeg-php -DPHP_ATOM_INC -I/root/ffmpeg-php/include -I/root/ffmpeg-php/main -I/root/ffmpeg-php -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/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/ffmpeg-php/ffmpeg-php.c -o ffmpeg-php.lo
libtool: compile: cc -I. -I/root/ffmpeg-php -DPHP_ATOM_INC -I/root/ffmpeg-php/include -I/root/ffmpeg-php/main -I/root/ffmpeg-php -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/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/ffmpeg-php/ffmpeg-php.c -fPIC -DPIC -o .libs/ffmpeg-php.o
In file included from /usr/include/sys/stat.h:107,
from /usr/include/php/main/php_streams.h:28,
from /usr/include/php/main/php.h:396,
from /root/ffmpeg-php/ffmpeg-php.c:40:
/usr/include/bits/stat.h:91: error: field ‘st_atim’ has incomplete type
/usr/include/bits/stat.h:92: error: field ‘st_mtim’ has incomplete type
/usr/include/bits/stat.h:93: error: field ‘st_ctim’ has incomplete type
/usr/include/bits/stat.h:152: error: field ‘st_atim’ has incomplete type
/usr/include/bits/stat.h:153: error: field ‘st_mtim’ has incomplete type
/usr/include/bits/stat.h:154: error: field ‘st_ctim’ has incomplete type
In file included from /usr/include/php/main/php_streams.h:28,
from /usr/include/php/main/php.h:396,
from /root/ffmpeg-php/ffmpeg-php.c:40:
/usr/include/sys/stat.h:367: error: array type has incomplete element type
/usr/include/sys/stat.h:374: error: array type has incomplete element type
In file included from /usr/include/php/main/php.h:402,
from /root/ffmpeg-php/ffmpeg-php.c:40:
/usr/include/php/TSRM/tsrm_virtual_cwd.h:218: error: expected specifier-qualifier-list before ‘time_t’
/usr/include/php/TSRM/tsrm_virtual_cwd.h:246: error: expected declaration specifiers or ‘...’ before ‘time_t’
make: *** [ffmpeg-php.lo] Error 1
Hi,
I am trying to install ffmpeg-php, following this url,
https://chrisjean.com/install-ffmpeg-and-ffmpeg-php-on-centos-easily/
All steps are successful instead the following. Please help me. Thanks in advance.
Installing shared extensions: /usr/lib64/php/modules/
cp: cannot stat `modules/': No such file or directory
make: ** [install-modules] Error 1
The directory " /usr/lib64/php/modules/" is valid and I am using root account.
Best Regards,
Rajib
Thanks for publishing this, was able to get this working with the latest ffmpeg 1.1.3 with one exception, the toGDImage() function was not returning a GD resource for me.
I had to use the following patch to get it working, might want to include it in your branch:
https://groups.google.com/d/msg/ffmpeg-php/CoSSSc1fP8U/_-eWIleSmAEJ
Make crashes with "make: *** [ffmpeg_movie.lo] Error 1"
The following is what make fails and is causing the compile error. Below that is the full output of running make. I have been trying to get around this for a week now, so any help would be appreciated. Thank you in advance,
This is the enviroment I am compiling in:
PHP 5.6.32 (cli) (built: Oct 25 2017 06:49:52)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Suhosin v0.9.38, Copyright (c) 2007-2015, by SektionEins GmbH
CentOS Linux release 7.4.1708 (Core)
3.10.0-693.5.2.el7.x86_64
ffmpeg version N-89398-gc8bd2c7 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-16)
configuration: --enable-gpl --enable-version3 --enable-postproc --enable-libfdk_aac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libgsm --enable-libxvid --enable-libass --disable-static --enable-shared --extra-ldflags=-L/usr/local/lib --extra-cflags=-I/usr/local/include
libavutil 56. 5.100 / 56. 5.100
libavcodec 58. 6.102 / 58. 6.102
libavformat 58. 2.103 / 58. 2.103
libavdevice 58. 0.100 / 58. 0.100
libavfilter 7. 6.100 / 7. 6.100
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
[root@localhost ffmpeg-php]# make
/bin/sh /root/ffmpeg_sources/ffmpeg-php/libtool --mode=compile cc -I. -I/root/ffmpeg_sources/ffmpeg-php -DPHP_ATOM_INC -I/root/ffmpeg_sources/ffmpeg-php/include -I/root/ffmpeg_sources/ffmpeg-php/main -I/root/ffmpeg_sources/ffmpeg-php -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/ffmpeg_sources/ffmpeg-php/ffmpeg-php.c -o ffmpeg-php.lo
libtool: compile: cc -I. -I/root/ffmpeg_sources/ffmpeg-php -DPHP_ATOM_INC -I/root/ffmpeg_sources/ffmpeg-php/include -I/root/ffmpeg_sources/ffmpeg-php/main -I/root/ffmpeg_sources/ffmpeg-php -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/ffmpeg_sources/ffmpeg-php/ffmpeg-php.c -fPIC -DPIC -o .libs/ffmpeg-php.o
/bin/sh /root/ffmpeg_sources/ffmpeg-php/libtool --mode=compile cc -I. -I/root/ffmpeg_sources/ffmpeg-php -DPHP_ATOM_INC -I/root/ffmpeg_sources/ffmpeg-php/include -I/root/ffmpeg_sources/ffmpeg-php/main -I/root/ffmpeg_sources/ffmpeg-php -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c -o ffmpeg_movie.lo
libtool: compile: cc -I. -I/root/ffmpeg_sources/ffmpeg-php -DPHP_ATOM_INC -I/root/ffmpeg_sources/ffmpeg-php/include -I/root/ffmpeg_sources/ffmpeg-php/main -I/root/ffmpeg_sources/ffmpeg-php -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c -fPIC -DPIC -o .libs/ffmpeg_movie.o
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c: In function '_php_get_stream_index':
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c:146:17: warning: 'codec' is deprecated (declared at /usr/local/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
GET_CODEC_FIELD(fmt_ctx->streams[i]->codec, codec_type) == type) {
^
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c: In function '_php_get_decoder_context':
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c:479:9: warning: 'codec' is deprecated (declared at /usr/local/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
decoder = avcodec_find_decoder(GET_CODEC_FIELD(
^
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c:490:13: warning: 'codec' is deprecated (declared at /usr/local/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
GET_CODEC_PTR(ffmovie_ctx->fmt_ctx->streams[stream_index]->codec);
^
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c: In function '_php_get_framerate':
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c:638:5: warning: 'codec' is deprecated (declared at /usr/local/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
if (GET_CODEC_FIELD(st->codec, codec_type) == AVMEDIA_TYPE_VIDEO){
^
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c:642:13: warning: 'codec' is deprecated (declared at /usr/local/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
rate = 1 / av_q2d(GET_CODEC_FIELD(st->codec, time_base));
^
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c: In function '_php_get_framewidth':
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c:718:5: warning: 'codec' is deprecated (declared at /usr/local/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
return GET_CODEC_FIELD(st->codec, width);
^
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c: In function '_php_get_frameheight':
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c:746:5: warning: 'codec' is deprecated (declared at /usr/local/include/libavformat/avformat.h:876) [-Wdeprecated-declarations]
return GET_CODEC_FIELD(st->codec, height);
^
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c: In function '_php_get_codec_name':
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c:921:27: error: 'AVCodecContext' has no member named 'codec_name'
} else if (decoder_ctx->codec_name[0] != '\0') {
^
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c:922:33: error: 'AVCodecContext' has no member named 'codec_name'
codec_name = decoder_ctx->codec_name;
^
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c: In function '_php_read_av_frame':
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c:1171:11: warning: assignment makes pointer from integer without a cast [enabled by default]
frame = avcodec_alloc_frame();
^
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c:1177:13: warning: 'avcodec_decode_video2' is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4638) [-Wdeprecated-declarations]
avcodec_decode_video2(decoder_ctx, frame, &got_frame, &packet);
^
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c:1182:17: warning: 'av_free_packet' is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4310) [-Wdeprecated-declarations]
av_free_packet(&packet);
^
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c:1188:9: warning: 'av_free_packet' is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4310) [-Wdeprecated-declarations]
av_free_packet(&packet);
^
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c: In function '_php_get_ff_frame':
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c:1294:28: warning: assignment makes pointer from integer without a cast [enabled by default]
ff_frame->av_frame = avcodec_alloc_frame();
^
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c:1295:9: warning: 'avpicture_alloc' is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:5277) [-Wdeprecated-declarations]
avpicture_alloc((AVPicture*)ff_frame->av_frame, ff_frame->pixel_format,
^
/root/ffmpeg_sources/ffmpeg-php/ffmpeg_movie.c:1301:9: warning: 'av_picture_copy' is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:5310) [-Wdeprecated-declarations]
av_picture_copy((AVPicture*)ff_frame->av_frame,
^
make: *** [ffmpeg_movie.lo] Error 1
[root@localhost ffmpeg-php]#
I followed the instructions listed here: https://my.9xhost.net/knowledgebase/article/39/install-ffmpeg---php-ffmpeg-on-centos-7-1/
I get to ./configure && make and it gives me the error:
checking for ffmpeg headers...
configure: error: ffmpeg headers not found. Make sure ffmpeg is compiled as shared libraries using the --enable-shared option
Please let me know the fix, I am using CENTOS 7.3 x86_64 kvm – na WHM 62.0 (build 2)
With @pbek's latest pull request fixes #17 and #18, ffmpeg-php compiles successfully against latest source compiled FFMPEG binary from github but there's a few warnings for depcreated stuff
php --ri ffmpeg
ffmpeg
ffmpeg-php version => 0.7.0
ffmpeg-php built on => Jan 13 2016 12:24:30
ffmpeg-php gd support => disabled
ffmpeg libavcodec version => Lavc57.22.100
ffmpeg libavcodec license => nonfree and unredistributable
ffmpeg libavformat version => Lavf57.21.101
ffmpeg libavformat license => nonfree and unredistributable
ffmpeg swscaler version => SwS4.0.100
ffmpeg swscaler license => nonfree and unredistributable
ffmpeg codec_list => a64multi(v), a64multi5(v), aasc(v), aic(v), alias_pix(v), alias_pix(v), amv(v), amv(v), anm(v), ansi(v), apng(v), apng(v), asv1(v), asv1(v), asv2(v), asv2(v), aura(v), aura2(v), avrp(v), avrp(v), avrn(v), avs(v), avui(v), avui(v), ayuv(v), ayuv(v), bethsoftvid(v), bfi(v), binkvideo(v), bmp(v), bmp(v), bmv_video(v), brender_pix(v), c93(v), cavs(v), cdgraphics(v), cdxl(v), cinepak(v), cinepak(v), cljr(v), cljr(v), cllc(v), comfortnoise(a), comfortnoise(a), cpia(v), camstudio(v), cyuv(v), dds(v), dfa(v), dirac(v), dnxhd(v), dnxhd(v), dpx(v), dpx(v), dsicinvideo(v), dvvideo(v), dvvideo(v), dxa(v), dxtory(v), dxv(v), eacmv(v), eamad(v), eatgq(v), eatgv(v), eatqi(v), 8bps(v), 8svx_exp(a), 8svx_fib(a), escape124(v), escape130(v), exr(v), ffv1(v), ffv1(v), ffvhuff(v), ffvhuff(v), fic(v), flashsv(v), flashsv(v), flashsv2(v), flashsv2(v), flic(v), flv(v), flv(v), 4xm(v), fraps(v), frwu(v), g2m(v), gif(v), gif(v), h261(v), h261(v), h263(v), h263(v), h263i(v), h263p(v), h263p(v), h264(v), hap(v), hevc(v), hnm4video(v), hq_hqa(v), hqx(v), huffyuv(v), huffyuv(v), idcinvideo(v), iff(v), indeo2(v), indeo3(v), indeo4(v), indeo5(v), interplayvideo(v), jpeg2000(v), jpeg2000(v), jpegls(v), jpegls(v), jv(v), kgv1(v), kmvc(v), lagarith(v), ljpeg(v), loco(v), mdec(v), mimic(v), mjpeg(v), mjpeg(v), mjpegb(v), mmvideo(v), motionpixels(v), mpeg1video(v), mpeg1video(v), mpeg2video(v), mpeg2video(v), mpeg4(v), mpeg4(v), mpegvideo(v), msa1(v), msmpeg4v1(v), msmpeg4v2(v), msmpeg4v2(v), msmpeg4(v), msmpeg4(v), msrle(v), mss1(v), mss2(v), msvideo1(v), msvideo1(v), mszh(v), mts2(v), mvc1(v), mvc2(v), mxpeg(v), nuv(v), paf_video(v), pam(v), pam(v), pbm(v), pbm(v), pcx(v), pcx(v), pgm(v), pgm(v), pgmyuv(v), pgmyuv(v), pictor(v), png(v), png(v), ppm(v), ppm(v), prores(v), prores(v), prores_aw(v), prores_ks(v), prores_lgpl(v), ptx(v), qdraw(v), qpeg(v), qtrle(v), qtrle(v), r10k(v), r10k(v), r210(v), r210(v), rawvideo(v), rawvideo(v), rl2(v), roqvideo(v), roqvideo(v), rpza(v), rscc(v), rv10(v), rv10(v), rv20(v), rv20(v), rv30(v), rv40(v), s302m(a), s302m(a), sanm(v), screenpresso(v), sdx2_dpcm(a), sgi(v), sgi(v), sgirle(v), smackvid(v), smc(v), smvjpeg(v), snow(v), snow(v), sp5x(v), sunrast(v), sunrast(v), svq1(v), svq1(v), svq3(v), targa(v), targa(v), targa_y216(v), tdsc(v), theora(v), thp(v), tiertexseqvideo(v), tiff(v), tiff(v), tmv(v), truemotion1(v), truemotion2(v), camtasia(v), tscc2(v), txd(v), ultimotion(v), utvideo(v), utvideo(v), v210(v), v210(v), v210x(v), v308(v), v308(v), v408(v), v408(v), v410(v), v410(v), vb(v), vble(v), vc1(v), vc1image(v), vcr1(v), vmdvideo(v), vmnc(v), vp3(v), vp5(v), vp6(v), vp6a(v), vp6f(v), vp7(v), vp8(v), vp9(v), vqavideo(v), webp(v), wrapped_avframe(v), wmv1(v), wmv1(v), wmv2(v), wmv2(v), wmv3(v), wmv3image(v), wnv1(v), xan_wc3(v), xan_wc4(v), xbm(v), xbm(v), xface(v), xface(v), xl(v), xwd(v), xwd(v), y41p(v), y41p(v), yop(v), yuv4(v), yuv4(v), 012v(v), zerocodec(v), zlib(v), zlib(v), zmbv(v), zmbv(v), aac(a), aac(a), aac_fixed(a), aac_latm(a), ac3(a), ac3(a), ac3_fixed(a), ac3_fixed(a), alac(a), alac(a), als(a), amrnb(a), amrwb(a), ape(a), atrac1(a), atrac3(a), atrac3plus(a), binkaudio_dct(a), binkaudio_rdft(a), bmv_audio(a), cook(a), dca(a), dca(a), dsd_lsbf(a), dsd_msbf(a), dsd_lsbf_planar(a), dsd_msbf_planar(a), dsicinaudio(a), dss_sp(a), eac3(a), eac3(a), evrc(a), wavesynth(a), flac(a), flac(a), g723_1(a), g723_1(a), g729(a), gsm(a), gsm_ms(a), iac(a), imc(a), interplayacm(a), mace3(a), mace6(a), metasound(a), mlp(a), mp1(a), mp1float(a), mp2(a), mp2(a), mp2float(a), mp2fixed(a), mp3(a), mp3float(a), mp3adu(a), mp3adufloat(a), mp3on4(a), mp3on4float(a), mpc7(a), mpc8(a), nellymoser(a), nellymoser(a), on2avc(a), opus(a), paf_audio(a), qcelp(a), qdm2(a), real_144(a), real_144(a), real_288(a), ralf(a), shorten(a), sipr(a), smackaud(a), sonic(a), sonic(a), sonicls(a), tak(a), truehd(a), truespeech(a), tta(a), tta(a), twinvq(a), vmdaudio(a), vorbis(a), vorbis(a), wavpack(a), wavpack(a), wmalossless(a), wmapro(a), wmav1(a), wmav1(a), wmav2(a), wmav2(a), wmavoice(a), ws_snd1(a), xma1(a), xma2(a), pcm_alaw(a), pcm_alaw(a), pcm_bluray(a), pcm_dvd(a), pcm_f32be(a), pcm_f32be(a), pcm_f32le(a), pcm_f32le(a), pcm_f64be(a), pcm_f64be(a), pcm_f64le(a), pcm_f64le(a), pcm_lxf(a), pcm_mulaw(a), pcm_mulaw(a), pcm_s8(a), pcm_s8(a), pcm_s8_planar(a), pcm_s8_planar(a), pcm_s16be(a), pcm_s16be(a), pcm_s16be_planar(a), pcm_s16be_planar(a), pcm_s16le(a), pcm_s16le(a), pcm_s16le_planar(a), pcm_s16le_planar(a), pcm_s24be(a), pcm_s24be(a), pcm_s24daud(a), pcm_s24daud(a), pcm_s24le(a), pcm_s24le(a), pcm_s24le_planar(a), pcm_s24le_planar(a), pcm_s32be(a), pcm_s32be(a), pcm_s32le(a), pcm_s32le(a), pcm_s32le_planar(a), pcm_s32le_planar(a), pcm_u8(a), pcm_u8(a), pcm_u16be(a), pcm_u16be(a), pcm_u16le(a), pcm_u16le(a), pcm_u24be(a), pcm_u24be(a), pcm_u24le(a), pcm_u24le(a), pcm_u32be(a), pcm_u32be(a), pcm_u32le(a), pcm_u32le(a), pcm_zork(a), interplay_dpcm(a), roq_dpcm(a), roq_dpcm(a), sol_dpcm(a), xan_dpcm(a), adpcm_4xm(a), adpcm_adx(a), adpcm_adx(a), adpcm_afc(a), adpcm_aica(a), adpcm_ct(a), adpcm_dtk(a), adpcm_ea(a), adpcm_ea_maxis_xa(a), adpcm_ea_r1(a), adpcm_ea_r2(a), adpcm_ea_r3(a), adpcm_ea_xas(a), g722(a), g722(a), g726(a), g726(a), g726le(a), adpcm_ima_amv(a), adpcm_ima_apc(a), adpcm_ima_dk3(a), adpcm_ima_dk4(a), adpcm_ima_ea_eacs(a), adpcm_ima_ea_sead(a), adpcm_ima_iss(a), adpcm_ima_oki(a), adpcm_ima_qt(a), adpcm_ima_qt(a), adpcm_ima_rad(a), adpcm_ima_smjpeg(a), adpcm_ima_wav(a), adpcm_ima_wav(a), adpcm_ima_ws(a), adpcm_ms(a), adpcm_ms(a), adpcm_psx(a), adpcm_sbpro_2(a), adpcm_sbpro_3(a), adpcm_sbpro_4(a), adpcm_swf(a), adpcm_swf(a), adpcm_thp(a), adpcm_thp_le(a), adpcm_vima(a), adpcm_xa(a), adpcm_yamaha(a), adpcm_yamaha(a), ssa(s), ssa(s), ass(s), ass(s), cc_dec(s), dvbsub(s), dvbsub(s), dvdsub(s), dvdsub(s), jacosub(s), microdvd(s), mov_text(s), mov_text(s), mpl2(s), pgssub(s), pjs(s), realtext(s), sami(s), srt(s), srt(s), stl(s), subrip(s), subrip(s), subviewer(s), subviewer1(s), text(s), text(s), vplayer(s), webvtt(s), webvtt(s), xsub(s), xsub(s), libfdk_aac(a), libfdk_aac(a), libmp3lame(a), libopus(a), libopus(a), libvorbis(a), libvorbis(a), libvpx(v), libvpx(v), libvpx-vp9(v), libvpx-vp9(v), libx264(v), libx264rgb(v), libx265(v), bintext(v), xbin(v), idf(v),
Directive => Local Value => Master Value
ffmpeg.allow_persistent => 0 => 0
ffmpeg.show_warnings => 0 => 0
so just putting it out there
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c: In function 'img_convert':
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:64: warning: 'data' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3684)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:64: warning: 'linesize' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3686)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:64: warning: 'data' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3684)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:64: warning: 'linesize' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3686)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:64: warning: passing argument 2 of 'sws_scale' from incompatible pointer type
/opt/ffmpeg/include/libswscale/swscale.h:214: note: expected 'const uint8_t * const*' but argument is of type 'uint8_t **'
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c: In function 'img_resample':
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:77: warning: 'data' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3684)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:77: warning: 'data' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3684)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:77: warning: 'linesize' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3686)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:79: warning: 'data' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3684)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:79: warning: 'data' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3684)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:79: warning: 'linesize' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3686)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:81: warning: 'data' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3684)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:81: warning: 'data' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3684)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:81: warning: 'linesize' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3686)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:83: warning: 'linesize' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3686)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:83: warning: 'linesize' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3686)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:84: warning: 'linesize' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3686)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:84: warning: 'linesize' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3686)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:85: warning: 'linesize' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3686)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:85: warning: 'linesize' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3686)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:86: warning: 'data' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3684)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:87: warning: 'linesize' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3686)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:88: warning: 'data' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3684)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:88: warning: 'linesize' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:3686)
/svr-setup/ffmpeg-php-git/ffmpeg_tools.c:88: warning: passing argument 2 of 'sws_scale' from incompatible pointer type
/opt/ffmpeg/include/libswscale/swscale.h:214: note: expected 'const uint8_t * const*' but argument is of type 'uint8_t **'
ccache gcc -I. -I/svr-setup/ffmpeg-php-git -DPHP_ATOM_INC -I/svr-setup/ffmpeg-php-git/include -I/svr-setup/ffmpeg-php-git/main -I/svr-setup/ffmpeg-php-git -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/opt/ffmpeg/include -DHAVE_CONFIG_H -g -O2 -c /svr-setup/ffmpeg-php-git/ffmpeg_movie.c -fPIC -DPIC -o .libs/ffmpeg_movie.o
/svr-setup/ffmpeg-php-git/ffmpeg_frame.c: In function '_php_convert_frame':
/svr-setup/ffmpeg-php-git/ffmpeg_frame.c:215: warning: 'avpicture_alloc' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:4887)
/svr-setup/ffmpeg-php-git/ffmpeg_frame.c: In function '_php_resample_frame':
/svr-setup/ffmpeg-php-git/ffmpeg_frame.c:515: warning: 'avpicture_alloc' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:4887)
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function '_php_get_codec_name':
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c:921: warning: 'codec_name' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:1546)
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c:922: warning: 'codec_name' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:1546)
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function '_php_read_av_frame':
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1171: warning: assignment makes pointer from integer without a cast
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1182: warning: 'av_free_packet' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:4056)
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1188: warning: 'av_free_packet' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:4056)
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function '_php_get_ff_frame':
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1294: warning: assignment makes pointer from integer without a cast
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1295: warning: 'avpicture_alloc' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:4887)
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1301: warning: 'av_picture_copy' is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:4920)
/bin/sh /svr-setup/ffmpeg-php-git/libtool --mode=link ccache gcc -DPHP_ATOM_INC -I/svr-setup/ffmpeg-php-git/include -I/svr-setup/ffmpeg-php-git/main -I/svr-setup/ffmpeg-php-git -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/opt/ffmpeg/include -DHAVE_CONFIG_H -g -O2 -L/opt/ffmpeg/lib -o ffmpeg.la -export-dynamic -avoid-version -prefer-pic -module -rpath /svr-setup/ffmpeg-php-git/modules ffmpeg-php.lo ffmpeg_movie.lo ffmpeg_frame.lo ffmpeg_errorhandler.lo ffmpeg_tools.lo -Wl,-rpath,/opt/ffmpeg/lib -L/opt/ffmpeg/lib -lswscale -Wl,-rpath,/opt/ffmpeg/lib -L/opt/ffmpeg/lib -lavutil -Wl,-rpath,/opt/ffmpeg/lib -L/opt/ffmpeg/lib -lavformat -Wl,-rpath,/opt/ffmpeg/lib -L/opt/ffmpeg/lib -lavcodec
ccache gcc -shared .libs/ffmpeg-php.o .libs/ffmpeg_movie.o .libs/ffmpeg_frame.o .libs/ffmpeg_errorhandler.o .libs/ffmpeg_tools.o -L/opt/ffmpeg/lib -lswscale -lavutil -lavformat -lavcodec -Wl,-rpath -Wl,/opt/ffmpeg/lib -Wl,-rpath -Wl,/opt/ffmpeg/lib -Wl,-rpath -Wl,/opt/ffmpeg/lib -Wl,-rpath -Wl,/opt/ffmpeg/lib -Wl,-soname -Wl,ffmpeg.so -o .libs/ffmpeg.so
creating ffmpeg.la
(cd .libs && rm -f ffmpeg.la && ln -s ../ffmpeg.la ffmpeg.la)
/bin/sh /svr-setup/ffmpeg-php-git/libtool --mode=install cp ./ffmpeg.la /svr-setup/ffmpeg-php-git/modules
cp ./.libs/ffmpeg.so /svr-setup/ffmpeg-php-git/modules/ffmpeg.so
cp ./.libs/ffmpeg.lai /svr-setup/ffmpeg-php-git/modules/ffmpeg.la
PATH="$PATH:/sbin" ldconfig -n /svr-setup/ffmpeg-php-git/modules
----------------------------------------------------------------------
Libraries have been installed in:
/svr-setup/ffmpeg-php-git/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20121212/
I am running into a problem where the video is taken in landscape mode, and picking a frame to make an image messes up the orientation of the image.
An example
http://rocklivewests3-a.akamaihd.net/18357527/18321767_goi803evar8gzmolpth17i2jes79erme2q3j7bes.mp4
ffmpeg -i 18321767_goi803evar8gzmolpth17i2jes79erme2q3j7bes.mp4 -f ffmetadata
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/mikhail/Downloads/18321767_goi803evar8gzmolpth17i2jes79erme2q3j7bes.mp4':
Metadata:
major_brand : isom
minor_version : 0
compatible_brands: isomiso2avc1
creation_time : 2014-12-16 14:54:34
Duration: 00:00:02.40, start: 0.000000, bitrate: 6588 kb/s
Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x480, 7288 kb/s, SAR 65536:65536 DAR 4:3, 25.80 fps, 90k tbr, 90k tbn, 180k tbc (default)
Metadata:
rotate : 270
creation_time : 2014-12-16 14:54:32
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 96 kb/s (default)
Metadata:
creation_time : 2014-12-16 14:54:32
The rotation is 270 and picking a frame
http://rocklivewests3-a.akamaihd.net/18357527/18321767_goi803evar8gzmolpth17i2jes79erme2q3j7bes.jpg
Produces A bad rotation.
I cannot read the metadata of the original mp4 file without shelling out? Is there an undocumented api for this?
Additionally producing the gdimage does not pass the exif orientation info.
$mov = new \ffmpeg_movie($fileSource);
$ff_frame = $mov->getFrame(3);
if (!$ff_frame) {
throw new \InvalidMovieException("Unable to pull the frame");
}
$gd_image = $ff_frame->toGDImage();
....
thus I cannot rotate the image.
Is there anyway to get the orientation info?
Is there a way to pass orientation to the gd image?
Hi I am trying to compile your ffmpeg-php code against a source compiled ffmpeg on CentOS 7.1 using the installer I wrote at https://bitbucket.org/eva2000/ffmpeg-installer/src/d7b8c640e41b4799f70adf60696f1e820261d300/ffmpeg.sh?at=master
ffmpeg installed fine
/opt/bin/ffmpeg -version
ffmpeg version git-2015-09-11-d5f8a64 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)
configuration: --prefix=/opt/ffmpeg --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib --bindir=/opt/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-swscale --enable-shared
libavutil 55. 2.100 / 55. 2.100
libavcodec 57. 1.100 / 57. 1.100
libavformat 57. 0.100 / 57. 0.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 1.100 / 6. 1.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.100 / 2. 0.100
libpostproc 54. 0.100 / 54. 0.100
however I am getting errors on make
run - full log of errors at https://gist.github.com/centminmod/890e7261d5925066cd77
/bin/sh /svr-setup/ffmpeg-php-git/libtool --mode=compile ccache gcc -I. -I/svr-setup/ffmpeg-php-git -DPHP_ATOM_INC -I/svr-setup/ffmpeg-php-git/include -I/svr-setup/ffmpeg-php-git/main -I/svr-setup/ffmpeg-php-git -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/opt/ffmpeg/include -DHAVE_CONFIG_H -g -O2 -c /svr-setup/ffmpeg-php-git/ffmpeg_movie.c -o ffmpeg_movie.lo
ccache gcc -I. -I/svr-setup/ffmpeg-php-git -DPHP_ATOM_INC -I/svr-setup/ffmpeg-php-git/include -I/svr-setup/ffmpeg-php-git/main -I/svr-setup/ffmpeg-php-git -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/opt/ffmpeg/include -DHAVE_CONFIG_H -g -O2 -c /svr-setup/ffmpeg-php-git/ffmpeg_movie.c -fPIC -DPIC -o .libs/ffmpeg_movie.o
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function ‘_php_get_codec_name’:
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c:918:41: error: ‘CODEC_ID_MPEG2TS’ undeclared (first use in this function)
} else if (decoder_ctx->codec_id == CODEC_ID_MPEG2TS) {
^
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c:918:41: note: each undeclared identifier is reported only once for each function it appears in
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c:921:5: warning: ‘codec_name’ is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:1483) [-Wdeprecated-declarations]
} else if (decoder_ctx->codec_name[0] != '\0') {
^
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c:922:9: warning: ‘codec_name’ is deprecated (declared at /opt/ffmpeg/include/libavcodec/avcodec.h:1483) [-Wdeprecated-declarations]
codec_name = decoder_ctx->codec_name;
^
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function ‘_php_read_av_frame’:
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1171:11: warning: assignment makes pointer from integer without a cast [enabled by default]
frame = avcodec_alloc_frame();
^
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c: In function ‘_php_get_ff_frame’:
/svr-setup/ffmpeg-php-git/ffmpeg_movie.c:1294:28: warning: assignment makes pointer from integer without a cast [enabled by default]
ff_frame->av_frame = avcodec_alloc_frame();
^
make: *** [ffmpeg_movie.lo] Error 1
Hello.
I was able to compile this library.
But when I look it into php (with php --ri ffmpeg) I got this output :
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/ffmpeg.so' - /usr/lib/php5/20121212/ffmpeg.so: undefined symbol: avcodec_alloc_frame in Unknown on line 0
Do you know why ?
Thanks a lot.
Adrien.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/bin/sh /home/share/ffmpeg-php/libtool --mode=compile cc -I. -I/home/share/ffmpeg-php -DPHP_ATOM_INC -I/home/share/ffmpeg-php/include -I/home/share/ffmpeg-php/main -I/home/share/ffmpeg-php -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/share/ffmpeg-php/ffmpeg-php.c -o ffmpeg-php.lo
libtool: compile: cc -I. -I/home/share/ffmpeg-php -DPHP_ATOM_INC -I/home/share/ffmpeg-php/include -I/home/share/ffmpeg-php/main -I/home/share/ffmpeg-php -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/share/ffmpeg-php/ffmpeg-php.c -fPIC -DPIC -o .libs/ffmpeg-php.o
In file included from /usr/include/sys/stat.h:107,
from /usr/include/php/main/php_streams.h:28,
from /usr/include/php/main/php.h:395,
from /home/share/ffmpeg-php/ffmpeg-php.c:40:
/usr/include/bits/stat.h:91: error: field ‘st_atim’ has incomplete type
/usr/include/bits/stat.h:92: error: field ‘st_mtim’ has incomplete type
/usr/include/bits/stat.h:93: error: field ‘st_ctim’ has incomplete type
/usr/include/bits/stat.h:152: error: field ‘st_atim’ has incomplete type
/usr/include/bits/stat.h:153: error: field ‘st_mtim’ has incomplete type
/usr/include/bits/stat.h:154: error: field ‘st_ctim’ has incomplete type
In file included from /usr/include/php/main/php_streams.h:28,
from /usr/include/php/main/php.h:395,
from /home/share/ffmpeg-php/ffmpeg-php.c:40:
/usr/include/sys/stat.h:367: error: array type has incomplete element type
/usr/include/sys/stat.h:374: error: array type has incomplete element type
In file included from /usr/include/php/main/php.h:401,
from /home/share/ffmpeg-php/ffmpeg-php.c:40:
/usr/include/php/TSRM/tsrm_virtual_cwd.h:218: error: expected specifier-qualifier-list before ‘time_t’
/usr/include/php/TSRM/tsrm_virtual_cwd.h:246: error: expected declaration specifiers or ‘...’ before ‘time_t’
make: *** [ffmpeg-php.lo] Error 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.