ffmpeg-php icon indicating copy to clipboard operation
ffmpeg-php copied to clipboard

error: 'AVCodecContext' has no member named 'codec_name'

Open worksmarter opened this issue 8 years ago • 2 comments

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/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@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]#

worksmarter avatar Dec 12 '17 08:12 worksmarter

Got the same issue. What's the data field change?

Baytars avatar Mar 04 '20 17:03 Baytars

Well I see, the data field "codec_name" has been marked "deprecated" since v2.3 according to its Doxygen documentation.

Baytars avatar Mar 04 '20 17:03 Baytars