Multimedia▲
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 |
||||
Playing low latency audio |
||||
Playing encoded audio (MP3, AAC etc) |
||||
Accessing raw audio input data |
||||
Recording encoded audio data |
||||
Discovering raw audio devices |
||||
Video Playback |
||||
Video Processing |
||||
Listening to the radio |
||||
Accessing camera viewfinder |
||||
Viewfinder processing |
||||
Capturing photos |
||||
Capturing movies |
||||
3D sound sources |
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
-
Audio: Add audio playback to a scene.
-
Camera: Access viewfinder frames, and take photos and movies.
-
CameraCapture: An interface for capturing camera images.
-
CameraExposure: An interface for exposure related camera settings.
-
CameraFlash: An interface for flash related camera settings.
-
CameraFocus: An interface for focus related camera settings.
-
CameraImageProcessing: An interface for camera capture related settings.
-
CameraRecorder: Controls video recording with the Camera.
-
MediaPlayer: Add media playback to a scene.
-
Playlist: For specifying a list of media to be played.
-
PlaylistItem: Defines an item in a Playlist.
-
QtMultimedia: Provides a global object with useful functions from Qt Multimedia.
-
Radio: Access radio functionality from a QML application.
-
RadioData: Access RDS data from a QML application.
-
SoundEffect: The SoundEffect type provides a way to play sound effects in QML.
-
Torch: Simple control over torch functionality.
-
Video: A convenience type for showing a specified video.
-
VideoOutput: Render video or camera viewfinder.
The following types are accessed by using Qt Audio Engine:
import
QtAudioEngine 1.1
-
AttenuationModelInverse: Defines a non-linear attenuation curve for a Sound.
-
AttenuationModelLinear: Defines a linear attenuation curve for a Sound.
-
AudioCategory: Control all active sound instances by group.
-
AudioEngine: Organize all your 3d audio content in one place.
-
AudioListener: Control global listener parameters.
-
AudioSample: Load audio samples, mostly .wav.
-
PlayVariation: 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.
-
Sound: Define a variety of samples and parameters to be used for SoundInstance.
-
SoundInstance: Play 3d audio content.
Multimedia Classes▲
-
QAbstractAudioDeviceInfo: The QAbstractAudioDeviceInfo class is a base class for audio backends.
-
QAbstractAudioInput: The QAbstractAudioInput class provides access for QAudioInput to access the audio device provided by the plugin.
-
QAbstractAudioOutput: The QAbstractAudioOutput class is a base class for audio backends.
-
QAbstractPlanarVideoBuffer: The QAbstractPlanarVideoBuffer class is an abstraction for planar video data.
-
QAbstractVideoBuffer: The QAbstractVideoBuffer class is an abstraction for video data.
-
QAbstractVideoFilter: The QAbstractVideoFilter class represents a filter that is applied to the video frames received by a VideoOutput type.
-
QAbstractVideoSurface: The QAbstractVideoSurface class is a base class for video presentation surfaces.
-
QAudio: The QAudio namespace contains enums used by the audio classes.
-
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.
-
QAudioDecoder: The QAudioDecoder class allows decoding audio.
-
QAudioDeviceInfo: The QAudioDeviceInfo class provides an interface to query audio devices and their functionality.
-
QAudioEncoderSettings: The QAudioEncoderSettings class provides a set of audio encoder settings.
-
QAudioFormat: The QAudioFormat class stores audio stream parameter information.
-
QAudioInput: The QAudioInput class provides an interface for receiving audio data from an audio input device.
-
QAudioOutput: The QAudioOutput class provides an interface for sending audio data to an audio output device.
-
QAudioProbe: The QAudioProbe class allows you to monitor audio being played or recorded.
-
QAudioRecorder: The QAudioRecorder class is used for the recording of audio.
-
QAudioSystemPlugin: The QAudioSystemPlugin class provides an abstract base for audio plugins.
-
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.
-
QCameraExposure: The QCameraExposure class provides interface for exposure related camera settings.
-
QCameraFocus: The QCameraFocus class provides an interface for focus and zoom related camera settings.
-
QCameraFocusZone: The QCameraFocusZone class provides information on zones used for autofocusing a camera.
-
QCameraImageCapture: The QCameraImageCapture class is used for the recording of media content.
-
QCameraImageProcessing: The QCameraImageProcessing class provides an interface for image processing related camera settings.
-
QCameraInfo: The QCameraInfo class provides general information about camera devices.
-
QCameraViewfinderSettings: The QCameraViewfinderSettings class provides a set of viewfinder settings.
-
QGraphicsEffect: The QGraphicsEffect class is the base class for all graphics effects.
-
QGraphicsVideoItem: The QGraphicsVideoItem class provides a graphics item which display video produced by a QMediaObject.
-
QImageEncoderSettings: The QImageEncoderSettings class provides a set of image encoder settings.
-
QMediaBindableInterface: The QMediaBindableInterface class is the base class for objects extending media objects functionality.
-
QMediaContent: The QMediaContent class provides access to the resources relating to a media content.
-
QMediaControl: The QMediaControl class provides a base interface for media service controls.
-
QMediaMetaData: Provides identifiers for meta-data attributes.
-
QMediaObject: The QMediaObject class provides a common base for multimedia objects.
-
QMediaPlayer: The QMediaPlayer class allows the playing of a media source.
-
QMediaPlaylist: The QMediaPlaylist class provides a list of media content to play.
-
QMediaRecorder: The QMediaRecorder class is used for the recording of media content.
-
QMediaResource: The QMediaResource class provides a description of a media resource.
-
QMediaService: The QMediaService class provides a common base class for media service implementations.
-
QMediaTimeInterval: The QMediaTimeInterval class represents a time interval with integer precision.
-
QMediaTimeRange: The QMediaTimeRange class represents a set of zero or more disjoint time intervals.
-
QMultimedia: The QMultimedia namespace contains miscellaneous identifiers used throughout the Qt Multimedia library.
-
QRadioData: The QRadioData class provides interfaces to the RDS functionality of the system radio.
-
QRadioTuner: The QRadioTuner class provides an interface to the systems analog radio device.
-
QSound: The QSound class provides a method to play .wav sound files.
-
QSoundEffect: The QSoundEffect class provides a way to play low latency sound effects.
-
QStaticText: The QStaticText class enables optimized drawing of text when the text and its layout is updated rarely.
-
QVideoEncoderSettings: The QVideoEncoderSettings class provides a set of video encoder settings.
-
QVideoFilterRunnable: The QVideoFilterRunnable class represents the implementation of a filter that owns all graphics and computational resources, and performs the actual filtering or calculations.
-
QVideoFrame: The QVideoFrame class represents a frame of video data.
-
QVideoProbe: The QVideoProbe class allows you to monitor video frames being played or recorded.
-
QVideoSurfaceFormat: The QVideoSurfaceFormat class specifies the stream format of a video presentation surface.
-
QVideoWidget: The QVideoWidget class provides a widget which presents video produced by a media object.