QtAV
QtAV copied to clipboard
QtAV is not compatible with the latest ffmpeg
Attempts to build it result in a lot of compilation errors
yes. the apis used by qtav are deprecated in ffmpeg4.x, and removed in ffmpeg 5.x
This is a (not fully complete) attempt at a minimally invasive patch to support ffmpeg 5.0. QtAV-1.13.0-ffmpeg-5.0.patch.txt
It compiles, but crashes after playing a few frames. Probably one of the AVStream->codec -> AVStream->codecpar shortcuts I've taken is too much. Got to debug this some more (or pass it to someone who has more time than myself, which is why I'm publishing the incomplete patch...)
@wang-bin
Any feedback to review and improve this patch from @berolinux to support ffmpeg 5 API ?
Thanks in advance
@cgilles I can build QtAV with ffmpeg5 at commit https://github.com/wang-bin/QtAV/commit/fdc613dc99304f208cff0bb25b3ded14bb993237 with this patch.
@rezso : this commit : https://github.com/wang-bin/QtAV/commit/fdc613dc99304f208cff0bb25b3ded14bb993237
Really ??? Do you mean to switch to mdk-sdk framework ? Definitively not for me...
Gilles Caulier
@cgilles : No. I tried the QtAV lib, not the mdk-sdk framework. But QtAV is needed for me only for digikam build, so not an important thing.
ok, so you build QtAV with ffmpeg 5, and did you use it ? It works as expected to read video ?
I just tried to compile QtAv code from git/master against ffmpeg code from git/master (aka future 5.1). QtAv do not compile at all:
Scanning dependencies of target QtAV_autogen
[ 1%] Automatic MOC for target QtAV
[ 1%] Built target QtAV_autogen
[ 2%] Generating qrc_shaders.cpp
[ 2%] Generating qrc_QtAV.cpp
Scanning dependencies of target QtAV
[ 4%] Building CXX object src/CMakeFiles/QtAV.dir/QtAV_autogen/mocs_compilation.cpp.o
[ 4%] Building CXX object src/CMakeFiles/QtAV.dir/capi/ass_api.cpp.o
[ 5%] Building CXX object src/CMakeFiles/QtAV.dir/subtitle/SubtitleProcessorLibASS.cpp.o
[ 6%] Building CXX object src/CMakeFiles/QtAV.dir/capi/openal_api.cpp.o
[ 7%] Building CXX object src/CMakeFiles/QtAV.dir/output/audio/AudioOutputOpenAL.cpp.o
[ 8%] Building CXX object src/CMakeFiles/QtAV.dir/AudioResamplerFF.cpp.o
In file included from /home/gilles/Devel/QtAV/src/AudioResamplerFF.cpp:23:
/home/gilles/Devel/QtAV/src/AudioResamplerTemplate.cpp: In member function ‘virtual bool QtAV::AudioResamplerFF::prepare()’:
/home/gilles/Devel/QtAV/src/AudioResamplerTemplate.cpp:131:100: warning: ‘int64_t av_get_default_channel_layout(int)’ is deprecated [-Wdeprecated-declarations]
131 | d.in_format.setChannelLayoutFFmpeg(av_get_default_channel_layout(d.in_format.channels())); //from mplayer2
| ^
In file included from /usr/include/libavutil/frame.h:33,
from /usr/include/libavutil/hwcontext.h:23,
from /usr/include/libavcodec/codec.h:27,
from /usr/include/libavformat/avformat.h:313,
from /home/gilles/Devel/QtAV/src/QtAV/private/AVCompat.h:47,
from /home/gilles/Devel/QtAV/src/QtAV/private/AudioResampler_p.h:26,
from /home/gilles/Devel/QtAV/src/AudioResamplerTemplate.cpp:24,
from /home/gilles/Devel/QtAV/src/AudioResamplerFF.cpp:23:
/usr/include/libavutil/channel_layout.h:457:9: note: declared here
457 | int64_t av_get_default_channel_layout(int nb_channels);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/gilles/Devel/QtAV/src/AudioResamplerFF.cpp:23:
/home/gilles/Devel/QtAV/src/AudioResamplerTemplate.cpp:134:104: warning: ‘int av_get_channel_layout_nb_channels(uint64_t)’ is deprecated [-Wdeprecated-declarations]
134 | d.in_format.setChannels(av_get_channel_layout_nb_channels(d.in_format.channelLayoutFFmpeg()));
| ^
In file included from /usr/include/libavutil/frame.h:33,
from /usr/include/libavutil/hwcontext.h:23,
from /usr/include/libavcodec/codec.h:27,
from /usr/include/libavformat/avformat.h:313,
from /home/gilles/Devel/QtAV/src/QtAV/private/AVCompat.h:47,
from /home/gilles/Devel/QtAV/src/QtAV/private/AudioResampler_p.h:26,
from /home/gilles/Devel/QtAV/src/AudioResamplerTemplate.cpp:24,
from /home/gilles/Devel/QtAV/src/AudioResamplerFF.cpp:23:
/usr/include/libavutil/channel_layout.h:449:5: note: declared here
449 | int av_get_channel_layout_nb_channels(uint64_t channel_layout);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/gilles/Devel/QtAV/src/AudioResamplerFF.cpp:23:
/home/gilles/Devel/QtAV/src/AudioResamplerTemplate.cpp:141:96: warning: ‘int64_t av_get_default_channel_layout(int)’ is deprecated [-Wdeprecated-declarations]
141 | d.in_format.setChannelLayoutFFmpeg(av_get_default_channel_layout(d.in_format.channels()));
| ^
In file included from /usr/include/libavutil/frame.h:33,
from /usr/include/libavutil/hwcontext.h:23,
from /usr/include/libavcodec/codec.h:27,
from /usr/include/libavformat/avformat.h:313,
from /home/gilles/Devel/QtAV/src/QtAV/private/AVCompat.h:47,
from /home/gilles/Devel/QtAV/src/QtAV/private/AudioResampler_p.h:26,
from /home/gilles/Devel/QtAV/src/AudioResamplerTemplate.cpp:24,
from /home/gilles/Devel/QtAV/src/AudioResamplerFF.cpp:23:
/usr/include/libavutil/channel_layout.h:457:9: note: declared here
457 | int64_t av_get_default_channel_layout(int nb_channels);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/gilles/Devel/QtAV/src/AudioResamplerFF.cpp:23:
/home/gilles/Devel/QtAV/src/AudioResamplerTemplate.cpp:145:106: warning: ‘int av_get_channel_layout_nb_channels(uint64_t)’ is deprecated [-Wdeprecated-declarations]
145 | d.out_format.setChannels(av_get_channel_layout_nb_channels(d.out_format.channelLayoutFFmpeg()));
| ^
In file included from /usr/include/libavutil/frame.h:33,
from /usr/include/libavutil/hwcontext.h:23,
from /usr/include/libavcodec/codec.h:27,
from /usr/include/libavformat/avformat.h:313,
from /home/gilles/Devel/QtAV/src/QtAV/private/AVCompat.h:47,
from /home/gilles/Devel/QtAV/src/QtAV/private/AudioResampler_p.h:26,
from /home/gilles/Devel/QtAV/src/AudioResamplerTemplate.cpp:24,
from /home/gilles/Devel/QtAV/src/AudioResamplerFF.cpp:23:
/usr/include/libavutil/channel_layout.h:449:5: note: declared here
449 | int av_get_channel_layout_nb_channels(uint64_t channel_layout);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/gilles/Devel/QtAV/src/AudioResamplerFF.cpp:23:
/home/gilles/Devel/QtAV/src/AudioResamplerTemplate.cpp:157:98: warning: ‘int64_t av_get_default_channel_layout(int)’ is deprecated [-Wdeprecated-declarations]
157 | d.out_format.setChannelLayoutFFmpeg(av_get_default_channel_layout(d.out_format.channels()));
| ^
In file included from /usr/include/libavutil/frame.h:33,
from /usr/include/libavutil/hwcontext.h:23,
from /usr/include/libavcodec/codec.h:27,
from /usr/include/libavformat/avformat.h:313,
from /home/gilles/Devel/QtAV/src/QtAV/private/AVCompat.h:47,
from /home/gilles/Devel/QtAV/src/QtAV/private/AudioResampler_p.h:26,
from /home/gilles/Devel/QtAV/src/AudioResamplerTemplate.cpp:24,
from /home/gilles/Devel/QtAV/src/AudioResamplerFF.cpp:23:
/usr/include/libavutil/channel_layout.h:457:9: note: declared here
457 | int64_t av_get_default_channel_layout(int nb_channels);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/gilles/Devel/QtAV/src/AudioResamplerFF.cpp:23:
/home/gilles/Devel/QtAV/src/AudioResamplerTemplate.cpp:179:69: warning: ‘SwrContext* swr_alloc_set_opts(SwrContext*, int64_t, AVSampleFormat, int, int64_t, AVSampleFormat, int, int, void*)’ is deprecated [-Wdeprecated-declarations]
179 | , 0 /*log_offset*/, 0 /*log_ctx*/);
| ^
In file included from /home/gilles/Devel/QtAV/src/QtAV/private/AVCompat.h:74,
from /home/gilles/Devel/QtAV/src/QtAV/private/AudioResampler_p.h:26,
from /home/gilles/Devel/QtAV/src/AudioResamplerTemplate.cpp:24,
from /home/gilles/Devel/QtAV/src/AudioResamplerFF.cpp:23:
/usr/include/libswresample/swresample.h:260:20: note: declared here
260 | struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
| ^~~~~~~~~~~~~~~~~~
[ 9%] Building CXX object src/CMakeFiles/QtAV.dir/AVCompat.cpp.o
[ 10%] Building CXX object src/CMakeFiles/QtAV.dir/QtAV_Global.cpp.o
/home/gilles/Devel/QtAV/src/subtitle/SubtitleProcessorLibASS.cpp: In function ‘void QtAV::ass_msg_cb(int, const char*, __va_list_tag*, void*)’:
/home/gilles/Devel/QtAV/src/subtitle/SubtitleProcessorLibASS.cpp:118:73: warning: ‘QString& QString::vsprintf(const char*, __va_list_tag*)’ is deprecated: Use vasprintf(), arg() or QTextStream instead [-Wdeprecated-declarations]
118 | QString msg(QStringLiteral("{libass} ") + QString().vsprintf(fmt, va)); //QString.vsprintf() may crash at strlen().
| ^
In file included from /usr/include/qt5/QtCore/qhashfunctions.h:44,
from /usr/include/qt5/QtCore/qlist.h:47,
from /usr/include/qt5/QtCore/QList:1,
from /home/gilles/Devel/QtAV/src/QtAV/private/SubtitleProcessor.h:25,
from /home/gilles/Devel/QtAV/src/subtitle/SubtitleProcessorLibASS.cpp:22:
/usr/include/qt5/QtCore/qstring.h:391:14: note: declared here
391 | QString &vsprintf(const char *format, va_list ap) Q_ATTRIBUTE_FORMAT_PRINTF(2, 0);
| ^~~~~~~~
In file included from /home/gilles/Devel/QtAV/build/src/QtAV_autogen/NWVRT4SIGP/../../../../src/codec/video/VideoDecoderFFmpegBase.h:26,
from /home/gilles/Devel/QtAV/build/src/QtAV_autogen/NWVRT4SIGP/../../../../src/codec/video/VideoDecoderFFmpegHW.h:25,
from /home/gilles/Devel/QtAV/build/src/QtAV_autogen/NWVRT4SIGP/moc_VideoDecoderFFmpegHW.cpp:10,
from /home/gilles/Devel/QtAV/build/src/QtAV_autogen/mocs_compilation.cpp:32:
/home/gilles/Devel/QtAV/src/QtAV/private/AVDecoder_p.h: In static member function ‘static const char* QtAV::AVDecoderPrivate::getProfileName(AVCodecID, int)’:
/home/gilles/Devel/QtAV/src/QtAV/private/AVDecoder_p.h:81:42: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive]
81 | AVCodec *c = avcodec_find_decoder(id);
| ~~~~~~~~~~~~~~~~~~~~^~~~
| |
| const AVCodec*
[ 11%] Building CXX object src/CMakeFiles/QtAV.dir/subtitle/CharsetDetector.cpp.o
/home/gilles/Devel/QtAV/src/AVCompat.cpp: In function ‘const char* get_codec_long_name(AVCodecID)’:
/home/gilles/Devel/QtAV/src/AVCompat.cpp:394:42: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive]
394 | AVCodec *codec = avcodec_find_decoder(id);
| ~~~~~~~~~~~~~~~~~~~~^~~~
| |
| const AVCodec*
/home/gilles/Devel/QtAV/src/AVCompat.cpp:397:33: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive]
397 | codec = avcodec_find_encoder(id);
| ~~~~~~~~~~~~~~~~~~~~^~~~
| |
| const AVCodec*
make[2]: *** [src/CMakeFiles/QtAV.dir/build.make:175: src/CMakeFiles/QtAV.dir/AVCompat.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [src/CMakeFiles/QtAV.dir/build.make:97: src/CMakeFiles/QtAV.dir/QtAV_autogen/mocs_compilation.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:136: src/CMakeFiles/QtAV.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
@wang-bin: so this entry still valid and need to be fixed. Please review the patch from @ElderOrb
Best
Gilles Caulier
Hello, I trying to package QtAV for Mageia 9. We have switched to ffmpeg 5. Thus I applied the berolinux's patch above to the latest release 1.13.0. It seems that compilation passes with ffmpeg part, but I'm stick with this error:
make[1]: Entering directory '/builddir/build/BUILD/QtAV-1.13.0/src'
g++ -c -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fasynchronous-unwind-tables -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fasynchronous-unwind-tables -fno-strict-aliasing -DPIC -fPIC -Wall -Wextra -D_REENTRANT -fPIC -DBUILD_QTAV_LIB -DLINK_UCHARDET -DQTAV_HAVE_CAPI=1 -DQTAV_HAVE_SSE4_1=1 -DQTAV_HAVE_SSE2=1 -DQTAV_HAVE_EGL_CAPI=1 -D__STDC_CONSTANT_MACROS -DQTAV_HAVE_X11=1 -DQTAV_HAVE_SWRESAMPLE=1 -DQTAV_HAVE_AVDEVICE=1 -DQTAV_HAVE_AVFILTER=1 -DQTAV_HAVE_OPENAL=1 -DQTAV_HAVE_PULSEAUDIO=1 -DQTAV_HAVE_CUDA=1 -DQTAV_HAVE_QT_EGL=1 -DQTAV_HAVE_LIBASS=1 -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/usr/include/qt5 -I. -I/builddir/build/BUILD/QtAV-1.13.0 -IQtAV -I../contrib/capi -Icuda -Icuda/dllapi -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I../.moc/5.15.2/QtAV -I/usr/lib64/qt5/mkspecs/linux-g++ -o ../.obj/QtAV_linux_x86_64/VideoDecoderCUDA.o codec/video/VideoDecoderCUDA.cpp
make[1]: Leaving directory '/builddir/build/BUILD/QtAV-1.13.0/src'
In file included from ./cuda/helper_cuda.h:25,
from codec/video/VideoDecoderCUDA.cpp:44:
./cuda/dllapi/nv_inc.h:30:1: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
30 | #if !NV_CONFIG(DLLAPI_CUDA) && !defined(CUDA_LINK)
| ^~~~~~~~~~~~~~~~~~~~~
./cuda/dllapi/nv_inc.h:35:1: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
35 | #if NV_CONFIG(DLLAPI_CUDA)
| ^~~~~~~~~~~~~~~~~~~~~
./cuda/dllapi/nv_inc.h:61:1: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
61 | #if NV_CONFIG(DLLAPI_CUDA)
| ^~~~~~~~~~~~~~~~~~~~~
./cuda/helper_cuda.h:26:1: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
26 | #if NV_CONFIG(DLLAPI_CUDA)
| ^~~~~~~~~~~~~~~~~~~~~
In file included from codec/video/VideoDecoderCUDA.cpp:45:
./cuda/cuda_api.h:48:1: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
48 | #if !NV_CONFIG(DLLAPI_CUDA) && !defined(CUDA_LINK)
| ^~~~~~~~~~~~~~~~~~~~~
codec/video/VideoDecoderCUDA.cpp:323:5: error: 'AVBitStreamFilterContext' does not name a type
323 | AVBitStreamFilterContext *bsf; //TODO: rename bsf_ctx
| ^~~~~~~~~~~~~~~~~~~~~~~~
codec/video/VideoDecoderCUDA.cpp: In constructor 'QtAV::VideoDecoderCUDAPrivate::VideoDecoderCUDAPrivate()':
codec/video/VideoDecoderCUDA.cpp:167:9: error: 'bsf' was not declared in this scope
167 | bsf = 0;
| ^~~
codec/video/VideoDecoderCUDA.cpp: In destructor 'virtual QtAV::VideoDecoderCUDAPrivate::~VideoDecoderCUDAPrivate()':
codec/video/VideoDecoderCUDA.cpp:186:13: error: 'bsf' was not declared in this scope
186 | if (bsf)
| ^~~
codec/video/VideoDecoderCUDA.cpp:187:13: error: 'av_bitstream_filter_close' was not declared in this scope
187 | av_bitstream_filter_close(bsf);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
codec/video/VideoDecoderCUDA.cpp: In member function 'virtual bool QtAV::VideoDecoderCUDA::decode(const QtAV::Packet&)':
codec/video/VideoDecoderCUDA.cpp:391:11: error: 'class QtAV::VideoDecoderCUDAPrivate' has no member named 'bsf'
391 | if (d.bsf) {
| ^~~
codec/video/VideoDecoderCUDA.cpp:394:49: error: 'class QtAV::VideoDecoderCUDAPrivate' has no member named 'bsf'
394 | filtered = av_bitstream_filter_filter(d.bsf, d.codec_ctx, NULL, &outBuf, &outBufSize
| ^~~
codec/video/VideoDecoderCUDA.cpp:394:20: error: 'av_bitstream_filter_filter' was not declared in this scope
394 | filtered = av_bitstream_filter_filter(d.bsf, d.codec_ctx, NULL, &outBuf, &outBufSize
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
codec/video/VideoDecoderCUDA.cpp: In member function 'void QtAV::VideoDecoderCUDAPrivate::setBSF(AVCodecID)':
codec/video/VideoDecoderCUDA.cpp:782:14: error: 'bsf' was not declared in this scope
782 | if (!bsf)
| ^~~
codec/video/VideoDecoderCUDA.cpp:783:19: error: 'av_bitstream_filter_init' was not declared in this scope
783 | bsf = av_bitstream_filter_init("h264_mp4toannexb");
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/qt5/QtCore/qmetatype.h:45,
from /usr/include/qt5/QtCore/QMetaType:1,
from ./QtAV/QtAV_Global.h:27,
from ./QtAV/AVError.h:24,
from ./QtAV/AVDecoder.h:25,
from ./QtAV/VideoDecoder.h:25,
from codec/video/VideoDecoderCUDA.cpp:22:
codec/video/VideoDecoderCUDA.cpp:784:18: error: 'bsf' was not declared in this scope
784 | Q_ASSERT(bsf && "h264_mp4toannexb bsf not found");
| ^~~
/usr/include/qt5/QtCore/qglobal.h:857:56: note: in definition of macro 'Q_ASSERT'
857 | # define Q_ASSERT(cond) static_cast<void>(false && (cond))
| ^~~~
codec/video/VideoDecoderCUDA.cpp:786:14: error: 'bsf' was not declared in this scope
786 | if (!bsf)
| ^~~
codec/video/VideoDecoderCUDA.cpp:787:19: error: 'av_bitstream_filter_init' was not declared in this scope
787 | bsf = av_bitstream_filter_init("hevc_mp4toannexb");
| ^~~~~~~~~~~~~~~~~~~~~~~~
codec/video/VideoDecoderCUDA.cpp:788:18: error: 'bsf' was not declared in this scope
788 | Q_ASSERT(bsf && "hevc_mp4toannexb bsf not found");
| ^~~
/usr/include/qt5/QtCore/qglobal.h:857:56: note: in definition of macro 'Q_ASSERT'
857 | # define Q_ASSERT(cond) static_cast<void>(false && (cond))
| ^~~~
codec/video/VideoDecoderCUDA.cpp:790:13: error: 'bsf' was not declared in this scope
790 | if (bsf) {
| ^~~
codec/video/VideoDecoderCUDA.cpp:791:13: error: 'av_bitstream_filter_close' was not declared in this scope
791 | av_bitstream_filter_close(bsf);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [Makefile.libQtAV:1409: ../.obj/QtAV_linux_x86_64/VideoDecoderCUDA.o]
The build is done with qmake. I tried with cmake, but got another error. The process build is more or less with this spec file, by adding the patch : https://svnweb.mageia.org/packages/cauldron/qtav/current/SPECS/qtav.spec?view=markup Any clue? Compiler is GCC 12.
I use @berolinux's patch and add some more patches in this fork: https://github.com/cmguo/QtAV.
I use @berolinux's patch and add some more patches in this fork: https://github.com/cmguo/QtAV.
Thanks for your contribution. I got a tarball from your repository, but the build fails with:
usr/bin/c++ -fPIC -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fasynchronous-unwind-tables -DNDEBUG -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -Wl,--build-id=sha1 -Wl,--enable-new-dtags -shared -Wl,-soname,libQtAV.so.1 -o ../lib/libQtAV.so.1.13.0 CMakeFiles/QtAV.dir/QtAV_autogen/mocs_compilation.cpp.o CMakeFiles/QtAV.dir/capi/ass_api.cpp.o CMakeFiles/QtAV.dir/subtitle/SubtitleProcessorLibASS.cpp.o CMakeFiles/QtAV.dir/capi/openal_api.cpp.o CMakeFiles/QtAV.dir/output/audio/AudioOutputOpenAL.cpp.o CMakeFiles/QtAV.dir/AudioResamplerFF.cpp.o CMakeFiles/QtAV.dir/AVCompat.cpp.o CMakeFiles/QtAV.dir/QtAV_Global.cpp.o CMakeFiles/QtAV.dir/subtitle/CharsetDetector.cpp.o CMakeFiles/QtAV.dir/subtitle/PlainText.cpp.o CMakeFiles/QtAV.dir/subtitle/PlayerSubtitle.cpp.o CMakeFiles/QtAV.dir/subtitle/Subtitle.cpp.o CMakeFiles/QtAV.dir/subtitle/SubtitleProcessor.cpp.o CMakeFiles/QtAV.dir/subtitle/SubtitleProcessorFFmpeg.cpp.o CMakeFiles/QtAV.dir/subtitle/SubImage.cpp.o CMakeFiles/QtAV.dir/utils/GPUMemCopy.cpp.o CMakeFiles/QtAV.dir/utils/Logger.cpp.o CMakeFiles/QtAV.dir/AudioThread.cpp.o CMakeFiles/QtAV.dir/utils/internal.cpp.o CMakeFiles/QtAV.dir/AVThread.cpp.o CMakeFiles/QtAV.dir/AudioFormat.cpp.o CMakeFiles/QtAV.dir/AudioFrame.cpp.o CMakeFiles/QtAV.dir/AudioResampler.cpp.o CMakeFiles/QtAV.dir/AudioResamplerTemplate.cpp.o CMakeFiles/QtAV.dir/codec/audio/AudioDecoder.cpp.o CMakeFiles/QtAV.dir/codec/audio/AudioDecoderFFmpeg.cpp.o CMakeFiles/QtAV.dir/codec/audio/AudioEncoder.cpp.o CMakeFiles/QtAV.dir/codec/audio/AudioEncoderFFmpeg.cpp.o CMakeFiles/QtAV.dir/codec/AVDecoder.cpp.o CMakeFiles/QtAV.dir/codec/AVEncoder.cpp.o CMakeFiles/QtAV.dir/AVMuxer.cpp.o CMakeFiles/QtAV.dir/AVDemuxer.cpp.o CMakeFiles/QtAV.dir/AVDemuxThread.cpp.o CMakeFiles/QtAV.dir/ColorTransform.cpp.o CMakeFiles/QtAV.dir/Frame.cpp.o CMakeFiles/QtAV.dir/FrameReader.cpp.o CMakeFiles/QtAV.dir/filter/Filter.cpp.o CMakeFiles/QtAV.dir/filter/FilterContext.cpp.o CMakeFiles/QtAV.dir/filter/FilterManager.cpp.o CMakeFiles/QtAV.dir/filter/LibAVFilter.cpp.o CMakeFiles/QtAV.dir/filter/SubtitleFilter.cpp.o CMakeFiles/QtAV.dir/filter/EncodeFilter.cpp.o CMakeFiles/QtAV.dir/ImageConverter.cpp.o CMakeFiles/QtAV.dir/ImageConverterFF.cpp.o CMakeFiles/QtAV.dir/Packet.cpp.o CMakeFiles/QtAV.dir/PacketBuffer.cpp.o CMakeFiles/QtAV.dir/AVError.cpp.o CMakeFiles/QtAV.dir/AVPlayer.cpp.o CMakeFiles/QtAV.dir/AVPlayerPrivate.cpp.o CMakeFiles/QtAV.dir/AVTranscoder.cpp.o CMakeFiles/QtAV.dir/AVClock.cpp.o CMakeFiles/QtAV.dir/VideoCapture.cpp.o CMakeFiles/QtAV.dir/VideoFormat.cpp.o CMakeFiles/QtAV.dir/VideoFrame.cpp.o CMakeFiles/QtAV.dir/io/MediaIO.cpp.o CMakeFiles/QtAV.dir/io/QIODeviceIO.cpp.o CMakeFiles/QtAV.dir/output/audio/AudioOutput.cpp.o CMakeFiles/QtAV.dir/output/audio/AudioOutputBackend.cpp.o CMakeFiles/QtAV.dir/output/audio/AudioOutputNull.cpp.o CMakeFiles/QtAV.dir/output/video/VideoRenderer.cpp.o CMakeFiles/QtAV.dir/output/video/VideoOutput.cpp.o CMakeFiles/QtAV.dir/output/video/QPainterRenderer.cpp.o CMakeFiles/QtAV.dir/output/AVOutput.cpp.o CMakeFiles/QtAV.dir/output/OutputSet.cpp.o CMakeFiles/QtAV.dir/Statistics.cpp.o CMakeFiles/QtAV.dir/codec/video/VideoDecoder.cpp.o CMakeFiles/QtAV.dir/codec/video/VideoDecoderFFmpegBase.cpp.o CMakeFiles/QtAV.dir/codec/video/VideoDecoderFFmpeg.cpp.o CMakeFiles/QtAV.dir/codec/video/VideoDecoderFFmpegHW.cpp.o CMakeFiles/QtAV.dir/codec/video/VideoEncoder.cpp.o CMakeFiles/QtAV.dir/codec/video/VideoEncoderFFmpeg.cpp.o CMakeFiles/QtAV.dir/VideoThread.cpp.o CMakeFiles/QtAV.dir/VideoFrameExtractor.cpp.o CMakeFiles/QtAV.dir/opengl/ConvolutionShader.cpp.o CMakeFiles/QtAV.dir/opengl/Geometry.cpp.o CMakeFiles/QtAV.dir/opengl/GeometryRenderer.cpp.o CMakeFiles/QtAV.dir/opengl/OpenGLHelper.cpp.o CMakeFiles/QtAV.dir/opengl/OpenGLTypes.cpp.o CMakeFiles/QtAV.dir/opengl/OpenGLVideo.cpp.o CMakeFiles/QtAV.dir/opengl/ShaderManager.cpp.o CMakeFiles/QtAV.dir/opengl/SubImagesGeometry.cpp.o CMakeFiles/QtAV.dir/opengl/SubImagesRenderer.cpp.o CMakeFiles/QtAV.dir/opengl/VideoShader.cpp.o CMakeFiles/QtAV.dir/opengl/VideoShaderObject.cpp.o CMakeFiles/QtAV.dir/opengl/gl_api.cpp.o CMakeFiles/QtAV.dir/filter/GLSLFilter.cpp.o CMakeFiles/QtAV.dir/output/video/OpenGLRendererBase.cpp.o CMakeFiles/QtAV.dir/output/video/OpenGLWindowRenderer.cpp.o CMakeFiles/QtAV.dir/output/audio/AudioOutputPortAudio.cpp.o CMakeFiles/QtAV.dir/output/audio/AudioOutputPulse.cpp.o CMakeFiles/QtAV.dir/qrc_QtAV.cpp.o CMakeFiles/QtAV.dir/qrc_shaders.cpp.o -L/builddir/build/BUILD/QtAV-master/external/lib -lass -lopenal -lportaudio -lpulse /usr/lib64/libQt5Gui.so.5.15.7 -lavformat -lavcodec -lswscale -lavutil -lavfilter -lavdevice -lswresample /usr/lib64/libQt5Core.so.5.15.7
/usr/bin/ld: CMakeFiles/QtAV.dir/opengl/GeometryRenderer.cpp.o: in function `QtAV::GeometryRenderer::render()':
/builddir/build/BUILD/QtAV-master/src/opengl/GeometryRenderer.cpp:270: undefined reference to `glDrawElements'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/GeometryRenderer.cpp:272: undefined reference to `glDrawArrays'
/usr/bin/ld: CMakeFiles/QtAV.dir/opengl/OpenGLHelper.cpp.o: in function `QtAV::OpenGLHelper::GLSLVersion()':
/builddir/build/BUILD/QtAV-master/src/opengl/OpenGLHelper.cpp:140: undefined reference to `glGetString'
/usr/bin/ld: CMakeFiles/QtAV.dir/opengl/OpenGLHelper.cpp.o: in function `QtAV::OpenGLHelper::test_gl_param(QtAV::OpenGLHelper::gl_param_t const&, bool*)':
/builddir/build/BUILD/QtAV-master/src/opengl/OpenGLHelper.cpp:357: undefined reference to `glGenTextures'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/OpenGLHelper.cpp:358: undefined reference to `glBindTexture'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/OpenGLHelper.cpp:359: undefined reference to `glGetError'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/OpenGLHelper.cpp:360: undefined reference to `glTexImage2D'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/OpenGLHelper.cpp:361: undefined reference to `glGetError'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/OpenGLHelper.cpp:382: undefined reference to `glDeleteTextures'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/OpenGLHelper.cpp:367: undefined reference to `glDeleteTextures'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/OpenGLHelper.cpp:378: undefined reference to `glDeleteTextures'
/usr/bin/ld: CMakeFiles/QtAV.dir/opengl/OpenGLVideo.cpp.o: in function `QtAV::OpenGLVideo::fill(QColor const&)':
/builddir/build/BUILD/QtAV-master/src/opengl/OpenGLVideo.cpp:340: undefined reference to `glClearColor'
/usr/bin/ld: CMakeFiles/QtAV.dir/opengl/OpenGLVideo.cpp.o: in function `QtAV::OpenGLVideo::setOpenGLContext(QOpenGLContext*)':
/builddir/build/BUILD/QtAV-master/src/opengl/OpenGLVideo.cpp:233: undefined reference to `glGetString'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/OpenGLVideo.cpp:234: undefined reference to `glGetString'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/OpenGLVideo.cpp:235: undefined reference to `glGetString'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/OpenGLVideo.cpp:236: undefined reference to `glGetString'
/usr/bin/ld: CMakeFiles/QtAV.dir/opengl/OpenGLVideo.cpp.o: in function `QtAV::OpenGLVideo::render(QRectF const&, QRectF const&, QMatrix4x4 const&)':
/builddir/build/BUILD/QtAV-master/src/opengl/OpenGLVideo.cpp:359: undefined reference to `glViewport'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/OpenGLVideo.cpp:367: undefined reference to `glEnable'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/OpenGLVideo.cpp:374: undefined reference to `glDisable'
/usr/bin/ld: CMakeFiles/QtAV.dir/opengl/OpenGLVideo.cpp.o: in function `QtAV::OpenGLVideo::setViewport(QRectF const&)':
/builddir/build/BUILD/QtAV-master/src/opengl/OpenGLVideo.cpp:286: undefined reference to `glViewport'
/usr/bin/ld: CMakeFiles/QtAV.dir/opengl/OpenGLVideo.cpp.o: in function `QtAV::OpenGLVideo::fill(QColor const&)':
/builddir/build/BUILD/QtAV-master/src/opengl/OpenGLVideo.cpp:341: undefined reference to `glClear'
/usr/bin/ld: CMakeFiles/QtAV.dir/opengl/SubImagesRenderer.cpp.o: in function `QtAV::SubImagesRenderer::uploadTexture(QtAV::SubImagesGeometry*)':
/builddir/build/BUILD/QtAV-master/src/opengl/SubImagesRenderer.cpp:123: undefined reference to `glBindTexture'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/SubImagesRenderer.cpp:124: undefined reference to `glTexParameteri'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/SubImagesRenderer.cpp:125: undefined reference to `glTexParameteri'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/SubImagesRenderer.cpp:126: undefined reference to `glTexParameteri'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/SubImagesRenderer.cpp:127: undefined reference to `glTexParameteri'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/SubImagesRenderer.cpp:128: undefined reference to `glTexImage2D'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/SubImagesRenderer.cpp:133: undefined reference to `glTexSubImage2D'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/SubImagesRenderer.cpp:136: undefined reference to `glBindTexture'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/SubImagesRenderer.cpp:114: undefined reference to `glGenTextures'
/usr/bin/ld: CMakeFiles/QtAV.dir/opengl/SubImagesRenderer.cpp.o: in function `QtAV::SubImagesRenderer::render(QtAV::SubImageSet const&, QRect const&, QMatrix4x4 const&)':
/builddir/build/BUILD/QtAV-master/src/opengl/SubImagesRenderer.cpp:91: undefined reference to `glBindTexture'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/SubImagesRenderer.cpp:94: undefined reference to `glEnable'
/usr/bin/ld: /builddir/build/BUILD/QtAV-master/src/opengl/SubImagesRenderer.cpp:102: undefined reference to `glDisable'
/usr/bin/ld: CMakeFiles/QtAV.dir/opengl/VideoShader.cpp.o: in function `QtAV::VideoShader::build(QOpenGLShaderProgram*)':
/builddir/build/BUILD/QtAV-master/src/opengl/VideoShader.cpp:443: undefined reference to `glGetIntegerv'
I tried also with the option BUILD_QT5OPENGL=OFF, but fails in the same manner.
@papoteur-mga Try building with the "Qt Creator".
@papoteur-mga Try building with the "Qt Creator".
Hum, this is not really an option. The goal is to have it packaged in Mageia distribution, thus to be build by our buildsystem.
I have tried in the targeted system, importing the last snapshot in qt-creator. And indeed, this works. I installed the libraries already listed for the build. This includes GL, EGL, GLES, GLES2 and GLES3. Thus it seems that the libraries are found from within qt-creator, but when building as standalone.
I have tried in the targeted system, importing the last snapshot in qt-creator. And indeed, this works. I installed the libraries already listed for the build. This includes GL, EGL, GLES, GLES2 and GLES3. Thus it seems that the libraries are found from within qt-creator, but when building as standalone.
I found that a difference with our standalone build and within qt-creator is the build type.
In qt-creator I successfull build in Release and Debug mode, but fail in Release With Debug Information with
/home/yves/cauldron/qtav/SOURCES/QtAV-master/src/capi/ass_api.cpp:26:10: fatal error: capi.h: No such file or directory
26 | #include "capi.h"
| ^~~~~~~~
This is the latest build mode that we use.
Hello, I trying to package QtAV for Mageia 9. We have switched to ffmpeg 5. Thus I applied the berolinux's patch above to the latest release 1.13.0. It seems that compilation passes with ffmpeg part, but I'm stick with this error:
make[1]: Entering directory '/builddir/build/BUILD/QtAV-1.13.0/src' g++ -c -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fasynchronous-unwind-tables -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fasynchronous-unwind-tables -fno-strict-aliasing -DPIC -fPIC -Wall -Wextra -D_REENTRANT -fPIC -DBUILD_QTAV_LIB -DLINK_UCHARDET -DQTAV_HAVE_CAPI=1 -DQTAV_HAVE_SSE4_1=1 -DQTAV_HAVE_SSE2=1 -DQTAV_HAVE_EGL_CAPI=1 -D__STDC_CONSTANT_MACROS -DQTAV_HAVE_X11=1 -DQTAV_HAVE_SWRESAMPLE=1 -DQTAV_HAVE_AVDEVICE=1 -DQTAV_HAVE_AVFILTER=1 -DQTAV_HAVE_OPENAL=1 -DQTAV_HAVE_PULSEAUDIO=1 -DQTAV_HAVE_CUDA=1 -DQTAV_HAVE_QT_EGL=1 -DQTAV_HAVE_LIBASS=1 -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/usr/include/qt5 -I. -I/builddir/build/BUILD/QtAV-1.13.0 -IQtAV -I../contrib/capi -Icuda -Icuda/dllapi -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I../.moc/5.15.2/QtAV -I/usr/lib64/qt5/mkspecs/linux-g++ -o ../.obj/QtAV_linux_x86_64/VideoDecoderCUDA.o codec/video/VideoDecoderCUDA.cpp make[1]: Leaving directory '/builddir/build/BUILD/QtAV-1.13.0/src' In file included from ./cuda/helper_cuda.h:25, from codec/video/VideoDecoderCUDA.cpp:44: ./cuda/dllapi/nv_inc.h:30:1: warning: this use of "defined" may not be portable [-Wexpansion-to-defined] 30 | #if !NV_CONFIG(DLLAPI_CUDA) && !defined(CUDA_LINK) | ^~~~~~~~~~~~~~~~~~~~~ ./cuda/dllapi/nv_inc.h:35:1: warning: this use of "defined" may not be portable [-Wexpansion-to-defined] 35 | #if NV_CONFIG(DLLAPI_CUDA) | ^~~~~~~~~~~~~~~~~~~~~ ./cuda/dllapi/nv_inc.h:61:1: warning: this use of "defined" may not be portable [-Wexpansion-to-defined] 61 | #if NV_CONFIG(DLLAPI_CUDA) | ^~~~~~~~~~~~~~~~~~~~~ ./cuda/helper_cuda.h:26:1: warning: this use of "defined" may not be portable [-Wexpansion-to-defined] 26 | #if NV_CONFIG(DLLAPI_CUDA) | ^~~~~~~~~~~~~~~~~~~~~ In file included from codec/video/VideoDecoderCUDA.cpp:45: ./cuda/cuda_api.h:48:1: warning: this use of "defined" may not be portable [-Wexpansion-to-defined] 48 | #if !NV_CONFIG(DLLAPI_CUDA) && !defined(CUDA_LINK) | ^~~~~~~~~~~~~~~~~~~~~ codec/video/VideoDecoderCUDA.cpp:323:5: error: 'AVBitStreamFilterContext' does not name a type 323 | AVBitStreamFilterContext *bsf; //TODO: rename bsf_ctx | ^~~~~~~~~~~~~~~~~~~~~~~~ codec/video/VideoDecoderCUDA.cpp: In constructor 'QtAV::VideoDecoderCUDAPrivate::VideoDecoderCUDAPrivate()': codec/video/VideoDecoderCUDA.cpp:167:9: error: 'bsf' was not declared in this scope 167 | bsf = 0; | ^~~ codec/video/VideoDecoderCUDA.cpp: In destructor 'virtual QtAV::VideoDecoderCUDAPrivate::~VideoDecoderCUDAPrivate()': codec/video/VideoDecoderCUDA.cpp:186:13: error: 'bsf' was not declared in this scope 186 | if (bsf) | ^~~ codec/video/VideoDecoderCUDA.cpp:187:13: error: 'av_bitstream_filter_close' was not declared in this scope 187 | av_bitstream_filter_close(bsf); | ^~~~~~~~~~~~~~~~~~~~~~~~~ codec/video/VideoDecoderCUDA.cpp: In member function 'virtual bool QtAV::VideoDecoderCUDA::decode(const QtAV::Packet&)': codec/video/VideoDecoderCUDA.cpp:391:11: error: 'class QtAV::VideoDecoderCUDAPrivate' has no member named 'bsf' 391 | if (d.bsf) { | ^~~ codec/video/VideoDecoderCUDA.cpp:394:49: error: 'class QtAV::VideoDecoderCUDAPrivate' has no member named 'bsf' 394 | filtered = av_bitstream_filter_filter(d.bsf, d.codec_ctx, NULL, &outBuf, &outBufSize | ^~~ codec/video/VideoDecoderCUDA.cpp:394:20: error: 'av_bitstream_filter_filter' was not declared in this scope 394 | filtered = av_bitstream_filter_filter(d.bsf, d.codec_ctx, NULL, &outBuf, &outBufSize | ^~~~~~~~~~~~~~~~~~~~~~~~~~ codec/video/VideoDecoderCUDA.cpp: In member function 'void QtAV::VideoDecoderCUDAPrivate::setBSF(AVCodecID)': codec/video/VideoDecoderCUDA.cpp:782:14: error: 'bsf' was not declared in this scope 782 | if (!bsf) | ^~~ codec/video/VideoDecoderCUDA.cpp:783:19: error: 'av_bitstream_filter_init' was not declared in this scope 783 | bsf = av_bitstream_filter_init("h264_mp4toannexb"); | ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/qt5/QtCore/qmetatype.h:45, from /usr/include/qt5/QtCore/QMetaType:1, from ./QtAV/QtAV_Global.h:27, from ./QtAV/AVError.h:24, from ./QtAV/AVDecoder.h:25, from ./QtAV/VideoDecoder.h:25, from codec/video/VideoDecoderCUDA.cpp:22: codec/video/VideoDecoderCUDA.cpp:784:18: error: 'bsf' was not declared in this scope 784 | Q_ASSERT(bsf && "h264_mp4toannexb bsf not found"); | ^~~ /usr/include/qt5/QtCore/qglobal.h:857:56: note: in definition of macro 'Q_ASSERT' 857 | # define Q_ASSERT(cond) static_cast<void>(false && (cond)) | ^~~~ codec/video/VideoDecoderCUDA.cpp:786:14: error: 'bsf' was not declared in this scope 786 | if (!bsf) | ^~~ codec/video/VideoDecoderCUDA.cpp:787:19: error: 'av_bitstream_filter_init' was not declared in this scope 787 | bsf = av_bitstream_filter_init("hevc_mp4toannexb"); | ^~~~~~~~~~~~~~~~~~~~~~~~ codec/video/VideoDecoderCUDA.cpp:788:18: error: 'bsf' was not declared in this scope 788 | Q_ASSERT(bsf && "hevc_mp4toannexb bsf not found"); | ^~~ /usr/include/qt5/QtCore/qglobal.h:857:56: note: in definition of macro 'Q_ASSERT' 857 | # define Q_ASSERT(cond) static_cast<void>(false && (cond)) | ^~~~ codec/video/VideoDecoderCUDA.cpp:790:13: error: 'bsf' was not declared in this scope 790 | if (bsf) { | ^~~ codec/video/VideoDecoderCUDA.cpp:791:13: error: 'av_bitstream_filter_close' was not declared in this scope 791 | av_bitstream_filter_close(bsf); | ^~~~~~~~~~~~~~~~~~~~~~~~~ make[1]: *** [Makefile.libQtAV:1409: ../.obj/QtAV_linux_x86_64/VideoDecoderCUDA.o]The build is done with qmake. I tried with cmake, but got another error. The process build is more or less with this spec file, by adding the patch : https://svnweb.mageia.org/packages/cauldron/qtav/current/SPECS/qtav.spec?view=markup Any clue? Compiler is GCC 12.
Have you solved this problem? How to solve it?
Hello, I trying to package QtAV for Mageia 9. We have switched to ffmpeg 5. Thus I applied the berolinux's patch above to the latest release 1.13.0. It seems that compilation passes with ffmpeg part, but I'm stick with this error:
Have you solved this problem? How to solve it?
I use now this repository:
https://github.com/cmguo/QtAV
However, the project compiles in Debug or Release mode within QtCreator, but not in RelWithDebInfo. See errors above.