Skip to content

Fails to build with FFMPEG 5 #45

@dbungert

Description

@dbungert

performous-composer will fail to build when doing so on Debian Sid or Ubuntu Kinetic.
Both these environments have FFMPEG 5.

The debbug has a good summary of the problem:

/<<PKGBUILDDIR>>/src/ffmpeg.cc: In member function ‘void FFmpeg::open()’:
/<<PKGBUILDDIR>>/src/ffmpeg.cc:71:9: error: ‘av_register_all’ was not declared in this scope
   71 |         av_register_all();
      |         ^~~~~~~~~~~~~~~
/<<PKGBUILDDIR>>/src/ffmpeg.cc:79:62: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
   79 |                 AVCodecContext* cc = pFormatCtx->streams[i]->codec;
      |                                                              ^~~~~
/<<PKGBUILDDIR>>/src/ffmpeg.cc:84:64: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
   84 |         AVCodecContext* cc = pFormatCtx->streams[audioStream]->codec;
      |                                                                ^~~~~
/<<PKGBUILDDIR>>/src/ffmpeg.cc:85:43: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive]
   85 |         pAudioCodec = avcodec_find_decoder(cc->codec_id);
      |                       ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
      |                                           |
      |                                           const AVCodec*
/<<PKGBUILDDIR>>/src/ffmpeg.cc: In member function ‘void FFmpeg::decodeNextFrame()’:
/<<PKGBUILDDIR>>/src/ffmpeg.cc:172:45: error: ‘avcodec_decode_audio4’ was not declared in this scope; did you mean ‘avcodec_decode_subtitle2’?
  172 |                                 bytesUsed = avcodec_decode_audio4(pAudioCodecCtx,m_frame,&gotFramePointer, &packet);
      |                                             ^~~~~~~~~~~~~~~~~~~~~
      |                                             avcodec_decode_subtitle2
make[3]: *** [src/CMakeFiles/composer.dir/build.make:166: src/CMakeFiles/composer.dir/ffmpeg.cc.o] Error 1

Here is a longer form log with the same failure:
https://launchpadlibrarian.net/619963471/buildlog_ubuntu-kinetic-amd64.performous-composer_2.0+20181009-gitbeeea23-2.1build2_BUILDING.txt.gz

The first 3 failure lines aren't so bad, but avcodec_decode_audio4 will need a more dedicated adjustment.

I think performous/performous@6ac4866 is a good reference point if one wants to port things over one step at a time, or maybe mass merging over the FFmpeg class entirely would be preferable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions