QPlaybackOptions Class

The QPlaybackOptions class enables low-level control of media playback options. More...

Header: #include <QPlaybackOptions>
CMake: find_package(Qt6 REQUIRED COMPONENTS Multimedia)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia)
qmake: QT += multimedia
Since: Qt 6.10
In QML: playbackOptions

Public Types

(since 6.10) enum class PlaybackIntent { Playback, LowLatencyStreaming }

Properties

Public Functions

std::chrono::milliseconds networkTimeout() const
QPlaybackOptions::PlaybackIntent playbackIntent() const
qsizetype probeSize() const
void resetNetworkTimeout()
void resetPlaybackIntent()
void resetProbeSize()
void setNetworkTimeout(std::chrono::milliseconds timeout)
void setPlaybackIntent(QPlaybackOptions::PlaybackIntent intent)
void setProbeSize(qsizetype probeSizeBytes)

Detailed Description

QPlaybackOptions gives low-level control of media playback options. Although we strongly recommend to rely on the default settings of QMediaPlayer, QPlaybackOptions can be used to optimize media playback to specific use cases where the default options are not ideal.

Note that options are hints to the media backend, and may be ignored if they are not supported by the current media format or codec.

Playback options rely on support in the media backend. Availability is documented per option.

See also QMediaPlayer.

Member Type Documentation

[since 6.10] enum class QPlaybackOptions::PlaybackIntent

Configures the intent of media playback, to focus on either high quality playback or low latency media streaming.

ConstantValueDescription
QPlaybackOptions::PlaybackIntent::Playback0The intent is robust and high quality media playback, enabling sufficient buffering to prevent glitches during playback.
QPlaybackOptions::PlaybackIntent::LowLatencyStreaming1Buffering is reduced to optimize for low latency streaming, but with a higher likelihood of lost frames or other glitches during playback.

This enum was introduced in Qt 6.10.

Property Documentation

[since 6.10] networkTimeout : std::chrono::milliseconds

Determines the network timeout used for socket I/O operations with some network formats.

This option is only supported with the FFmpeg media backend.

This property was introduced in Qt 6.10.

Access functions:

std::chrono::milliseconds networkTimeout() const
void setNetworkTimeout(std::chrono::milliseconds timeout)
void resetNetworkTimeout()

[since 6.10] playbackIntent : PlaybackIntent

Determines if QMediaPlayer should optimize for robust high quality video playback (default), or low latency streaming.

This option is only supported with the FFmpeg media backend.

This property was introduced in Qt 6.10.

Access functions:

QPlaybackOptions::PlaybackIntent playbackIntent() const
void setPlaybackIntent(QPlaybackOptions::PlaybackIntent intent)
void resetPlaybackIntent()

[since 6.10] probeSize : qsizetype

Probesize defines the amount of data (in bytes) to analyze in order to gather stream information before media playback starts.

A larger probesize value can give more robust playback but may increase latency. Conversely, a smaller probesize can reduce latency but might miss some stream details. The default probesize is -1, and the actual probesize is determined by the media backend.

This option is only supported with the FFmpeg media backend.

This property was introduced in Qt 6.10.

Access functions:

qsizetype probeSize() const
void setProbeSize(qsizetype probeSizeBytes)
void resetProbeSize()

© 2025 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.