Recommended Free Tools
Use TorchCodec to decode or encode images, video, and audio; use TorchVision to transform image and video tensors, and TorchAudio to transform audio tensors. The change was gradual: older media I/O APIs were deprecated and removed on different schedules, so the right migration depends on the library and version in your project.
Which PyTorch library should I use to decode video or audio?
Choose by operation, not just by media type. TorchCodec handles conversion between media and tensors; TorchVision and TorchAudio handle transformations after media is represented as tensors.
As an Amazon Associate I earn from qualifying purchases.
| Task | Library | Example |
|---|---|---|
| Decode or encode images, video, or audio | TorchCodec | Decode video frames into a tensor batch |
| Transform image or video tensors | TorchVision | Apply TorchVision v2 transforms to decoded frames |
| Transform audio tensors | TorchAudio | Apply MelSpectrogram to decoded audio |
The examples illustrate how the libraries fit together; they are not performance guarantees. The PyTorch overview also points to Hugging Face libraries as examples of other ecosystem tools for functions such as models and datasets.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
A typical video pipeline
Use TorchCodec’s VideoDecoder to retrieve frames as a batch, then pass the resulting tensor to TorchVision v2 transforms. Decoding and preprocessing are separate steps, and both may remain part of a video workflow.
#1 Best Overall
A typical audio pipeline
Use TorchCodec’s AudioDecoder to decode audio, then apply an audio transform such as TorchAudio’s MelSpectrogram.
Why PyTorch consolidated media I/O
Media decoding and encoding had been spread across multiple entry points and backends. TorchVision offered video utilities and image I/O, while TorchAudio included media streaming and audio decoding and encoding utilities. Their backend options included PyAV, FFmpeg, CUDA/NVCUVID, libsoundfile, and libsox, depending on the library and task.
Rank #2
That arrangement meant overlapping implementations to maintain and optimize. In its October 5, 2026 overview, PyTorch says centralizing media decoding and encoding in TorchCodec supports focused optimization, reduces duplicated maintenance, and makes library roles more predictable. The authors characterize TorchCodec as generally more performant than earlier TorchVision and TorchAudio implementations, particularly for CUDA video decoding; that is the project’s assessment, not an independent comparative benchmark.
Free tools Windows power users keep installed
One-click scans. No signup required.
What changed, and when
The migration was staged rather than a single coordinated removal. Check the release notes for the version you use before changing imports or dependencies.
Rank #3
| Library or change | Version or date | What the official material says |
|---|---|---|
| TorchVision video I/O deprecation | Beginning with version 0.22 | The April 2025 announcement said video decoding and encoding were deprecated, with removal planned for 0.24. Read the announcement. |
| TorchVision video I/O removal | Version 0.26 release notes | Utilities including torchvision.io.video.*, read_video, write_video, and VideoReader were removed. Check the release history. |
| TorchVision image I/O | Later release notes | Image decoding and encoding were marked deprecated; the notes direct users to TorchCodec 0.16 or later and a migration guide. Consult the TorchVision release notes for the applicable release details. |
| TorchAudio decoding and encoding APIs | Announcement planned deprecation from 2.8 and removal in 2.9 | The project announcement set out this schedule and said many transforms, functional APIs, models, pipelines, and Kaldi compliance APIs would remain. Treat the dates as the announced schedule unless checking a specific installed release. Read the TorchAudio announcement. |
| TorchCodec scope | 2024 announcement and October 2026 overview | The 2024 launch announcement described future audio support; the later overview describes consolidated image, video, and audio decoding and encoding. An early launch description should not be taken as the current scope. Read the launch announcement. |
The same October 2026 overview says TorchCodec, TorchVision, and TorchAudio are ABI stable and do not need to match every PyTorch release. ABI stability does not replace checking installation instructions and migration guidance for your environment.
How to migrate from torchvision.io or TorchAudio media decoding
- Identify the operation. List the code that reads or writes media separately from the code that transforms tensors. Move decoding and encoding work to TorchCodec; retain the appropriate tensor transformations in TorchVision or TorchAudio.
- Check the exact release you depend on. Use the TorchVision release history for the status of image or video APIs, and the TorchAudio project announcement alongside release-specific documentation for audio APIs.
- Replace the media I/O path with the matching TorchCodec decoder or encoder. For example, use
VideoDecoderto retrieve video frames andAudioDecoderto decode audio, then feed the tensors into your existing transform stage. - Validate the full pipeline in its deployment environment. Check that the codecs your files need are available through the installed FFmpeg version, and confirm that your CPU or CUDA execution path works for the installed build.
The PyTorch overview gives the library roles and examples; consult its linked migration documentation for API-specific conversion details rather than assuming a one-to-one replacement for every older call.
Rank #4
CPU, CUDA, and codec availability
TorchCodec documents CPU decoding as well as CUDA-accelerated decoding for workloads that benefit from higher throughput. CUDA is an option, not a requirement for decoding media. The launch announcement also describes retrieving frames by index or presentation time and sampling batches; accurate seeking can be slower in some cases, so performance depends on the access pattern and workload.
Available codecs depend on the FFmpeg version installed in the environment. Do not assume that every codec or backend is present in every installation, or that CUDA acceleration will improve every workload. Compare the actual deployment requirements—throughput, memory, cost, and hardware availability—before choosing an execution path. The official materials cited here do not establish a particular GPU model as a requirement.
What the transition means for a PyTorch project
- For new media decoding or encoding, start with TorchCodec’s current documentation and installation guidance.
- Keep TorchVision and TorchAudio where their tensor transformations and other retained APIs serve the pipeline.
- Plan upgrades against the specific deprecation or removal notices that affect your code; the older APIs did not all disappear at once.
- Treat performance statements as workload-dependent, especially when deciding whether to use CUDA.
For the current division of responsibilities and the authors’ explanation of the consolidation, see the PyTorch media-processing overview.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




