IO Module¶
The spdl.io module is a stand-alone module that implements efficient loading of data into array formats.
It is mainly designed for AI training/inference running in the cloud. It supports converting various data formats in byte strings (downloaded from remote storage) into array format, and transferring it to GPU without interrupting the model computation on GPU.
The module can decode images and videos into various color formats (RGB, YUV420p, NV12, etc.) to support different use cases and optimize memory usage for specific applications. See Video Color Space for the supported pixel formats and how to select them.
The following diagram illustrates this workflow:
The IO module contains efficient implementations for commonly used formats. This section provides detailed documentation on how to use these implementations.
- High-Level Loading Functions
- Decoding Process Overview
- Packets and Frames
- Filter Graphs
- Video Color Space
- Advanced Filter Graphs
- Streaming Decoding
- Hardware-Accelerated Video Decoding
- Loading NumPy Arrays
- Media Encoding
- FFmpeg CLI Cheat Sheet
DemuxConfig—demux_config(...)DecodeConfig—decode_config(...)VideoEncodeConfig—video_encode_config(...)AudioEncodeConfig—audio_encode_config(...)- Encoder selection —
Muxer.add_encode_stream(...) - Output container —
Muxer(...)/Muxer.open(...) - Video filters —
get_video_filter_desc(...) - Audio filters —
get_audio_filter_desc(...) - Complex filter graphs —
FilterGraph CUDAConfig—cuda_config(...)- NVDEC / nvJPEG — not a 1:1 of
*_cuvid - Deliberately not mapped