Skip to content
HN On Hacker News ↗

Release TorchCodec 0.14: HDR Video Decoding for CPU & CUDA, and Fast Wav Decoder · meta-pytorch/torchcodec

▲ 62 points • 13 comments • by scott_s • 5mo ago • HN discussion ↗

Pangram verdict · v3.3

We believe that this document is fully human-written

1 %

AI likelihood · overall

Human
100% human-written 0% AI-generated
SEGMENTS · HUMAN 1 of 1
SEGMENTS · AI 0 of 1
WORD COUNT 239
PEAK AI % 1% · §1
Analyzed
Jun 14
backend: pangram/v3.3
Segments scanned
1 windows
avg 239 words each
Distribution
100 / 0%
human / AI fraction
Verdict
Human
Pangram v3.3

Article text · 239 words · 1 segments analyzed

Human AI-generated
§1 Human · 1%

TorchCodec 0.14 is out! It is compatible with torch >= 2.11. It comes with two major additions: a fast audio WavDecoder, and support for HDR video decoding! Fast wav decoder TorchCodec now has a dedicated WavDecoder for decoding WAV files. It bypasses FFmpeg entirely and reads WAV data directly, resulting in significantly faster decoding. It supports multiple sample formats (int16, int32, float32, etc.), and can decode from files, bytes, or file-like objects. from torchcodec.decoders import WavDecoder

decoder = WavDecoder("audio.wav") samples = decoder.get_all_samples() # AudioSamples with data and sample_rate Read more in our docs. HDR Video Decoding VideoDecoder now supports HDR (High Dynamic Range) video decoding without losing precision. When output_dtype=torch.float32 is specified, the decoder outputs RGB float32 frames in [0, 1], preserving the full HDR color range. This is supported for both CPU and CUDA! import torch from torchcodec.decoders import VideoDecoder

decoder = VideoDecoder("hdr_video.mp4", output_dtype=torch.float32) frame = decoder[0] # Full HDR precision in float32 Read more in our docs. ⚠ This feature is in beta stage, so behavior may slightly change depending on user feedback. Let us know if you encounter any issue! Other Improvements

Improved audio seeking: AudioDecoder seeking is now much faster (#1449) Dropped NPP dependency: TorchCodec no longer depends on NVIDIA's NPP library, which will simplify installing and using TorchCodec for CUDA decoding.

Bug Fixes

Fix a rare crash scenario during process teardown with the CUDA decoder (#1441) Fix CUDA decoding of videos with odd dimensions(#1462)