PySide6.QtMultimedia¶
- PySide6.QtMultimedia.QAbstractVideoBuffer
- PySide6.QtMultimedia.QAudio
- PySide6.QtMultimedia.QAudioBuffer
- PySide6.QtMultimedia.QAudioBufferInput
- PySide6.QtMultimedia.QAudioBufferOutput
- PySide6.QtMultimedia.QAudioDecoder
- PySide6.QtMultimedia.QAudioDevice
- PySide6.QtMultimedia.QAudioFormat
- PySide6.QtMultimedia.QAudioInput
- PySide6.QtMultimedia.QAudioOutput
- PySide6.QtMultimedia.QAudioSink
- PySide6.QtMultimedia.QAudioSource
- PySide6.QtMultimedia.QCamera
- PySide6.QtMultimedia.QCameraDevice
- PySide6.QtMultimedia.QCameraFormat
- PySide6.QtMultimedia.QCapturableWindow
- PySide6.QtMultimedia.QImageCapture
- PySide6.QtMultimedia.QMediaCaptureSession
- PySide6.QtMultimedia.QMediaDevices
- PySide6.QtMultimedia.QMediaFormat
- PySide6.QtMultimedia.QMediaMetaData
- PySide6.QtMultimedia.QMediaPlayer
- PySide6.QtMultimedia.QMediaRecorder
- PySide6.QtMultimedia.QMediaTimeRange
- PySide6.QtMultimedia.QPlaybackOptions
- PySide6.QtMultimedia.QScreenCapture
- PySide6.QtMultimedia.QSoundEffect
- PySide6.QtMultimedia.QVideoFrame
- PySide6.QtMultimedia.QVideoFrameFormat
- PySide6.QtMultimedia.QVideoFrameInput
- PySide6.QtMultimedia.QVideoSink
- PySide6.QtMultimedia.QWaveDecoder
- PySide6.QtMultimedia.QWindowCapture
- PySide6.QtMultimedia.QtAudio
- PySide6.QtMultimedia.QtVideo
Detailed Description¶
The Qt Multimedia module provides APIs for playing back and recording audiovisual content
Qt Multimedia is an add-on module that provides a rich set of QML types and C++ classes to handle multimedia content. It contains an easy to use API for playing back audio and video files and rendering those on screen, as well as a comprehensive API for recording audio and video from various sources, including system cameras and microphones, screen or window captures, and audio or video memory buffers.
The functionality of this module is divided into the following submodules:
Provides an API for multimedia-specific use cases.
Provides a widget-based multimedia API.
Provides an API for implementing sound fields in 3D space.
Getting started¶
To include the definitions of modules classes, use the following directive:
import PySide6.QtMultimedia
Overviews and important topics¶
Target platform and backend notes¶
Qt Multimedia offers user-friendly, cross-platform APIs for media playback,
recording, and device management. The implementation of core APIs, including
QMediaDevices ,
QAudioDevice ,
QSoundEffect ,
QAudioSink , and
QAudioSource are integrated into
the main Qt Multimedia library, eliminating the need for additional libraries.
Other Qt Multimedia APIs are implemented using plugin libraries known as media
backends. The main media backend, built on FFmpeg ,
ensures seamless cross-platform functionality, and is the default on all
platforms except WebAssembly and embedded Linux/Boot2Qt. With Boot2Qt, the
default backend is built on top of GStreamer, but the FFmpeg media backend
can be enabled using the QT_MEDIA_BACKEND environment variable.
The FFmpeg backend¶
The FFmpeg media backend relies on the FFmpeg 7.1.3 libraries, which are included with the Qt Online Installer and tested by the maintainers. The binary packages from the online installer use dynamic linking to FFmpeg. Therefore, applications must either bundle FFmpeg binaries in their installer or depend on FFmpeg being installed on the operating system. The FFmpeg libraries are automatically deployed using Qt’s deployment tools as described in the Deploying Qt Applications documentation, except for Linux/X11. Applications can also deploy their own build of FFmpeg, either as shared or static libraries, provided the FFmpeg major version matches the version used by Qt.
While Qt Multimedia leverages the FFmpeg media backend on most operating systems, platform specific functional or visual differences may arise between applications on different platforms. FFmpeg does not provide identical codec and format support across all platforms, and the performance of Qt Multimedia features may depend on hardware support that is only available on certain platforms. For instance, FFmpeg encounters specific issues with hardware acceleration on Linux targets with ARM architectures. Therefore, it is recommended to test Qt Multimedia applications on all target platforms.
Note
The FFmpeg project provides features under various licenses. The pre-built FFmpeg libraries that are provided through the Online Installer are only including features that agree with the permissive licenses listed under Licenses and attributions.
To ease development and debugging, some FFmpeg functionality is configurable via Advanced FFmpeg Configuration which are part of the private Qt Multimedia API.
Native backends¶
For compatibility with existing applications, we maintain native media backends for each operating system:
Qt Multimedia GStreamer backend on Embedded Linux
AVFoundation on macOS and iOS
WebAudio and WebVideo on WebAssembly
Note
The FFmpeg media backend is the default backend except on WebAssembly, native backends are still available but with limited support. The GStreamer backend is only available on Linux, and is only recommended for embedded applications.
Qt Maintainers will strive to fix critical issues with the native backends but don’t guarantee fixing minor issues, including inconsistent behavior across platforms. New features will only be implemented on the FFmpeg media backend, with the exception of WebAssembly.
The GStreamer backend has some private APIs to allow more fine-grained control. However, there are known bugs in the GStreamer backend. More details can be found in Qt Multimedia GStreamer backend.
Backend limitations will be documented, and their status will be maintained in the respective classes.
Changing backends¶
In the case of issues with the default FFmpeg backend, we suggest testing with
a native backend. You can switch to native backends by setting the
QT_MEDIA_BACKEND environment variable to windows, gstreamer (on
Embedded Linux), darwin (on macOS and iOS), or android:
export QT_MEDIA_BACKEND=darwin
To force assign FFmpeg as the used backend, set the variable to ffmpeg:
export QT_MEDIA_BACKEND=ffmpeg
On the Qt Multimedia compilation stage, the default media backend can be
configured via cmake variable QT_DEFAULT_MEDIA_BACKEND.
Target platform notes¶
The following pages list issues for specific target platforms.
Permissions¶
Starting from Qt 6.6, the Qt Multimedia module uses new
QPermission API to handle
QCameraPermission and
QMicrophonePermission permissions.
This means that Qt itself no longer queries for these permissions, so this needs to be done directly from the client application.
Please refer to the Application Permissions page for an example of how to integrate the new QPermission API into the application.
List of QML types¶
List of Classes¶
A |
|||
C |
|||
I |
|||
M |
|||
P |
|||
Q |
|||
S |
|||
V |
|||
W |
|||