#118 Fails to compile with newer ffmpeg

open
nobody
5
2012-07-15
2012-07-15
bobbens
No

[ 19%] Building CXX object CMakeFiles/vbamcore.dir/src/common/ffmpeg.cpp.o
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp:14:28: fatal error: libavcodec/opt.h: No such file or directory

The new ffmpeg seems to have removed libavcodec/opt.h [1] which causes vba-m to fail to compile. This affects arch linux currently and probably more distros as they move to the newer ffmpeg. It seems like quite a few of the functionality used by ffmpeg was deprecated and has been removed.

If I remove the include I get new errors:

[ 32%] Building CXX object CMakeFiles/vbamcore.dir/src/common/ffmpeg.cpp.o
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp: In member function ‘MediaRet MediaRecorder::setup_sound_stream(const char*, AVOutputFormat*)’:
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp:95:14: warning: ‘AVStream* av_new_stream(AVFormatContext*, int)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1557) [-Wdeprecated-declarations]
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp:95:33: warning: ‘AVStream* av_new_stream(AVFormatContext*, int)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1557) [-Wdeprecated-declarations]
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp:104:23: error: ‘SAMPLE_FMT_S16’ was not declared in this scope
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp:114:18: warning: ‘int avcodec_open(AVCodecContext*, AVCodec*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3380) [-Wdeprecated-declarations]
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp:114:41: warning: ‘int avcodec_open(AVCodecContext*, AVCodec*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3380) [-Wdeprecated-declarations]
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp: In member function ‘MediaRet MediaRecorder::setup_video_stream(const char*, int, int, int)’:
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp:126:14: warning: ‘AVStream* av_new_stream(AVFormatContext*, int)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1557) [-Wdeprecated-declarations]
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp:126:33: warning: ‘AVStream* av_new_stream(AVFormatContext*, int)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1557) [-Wdeprecated-declarations]
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp:193:52: error: ‘av_set_int’ was not declared in this scope
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp:205:18: warning: ‘int avcodec_open(AVCodecContext*, AVCodec*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3380) [-Wdeprecated-declarations]
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp:205:41: warning: ‘int avcodec_open(AVCodecContext*, AVCodec*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3380) [-Wdeprecated-declarations]
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp: In member function ‘MediaRet MediaRecorder::finish_setup(const char*)’:
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp:216:34: error: ‘av_set_parameters’ was not declared in this scope
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp:266:31: error: ‘URL_WRONLY’ was not declared in this scope
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp:272:23: error: ‘av_write_header’ was not declared in this scope
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp: In member function ‘MediaRet MediaRecorder::AddFrame(const u8*)’:
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp:390:13: warning: ‘int avcodec_encode_video(AVCodecContext*, uint8_t*, int, const AVFrame*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:4077) [-Wdeprecated-declarations]
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp:390:66: warning: ‘int avcodec_encode_video(AVCodecContext*, uint8_t*, int, const AVFrame*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:4077) [-Wdeprecated-declarations]
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp: In member function ‘MediaRet MediaRecorder::AddFrame(const u16*)’:
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp:442:13: warning: ‘int avcodec_encode_audio(AVCodecContext*, uint8_t*, int, const short int*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:4015) [-Wdeprecated-declarations]
/tmp/yaourt-tmp-bobbens/aur-vba-m-gtk-svn/src/vbam/src/common/ffmpeg.cpp:443:55: warning: ‘int avcodec_encode_audio(AVCodecContext*, uint8_t*, int, const short int*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:4015) [-Wdeprecated-declarations]
make[2]: *** [CMakeFiles/vbamcore.dir/src/common/ffmpeg.cpp.o] Error 1
make[1]: *** [CMakeFiles/vbamcore.dir/all] Error 2

Which seem to indicate ffmpeg.ccp needs to be update to support the newer ffmpeg.

[1]: http://comments.gmane.org/gmane.comp.video.mplayer.user/67542

Discussion

  • use the old one then

     
  • bobbens
    bobbens
    2012-07-17

    Certainly that's a temporal solution for the issue at hand that I can use. However, as I believe this issue should be affecting all Arch Linux users currently and when eventually the ffmpeg propagate into other distributions, them also, it should be worth investigating into as part of a mid/long term strategy.