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

Unable to build on Debian Testing with ffmpeg 7.0.2 #522

Open
undef21 opened this issue Oct 1, 2024 · 5 comments
Open

Unable to build on Debian Testing with ffmpeg 7.0.2 #522

undef21 opened this issue Oct 1, 2024 · 5 comments

Comments

@undef21
Copy link

undef21 commented Oct 1, 2024

When I try to build Aleph One on Debian Testing (13) I get the next build error:

Making all in FFmpeg
make[3]: Entering directory '/root/alephone-release-20240822/Source_Files/FFmpeg'
gcc -DHAVE_CONFIG_H -I. -I../..  -I../../Source_Files/CSeries -I../../Source_Files/Files -I../../Source_Files/GameWorld -I../../Source_Files/Input -I../../Source_Files/Misc -I../../Source_Files/ModelView -I../../Source_Files/Network -I../../Source_Files/Sound -I../../Source_Files/RenderMain -I../../Source_Files/RenderOther -I../../Source_Files/XML -I../../Source_Files -D__STDC_CONSTANT_MACROS -I/usr/include/libpng16   -I/usr/include/x86_64-linux-gnu -I/usr/include/p11-kit-1  -I/usr/include/x86_64-linux-gnu  -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/libpng16 -I/usr/include/x86_64-linux-gnu -I/usr/include/webp  -I/usr/include/AL  -I/usr/include/opus -I/usr/include/x86_64-linux-gnu   -I/usr/include/SDL2 -D_REENTRANT  -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/sysprof-6 -pthread   -I/usr/include/SDL2 -D_REENTRANT  -DSDL -std=c99 -g -O2 -c -o SDL_ffmpeg.o SDL_ffmpeg.c
g++ -DHAVE_CONFIG_H -I. -I../..  -I../../Source_Files/CSeries -I../../Source_Files/Files -I../../Source_Files/GameWorld -I../../Source_Files/Input -I../../Source_Files/Misc -I../../Source_Files/ModelView -I../../Source_Files/Network -I../../Source_Files/Sound -I../../Source_Files/RenderMain -I../../Source_Files/RenderOther -I../../Source_Files/XML -I../../Source_Files -D__STDC_CONSTANT_MACROS -I/usr/include/libpng16   -I/usr/include/x86_64-linux-gnu -I/usr/include/p11-kit-1  -I/usr/include/x86_64-linux-gnu  -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/libpng16 -I/usr/include/x86_64-linux-gnu -I/usr/include/webp  -I/usr/include/AL  -I/usr/include/opus -I/usr/include/x86_64-linux-gnu   -I/usr/include/SDL2 -D_REENTRANT  -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/sysprof-6 -pthread   -I/usr/include/SDL2 -D_REENTRANT  -DSDL  -g -O2 -c -o Movie.o Movie.cpp
SDL_ffmpeg.c: In function 'SDL_ffmpegOpen':
SDL_ffmpeg.c:380:34: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  380 |                 AVCodec *codec = avcodec_find_decoder( stream->_ffmpeg->codecpar->codec_id );
      |                                  ^~~~~~~~~~~~~~~~~~~~
SDL_ffmpeg.c:430:34: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  430 |                 AVCodec *codec = avcodec_find_decoder( file->_ffmpeg->streams[i]->codecpar->codec_id );
      |                                  ^~~~~~~~~~~~~~~~~~~~
SDL_ffmpeg.c:447:69: error: 'AVCodecParameters' has no member named 'channel_layout'; did you mean 'ch_layout'?
  447 |                     int channel_layout = stream->_ffmpeg->codecpar->channel_layout ? stream->_ffmpeg->codecpar->channel_layout :
      |                                                                     ^~~~~~~~~~~~~~
      |                                                                     ch_layout
SDL_ffmpeg.c:447:113: error: 'AVCodecParameters' has no member named 'channel_layout'; did you mean 'ch_layout'?
  447 |                     int channel_layout = stream->_ffmpeg->codecpar->channel_layout ? stream->_ffmpeg->codecpar->channel_layout :
      |                                                                                                                 ^~~~~~~~~~~~~~
      |                                                                                                                 ch_layout
SDL_ffmpeg.c:448:51: error: 'AVCodecParameters' has no member named 'channels'
  448 |                         (stream->_ffmpeg->codecpar->channels == 2 ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO);
      |                                                   ^~
