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 值可降低延迟,但可能会遗漏部分流媒体细节。probesize 的默认值为 -1,实际值由媒体后端决定。
请注意,过小的 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.