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 devices.
Here are some things you can do with the Qt Multimedia APIs:
The Qt Multimedia APIs are categorized into three main components. More information specific to each component is available in the overview pages. You can also take a look at some recipes.
For some quick recipes, see this table:
|Use case||Examples||QML Types||C++ Classes|
|Playing a sound effect||SoundEffect||QSoundEffect|
|Playing 3D sound||audiopanning||SpatialSound, AudioEngine||QSpatialSound, QAudioEngine|
|Playing encoded audio (MP3, AAC etc)||player||MediaPlayer||QMediaPlayer|
|Playing raw audio data with low latency||audiooutput,||QAudioSink|
|Accessing raw audio input data||spectrum, audiosource||QAudioSource|
|Recording encoded audio data||audiorecorder||CaptureSession, AudioInput, MediaRecorder||QMediaCaptureSession, QAudioInput, QMediaRecorder|
|Discovering audio and video devices||audiodevices||MediaDevices, audioDevice, cameraDevice||QMediaDevices, QAudioDevice, QCameraDevice|
|Video Playback||player, mediaplayer||MediaPlayer, VideoOutput, Video||QMediaPlayer, QVideoWidget, QGraphicsVideoItem|
|Capturing audio and video||camera, recorder||CaptureSession, Camera, AudioInput VideoOutput||QMediaCaptureSession, QCamera, QAudioInput, QVideoWidget|
|Capturing photos||camera, recorder||CaptureSession, Camera, ImageCapture||QMediaCaptureSession, QCamera, QImageCapture|
|Capturing movies||camera, recorder||CaptureSession, Camera, MediaRecorder||QMediaCaptureSession, QCamera, QMediaRecorder|
The Qt Multimedia APIs build upon the multimedia framework of the underlying platform. This can mean that support for various codecs, or containers will vary between machines. This support depends on what the end user has installed. See Supported Media Formats for more detail.
If you previously used Qt Multimedia in Qt 5, see Changes to Qt Multimedia for more information on what has changed, and what you might need to change when porting code to Qt 6.