tony2001 / ffmpeg-php

PHP extension for video editing, wrapping ffmpeg
GNU General Public License v2.0
84 stars 62 forks source link

ffmpeg_movie.c:918:41: error: ‘CODEC_ID_MPEG2TS’ undeclared #14

Open centminmod opened 9 years ago

centminmod commented 9 years ago

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    
centminmod commented 8 years ago

curious if anyone has a solution ?

BOPOHA commented 8 years ago

the installer I wrote at https://bitbucket.org/eva2000/ffmpeg-installer/

I think, You have ask the question to eva2000.

curious if anyone has a solution ?

I recently builded it with php-ffmpeg.spec on OBS.

pbek commented 8 years ago

I ran into the same problem with CODEC_ID_MPEG2TS. Is there any solution on the horizon?

pbek commented 8 years ago

I fixed this bug now, was able to build ffmpeg-php and created a pull request: https://github.com/tony2001/ffmpeg-php/pull/17

Since it might be possible this request will never get accepted (like all other pull requests in the last years) you can also use my fork https://github.com/pbek/ffmpeg-php directly.

centminmod commented 8 years ago

wow thanks again @pbek this is awesome - testing it out right now :)

pbek commented 8 years ago

The pull request got already accepted! ;)

pbek commented 8 years ago

I still run into https://github.com/tony2001/ffmpeg-php/issues/16 :smile: How far did you get?

centminmod commented 8 years ago

@pbek 100% working on my end https://community.centminmod.com/posts/24018/ against source compiled FFMPEG binary from git :)

pbek commented 8 years ago

I had to find a fix for a above bug first, but now the module loads! @tony2001, shall we close this issue?