TorchCodec 0.13 is out! It is compatible with torch >= 2.11, and it is packed with new features.
Multi-stream iterative Encoder
This release comes with a new major feature: the multi-stream Encoder! The Encoder supports multiple streams and incremental encoding. Frames and samples can be added progressively, which is useful when data is generated on-the-fly or when encoding both audio and video into the same container.
from torchcodec.encoders import Encoder
encoder = Encoder()
video_stream = encoder.add_video(height=256, width=256, frame_rate=30)
audio_stream = encoder.add_audio(sample_rate=16000, num_channels=1)
with encoder.open_file("output.mp4"):
video_stream.add_frames(frames_tensor)
audio_stream.add_samples(samples_tensor)
# Add more frames by calling video_stream.add_frames again
# Add more samples by calling audio_stream.add_samples againThe Encoder also supports CUDA encoding! Read more in our docs!
Broader support for aarch64 and Windows
Based on popular requests, we are now shipping aarch64 CPU wheels and Windows CUDA wheels. Both are in beta status, so let us know if you encounter any issue. See our installation instructions for more details.
TorchCodec now officially supports the following platforms:
- Linux x86 (CUDA and CPU)
- Linux aarch64 (CUDA and CPU)
- Windows (CUDA and CPU)
- MacOs
CUDA wheels now shipped on PyPI by default
pip install torchcodec should now install the CUDA wheels by default on Linux x86 and aarch64. Those wheels should still work even if you do not have a CUDA GPU, or if you are missing CUDA dependencies. Let us know if you encounter any issue.
To install the CPU-only wheels, please refer to our installation instructions.