Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with ffmpeg4.4 #139

Open
waarmond opened this issue Mar 10, 2024 · 0 comments
Open

Problems with ffmpeg4.4 #139

waarmond opened this issue Mar 10, 2024 · 0 comments

Comments

@waarmond
Copy link

I'm happily using chromaprint as a depency of essentia for a long time. Since FFmpeg has become too modern I'm compiling against a separate ffmpeg4.4 with such a patch:

--- a/cmake/modules/FindFFmpeg.cmake	2021-12-23 06:57:54.000000000 +0100
+++ b/cmake/modules/FindFFmpeg.cmake	2024-03-10 22:26:24.794686739 +0100
@@ -39,7 +39,7 @@
 		/opt/include
 		/usr/freeware/include
 		NO_DEFAULT_PATH
-		PATH_SUFFIXES ffmpeg
+		PATH_SUFFIXES ffmpeg ffmpeg4.4
 		DOC "Location of FFMPEG Headers"
 	)
 	FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS lib${shortname}/${headername}
@@ -93,7 +93,7 @@
     /opt/csw/include # Blastwave
     /opt/include
     /usr/freeware/include
-    PATH_SUFFIXES ffmpeg
+    PATH_SUFFIXES ffmpeg ffmpeg4.4
     DOC "Location of FFMPEG stdint.h Header"
 )

Now I'm on a new system and have to recompile everything and the compilation of fpcalc fails:

[ 95%] Building CXX object src/cmd/CMakeFiles/fpcalc.dir/fpcalc.cpp.o
In file included from ./src/audio/ffmpeg_audio_reader.h:24,
                 from ./src/cmd/fpcalc.cpp:7:
./src/audio/ffmpeg_audio_processor.h:14:2: error: #error "no audio processing library"
   14 | #error "no audio processing library"
      |  ^~~~~
./src/audio/ffmpeg_audio_reader.h:73:25: error: 'FFmpegAudioProcessor' was not declared in this scope; did you mean 'FFmpegAudioReader'?
   73 |         std::unique_ptr<FFmpegAudioProcessor> m_converter;
      |                         ^~~~~~~~~~~~~~~~~~~~
      |                         FFmpegAudioReader
./src/audio/ffmpeg_audio_reader.h:73:45: error: template argument 1 is invalid
   73 |         std::unique_ptr<FFmpegAudioProcessor> m_converter;
      |                                             ^
./src/audio/ffmpeg_audio_reader.h:73:45: error: template argument 2 is invalid
./src/audio/ffmpeg_audio_reader.h: In member function 'bool chromaprint::FFmpegAudioReader::Open(const std::string&)':
./src/audio/ffmpeg_audio_reader.h:182:9: error: 'AVChannelLayout' was not declared in this scope
  182 |         AVChannelLayout output_channel_layout;
      |         ^~~~~~~~~~~~~~~
./src/audio/ffmpeg_audio_reader.h:184:44: error: 'output_channel_layout' was not declared in this scope; did you mean 'av_get_channel_layout'?
  184 |                 av_channel_layout_default(&output_channel_layout, m_output_channels);
      |                                            ^~~~~~~~~~~~~~~~~~~~~
      |                                            av_get_channel_layout
./src/audio/ffmpeg_audio_reader.h:184:17: error: 'av_channel_layout_default' was not declared in this scope
  184 |                 av_channel_layout_default(&output_channel_layout, m_output_channels);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
./src/audio/ffmpeg_audio_reader.h:186:50: error: 'AVCodecContext' {aka 'struct AVCodecContext'} has no member named 'ch_layout'; did you mean 'channel_layout'?
  186 |                 m_output_channels = m_codec_ctx->ch_layout.nb_channels;
      |                                                  ^~~~~~~~~
      |                                                  channel_layout
./src/audio/ffmpeg_audio_reader.h:187:44: error: 'output_channel_layout' was not declared in this scope; did you mean 'av_get_channel_layout'?
  187 |                 av_channel_layout_default(&output_channel_layout, m_output_channels);
      |                                            ^~~~~~~~~~~~~~~~~~~~~
      |                                            av_get_channel_layout
./src/audio/ffmpeg_audio_reader.h:187:17: error: 'av_channel_layout_default' was not declared in this scope
  187 |                 av_channel_layout_default(&output_channel_layout, m_output_channels);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
