This page describes the process of configuring and building Qt Multimedia. This description assumes familiarity with Building Qt Sources which specifies build requirements for your platform, as well as an overview of Qt Configure Options. For platform-specific considerations related to the Qt Multimedia module, see Platform Notes below.
Building Qt Multimedia with full feature support depends on FFmpeg headers and libraries on most platforms. It is possible to build Qt Multimedia without the Qt Multimedia FFmpeg media backend, but this is only recommended when building for platforms where the FFmpeg backend is not supported.
FFmpeg development libraries required to build Qt Multimedia can be built from sources or downloaded as binary packages. Qt Multimedia can use either static linking or dynamic linking to FFmpeg libraries. We recommend using the same major version of FFmpeg that is listed in FFmpeg as the default backend. For information on how to build the FFmpeg development libraries, see Building FFmpeg from source.
To build Qt Multimedia with FFmpeg support, specify the -DFFMPEG_DIR CMake variable on the configure command line when building Qt. Note the -- separator which
separates ordinary configure arguments from CMake parameters.
qt-source/configure -- -DFFMPEG_DIR=<FFMPEG_DIR>
Here, <FFMPEG_DIR> is the directory containing the FFmpeg include, lib, and bin directories. To build Qt Multimedia without FFmpeg, omit the <FFMPEG_DIR>
variable and specify the -no-feature-ffmpeg configure option.
If you prefer not to build all Qt's submodules, you can reduce configure and build times using the -submodules configure option. This will configure a build that only builds Qt Multimedia and its
dependencies.
qt-source/configure -submodules qtmultimedia -- -DFFMPEG_DIR=<FFMPEG_DIR>
If you configure Qt Multimedia against FFmpeg built with shared libraries (dynamic linking), the FFmpeg shared libraries must be in the module loader's search path to run tests or use examples.
Note: Qt Multimedia requires the FFmpeg avformat, avcodec, swresample, swscale, and avutil libraries during runtime to be able to use the FFmpeg media backend. If one or more of these dynamic libraries are not found during application startup, the FFmpeg media backend will fail to load, and the system will attempt to load the native backend. Qt Multimedia doesn't support as many features on native backends.
If you don't already have these libraries in the path, specify the -DQT_DEPLOY_FFMPEG=ON configure option. With this option enabled, the necessary FFmpeg binaries will
be copied to Qt's install directory during the build and install steps:
qt-source/configure -submodules qtmultimedia -- -DFFMPEG_DIR=<FFMPEG_DIR> -DQT_DEPLOY_FFMPEG=ON
After configuring Qt Multimedia, carefully review the configure summary (found in the config.summary file). You can verify that FFmpeg is found under the "Plugin" section. Then follow the regular build and install steps described in Building Qt Sources.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: