TorchCodec 0.8 is out, and is compatible with torch 2.9!
Faster GPU decoding!
Faster video decoding on GPU is available, with our new Beta CUDA backend! We have observed up to 3x speedups compared to our previous GPU decoding implementation, and up to 90% NVDEC utilization.
We are releasing it as a Beta feature that we will polish over time, but we are confident it is ready to use, and we are eager to hear your feedback! Eventually, this Beta backend will become the default.
To use it, you just need to specify the "beta" backend when creating the VideoDecoder instance:
from torchcodec.decoders import set_cuda_backend, VideoDecoder
with set_cuda_backend("beta"):
dec = VideoDecoder("file.mp4", device="cuda")
# All existing methods are supported
batch = dec.get_frames_at(...)Custom Frame Mappings
Video decoding now accepts pre-computed frame index data for faster VideoDecoder instantiation speeds, while maintaining exact frame seeking accuracy.
Read more about this feature in our tutorial!
Enhancements
- #935, #947 - Enabled compatibility with FFmpeg8 for Linux and Mac
- #899 - More robust support for 10-bit videos on CUDA.
- #915 - Added support for tensor indices in
dec.get_frames_at(indices)and for timestamps indec.get_frames_played_at(timestamps).
Bug fixes
- #901 - Fixed a rare floating point error in
clips_at_regular_timestamps()