./src/audio/ffmpeg_audio_reader.h:190:74: error: 'AVCodecContext' {aka 'struct AVCodecContext'} has no member named 'ch_layout'; did you mean 'channel_layout'?
  190 |         if (m_codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16 || m_codec_ctx->ch_layout.nb_channels != m_output_channels || m_codec_ctx->sample_rate != m_output_sample_rate) {
      |                                                                          ^~~~~~~~~
      |                                                                          channel_layout
./src/audio/ffmpeg_audio_reader.h:191:29: error: request for member 'reset' in '((chromaprint::FFmpegAudioReader*)this)->chromaprint::FFmpegAudioReader::m_converter', which is of non-class type 'int'
  191 |                 m_converter.reset(new FFmpegAudioProcessor());
      |                             ^~~~~
./src/audio/ffmpeg_audio_reader.h:191:39: error: expected type-specifier before 'FFmpegAudioProcessor'
  191 |                 m_converter.reset(new FFmpegAudioProcessor());
      |                                       ^~~~~~~~~~~~~~~~~~~~
./src/audio/ffmpeg_audio_reader.h:192:28: error: base operand of '->' is not a pointer
  192 |                 m_converter->SetCompatibleMode();
      |                            ^~
./src/audio/ffmpeg_audio_reader.h:193:28: error: base operand of '->' is not a pointer
  193 |                 m_converter->SetInputSampleFormat(m_codec_ctx->sample_fmt);
      |                            ^~
./src/audio/ffmpeg_audio_reader.h:194:28: error: base operand of '->' is not a pointer
  194 |                 m_converter->SetInputSampleRate(m_codec_ctx->sample_rate);
      |                            ^~
./src/audio/ffmpeg_audio_reader.h:195:28: error: base operand of '->' is not a pointer
  195 |                 m_converter->SetInputChannelLayout(&(m_codec_ctx->ch_layout));
      |                            ^~
./src/audio/ffmpeg_audio_reader.h:195:67: error: 'AVCodecContext' {aka 'struct AVCodecContext'} has no member named 'ch_layout'; did you mean 'channel_layout'?
  195 |                 m_converter->SetInputChannelLayout(&(m_codec_ctx->ch_layout));
      |                                                                   ^~~~~~~~~
      |                                                                   channel_layout
./src/audio/ffmpeg_audio_reader.h:196:28: error: base operand of '->' is not a pointer
  196 |                 m_converter->SetOutputSampleFormat(AV_SAMPLE_FMT_S16);
      |                            ^~
./src/audio/ffmpeg_audio_reader.h:197:28: error: base operand of '->' is not a pointer
  197 |                 m_converter->SetOutputSampleRate(m_output_sample_rate);
      |                            ^~
./src/audio/ffmpeg_audio_reader.h:198:28: error: base operand of '->' is not a pointer
  198 |                 m_converter->SetOutputChannelLayout(&output_channel_layout);
      |                            ^~
./src/audio/ffmpeg_audio_reader.h:198:54: error: 'output_channel_layout' was not declared in this scope; did you mean 'av_get_channel_layout'?
  198 |                 m_converter->SetOutputChannelLayout(&output_channel_layout);
      |                                                      ^~~~~~~~~~~~~~~~~~~~~
      |                                                      av_get_channel_layout
./src/audio/ffmpeg_audio_reader.h:199:39: error: base operand of '->' is not a pointer
  199 |                 auto ret = m_converter->Init();
      |                                       ^~
./src/audio/ffmpeg_audio_reader.h:206:35: error: 'output_channel_layout' was not declared in this scope; did you mean 'av_get_channel_layout'?
  206 |         av_channel_layout_uninit(&output_channel_layout);
      |                                   ^~~~~~~~~~~~~~~~~~~~~
      |                                   av_get_channel_layout
./src/audio/ffmpeg_audio_reader.h:206:9: error: 'av_channel_layout_uninit' was not declared in this scope; did you mean 'av_get_channel_layout_string'?
  206 |         av_channel_layout_uninit(&output_channel_layout);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
      |         av_get_channel_layout_string
./src/audio/ffmpeg_audio_reader.h: In member function 'bool chromaprint::FFmpegAudioReader::Read(const int16_t**, size_t*)':
./src/audio/ffmpeg_audio_reader.h:316:105: error: 'AVCodecContext' {aka 'struct AVCodecContext'} has no member named 'ch_layout'; did you mean 'channel_layout'?
  316 |                                         ret = av_samples_alloc(m_convert_buffer, &linsize, m_codec_ctx->ch_layout.nb_channels, m_convert_buffer_nb_samples, AV_SAMPLE_FMT_S16, 1);
      |                                                                                                         ^~~~~~~~~
      |                                                                                                         channel_layout
./src/audio/ffmpeg_audio_reader.h:322:62: error: base operand of '->' is not a pointer
  322 |                                 auto nb_samples = m_converter->Convert(m_convert_buffer, m_convert_buffer_nb_samples, (const uint8_t **) m_frame->data, m_frame->nb_samples);
      |                                                              ^~
./src/audio/ffmpeg_audio_reader.h:336:70: error: base operand of '->' is not a pointer
  336 |                                         auto nb_samples = m_converter->Flush(m_convert_buffer, m_convert_buffer_nb_samples);
      |                                                                      ^~
./src/cmd/fpcalc.cpp: In function 'void ParseOptions(int&, char**)':
./src/cmd/fpcalc.cpp:132:34: error: 'LIBAVRESAMPLE_IDENT' was not declared in this scope; did you mean 'LIBAVUTIL_IDENT'?
  132 | #define RESAMPLE_LIB_IDENT_IDENT LIBAVRESAMPLE_IDENT
      |                                  ^~~~~~~~~~~~~~~~~~~
./src/cmd/fpcalc.cpp:134:146: note: in expansion of macro 'RESAMPLE_LIB_IDENT_IDENT'
  134 |                  fprintf(stdout, "fpcalc version %s (FFmpeg %s %s %s)\n", chromaprint_get_version(), LIBAVCODEC_IDENT, LIBAVFORMAT_IDENT, RESAMPLE_LIB_IDENT_IDENT);
      |                                                                                                                                           ^~~~~~~~~~~~~~~~~~~~~~~~

How is this possible? I thought that chromaprint would be too old and need a patch for ffmpeg 5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant