Skip to content

TorchCodec 0.10

Latest

Choose a tag to compare

@Dan-Flores Dan-Flores released this 22 Jan 15:56
· 25 commits to main since this release
0b261b9

TorchCodec 0.10 is out! It is compatible with torch 2.10, and comes with exciting new features.

Decoder Transforms

Decoder Transforms are available! We have released Resize, CenterCrop, RandomCrop, which can be used in VideoDecoder to transform data during preprocessing:

resize_decoder = VideoDecoder(
    video_path,
    transforms= [
        torchcodec.transforms.RandomCrop(size=(1280, 1664)),
        torchcodec.transforms.Resize(size=(480, 640)),
    ]
)
resized_frame = resize_decoder[5]

Read more about this in the tutorial!

Let us know any transforms you want to see added in #1134!

Video Encoding on GPU

VideoEncoder now supports encoding on GPU! This can improve performance by ~3x!
To use it, simply move the input frames onto the CUDA device before encoding:

encoder = VideoEncoder(frames=frames.cuda(), frame_rate=frame_rate)
encoder.to_file(dest="output.mp4", codec="h264_nvenc")

Performance Tips guide

Check out our new performance tips guide to read about best practices to improve performance!
The guide covers batch APIs, decoding seek modes, multi-threading, GPU decoding, and checking for CPU fallback during decoding.

Enhancements

  • We've added a detailed stack trace when FFmpeg is not found. This should help debug installation issues on various development environments. (#1138)
  • On MacOS, we've improved Homebrew FFmpeg discoverability. (#1152, #1175, #1177)