spdl.io.load_video

load_video(src: str | bytes, timestamp: tuple[float, float] | None = None, *, demux_config: DemuxConfig | None = None, decode_config: DecodeConfig | None = None, filter_desc: str | None = _FILTER_DESC_DEFAULT, device_config: None = None, **kwargs: object) CPUBuffer[source]
load_video(src: str | bytes, timestamp: tuple[float, float] | None = None, *, demux_config: DemuxConfig | None = None, decode_config: DecodeConfig | None = None, filter_desc: str | None = _FILTER_DESC_DEFAULT, device_config: CUDAConfig, **kwargs: object) CUDABuffer

Load video from source into buffer.

This function combines demux_video(), decode_packets(), convert_frames(), and optionally, transfer_buffer(), to produce buffer object from source in one step.

Parameters:
Returns:

Buffer object.

Note

The decoder thread configuration can significantly affect video decoding performance. By default, SPDL uses a single thread for decoding. You can customize this via decode_config using decoder_options={"threads": "X"}, where X is the number of threads (or "0" to let FFmpeg choose automatically).

The optimal configuration depends on your workload’s characteristics. For benchmarking different thread configurations, see Benchmark video.

See also