PlaybackOptions QML Type
低级媒体播放选项。更多
| Import Statement: | import QtMultimedia |
| Since: | Qt 6.10 |
| In C++: | QPlaybackOptions |
属性
- networkTimeoutMs : qint64
(since 6.10) - playbackIntent : enumeration
(since 6.10) - probeSize : qsizetype
(since 6.10)
详细说明
播放选项提供了媒体播放选项的底层控制。虽然我们强烈建议使用MediaPlayer 的默认设置,但在默认选项不理想的特定使用情况下,可以使用 PlaybackOptions 来优化媒体播放。
请注意,选项是对媒体后端的提示,如果当前媒体格式或编解码器不支持这些选项,则可能会被忽略。
播放选项依赖于媒体后端的支持。每个选项都记录了可用性。
另请参阅 MediaPlayer 。
属性文档
networkTimeoutMs : qint64 [since 6.10]
确定某些网络格式的套接字 I/O 操作所使用的网络超时(毫秒)。
该选项仅支持 FFmpeg 媒体后端。
此属性在 Qt 6.10 中引入。
playbackIntent : enumeration [since 6.10]
决定MediaPlayer 应为稳健的高质量视频播放(默认)还是低延迟流进行优化。
该选项仅支持 FFmpeg 媒体后端。
| 常量 | 说明 |
|---|---|
PlaybackOptions.Playback | 目的是实现稳健的高质量媒体播放,提供足够的缓冲以防止播放过程中出现故障。 |
PlaybackOptions.LowLatencyStreaming | 减少缓冲可优化低延迟流媒体,但在播放过程中出现丢失帧或其他故障的可能性较高。 |
此属性在 Qt 6.10 中引入。
probeSize : qsizetype [since 6.10]
probesize 定义了在媒体播放开始前为收集流信息而分析的数据量(以字节为单位)。
探测值越大,播放效果越好,但可能会增加延迟。反之,较小的 probesize 值可以减少延迟,但可能会错过一些流细节。默认 probesize 为-1,实际 probesize 由媒体后端决定。
请注意,probeSize 太小可能导致无法播放媒体,而 probeSize 太大则会增加延迟。
只有 FFmpeg 媒体后端支持该选项。
此属性在 Qt 6.10 中引入。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.