Qt Multimedia

"image of multimedia icons, courtesy of misirlou from the Noun Project"

Qt Multimedia is an add-on module that provides a rich set of QML types and C++ classes to handle multimedia content. It also provides necessary APIs to access the camera functionality.

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

Qt MultimediaProvides API for multimedia-specific use cases.
Qt Multimedia WidgetsProvides the widget-based multimedia API.

Getting Started

The QML types can be imported into an application using the following statement in your .qml file.

 import QtMultimedia

If you want to use the C++ classes in your application, include the C++ definitions using the following directive:

 #include <QtMultimedia>
 #include <QtMultimediaWidgets>

Note: If you are using a few classes from this module, we recommend including those specific classes only instead of the module.

To link against the corresponding C++ libraries, add the following to your qmake project file:

 QT += multimedia multimediawidgets

QML Types and C++ Classes

The following is a list of important QML types and C++ classes provided by this module:

TypeDescription
AudioAdd audio playback functionality to a scene
PlaylistFor specifying a list of media to be played.
CameraAccess camera viewfinder frames
MediaPlayerAdd media playback functionality to a scene. It is same as the Audio type, but can be used for video playback with the VideoOutput type.
VideoAdd Video playback functionality to a scene. It uses MediaPlayer and VideoOutput types to provide video playback functionality.
ClassDescription
QAudioSinkSends audio data to an audio output device
QAudioRecorderRecord media content from an audio source.
QCameraAccess camera viewfinder.
QImageCaptureCapture still images with a camera.
QMediaRecorderRecord media content from a camera source.
QMediaPlayerPlayback media from a source.
QMediaPlaylistList of media to be played.
QVideoSinkClass for video presentation.

Licenses and Attributions

The Qt Quick Multimedia module is available under commercial licenses from The Qt Company. In addition, it is available under free software licenses. Since Qt 5.4, these free software licenses are GNU Lesser General Public License, version 3, or the GNU General Public License, version 2. See Qt Licensing for further details.

Guides

Platform Notes

For most features, Qt Multimedia builds upon the multimedia framework of the underlying operating system. Therefore there are several multimedia back ends based on different technologies and APIs. For further details, see the Qt Multimedia back ends wiki.

Reference

Examples