spdl.io

Overview

Implements the core I/O functionalities.

API Reference

Functions

load_audio

load_audio

Load audio from source into buffer.

load_video

load_video

Load video from source into buffer.

load_image

load_image

Load image from source into buffer.

load_image_batch

load_image_batch

Batch load images.

load_image_batch_nvjpeg

load_image_batch_nvjpeg

[Experimental] Batch load images with nvJPEG.

sample_decode_video

sample_decode_video

Decode specified frames from the packets.

demux_audio

demux_audio

Demux audio from the source.

demux_video

demux_video

Demux video from the source.

demux_image

demux_image

Demux image from the source.

decode_packets

decode_packets

Decode packets.

decode_packets_nvdec

decode_packets_nvdec

[Experimental] Decode packets with NVDEC.

streaming_decode_packets

streaming_decode_packets

Decode the video packets chunk by chunk.

decode_image_nvjpeg

decode_image_nvjpeg

[Experimental] Decode image with nvJPEG.

get_audio_filter_desc

get_audio_filter_desc

Construct FFmpeg filter expression for preprocessing audio.

get_video_filter_desc

get_video_filter_desc

Construct FFmpeg filter expression for preprocessing video/image.

get_filter_desc

get_filter_desc

Get the filter to process the given packets.

convert_array

convert_array

Convert the given array to buffer.

convert_frames

convert_frames

Convert the decoded frames to buffer.

transfer_buffer

transfer_buffer

Move the given CPU buffer to CUDA device.

transfer_buffer_cpu

transfer_buffer_cpu

Move the given CUDA buffer to CPU.

to_numba

to_numba

Convert to Numba DeviceNDArray or NumPy NDArray.

to_numpy

to_numpy

Convert to NumPy NDArray.

to_torch

to_torch

Convert to PyTorch Tensor.

to_jax

to_jax

Convert to JAX Array.

encode_image

encode_image

Save the given image array/tensor to file.

demux_config

demux_config

Customize demuxing behavior.

decode_config

decode_config

Customize decoding behavior.

encode_config

encode_config

Customize encoding behavior.

cuda_config

cuda_config

Sprcify the CUDA device and memory management.

cpu_storage

cpu_storage

Allocate a block of memory.

load_npz

load_npz

[Experimental] Load a numpy archive file (npz).

Classes

Demuxer

Demuxer

Demuxer can demux audio, video and image from the soure.

Packets

Packets

Packets object.

AudioPackets

AudioPackets

Packets object containing audio samples.

VideoPackets

VideoPackets

Packets object containing video frames.

ImagePackets

ImagePackets

Packets object contain an image frame.

Frames

Frames

Frames object.

AudioFrames

AudioFrames

Audio frames.

VideoFrames

VideoFrames

Video frames.

ImageFrames

ImageFrames

Image frames.

CPUBuffer

CPUBuffer

Buffer implements array interface.

CUDABuffer

CUDABuffer

CUDABuffer implements CUDA array interface.

DemuxConfig

DemuxConfig

Demux configuration.

DecodeConfig

DecodeConfig

Decode configuration.

EncodeConfig

EncodeConfig

Encode configuration.

CUDAConfig

CUDAConfig

Specify the CUDA devie and memory management.

CPUStorage

CPUStorage

Allocate a block of CPU memory.

NpzFile

NpzFile

A class mimics the behavior of numpy.lib.npyio.NpzFile.