多媒体

Qt 中的多媒体支持,通过 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.

特征

这里是 Qt Multimedia API 能做什么的一些范例:

  • 访问输入/输出原生音频设备
  • 播放低延迟音效
  • 播放 playlist 媒体文件 (譬如:压缩音频/视频文件)
  • 录制音频并压缩
  • 调整和收听无线电台
  • 使用摄像头 (包括取景器) 捕获图像 录制影片
  • 播放 3D 位置音频,采用 Qt Audio Engine
  • 把音频媒体文件解码到内存中进行处理
  • 在播放 (或录制) 视频帧/音频缓冲时,访问它们

多媒体组件

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 多媒体后端开发 .

先前版本的变化

If you previously used Qt Multimedia in Qt 4, or used Qt Multimedia Kit in Qt Mobility, please see Qt Multimedia 的变化 for more information on what changed, and what you might need to change when porting code.

参考文档编制

QML 类型

访问 QML 类型,通过使用:

import QtMultimedia 5.8
							

Audio

把音频回放添加到场景

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

控制摄像头录制视频

MediaPlayer

把媒体回放添加到场景

Playlist

针对要播放的指定媒体列表

PlaylistItem

定义 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

Type provides a way to play sound effects in QML

Torch

Simple control over torch functionality

Video

展示指定视频的方便类型

VideoOutput

渲染视频或摄像头取景器

访问下列类型,通过使用 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

播放 3D 音频内容

多媒体类

QCamera::FrameRateRange

FrameRateRange 表示最小和最大速率的帧速率范围

QAbstractAudioDeviceInfo

音频后端基类

QAbstractAudioInput

访问 QAudioInput,以访问由插件提供的音频设备

QAbstractAudioOutput

音频后端基类

QAbstractPlanarVideoBuffer

抽象平面视频数据

QAbstractVideoBuffer

抽象视频数据

QAbstractVideoFilter

表示应用于 VideoOutput 类型接收视频帧的过滤器

QAbstractVideoSurface

视频呈现表面的基类

QAudio

包含用于音频类的枚举

QAudioBuffer

表示具有特定格式和采样率的音频样本的集合

QAudioDecoder

允许解码音频

QAudioDeviceInfo

查询音频设备及其功能的接口

QAudioEncoderSettings

音频编码器设置集

QAudioFormat

存储音频流参数信息

QAudioInput

从音频输入设备接收音频数据的接口

QAudioOutput

把音频数据发送到音频输出设备的接口

QAudioProbe

允许监视正播放 (或录制) 音频

QAudioRecorder

用于录制音频

QAudioSystemPlugin

音频插件抽象基

QCamera

系统摄像头设备接口

QCameraExposure

用于曝光相关摄像头设置的接口

QCameraFocus

Interface for focus and zoom related camera settings

QCameraFocusZone

Information on zones used for autofocusing a camera

QCameraImageCapture

用于录制媒体内容

QCameraImageProcessing

Interface for image processing related camera settings

QCameraInfo

General information about camera devices

QCameraViewfinderSettings

取景器设置集

QGraphicsEffect

用于所有图形效果的基类

QGraphicsVideoItem

显示 QMediaObject 产生视频的图形项

QImageEncoderSettings

图像编码器设置集

QMediaBindableInterface

用于扩展媒体对象功能的对象基类

QMediaContent

Access to the resources relating to a media content

QMediaControl

Base interface for media service controls

QMediaMetaData

提供元数据属性标识符

QMediaObject

用于多媒体对象的公共基

QMediaPlayer

允许播放媒体源

QMediaPlaylist

要播放的媒体内容列表

QMediaRecorder

用于录制媒体内容

QMediaResource

Description of a media resource

QMediaService

Common base class for media service implementations

QMediaTimeInterval

Represents a time interval with integer precision

QMediaTimeRange

Represents a set of zero or more disjoint time intervals

QMultimedia

包含用于整个 Qt Multimedia 库的杂项标识符

QRadioData

Interfaces to the RDS functionality of the system radio

QRadioTuner

Interface to the systems analog radio device

QSound

播放 .wav 声音文件的方法

QSoundEffect

播放低延迟声音效果的办法

QStaticText

当文本及其布局很少更新时,启用优化文本绘制

QVideoEncoderSettings

视频编码器设置集

QVideoFilterRunnable

表示拥有所有图形 计算资源,履行实际过滤 (或计算) 的过滤器实现

QVideoFrame

表示视频数据帧

QVideoProbe

允许监视正播放 (或录制) 视频帧

QVideoSurfaceFormat

指定视频呈现表面的流格式

QVideoWidget

呈现媒体对象产生视频的小部件

QAudioBuffer::StereoFrame

立体声音频帧的简单包裹器