Skip to content

TorchCodec 0.3

Latest
Compare
Choose a tag to compare
@NicolasHug NicolasHug released this 24 Apr 09:29
· 8 commits to main since this release
b3725a7

TorchCodec 0.3.0 is out! It comes with two new major features: Audio decoding, and Streaming.

Audio decoding

You can now decode audio streams from videos, or from audio files! The AudioDecoder looks a lot like the existing VideoDecoder:

from torchcodec.decoders import AudioDecoder

decoder = AudioDecoder(path_to_audio)
samples = decoder.get_all_samples()

print(samples)
# AudioSamples:
#  data (shape): torch.Size([2, 4297722])
#  pts_seconds: 0.02505668934240363
#  duration_seconds: 97.45401360544217
#  sample_rate: 44100

Lean more in our tutorial.

Streaming

You can now decode steaming videos and audio! That is, when files do not reside locally, TorchCodec now supports downloading only the data segments that are needed to decode the frames you care about. The API is generic and integrates nicely with existing file-like interfaces like fsspec and others.

Learn more in our tutorial.


Bug fixes

  • VideoDecoder now accept a torch.device parameter (#607)
  • Fix PTS of the first frame (#565)