SDL_ffmpeg.c:450:43: error: implicit declaration of function 'swr_alloc_set_opts'; did you mean 'swr_alloc_set_opts2'? [-Wimplicit-function-declaration]
  450 |                     stream->swr_context = swr_alloc_set_opts(stream->swr_context, channel_layout, AV_SAMPLE_FMT_FLT,
      |                                           ^~~~~~~~~~~~~~~~~~
      |                                           swr_alloc_set_opts2
SDL_ffmpeg.c:450:41: error: assignment to 'struct SwrContext *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  450 |                     stream->swr_context = swr_alloc_set_opts(stream->swr_context, channel_layout, AV_SAMPLE_FMT_FLT,
      |                                         ^
SDL_ffmpeg.c: In function 'SDL_ffmpegCreate':
SDL_ffmpeg.c:500:24: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  500 |     file->_ffmpeg->url = filename;
      |                        ^
SDL_ffmpeg.c: In function 'SDL_ffmpegAddAudioFrame':
SDL_ffmpeg.c:651:107: error: 'AVCodecContext' has no member named 'channels'
  651 |     int32_t read_samples = frame->size / (av_get_bytes_per_sample(file->audioStream->audioFormat) * acodec->channels);
      |                                                                                                           ^~
SDL_ffmpeg.c:668:16: error: 'AVFrame' has no member named 'channels'
  668 |     audio_frame->channels = acodec->channels;
      |                ^~
SDL_ffmpeg.c:668:35: error: 'AVCodecContext' has no member named 'channels'
  668 |     audio_frame->channels = acodec->channels;
      |                                   ^~
SDL_ffmpeg.c:670:18: error: 'AVFrame' has no member named 'channel_layout'; did you mean 'ch_layout'?
  670 |     audio_frame->channel_layout = acodec->channel_layout;
      |                  ^~~~~~~~~~~~~~
      |                  ch_layout
SDL_ffmpeg.c:670:43: error: 'AVCodecContext' has no member named 'channel_layout'; did you mean 'ch_layout'?
  670 |     audio_frame->channel_layout = acodec->channel_layout;
      |                                           ^~~~~~~~~~~~~~
      |                                           ch_layout
SDL_ffmpeg.c:678:61: error: 'AVCodecContext' has no member named 'channels'
  678 |     int asize = avcodec_fill_audio_frame(audio_frame, acodec->channels,
      |                                                             ^~
SDL_ffmpeg.c:681:43: error: 'AVCodecContext' has no member named 'channels'
  681 |         write_samples * write_bps * acodec->channels, 1);
      |                                           ^~
SDL_ffmpeg.c: In function 'SDL_ffmpegCreateAudioFrame':
SDL_ffmpeg.c:765:140: error: 'struct AVCodecContext' has no member named 'channels'
  765 |         bytes = file->audioStream->encodeAudioInputSize * av_get_bytes_per_sample(file->audioStream->audioFormat) * file->audioStream->_ctx->channels;
      |                                                                                                                                            ^~
SDL_ffmpeg.c:768:103: error: 'struct AVCodecContext' has no member named 'channels'
  768 |         if (av_samples_alloc_array_and_samples(&frame->conversionBuffer, NULL, file->audioStream->_ctx->channels, file->audioStream->encodeAudioInputSize, file->audioStream->_ctx->sample_fmt, 0) < 0)
      |                                                                                                       ^~
SDL_ffmpeg.c: In function 'SDL_ffmpegGetAudioSpec':
SDL_ffmpeg.c:1358:59: error: 'struct AVCodecContext' has no member named 'channels'
 1358 |         spec.channels = ( uint8_t )file->audioStream->_ctx->channels;
      |                                                           ^~
SDL_ffmpeg.c: In function 'SDL_ffmpegAddAudioStream':
SDL_ffmpeg.c:1690:21: error: 'AVCodecParameters' has no member named 'channels'
 1690 |     stream->codecpar->channels = codec.channels;
      |                     ^~
SDL_ffmpeg.c:1691:23: error: 'AVCodecParameters' has no member named 'channel_layout'; did you mean 'ch_layout'?
 1691 |     stream->codecpar->channel_layout = codec.channels == 2 ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
      |                       ^~~~~~~~~~~~~~
      |                       ch_layout
SDL_ffmpeg.c:1737:74: error: 'AVCodecContext' has no member named 'channel_layout'; did you mean 'ch_layout'?
 1737 |         str->swr_context = swr_alloc_set_opts(str->swr_context, context->channel_layout, context->sample_fmt, context->sample_rate,
      |                                                                          ^~~~~~~~~~~~~~
      |                                                                          ch_layout
SDL_ffmpeg.c:1738:22: error: 'AVCodecContext' has no member named 'channel_layout'; did you mean 'ch_layout'?
 1738 |             context->channel_layout, str->audioFormat, context->sample_rate, 0, NULL);
      |                      ^~~~~~~~~~~~~~
      |                      ch_layout
SDL_ffmpeg.c:1748:79: error: 'AVCodecParameters' has no member named 'channels'
 1748 |         str->sampleBufferSize = av_samples_get_buffer_size(0, stream->codecpar->channels, stream->codecpar->frame_size, AV_SAMPLE_FMT_FLT, 0);
      |                                                                               ^~
SDL_ffmpeg.c:1750:82: error: 'AVCodecParameters' has no member named 'channels'
 1750 |         if (av_samples_alloc((uint8_t**)(&str->sampleBuffer), 0, stream->codecpar->channels, stream->codecpar->frame_size, AV_SAMPLE_FMT_FLT, 0) < 0)
      |                                                                                  ^~
SDL_ffmpeg.c:1760:81: error: 'AVCodecParameters' has no member named 'channels'
 1760 |             str->encodeAudioInputSize = str->sampleBufferSize / stream->codecpar->channels;
      |                                                                                 ^~
SDL_ffmpeg.c: In function 'SDL_ffmpegDecodeAudioFrame':
SDL_ffmpeg.c:1949:43: error: 'struct AVCodecContext' has no member named 'channels'
 1949 |     int channels = file->audioStream->_ctx->channels;
      |                                           ^~
SDL_ffmpeg.c:2024:17: error: 'AVFrame' has no member named 'channel_layout'; did you mean 'ch_layout'?
 2024 |         dframe->channel_layout |= dframe->channels == 2 ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
      |                 ^~~~~~~~~~~~~~
      |                 ch_layout
SDL_ffmpeg.c:2024:41: error: 'AVFrame' has no member named 'channels'
 2024 |         dframe->channel_layout |= dframe->channels == 2 ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
      |                                         ^~
SDL_ffmpeg.c:2026:25: error: 'AVFrame' has no member named 'channel_layout'; did you mean 'ch_layout'?
 2026 |         convertedFrame->channel_layout = dframe->channel_layout;
      |                         ^~~~~~~~~~~~~~
      |                         ch_layout
SDL_ffmpeg.c:2026:50: error: 'AVFrame' has no member named 'channel_layout'; did you mean 'ch_layout'?
 2026 |         convertedFrame->channel_layout = dframe->channel_layout;
      |                                                  ^~~~~~~~~~~~~~
      |                                                  ch_layout
SDL_ffmpeg.c:2039:79: error: 'AVFrame' has no member named 'channels'
 2039 |         int data_size = av_samples_get_buffer_size(&plane_size, convertedFrame->channels, convertedFrame->nb_samples, convertedFrame->format, 1);
      |                                                                               ^~
SDL_ffmpeg.c:2043:37: error: 'AVFrame' has no member named 'channels'
 2043 |         if (planar && convertedFrame->channels > 1)
      |                                     ^~
SDL_ffmpeg.c:2047:45: error: 'AVFrame' has no member named 'channels'
 2047 |             for (ch = 1; ch < convertedFrame->channels; ch++)
      |                                             ^~
make[3]: *** [Makefile:410: SDL_ffmpeg.o] Error 1
make[3]: *** Waiting for unfinished jobs....
Movie.cpp:120:5: error: 'AVFifoBuffer' does not name a type; did you mean 'AVBuffer'?
  120 |     AVFifoBuffer *audio_fifo;
      |     ^~~~~~~~~~~~
      |     AVBuffer
Movie.cpp: In member function 'bool Movie::Setup()':
Movie.cpp:282:9: error: 'struct libav_vars' has no member named 'audio_fifo'
  282 |     av->audio_fifo = av_fifo_alloc(262144);
      |         ^~~~~~~~~~
Movie.cpp:282:22: error: 'av_fifo_alloc' was not declared in this scope; did you mean 'av_fifo_alloc2'?
  282 |     av->audio_fifo = av_fifo_alloc(262144);
      |                      ^~~~~~~~~~~~~
      |                      av_fifo_alloc2
Movie.cpp:283:14: error: 'struct libav_vars' has no member named 'audio_fifo'
  283 |     if (!av->audio_fifo) { ThrowUserError("Could not allocate audio fifo"); return false; }
      |              ^~~~~~~~~~
Movie.cpp: In member function 'void Movie::EncodeAudio(bool)':
Movie.cpp:338:31: error: 'struct libav_vars' has no member named 'audio_fifo'
  338 |     av_fifo_generic_write(av->audio_fifo, &audiobuf[0], audiobuf.size(), NULL);
      |                               ^~~~~~~~~~
Movie.cpp:338:5: error: 'av_fifo_generic_write' was not declared in this scope; did you mean 'av_fifo_can_write'?
  338 |     av_fifo_generic_write(av->audio_fifo, &audiobuf[0], audiobuf.size(), NULL);
      |     ^~~~~~~~~~~~~~~~~~~~~
      |     av_fifo_can_write
Movie.cpp:342:28: error: 'struct AVCodecContext' has no member named 'channels'
  342 |     int channels = acodec->channels;
      |                            ^~~~~~~~
Movie.cpp:346:29: error: 'struct libav_vars' has no member named 'audio_fifo'
  346 |     while (av_fifo_size(av->audio_fifo) >= min_read)
      |                             ^~~~~~~~~~
Movie.cpp:346:12: error: 'av_fifo_size' was not declared in this scope; did you mean 'avio_size'?
  346 |     while (av_fifo_size(av->audio_fifo) >= min_read)
      |            ^~~~~~~~~~~~
      |            avio_size
In file included from ../../Source_Files/CSeries/cseries.h:102,
                 from Movie.cpp:26:
Movie.cpp:348:71: error: 'struct libav_vars' has no member named 'audio_fifo'
  348 |         int read_bytes = av->audio_frame->size = MIN(av_fifo_size(av->audio_fifo), max_read);
      |                                                                       ^~~~~~~~~~
../../Source_Files/CSeries/csmacros.h:39:20: note: in definition of macro 'MIN'
   39 | #define MIN(a,b) ((a)<=(b) ? (a) : (b))
      |                    ^
Movie.cpp:348:71: error: 'struct libav_vars' has no member named 'audio_fifo'
  348 |         int read_bytes = av->audio_frame->size = MIN(av_fifo_size(av->audio_fifo), max_read);
      |                                                                       ^~~~~~~~~~
../../Source_Files/CSeries/csmacros.h:39:31: note: in definition of macro 'MIN'
   39 | #define MIN(a,b) ((a)<=(b) ? (a) : (b))
      |                               ^
Movie.cpp:349:34: error: 'struct libav_vars' has no member named 'audio_fifo'
  349 |         av_fifo_generic_read(av->audio_fifo, av->audio_frame->buffer, read_bytes, NULL);
      |                                  ^~~~~~~~~~
Movie.cpp:349:9: error: 'av_fifo_generic_read' was not declared in this scope; did you mean 'av_fifo_can_read'?
  349 |         av_fifo_generic_read(av->audio_fifo, av->audio_frame->buffer, read_bytes, NULL);
      |         ^~~~~~~~~~~~~~~~~~~~
      |         av_fifo_can_read
Movie.cpp: In member function 'void Movie::StopRecording()':
Movie.cpp:467:13: error: 'struct libav_vars' has no member named 'audio_fifo'
  467 |     if (av->audio_fifo)
      |             ^~~~~~~~~~
Movie.cpp:469:26: error: 'struct libav_vars' has no member named 'audio_fifo'
  469 |         av_fifo_free(av->audio_fifo);
      |                          ^~~~~~~~~~
Movie.cpp:469:9: error: 'av_fifo_free' was not declared in this scope; did you mean 'av_fifo_freep2'?
  469 |         av_fifo_free(av->audio_fifo);
      |         ^~~~~~~~~~~~
      |         av_fifo_freep2
Movie.cpp:470:13: error: 'struct libav_vars' has no member named 'audio_fifo'
  470 |         av->audio_fifo = NULL;
      |             ^~~~~~~~~~
make[3]: *** [Makefile:426: Movie.o] Error 1
make[3]: Leaving directory '/root/alephone-release-20240822/Source_Files/FFmpeg'
make[2]: *** [Makefile:604: all-recursive] Error 1
make[2]: Leaving directory '/root/alephone-release-20240822/Source_Files'
make[1]: *** [Makefile:560: all-recursive] Error 1
make[1]: Leaving directory '/root/alephone-release-20240822'
make: *** [Makefile:454: all] Error 2
@treellama
Copy link
Member

We don't support ffmpeg 7, so you'll need to configure --without-ffmpeg in order to build

@cheese1
Copy link

cheese1 commented Nov 6, 2024

are there plans to support ffmpeg 7.0 in the future?

@Kolfering
Copy link
Member

There are plans to replace ffmpeg entirely

@johnyBitmap
Copy link

Thanks much for this. That allowed me to build successfully, though I'm not on Debian. So ffmpeg is disabled for now.

I wonder - is that the case why .mp3 music is not playing in scenarios that use mp3s?
As I tried, all music that uses .ogg plays just fine, it's just mp3s that are completely silent (and there's not even an error log in the terminal that they couldn't be played).

@treellama
Copy link
Member

If you disable ffmpeg, then libsndfile must be built with mp3 support. This is relatively new (last four years) and may not be enabled in your distro for license reasons.

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

5 participants