Rate this Page

torchcodec.decoders#

Video Decoding#

For a video decoder tutorial, see: Decoding a video with VideoDecoder.

VideoDecoder

A single-stream video decoder.

WavDecoder

A fast decoder for WAV audio files.

VideoStreamMetadata

Metadata of a single video stream.

CUDA decoding utils:

set_cuda_backend

Context Manager to set the CUDA backend for VideoDecoder.

set_nvdec_cache_capacity

Set the maximum number of NVDEC decoders that can be cached (per GPU).

get_nvdec_cache_capacity

Get the capacity of the per-device NVDEC decoder cache.

CpuFallbackStatus

Information about CPU fallback status.

Audio Decoding#

For an audio decoder tutorial, see: Decoding audio streams with AudioDecoder.

AudioDecoder

A single-stream audio decoder.

WavDecoder

A fast decoder for WAV audio files.

AudioStreamMetadata

Metadata of a single audio stream.

Image Decoding#

decode_image

Decode an image into a [N]CHW tensor, detecting the format automatically.

decode_jpeg

Decode a JPEG image into a CHW tensor, on CPU or CUDA.

decode_png

Decode a PNG image into a CHW tensor.

decode_webp

Decode a WebP image into a [N]CHW tensor.

decode_gif

Decode a GIF image into a [N]CHW tensor.

decode_avif

Decode an AVIF image into a [N]CHW tensor.

decode_heic

Decode an HEIC/HEIF image into a [N]CHW tensor - requires libheif!

ImageReadMode

Color mode for image decoding.