VideoConfiguration
Additional configuration for video playback.
Properties
enable_hardware_acceleration- Whether to enable hardware acceleration.hardware_decoding_api- Sets the --hwdec property on native backend.height- The fixed height for the video output.mpv_properties- Extra mpv/libmpv properties to set on native backends (Windows/macOS/Linux/iOS/Android).output_driver- Sets the --vo property on native backend.scale- The scale for the video output.width- The fixed width for the video output.
Properties
enable_hardware_accelerationclass-attributeinstance-attribute
enable_hardware_acceleration: bool = TrueWhether to enable hardware acceleration. When disabled, may cause battery drain, device heating, and high CPU usage.
hardware_decoding_apiclass-attributeinstance-attribute
hardware_decoding_api: Optional[str] = NoneSets the --hwdec property on native backend.
The default value is platform dependent:
- Windows, GNU/Linux, macOS & iOS :
"auto" - Android:
"auto-safe"
heightclass-attributeinstance-attribute
height: Optional[Number] = NoneThe fixed height for the video output.
mpv_propertiesclass-attributeinstance-attribute
mpv_properties: Optional[dict[str, Union[str, int, float, bool]]] = NoneExtra mpv/libmpv properties to set on native backends (Windows/macOS/Linux/iOS/Android).
The keys are mpv option/property names without the leading --. Values can be
str, int, float or bool. All values are converted to strings before being
passed to mpv; boolean values are converted to "yes" / "no".
Full list of mpv options: https://mpv.io/manual/stable/#options
Example
>>> VideoConfiguration(
mpv_properties={
"profile": "low-latency", # --profile=low-latency
"untimed": True, # --untimed
"volume": 80, # --volume=80
}
)
output_driverclass-attributeinstance-attribute
output_driver: Optional[str] = NoneSets the --vo property on native backend.
The default value is platform dependent:
- Windows, GNU/Linux, macOS & iOS :
"libmpv" - Android:
"gpu"