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
multimedia-overview.qdoc
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4
5
6/*!
7\page multimediaoverview.html
8\title Multimedia Overview
9\brief A set of APIs for working with audio, video and camera devices.
10\ingroup explanations-graphicsandmultimedia
11
12Multimedia support in Qt is provided by the \l{Qt Multimedia} module. The Qt
13Multimedia module provides a rich feature set that enables you to easily take
14advantage of a platform's multimedia capabilities, such as media playback and
15the use of camera devices.
16
17\section1 Features
18
19Here are some things you can do with the Qt Multimedia APIs:
20
21\list
22\li Access raw audio devices for input and output.
23\li Play low latency sound effects.
24\li Play 3D spatial audio.
25\li Play media files in playlists (such as compressed audio or video files).
26\li Record audio and compress it.
27\li Use a camera, including viewfinder, image capture, and movie recording
28\li Decode audio media files into memory for processing.
29\endlist
30
31\section1 Multimedia Components
32
33The Qt Multimedia APIs are categorized into three main components. More
34information specific to each component is available in the overview pages. You
35can also take a look at some \l{Multimedia Recipes}{recipes}.
36
37\list
38\li \l {Audio Overview}
39\li \l {Video Overview}
40\li \l {Camera Overview}
41\li \l {Spatial Audio Overview} (Technology Preview)
42\endlist
43
44\section1 Multimedia Recipes
45
46For some quick recipes, see this table:
47
48\table 70%
49 \header
50 \li Use case
51 \li Examples
52 \li QML Types
53 \li C++ Classes
54 \row
55 \li Playing a sound effect
56 \li
57 \li \l{SoundEffect}
58 \li QSoundEffect
59 \row
60 \li Playing 3D sound
61 \li \l{Spatial Audio Panning Example}{audiopanning}
62 \li SpatialSound, AudioEngine
63 \li QSpatialSound, QAudioEngine
64 \row
65 \li Playing encoded audio (MP3, AAC etc)
66 \li \l{Media Player Example}{player}
67 \li \l{MediaPlayer}
68 \li QMediaPlayer
69 \row
70 \li Playing raw audio data with low latency
71 \li \l{Audio Output Example}{audiooutput}
72 \li
73 \li QAudioSink
74 \row
75 \li Accessing raw audio input data
76 \li \l{Audio Source Example}{audiosource}
77 \li
78 \li QAudioSource
79 \row
80 \li Recording encoded audio data
81 \li \l{Audio Recorder Example}{audiorecorder}
82 \li \l{CaptureSession}, \l{AudioInput}, \l{MediaRecorder}
83 \li QMediaCaptureSession, QAudioInput, QMediaRecorder
84 \row
85 \li Discovering audio and video devices
86 \li \l{Audio Devices Example}{audiodevices}
87 \li \l{MediaDevices}, \l{audioDevice}, \l{cameraDevice}
88 \li QMediaDevices, QAudioDevice, QCameraDevice
89 \row
90 \li Video Playback
91 \li \l{Media Player Example}{player},
92 \l{QML Media Player Example}{mediaplayer}
93 \li \l MediaPlayer, \l VideoOutput, \l Video
94 \li QMediaPlayer, QVideoWidget, QGraphicsVideoItem
95 \row
96 \li Capturing audio and video
97 \li \l {Camera Example}{camera},
98 \l {QML Video Recorder}{recorder}
99 \li \l CaptureSession, \l Camera, \l AudioInput \l VideoOutput
100 \li QMediaCaptureSession, QCamera, QAudioInput, QVideoWidget
101 \row
102 \li Capturing photos
103 \li \l {Camera Example}{camera},
104 \l {QML Video Recorder}{recorder}
105 \li \l CaptureSession, \l Camera, \l ImageCapture
106 \li QMediaCaptureSession, QCamera, QImageCapture
107 \row
108 \li Capturing movies
109 \li \l {Camera Example}{camera},
110 \l {QML Video Recorder}{recorder}
111 \li \l CaptureSession, \l Camera, \l MediaRecorder
112 \li QMediaCaptureSession, QCamera, QMediaRecorder
113\endtable
114
115\section1 Multimedia Security Notes
116
117Qt Multimedia relies heavily on media hardware and its drivers.
118Therefore, we highly recommend using trusted hardware, such as cameras,
119audio devices, graphics cards, and other peripherals, as well as
120a properly configured environment to avoid unexpected Qt Multimedia behavior
121that could result in security-critical issues.
122
123Qt Multimedia components, such as QMediaPlayer, QAudioDecoder,
124and QGStreamerVideoSource may process untrusted media sources.
125When using these components, follow the general best practices for
126\l{Handling Untrusted Data}{handling untrusted data}.
127We aim to keep Qt Multimedia secure regardless of the media file
128or stream provided as input. However, the module highly depends on third-party
129libraries, such as FFmpeg and GStreamer, resulting in a long processing
130data chain that may be vulnerable to security issues if a flaw exists
131at any stage. See \l{Multimedia Security Considerations} page describing
132security-related data flow and exploiting risks.
133
134\section1 Limitations
135
136The Qt Multimedia APIs build upon the multimedia framework of the underlying
137platform. This can mean that support for various codecs, or containers will vary
138between machines. This support depends on what the end user has installed.
139See \l{Supported Media Formats} for more detail.
140
141\note Qt Multimedia APIs depend on functionality provided by QCoreApplication,
142and multimedia objects created using the Qt Multimedia APIs can only be used
143during the lifetime of this application object. It is therefore important to
144create a QCoreApplication, QGuiApplication, or QApplication before accessing
145any of the Qt Multimedia APIs. If the application object is recreated, make
146sure that any Qt Multimedia objects are also recreated.
147
148\section1 Changes from Previous Versions
149
150If you previously used Qt Multimedia in Qt 5, see
151\l{Changes to Qt Multimedia} for more information on what has changed, and what
152you might need to change when porting code to Qt 6.
153
154\section1 Reference Documentation
155
156\list
157 \li \l{Qt Multimedia C++ Classes}{C++ Classes}
158 \li \l{Qt Multimedia QML Types}{QML Types}
159\endlist
160*/