PySide6.QtMultimedia

Detailed Description

../../_images/noun_Media_166644.svg

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 the systems cameras and microphones.

The functionality of this module is divided into the following submodules:

Qt Multimedia

Provides API for multimedia-specific use cases.

Qt Multimedia Widgets

Provides the widget-based multimedia API.

Getting started

If you are porting from Qt 5 to Qt 6 see Changes to Qt Multimedia .

To include the definitions of modules classes, use the following directive:

import PySide6.QtMultimedia

The module also provides QML types .

Overviews and Important Topics

QML Types

The following table outlines some important QML types.

Type

Description

MediaPlayer

Add audio/video playback functionality to a scene.

CaptureSession

Create a session for capturing audio/video.

Camera

Access a camera connected to the system.

AudioInput

Access an audio input (microphone) connected to the system.

AudioOutput

Access an audio output (speaker, headphone) connected to the system.

VideoOutput

Display video content.

MediaRecorder

Record audio/video from the CaptureSession .

ImageCapture

Capture still images from the Camera.

Video

Add Video playback functionality to a scene. Uses MediaPlayer and VideoOutput types to provide video playback functionality.

C++ Classes

The following table outlines some important C++ Classes

Class

Description

QMediaPlayer

Playback media from a source.

QVideoWidget

Display video from a media player or a capture session.

QMediaCaptureSession

Capture audio and video.

QCamera

Access a camera connected to the system

QAudioInput

Access an audio input (microphone) connected to the system.

QAudioOutput

Access an audio output (speaker, headphone) connected to the system.

QImageCapture

Capture still images with a camera.

QMediaRecorder

Record media content from a capture session.

QVideoSink

Access and render individual video frames.

QAudioSink

Sends raw audio data to an audio output device.

For playback QMediaPlayer , QAudioOutput and QVideoOutput contain all the required functionality. The other classes are used for capturing audio and video content, where the QMediaCaptureSession is the central class managing the whole capture/recording process.

List of Classes