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.
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
Qt's multimedia APIs are categorized into four main components. More information (including background information and class references) is available here:
For some quick recipes, look at the overviews above and consult this table:
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.
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.
The QML types are accessed by using:
import QtMultimedia 5.0
A convenience type for showing a specified video.
Add audio playback to a scene.
Add media playback to a scene.
Access viewfinder frames, and take photos and movies.
An interface for capturing camera images
An interface for exposure related camera settings.
An interface for flash related camera settings.
An interface for focus related camera settings.
An interface for camera capture related settings.
Controls video recording with the Camera.
Access radio functionality from a QML application.
Access RDS data from a QML application.
Simple control over torch functionality
Render video or camera viewfinder.
The SoundEffect type provides a way to play sound effects in QML.
The following types are accessed by using Qt Audio Engine:
import QtAudioEngine 1.0
Defines a linear attenuation curve for a Sound.
Defines a non-linear attenuation curve for a Sound.
Control all active sound instances by group.
Organize all your 3d audio content in one place.
Control global listener parameters.
Load audio samples, mostly .wav.
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.
Define a variety of samples and parameters to be used for SoundInstance.
Play 3d audio content.
The QGraphicsVideoItem class provides a graphics item which display video produced by a QMediaObject.
The QVideoWidget class provides a widget which presents video produced by a media object.
Contains enums used by the audio classes
Represents a collection of audio samples with a specific format and sample rate
Simple wrapper for a stereo audio frame
Allows decoding audio
Interface to query audio devices and their functionality
Stores audio stream parameter information
Interface for receiving audio data from an audio input device
Interface for sending audio data to an audio output device
Allows you to monitor audio being played or recorded
Method to play .wav sound files
Way to play low latency sound effects
Interface for system camera devices
Interface for exposure related camera settings
Information on zones used for autofocusing a camera
Interface for focus and zoom related camera settings
Used for the recording of media content
Interface for image processing related camera settings
Access to the resources relating to a media content
Allows the playing of a media source
List of media content to play
Description of a media resource
The base class for objects extending media objects functionality
Base interface for media service controls
Common base for multimedia objects
Common base class for media service implementations
Represents a time interval with integer precision
Represents a set of zero or more disjoint time intervals
Contains miscellaneous identifiers used throughout the Qt Multimedia library
Interfaces to the RDS functionality of the system radio
Interface to the systems analog radio device
Used for the recording of audio
Set of audio encoder settings
Set of video encoder settings
Set of image encoder settings
Used for the recording of media content
Abstraction for video data
Base class for video presentation surfaces
Represents a frame of video data
Allows you to monitor video frames being played or recorded
Specifies the stream format of a video presentation surface