Skip to content

[BUG] Fails to build with libavcodec 7.1.1 #797

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

Closed
mz-pdm opened this issue Apr 15, 2025 · 4 comments
Closed

[BUG] Fails to build with libavcodec 7.1.1 #797

mz-pdm opened this issue Apr 15, 2025 · 4 comments

Comments

@mz-pdm
Copy link

mz-pdm commented Apr 15, 2025

When I try to build the apps on Fedora rawhide, I get the following compilation error:

c++ -Irpicam_app.so.1.6.0.p -I. -I.. -I/usr/include/libcamera -I/usr/include -I/usr/include/ffmpeg -I/usr/include/webp -I/usr/include/libpng16 -I/usr/include/libdrm -fdiagnostics-color=always -D_GLIBCXX_ASSERTIONS=1 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=c++17 -O3 -pedantic -Wno-unused-parameter -faligned-new -D_FILE_OFFSET_BITS=64 -Wno-psabi -DLIBAV_PRESENT=1 -DLIBDRM_PRESENT=1 -DLIBEGL_PRESENT=1 -fPIC -DWITH_GZFILEOP -pthread -DBOOST_ALL_NO_LIB -MD -MQ rpicam_app.so.1.6.0.p/encoder_libav_encoder.cpp.o -MF rpicam_app.so.1.6.0.p/encoder_libav_encoder.cpp.o.d -o rpicam_app.so.1.6.0.p/encoder_libav_encoder.cpp.o -c ../encoder/libav_encoder.cpp
../encoder/libav_encoder.cpp: In member function ‘void LibAvEncoder::initAudioOutCodec(const VideoOptions*, const StreamInfo&)’:
../encoder/libav_encoder.cpp:322:51: error: ‘AVCodec::sample_fmts’ is deprecated [-Werror=deprecated-declarations]
  322 |         codec_ctx_[AudioOut]->sample_fmt = codec->sample_fmts[0];
      |                                                   ^~~~~~~~~~~
In file included from /usr/include/ffmpeg/libavcodec/avcodec.h:41,
                 from ../encoder/libav_encoder.hpp:19,
                 from ../encoder/libav_encoder.cpp:20:
/usr/include/ffmpeg/libavcodec/codec.h:219:32: note: declared here
  219 |     const enum AVSampleFormat *sample_fmts; ///< @deprecated use avcodec_get_supported_config()
      |                                ^~~~~~~~~~~

This can be avoided by passing -Dwerror=false to meson but the default compilation shouldn't fail.

@6by9
Copy link
Collaborator

6by9 commented Apr 15, 2025

#792

Support is predominantly for Raspberry Pi OS, based off Debian, which uses FFmpeg 7.0.

FFmpeg 7.1 added avcodec_get_supported_config in April 2024 - FFmpeg/FFmpeg@3305767
FFmpeg 7.1.1 has updated and deprecated the avcodec_get_supported_config call, but that won't hit Debian until Trixie.

@naushir
Copy link
Collaborator

naushir commented Apr 22, 2025

I'll look to change #792 to add an #ifdef so that it can compile with older versions of ffmpeg like what we currently use.

@naushir
Copy link
Collaborator

naushir commented Apr 22, 2025

#800 adds and #ifdef that will conditionally compile this with our existing ffmpeg version on Raspberry Pi OS.

@naushir
Copy link
Collaborator

naushir commented Apr 22, 2025

#800 is now merged, so resolving this.

@naushir naushir closed this as completed Apr 22, 2025
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

3 participants