Multimedia¶
A set of APIs for working with audio, video, radio and camera devices.
Multimedia support in Qt is provided by the Qt Multimedia module. The Qt Multimedia module provides a rich feature set that enables you to easily take advantage of a platform’s multimedia capabilities such as media playback and the use of camera and radio devices.
Features¶
Here are some examples of what can be done with Qt Multimedia APIs:
Access raw audio devices for input and output
Play low latency sound effects
Play media files in playlists (such as compressed audio or video files)
Record audio and compress it
Tune and listen to radio stations
Use a camera, including viewfinder, image capture, and movie recording
Play 3D positional audio with Qt Audio Engine
Decode audio media files into memory for processing
Accessing video frames or audio buffers as they are played or recorded
Multimedia Components¶
Qt’s multimedia APIs are categorized into four main components. More information (including background information and class references) is available here:
Multimedia Recipes¶
For some quick recipes, look at the overviews above and consult this table:
Use case
Examples
QML Types
C++ Classes
Playing a sound effect
QSoundEffect
Playing low latency audio
QAudioOutput
Playing encoded audio (MP3, AAC etc)
Audio , MediaPlayer
QMediaPlayer
Accessing raw audio input data
QAudioInput
Recording encoded audio data
QAudioRecorder
Discovering raw audio devices
QAudioDeviceInfo
Video Playback
player , qmlvideo , qmlvideofx
MediaPlayer , VideoOutput , Video
QMediaPlayer
,QVideoWidget
,QGraphicsVideoItem
Video Processing
MediaPlayer , VideoOutput
QMediaPlayer
,QAbstractVideoSurface
,QVideoFrame
Listening to the radio
Radio , RadioData
QRadioTuner
,QRadioData
Accessing camera viewfinder
Camera , VideoOutput
QCamera
,QVideoWidget
,QGraphicsVideoItem
Viewfinder processing
Camera , VideoOutput
QCamera
,QAbstractVideoSurface
,QVideoFrame
Capturing photos
QCamera
,QCameraImageCapture
Capturing movies
QCamera
,QMediaRecorder
3D sound sources
AudioEngine , Sound
Limitations¶
The Qt Multimedia APIs build upon the multimedia framework of the underlying platform. This can mean that support for various codecs or containers can vary between machines, depending on what the end user has installed.
Advanced Usage¶
For developers wishing to access some platform specific settings, or to port the Qt Multimedia APIs to a new platform or technology, see Multimedia Backend Development .
Changes from Previous Versions¶
If you previously used Qt Multimedia in Qt 4, or used Qt Multimedia Kit in Qt Mobility, please see Changes in Qt Multimedia for more information on what changed, and what you might need to change when porting code.
Reference Documentation¶
QML Types¶
The QML types are accessed by using:
import QtMultimedia 5.8
qml-qtmultimedia-video.html
A convenience type for showing a specified video.
qml-qtmultimedia-audio.html
Add audio playback to a scene.
qml-qtmultimedia-mediaplayer.html
Add media playback to a scene.
qml-qtmultimedia-camera.html
Access viewfinder frames, and take photos and movies.
qml-qtmultimedia-cameracapture.html
An interface for capturing camera images.
qml-qtmultimedia-cameraexposure.html
An interface for exposure related camera settings.
qml-qtmultimedia-cameraflash.html
An interface for flash related camera settings.
qml-qtmultimedia-camerafocus.html
An interface for focus related camera settings.
qml-qtmultimedia-cameraimageprocessing.html
An interface for camera capture related settings.
qml-qtmultimedia-camerarecorder.html
Controls video recording with the Camera.
qml-qtmultimedia-qtmultimedia.html
Provides a global object with useful functions from Qt Multimedia.
qml-qtmultimedia-playlistitem.html
Defines an item in a Playlist.
qml-qtmultimedia-playlist.html
For specifying a list of media to be played.
qml-qtmultimedia-radio.html
Access radio functionality from a QML application.
qml-qtmultimedia-radiodata.html
Access RDS data from a QML application.
qml-qtmultimedia-torch.html
Simple control over torch functionality.
qml-qtmultimedia-soundeffect.html
The SoundEffect type provides a way to play sound effects in QML.
qml-qtmultimedia-videooutput.html
Render video or camera viewfinder.
The following types are accessed by using Qt Audio Engine :
qml-qtaudioengine-attenuationmodellinear.html
Defines a linear attenuation curve for a Sound.
qml-qtaudioengine-attenuationmodelinverse.html
Defines a non-linear attenuation curve for a Sound.
qml-qtaudioengine-audiocategory.html
Control all active sound instances by group.
qml-qtaudioengine-audioengine.html
Organize all your 3d audio content in one place.
qml-qtaudioengine-audiolistener.html
Control global listener parameters.
qml-qtaudioengine-audiosample.html
Load audio samples, mostly .wav.
qml-qtaudioengine-playvariation.html
Define a playback variation for sounds. So each time the playback of the same sound can be a slightly different even with the same AudioSample.
qml-qtaudioengine-sound.html
Define a variety of samples and parameters to be used for SoundInstance.
qml-qtaudioengine-soundinstance.html
Play 3d audio content.
Multimedia Classes¶
qaudio.html
The QAudio namespace contains enums used by the audio classes.
PySide2.QtMultimedia.QAudioBuffer
The QAudioBuffer class represents a collection of audio samples with a specific format and sample rate.
QAudioBuffer.StereoFrame
The StereoFrame class provides a simple wrapper for a stereo audio frame.
PySide2.QtMultimedia.QAudioDecoder
The QAudioDecoder class allows decoding audio.
PySide2.QtMultimedia.QAudioDeviceInfo
The QAudioDeviceInfo class provides an interface to query audio devices and their functionality.
PySide2.QtMultimedia.QAudioFormat
The QAudioFormat class stores audio stream parameter information.
PySide2.QtMultimedia.QAudioInput
The QAudioInput class provides an interface for receiving audio data from an audio input device.
PySide2.QtMultimedia.QAudioOutput
The QAudioOutput class provides an interface for sending audio data to an audio output device.
PySide2.QtMultimedia.QAudioProbe
The QAudioProbe class allows you to monitor audio being played or recorded.
PySide2.QtMultimedia.QAbstractAudioDeviceInfo
The QAbstractAudioDeviceInfo class is a base class for audio backends.
PySide2.QtMultimedia.QAbstractAudioOutput
The QAbstractAudioOutput class is a base class for audio backends.
PySide2.QtMultimedia.QAbstractAudioInput
The QAbstractAudioInput class provides access for QAudioInput to access the audio device provided by the plugin.
QAudioSystemPlugin
The QAudioSystemPlugin class provides an abstract base for audio plugins.
PySide2.QtMultimedia.QSound
The QSound class provides a method to play .wav sound files.
PySide2.QtMultimedia.QSoundEffect
The QSoundEffect class provides a way to play low latency sound effects.
PySide2.QtMultimedia.QCamera
The QCamera class provides interface for system camera devices.
QCamera.FrameRateRange
A FrameRateRange represents a range of frame rates as minimum and maximum rate.
PySide2.QtMultimedia.QCameraExposure
The QCameraExposure class provides interface for exposure related camera settings.
PySide2.QtMultimedia.QCameraFocusZone
The QCameraFocusZone class provides information on zones used for autofocusing a camera.
PySide2.QtMultimedia.QCameraFocus
The QCameraFocus class provides an interface for focus and zoom related camera settings.
PySide2.QtMultimedia.QCameraImageCapture
The QCameraImageCapture class is used for the recording of media content.
PySide2.QtMultimedia.QCameraImageProcessing
The QCameraImageProcessing class provides an interface for image processing related camera settings.
PySide2.QtMultimedia.QCameraInfo
The QCameraInfo class provides general information about camera devices.
PySide2.QtMultimedia.QCameraViewfinderSettings
The QCameraViewfinderSettings class provides a set of viewfinder settings.
PySide2.QtMultimedia.QMediaContent
The QMediaContent class provides access to the resource relating to a media content.
PySide2.QtMultimedia.QMediaPlayer
The QMediaPlayer class allows the playing of a media source.
PySide2.QtMultimedia.QMediaPlaylist
The QMediaPlaylist class provides a list of media content to play.
The QMediaPlaylistReader class provides an interface for reading a playlist file.
The QMediaPlaylistNavigator class provides navigation for a media playlist.
The QMediaPlaylistProvider class provides an abstract list of media.
PySide2.QtMultimedia.QMediaResource
The QMediaResource class provides a description of a media resource.
PySide2.QtMultimedia.QMediaBindableInterface
The QMediaBindableInterface class is the base class for objects extending media objects functionality.
PySide2.QtMultimedia.QMediaControl
The QMediaControl class provides a base interface for media service controls.
qmediametadata.html
Provides identifiers for meta-data attributes.
PySide2.QtMultimedia.QMediaObject
The QMediaObject class provides a common base for multimedia objects.
PySide2.QtMultimedia.QMediaService
The QMediaService class provides a common base class for media service implementations.
The QMediaServiceProviderHint class describes what is required of a QMediaService.
The QMediaServiceProvider class provides an abstract allocator for media services.
PySide2.QtMultimedia.QMediaTimeInterval
The QMediaTimeInterval class represents a time interval with integer precision.
PySide2.QtMultimedia.QMediaTimeRange
The QMediaTimeRange class represents a set of zero or more disjoint time intervals.
qmultimedia.html
The QMultimedia namespace contains miscellaneous identifiers used throughout the Qt Multimedia library.
PySide2.QtMultimedia.QRadioData
The QRadioData class provides interfaces to the RDS functionality of the system radio.
PySide2.QtMultimedia.QRadioTuner
The QRadioTuner class provides an interface to the systems analog radio device.
PySide2.QtMultimedia.QAudioRecorder
The QAudioRecorder class is used for the recording of audio.
PySide2.QtMultimedia.QAudioEncoderSettings
The QAudioEncoderSettings class provides a set of audio encoder settings.
PySide2.QtMultimedia.QVideoEncoderSettings
The QVideoEncoderSettings class provides a set of video encoder settings.
PySide2.QtMultimedia.QImageEncoderSettings
The QImageEncoderSettings class provides a set of image encoder settings.
PySide2.QtMultimedia.QMediaRecorder
The QMediaRecorder class is used for the recording of media content.
PySide2.QtMultimedia.QAbstractVideoBuffer
The QAbstractVideoBuffer class is an abstraction for video data.
QAbstractPlanarVideoBuffer
The QAbstractPlanarVideoBuffer class is an abstraction for planar video data.
PySide2.QtMultimedia.QAbstractVideoFilter
The QAbstractVideoFilter class represents a filter that is applied to the video frames received by a VideoOutput type.
PySide2.QtMultimedia.QVideoFilterRunnable
The QVideoFilterRunnable class represents the implementation of a filter that owns all graphics and computational resources, and performs the actual filtering or calculations.
PySide2.QtMultimedia.QAbstractVideoSurface
The QAbstractVideoSurface class is a base class for video presentation surfaces.
PySide2.QtMultimedia.QVideoFrame
The QVideoFrame class represents a frame of video data.
PySide2.QtMultimedia.QVideoProbe
The QVideoProbe class allows you to monitor video frames being played or recorded.
PySide2.QtMultimedia.QVideoSurfaceFormat
The QVideoSurfaceFormat class specifies the stream format of a video presentation surface.
PySide2.QtMultimediaWidgets.QGraphicsVideoItem
The QGraphicsVideoItem class provides a graphics item which display video produced by a QMediaObject.
PySide2.QtMultimediaWidgets.QVideoWidget
The QVideoWidget class provides a widget which presents video produced by a media object.
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.