- Qt 6.10
- Qt Multimedia
- C++ Classes
- QtMultimedia
- QPlaybackOptions
- Qt 6.10.3 Reference Documentation

# 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

- List of all members, including inherited members

## Public Types

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

## Properties

- `(since 6.10)` networkTimeout : std::chrono::milliseconds
- `(since 6.10)` playbackIntent : PlaybackIntent
- `(since 6.10)` probeSize : qsizetype

## 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.

Constant | Value | Description
--- | --- | ---
`QPlaybackOptions::PlaybackIntent::Playback` | `0` | The intent is robust and high quality media playback, enabling sufficient buffering to prevent glitches during playback.
`QPlaybackOptions::PlaybackIntent::LowLatencyStreaming` | `1` | Buffering 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()