alexkay / spek

Acoustic spectrum analyser
http://spek.cc
GNU General Public License v3.0
2.66k stars 262 forks source link

Add FFMPEG-5.0 support #218

Closed perfect7gentleman closed 1 year ago

perfect7gentleman commented 2 years ago
x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I..  -include config.h -pthread -I/usr/lib64/wx/include/gtk3-unicode-3.1-gtk3 -I/usr/include/wx-3.1-gtk3 -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -DWXUSINGDLL -D__WXGTK__ -DNDEBUG     -march=native -mtune=native -O3 -pipe -fdata-sections -fdevirtualize-at-ltrans -ffunction-sections -fgraphite-identity -fipa-pta -flto=9 -flto-compression-level=9 -floop-interchange -floop-nest-optimize -floop-parallelize-all -fomit-frame-pointer -fopenmp -fsched-pressure -ftree-parallelize-loops=8 -fuse-linker-plugin -fno-asynchronous-unwind-tables -fno-plt -fno-semantic-interposition -fno-stack-protector -s -g0 -std=c++11 -Wall -Wextra -c -o libspek_a-spek-utils.o `test -f 'spek-utils.cc' || echo './'`spek-utils.cc
spek-audio.cc: In constructor ‘Audio::Audio()’:
spek-audio.cc:67:5: error: ‘av_register_all’ was not declared in this scope
   67 |     av_register_all();
      |     ^~~~~~~~~~~~~~~
spek-audio.cc: In destructor ‘Audio::~Audio()’:
spek-audio.cc:73:5: error: ‘av_lockmgr_register’ was not declared in this scope
   73 |     av_lockmgr_register(nullptr);
      |     ^~~~~~~~~~~~~~~~~~~
spek-audio.cc: In member function ‘std::unique_ptr<AudioFile> Audio::open(const string&, int)’:
spek-audio.cc:115:37: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive]
  115 |         codec = avcodec_find_decoder(codecpar->codec_id);
      |                 ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
      |                                     |
      |                                     const AVCodec*
spek-audio.cc: In constructor ‘AudioFileImpl::AudioFileImpl(AudioError, AVFormatContext*, AVCodecContext*, int, const string&, int, int, int, int, int, double)’:
spek-audio.cc:205:19: warning: ‘void av_init_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
  205 |     av_init_packet(&this->packet);
      |     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/libavformat/avformat.h:316,
                 from spek-audio.cc:6:
/usr/include/libavcodec/packet.h:506:6: note: declared here
  506 | void av_init_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
spek-audio.cc: In member function ‘virtual int AudioFileImpl::read()’:
spek-audio.cc:265:23: error: ‘avcodec_decode_audio4’ was not declared in this scope; did you mean ‘avcodec_decode_subtitle2’?
  265 |             int len = avcodec_decode_audio4(
      |                       ^~~~~~~~~~~~~~~~~~~~~
      |                       avcodec_decode_subtitle2
make[2]: *** [Makefile:604: libspek_a-spek-audio.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /usr/include/wx-3.1-gtk3/wx/window.h:18,
                 from /usr/include/wx-3.1-gtk3/wx/dcbuffer.h:16,
                 from spek-spectrogram.cc:3:
spek-events.h:31:5: warning: cast between incompatible pointer to member types from ‘void (wxEvtHandler::*)(SpekHaveSampleEvent&)’ to ‘wxObjectEventFunction’ {aka ‘void (wxEvtHandler::*)(wxEvent&)’} [-Wcast-function-type]
   31 |     (wxObjectEventFunction) (SpekHaveSampleEventFunction) &fn, (wxObject *) NULL ),
/usr/include/wx-3.1-gtk3/wx/event.h:91:73: note: in definition of macro ‘wxDECLARE_EVENT_TABLE_ENTRY’
   91 |     wxEventTableEntry(type, winid, idLast, wxNewEventTableFunctor(type, fn), obj)
      |                                                                         ^~
spek-events.h:30:5: note: in expansion of macro ‘DECLARE_EVENT_TABLE_ENTRY’
   30 |     DECLARE_EVENT_TABLE_ENTRY(SPEK_HAVE_SAMPLE, -1, -1, \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~
spek-spectrogram.cc:18:5: note: in expansion of macro ‘SPEK_EVT_HAVE_SAMPLE’
   18 |     SPEK_EVT_HAVE_SAMPLE(SpekSpectrogram::on_have_sample)
      |     ^~~~~~~~~~~~~~~~~~~~
make[2]: Leaving directory '/tmp/portage/media-sound/spek-9999/work/spek-9999/src'
make[1]: *** [Makefile:481: all-recursive] Error 1
make[1]: Leaving directory '/tmp/portage/media-sound/spek-9999/work/spek-9999'
make: *** [Makefile:407: all] Error 2
marillat commented 2 years ago

What's new ? FYI ffmpeg 5.0 is now in Debian unstable.

MikeWang000000 commented 2 years ago

My fork of Spek (MikeWang000000/spek-X) supports building against FFmpeg 5 now, with some bug fixes. I will tag a release in a few days. You can try to build my fork ;)

marillat commented 2 years ago

Yes, I already tested your fork (works fine) and sent to you a private e-mail yesterday to know if the goal is to keep spek-x and merge your work with spek. @MikeWang000000 would be nice to have an answer :)

MikeWang000000 commented 2 years ago

@marillat Spek-X is forked from withmorten/spek-alternative v0.8.2.3 (derived from alexkay/spek v0.8.2), which may cause some confict problems with current alexkay/spek. So I'm not going to open pull requests and I'll keep my own pace.

marillat commented 2 years ago

As withmorten/spek-alternative is dead (last commit in 2018) and alexkay/spek is also dead (no serious work since 2018) I will follow your nice work.

jlu5 commented 1 year ago

Just as an FYI, I'm not sure that the ffmpeg 5.x port in spek-x is complete yet. Some formats like AAC and Vorbis do not render any spectrogram at all: https://github.com/MikeWang000000/spek-X/issues/4

alexkay commented 1 year ago

Thanks all, let's move discussion to #232.