wang-bin / QtAV

A cross-platform multimedia framework based on Qt and FFmpeg. 基于Qt和FFmpeg的跨平台高性能音视频播放框架. Recommand to use new sdk https://github.com/wang-bin/mdk-sdk
http://qtav.org
3.99k stars 1.51k forks source link

Build fails with `AudioDecoderFFmpeg.cpp:103:15: error: ‘avcodec_decode_audio4’ was not declared in this scope; did you mean ‘avcodec_decode_subtitle2’?` and `AudioDecoderFFmpeg.cpp:103:15: error: ‘avcodec_decode_audio4’ was not declared in this scope; did you mean ‘avcodec_decode_subtitle2’?` #1426

Open dreirund opened 1 year ago

dreirund commented 1 year ago

QtAV, Qt version and platform

Reproduction steps

Build this software according to ↗ this PKGBUILD

Expected behavior

Clean build

Actual behavior

Fails to build for me with
AudioDecoderFFmpeg.cpp:103:15: error: ‘avcodec_decode_audio4’ was not declared in this scope; did you mean ‘avcodec_decode_subtitle2’?
and
AudioDecoderFFmpeg.cpp:148:37: error: ‘AVFrame’ {aka ‘struct AVFrame’} has no member named ‘pkt_pts’; did you mean ‘pkt_dts’?:

[...]
[ 19%] Building CXX object src/CMakeFiles/QtAV.dir/codec/audio/AudioDecoderFFmpeg.cpp.o
[...]
/tmp/makepkg/build/qtav-git/src/QtAV/src/codec/audio/AudioDecoderFFmpeg.cpp:103:15: error: ‘avcodec_decode_audio4’ was not declared in this scope; did you mean ‘avcodec_decode_subtitle2’?
  103 |         ret = avcodec_decode_audio4(d.codec_ctx, d.frame, &got_frame_ptr, &eofpkt);
      |               ^~~~~~~~~~~~~~~~~~~~~
      |               avcodec_decode_subtitle2
/tmp/makepkg/build/qtav-git/src/QtAV/src/codec/audio/AudioDecoderFFmpeg.cpp:106:15: error: ‘avcodec_decode_audio4’ was not declared in this scope; did you mean ‘avcodec_decode_subtitle2’?
  106 |         ret = avcodec_decode_audio4(d.codec_ctx, d.frame, &got_frame_ptr, (AVPacket*)packet.asAVPacket());
      |               ^~~~~~~~~~~~~~~~~~~~~
      |               avcodec_decode_subtitle2
[...]
/tmp/makepkg/build/qtav-git/src/QtAV/src/codec/audio/AudioDecoderFFmpeg.cpp:148:37: error: ‘AVFrame’ {aka ‘struct AVFrame’} has no member named ‘pkt_pts’; did you mean ‘pkt_dts’?
  148 |     f.setTimestamp((double)d.frame->pkt_pts/1000.0);
      |                                     ^~~~~~~
      |                                     pkt_dts
make[2]: *** [src/CMakeFiles/QtAV.dir/build.make:455: src/CMakeFiles/QtAV.dir/codec/audio/AudioDecoderFFmpeg.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:201: src/CMakeFiles/QtAV.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Log file

N/A, since I cannot build at all.

Sample files (optional)

N/A, since I cannot build at all.

wang-bin commented 1 year ago

they are removed in ffmpeg 6.0. you have to use new apis

dreirund commented 1 year ago

they are removed in ffmpeg 6.0. you have to use new apis

But isn't this then an issue with QtAV which needs to use new APIs, not me?

wang-bin commented 1 year ago

Yes, but i'm not maintaining this project, you have to use old ffmpeg version or modify yourself

dreirund commented 1 year ago

2023-05-08, WangBin @.***>:

Yes, but i'm not maintaining this project, you have to use old ffmpeg version or modify yourself

OK, I am confused: This project is hosted at wang-bin/QtAV, and you are wang-bin, so you seem to maintain this github project. What does it mean you are not maintaining it, and who is maintaining it?

wang-bin commented 1 year ago

no one. I'm working on other projects, this project is dead.

dreirund commented 1 year ago

2023-05-08, WangBin @.***>:

no one. I'm working on other projects, this project is dead.

OK.

can you then please add a prominent information at the top of the README.md and archive the repository?

Regards!

wang-bin commented 1 year ago

readme is updated