Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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 development libraries required to build Qt Multimedia can be
26built from sources or downloaded as binary packages. Qt Multimedia can
27use either static linking or dynamic linking to FFmpeg libraries. We
28recommend using the same major version of FFmpeg that is listed in
29\l{Target platform and backend notes}. For information on how to build
30the FFmpeg development libraries, see \l{Building FFmpeg from source}.
31
32To build Qt Multimedia with FFmpeg support, specify the \c{-ffmpeg-dir}
33option on the configure command line when building Qt.
34
35\badcode
36qt-source/configure -ffmpeg-dir <FFMPEG_DIR>
37\endcode
38
39Here, \c{<FFMPEG_DIR>} is the directory containing the FFmpeg include,
40lib, and bin directories. To build Qt Multimedia without FFmpeg, omit
41the \c{<FFMPEG_DIR>} variable and specify the \c{-no-feature-ffmpeg}
42configure option.
43
44If you prefer not to build all Qt's submodules, you can reduce configure
45and build times using the \c{-submodules} configure option. This will
46configure a build that only builds Qt Multimedia and its dependencies.
47
48\badcode
49qt-source/configure -submodules qtmultimedia -ffmpeg-dir <FFMPEG_DIR>
50\endcode
51
52If you configure Qt Multimedia against FFmpeg built with shared
53libraries (dynamic linking), the FFmpeg shared libraries must be in the
54module loader's search path to run tests or use examples.
55
56\note Qt Multimedia requires the FFmpeg avformat, avcodec, swresample,
57swscale, and avutil libraries during runtime to be able to use the
58FFmpeg media backend. If one or more of these dynamic libraries are not
59found during application startup, the FFmpeg media backend will fail to
60load, and the system will attempt to load the native backend. Qt
61Multimedia doesn't support as many features on native backends.
62
63If you don't already have these libraries in the \c{path}, specify the
64\c{-ffmpeg-deploy} configure option. With this option enabled,
65the necessary FFmpeg binaries will be copied to Qt's install directory
66during the build and install steps:
67
68\badcode
69qt-source/configure -submodules qtmultimedia -ffmpeg-dir <FFMPEG_DIR> -ffmpeg-deploy
70\endcode
71
72After configuring Qt Multimedia, carefully review the configure summary
73(found in the config.summary file). You can verify that FFmpeg is found
74under the "Plugin" section. Then follow the regular build and install
75steps described in \l{Building Qt Sources}.
76
77\section1 Platform Notes
78
79\section2 Linux
80
81\list
82 \li When configuring Qt Multimedia with FFmpeg enabled, the
83 pulseaudio development package is required. Without this
84 package, FFmpeg will not be recognized.
85 \li When using a version of FFmpeg that is built with VAAPI support,
86 we recommend building Qt Multimedia with VAAPI support as well
87 to make hardware texture conversion possible. To configure Qt
88 Multimedia with VAAPI support, VAAPI developer libraries must be
89 installed on your system. Review the config.summary file to
90 verify that VAAPI support is enabled under the "Hardware
91 acceleration and features" section.
92 \li When configuring Qt Multimedia with the GStreamer backend, GStreamer
93 v1.20 is the minimum requirement. However, we recommend using the
94 latest stable GStreamer upstream release if possible.
95\endlist
96*/