spdl.io.load_image_batch

load_image_batch(srcs: list[str | bytes], *, width: int | None, height: int | None, pix_fmt: str | None = 'rgb24', demux_config: DemuxConfig | None = None, decode_config: DecodeConfig | None = None, filter_desc: str | None = _FILTER_DESC_DEFAULT, device_config: None = None, storage: CPUStorage | None = None, strict: bool = True, **kwargs) → CPUBuffer[source]
load_image_batch(srcs: list[str | bytes], *, width: int | None, height: int | None, pix_fmt: str | None = 'rgb24', demux_config: DemuxConfig | None = None, decode_config: DecodeConfig | None = None, filter_desc: str | None = _FILTER_DESC_DEFAULT, device_config: CUDAConfig, storage: CPUStorage | None = None, strict: bool = True, **kwargs) → CUDABuffer

Batch load images.

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

Parameters:
  • srcs – List of source identifiers.

  • width – Optional: Resize the frame.

  • height – Optional: Resize the frame.

  • pix_fmt – Optional: The output pixel format.

  • demux_config – Optional: Demux configuration passed to demux_image().

  • decode_config – Optional: Decode configuration passed to decode_packets().

  • filter_desc – Optional: Filter description passed to decode_packets().

  • device_config – Optional: The CUDA device passed to transfer_buffer(). Providing this argument will move the resulting buffer to the CUDA device.

  • storage – Optional: The storage object passed to convert_frames().

  • strict – Optional: If True, raise an error if any of the images failed to load.

Returns:

A buffer object.