performous / composer

Song editor for Performous and other singing games
Other
39 stars 23 forks source link

Fails to build with FFMPEG 5 #45

Open dbungert opened 2 years ago

dbungert commented 2 years ago

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 https://github.com/performous/performous/commit/6ac48669f61926b3ee601f71f594944652236450 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.

Baklap4 commented 2 years ago

Thanks for notifying us about this :)

We did make some fixes over in performous already to support ffmpeg 5 i think so we'll have to do some updates here aswell

Baklap4 commented 1 year ago

Also fails when building for windows. @OznOg if you have any time, wanna check this out?

kangalio commented 1 year ago

I'm hitting this on Arch Linux despite having ffmpeg4.4 installed. How to redirect composer to use ffmpeg4.4 instead?

Baklap4 commented 1 year ago

@dbungert & @kangalioo for the time being can you guys use our AppImage which @ooshlablu just made? this should work out of the box as it includes and ships all the used libraries

kangalio commented 1 year ago

Yep, I tried it out immediately after ooshlablu made it. With exception of the Play button, it works :)

Baklap4 commented 1 year ago

Hmmm the play button should play the loaded mp3 file :o maybe good to create a new issue for that