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 能做什么的一些范例:
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:
用例 | 范例 | QML 类型 | C++ 类 | |
---|---|---|---|---|
播放音效 | QSoundEffect | |||
播放低延迟音频 | audioinput , spectrum | QAudioOutput | ||
播放编码音频 (MP3 AAC 等) | player | Audio , MediaPlayer | QMediaPlayer | |
访问原生音频输入数据 | spectrum , audioinput | QAudioInput | ||
录制编码音频数据 | audiorecorder | QAudioRecorder | ||
探索原生音频设备 | audiodevices | QAudioDeviceInfo | ||
视频回放 | player , qmlvideo , qmlvideofx | MediaPlayer , VideoOutput , Video | QMediaPlayer , QVideoWidget , QGraphicsVideoItem | |
视频处理 | qmlvideofx | MediaPlayer , VideoOutput | QMediaPlayer , QAbstractVideoSurface , QVideoFrame | |
收听无线电 | declarative-radio | Radio , RadioData | QRadioTuner, QRadioData | |
访问摄像头取景器 | camera , declarative-camera | Camera , VideoOutput | QCamera , QVideoWidget , QGraphicsVideoItem | |
取景器处理 | Camera , VideoOutput | QCamera , QAbstractVideoSurface , QVideoFrame | ||
捕获照片 | camera , declarative-camera | Camera | QCamera , QCameraImageCapture | |
捕获影片 | camera , declarative-camera | Camera | QCamera , QMediaRecorder | |
3D 音源 | Audio Engine | AudioEngine , Sound |
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 类型,通过使用:
import QtMultimedia 5.8
把音频回放添加到场景 |
|
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 |
|
控制摄像头录制视频 |
|
把媒体回放添加到场景 |
|
针对要播放的指定媒体列表 |
|
定义 Playlist 播放列表项 |
|
Provides a global object with useful functions from Qt Multimedia |
|
Access RDS data from a QML application |
|
Type provides a way to play sound effects in QML |
|
Simple control over torch functionality |
|
展示指定视频的方便类型 |
|
渲染视频或摄像头取景器 |
访问下列类型,通过使用 Qt Audio Engine :
import QtAudioEngine 1.14
Defines a non-linear attenuation curve for a Sound |
|
Defines a 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 |
|
播放 3D 音频内容 |
音频后端基类 |
|
访问 QAudioInput,以访问由插件提供的音频设备 |
|
音频后端基类 |
|
抽象平面视频数据 |
|
抽象视频数据 |
|
表示应用于 VideoOutput 类型接收视频帧的过滤器 |
|
视频呈现表面的基类 |
|
包含用于音频类的枚举 |
|
表示具有特定格式和采样率的音频样本的集合 |
|
立体声音频帧的简单包裹器 |
|
允许解码音频 |
|
查询音频设备及其功能的接口 |
|
音频编码器设置集 |
|
存储音频流参数信息 |
|
从音频输入设备接收音频数据的接口 |
|
把音频数据发送到音频输出设备的接口 |
|
允许监视正播放 (或录制) 音频 |
|
用于录制音频 |
|
音频插件抽象基 |
|
系统摄像头设备接口 |
|
FrameRateRange 表示最小和最大速率的帧速率范围 |
|
用于曝光相关摄像头设置的接口 |
|
Interface for focus and zoom related camera settings |
|
Information on zones used for autofocusing a camera |
|
用于录制媒体内容 |
|
Interface for image processing related camera settings |
|
General information about camera devices |
|
取景器设置集 |
|
用于所有图形效果的基类 |
|
显示 QMediaObject 产生视频的图形项 |
|
图像编码器设置集 |
|
用于扩展媒体对象功能的对象基类 |
|
访问媒体内容相关资源 |
|
Base interface for media service controls |
|
提供元数据属性标识符 |
|
用于多媒体对象的公共基 |
|
允许播放媒体源 |
|
要播放的媒体内容列表 |
|
用于录制媒体内容 |
|
Common base class for media service implementations |
|
Represents a time interval with integer precision |
|
Represents a set of zero or more disjoint time intervals |
|
包含用于整个 Qt Multimedia 库的杂项标识符 |
|
播放 .wav 声音文件的方法 |
|
播放低延迟声音效果的办法 |
|
当文本及其布局很少更新时,启用优化文本绘制 |
|
视频编码器设置集 |
|
表示拥有所有图形 计算资源,履行实际过滤 (或计算) 的过滤器实现 |
|
表示视频数据帧 |
|
允许监视正播放 (或录制) 视频帧 |
|
指定视频呈现表面的流格式 |
|
呈现媒体对象产生视频的小部件 |