How to configure Qt 6.5.1 QtMultimedia to use custom FFmpeg installation?
-
although, i already have those things?
(the/usr/local/FFmpeg-n6.0/
folder also has the same contents) -
well since i got the gstreamer backend working i guess ill just give up on ffmpeg for now and use that instead
-
@eramne This is working for me (Ubuntu 20.04), in so much as Qt detects FFmpeg during configuration:
cd /home/martinb/workspace/qt6_local_build/ffmpeg_linux_x86_64_build/FFmpeg-n6.0 /home/martinb/workspace/qt6_local_build/ffmpeg_linux_x86_64_build/FFmpeg-n6.0/configure --disable-programs --disable-doc --disable-debug --enable-network --disable-lzma --enable-pic --prefix=/FFmpeg-n6.0 make make install DESTDIR=/home/martinb/workspace/qt6_local_build/ffmpeg_linux_x86_64_build/FFmpeg-n6.0/installed/FFmpeg-n6.0 /home/martinb/workspace/qt6_local_build/src/qt6/qtbase/configure -top-level -prefix /home/martinb/workspace/qt6_local_build/qt_linux_x86_64_install -static -gstreamer -I /home/martinb/workspace/qt6_local_build/openssl_linux_x86_64_build/openssl-1.1.1s/include -L /home/martinb/workspace/qt6_local_build/openssl_linux_x86_64_build/openssl-1.1.1s -ccache -no-sql-sqlite -no-sql-db2 -no-sql-ibase -no-sql-mysql -no-sql-oci -no-sql-odbc -no-sql-psql -qt-doubleconversion -qt-libjpeg -qt-libpng -qt-zlib -no-warnings-are-errors -nomake examples -nomake tests -release -openssl-linked -- -DOPENSSL_USE_STATIC_LIBS=ON -DOPENSSL_ROOT_DIR=/home/martinb/workspace/qt6_local_build/openssl_linux_x86_64_build/openssl-1.1.1s -DFFMPEG_DIR=/home/martinb/workspace/qt6_local_build/ffmpeg_linux_x86_64_build/FFmpeg-n6.0/installed/FFmpeg-n6.0
I have a problem further down the line whereby the linker is trying to link the FFmpeg libraries both with and without the lib prefix. I'm currently investigating this.
-
nevermind the gstreamer backend is not working
giving me "Internal data stream error." when i try to play most files, other files it just crashes
back to trying to get the ffmpeg backend to work i guess -
that's weird, since i have all the libav/ffmpeg libraries built and installed at /usr/local/FFmpeg-n6.0, including libavdevice, libavfilter, and libpostproc
this is after running:
./configure -prefix "/home/eramne/Qt6.5.1/" -release -openssl -openssl-linked -no-widgets -submodules qt5compat,qtbase,qtdeclarative,qtimageformats,qtmultimedia,qtshadertools,qtsvg,qttranslations -DFFMPEG_DIR=/usr/local/FFmpeg-n6.0/
-
maybe its just trying to use the ffmpeg packages i have installed via apt instead of the ones i've built and linked to with
-DFFMPEG_DIR=/usr/local/FFmpeg-n6.0/
? If so, how do i stop it from doing that? -
yeah, it's doing that. I tried building/installing ffmpeg 5.1, using the
-DFFMPEG_DIR
thing to point to that, and in the output of the configure script it still showed that it's using the same versions of the av/ffmpeg libraries./configure -prefix "/home/eramne/Qt6.5.1/" -top-level -release -openssl -openssl-linked -no-widgets -submodules qt5compat,qtbase,qtdeclarative,qtimageformats,qtmultimedia,qtshadertools,qtsvg,qttranslations -DFFMPEG_DIR=/home/eramne/Desktop/ffmpeg/installed/ffmpeg-5.1 ./configure -redo
-
i modified the https://github.com/qt/qtmultimedia/blob/6.5.1/cmake/FindFFmpeg.cmake file like this
### Macro: set_component_found # # Marks the given component as found if both *_LIBRARIES AND *_INCLUDE_DIRS is present. # macro(set_component_found _component ) if (${_component}_LIBRARIES AND ${_component}_INCLUDE_DIRS) # message(STATUS " - ${_component} found.") set(${_component}_FOUND TRUE) set(${CMAKE_FIND_PACKAGE_NAME}_${_component}_FOUND TRUE) else () # message(STATUS " - ${_component} not found.") endif () endmacro() find_package(PkgConfig QUIET) #if (NOT PKG_CONFIG_FOUND AND NOT FFMPEG_DIR) # set(FFMPEG_DIR "/usr/local") #endif() set(FFMPEG_DIR "/home/eramne/Desktop/ffmpeg/installed/ffmpeg-6.0")
to explicitly force it to use my own ffmpeg installation
and that worked -
i guess cmake variables are separate from environment variables
since i tried usingexport FFMPEG_DIR=/home/eramne/Desktop/ffmpeg/installed/ffmpeg-6.0
, but that didn't work
i guess i probably could've used the configure.cmake file in some way to set that variable? but i don't use cmake and i don't know how to do that, and i didn't feel like figuring out how -
@eramne You need the -- in the Qt configure line to separate the CMake options from the Qt ones:
./configure -prefix "/home/eramne/Qt6.5.1/" -top-level -release -openssl -openssl-linked -no-widgets -submodules qt5compat,qtbase,qtdeclarative,qtimageformats,qtmultimedia,qtshadertools,qtsvg,qttranslations -- -DFFMPEG_DIR=/home/eramne/Desktop/ffmpeg/installed/ffmpeg-5.1
-
@Martin-Burchell oh! thanks for this
-
@eramne Is it working for you now? I've got a problem linking FFmpeg with static Qt, which I've logged at https://bugreports.qt.io/browse/QTBUG-115052 but if it's working for you, feel free to mark this as Solved