Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qtmultimedia-building-from-source.qdoc
Go to the documentation of this file.
1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5\page qtmultimedia-building-from-source.html
6\title Building Qt Multimedia from sources
7\brief This document describes how to build Qt Multimedia with full
8feature support from source code.
9
10This page describes the process of configuring and building \l{Qt
11Multimedia}. This description assumes familiarity with \l{Building Qt
12Sources} which specifies build requirements for your platform, as well
13as an overview of \l{Qt Configure Options}. For platform-specific
14considerations related to the Qt Multimedia module, see \l{Platform
15Notes} below.
16
17\section1 Building from source
18
19Building Qt Multimedia with full feature support depends on \l
20{https://ffmpeg.org/}{FFmpeg} headers and libraries on most platforms.
21It is possible to build Qt Multimedia without the Qt Multimedia FFmpeg
22media backend, but this is only recommended when building for platforms
23where the FFmpeg backend is not supported.
24
25FFmpeg developer libraries required to build Qt Multimedia can be built
26from sources or downloaded as binary packages. Qt Multimedia can use
27either static linking or dynamic linking to FFmpeg libraries. We
28recommend using the same major version of FFmpeg that is listed in
29\l{FFmpeg as the default backend}.
30
31To build Qt Multimedia with FFmpeg support, specify the \c{-DFFMPEG_DIR}
32CMake variable on the configure command line when building Qt. Note the
33\c{--} separator which separates ordinary configure arguments from CMake
34parameters.
35
36\badcode
37qt-source/configure -- -DFFMPEG_DIR=<FFMPEG_DIR>
38\endcode
39
40Here, \c{<FFMPEG_DIR>} is the directory containing the FFmpeg include,
41lib, and bin directories. To build Qt Multimedia without FFmpeg, omit
42the \c{<FFMPEG_DIR>} variable or specify the \c{-no-feature-ffmpeg}
43configure option.
44
45If you prefer not to build all Qt's submodules, you can reduce configure
46and build times using the \c{-submodules} configure option. This will
47configure a build that only builds Qt Multimedia and its dependencies.
48
49\badcode
50qt-source/configure -submodules qtmultimedia -- -DFFMPEG_DIR=<FFMPEG_DIR>
51\endcode
52
53If you configure Qt Multimedia against FFmpeg built with shared
54libraries (dynamic linking), the FFmpeg shared libraries must be in the
55module loader's search path to run tests or use examples.
56
57\note Qt Multimedia requires the FFmpeg avformat, avcodec, swresample,
58swscale, and avutil libraries during runtime to be able to use the
59FFmpeg media backend. If one or more of these dynamic libraries are not
60found during application startup, the FFmpeg media backend will fail to
61load, and the system will attempt to load the native backend. Qt
62Multimedia doesn't support as many features on native backends.
63
64If you don't already have these libraries in the \c{path}, specify the
65\c{-DQT_DEPLOY_FFMPEG=ON} configure option. With this option enabled,
66the necessary FFmpeg binaries will be copied to Qt's install directory
67during the build and install steps:
68
69\badcode
70qt-source/configure -submodules qtmultimedia -- -DFFMPEG_DIR=<FFMPEG_DIR> -DQT_DEPLOY_FFMPEG=ON
71\endcode
72
73After configuring Qt Multimedia, carefully review the configure summary
74(found in the config.summary file). You can verify that FFmpeg is found
75under the "Plugin" section. Then follow the regular build and install
76steps described in \l{Building Qt Sources}.
77
78\section1 Platform Notes
79
80\section2 Linux
81
82\list
83 \li When configuring Qt Multimedia with FFmpeg enabled, the
84 pulseaudio development package is required. Without this
85 package, FFmpeg will not be recognized.
86 \li When using a version of FFmpeg that is built with VAAPI support,
87 we recommend building Qt Multimedia with VAAPI support as well
88 to make hardware texture conversion possible. To configure Qt
89 Multimedia with VAAPI support, VAAPI developer libraries must be
90 installed on your system. Review the config.summary file to
91 verify that VAAPI support is enabled under the "Hardware
92 acceleration and features" section.
93\endlist
94*/