PyTorch发布TorchCodec 1.0媒体层
PyTorch宣布TorchCodec 1.0成为其媒体解码与编码API的稳定统一入口。该版本覆盖视频、音频和图像,新增底层流水线、多线程或多进程解码、原始YUV访问、自定义颜色转换及CPU或GPU执行,并支持将PyTorch张量编码为媒体。PyTorch还称,TorchCodec已投入生产使用两年多,并被Hugging Face的datasets、transformers和LeRobot,以及vLLM、SGLang等项目采用。
TorchCodec 1.0将多模态媒体处理集中到PyTorch,并通过底层控制支持定制和调优解码流水线,直接关系到视频、音频与图像模型的训练和推理。

TorchCodec 1.0 is here! TorchCodec started out as a video decoding library with a simple goal: efficiently turning encoded videos into RGB video frame tensors. Since then, it has grown to decode and encode all media, including audio and images. As we described in our previous post, TorchCodec is now where all of PyTorch’s media decoding and encoding lives. Our APIs have been stable for a while, and 1.0 makes it official!
TorchCodec has been used in production for over two years, and it is a key part of many multimodal projects. Hugging Face libraries like datasets, transformers and LeRobot rely on TorchCodec to decode audio and video, from dataset samples to model inputs. vLLM uses TorchCodec to decode the video, audio and images sent to multimodal models, on CPU or GPU. SGLang uses it as its preferred video and audio decoder, including GPU video decoding.
#PyTorch#TorchCodec 1.0#TorchVision#TorchAudio#Hugging Face#transformers#LeRobot#vLLM#SGLang#FFmpeg#NVIDIA NVDEC