gitwtfhub

wtf is avtensor?

runwayml/avtensor — explained in plain English

Analysis updated 2026-05-18

60RustAudience · developerComplexity · 4/5LicenseSetup · moderate

TL;DR

avtensor decodes video, audio, and images directly into PyTorch tensors using FFmpeg, built for fast machine learning data pipelines with cloud storage and GPU decode support.

Mindmap

mindmap
  root((avtensor))
    What it does
      Media to tensor decode
      FFmpeg backed
      Cloud storage input
    Tech stack
      Rust
      Python
      PyTorch
      FFmpeg
      CUDA
    Use cases
      ML data pipelines
      GPU accelerated decode
      HDR tone mapping
    Compared to
      torchcodec
      Native cloud support

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Build a fast data-loading pipeline that turns video files directly into PyTorch tensors for model training.

REASON 2

Decode media stored in Google Cloud Storage or S3 without downloading it separately first.

REASON 3

Resize or resample video and audio during decode to save memory and processing time.

REASON 4

Use NVIDIA GPU decoding to keep video frames on the GPU throughout a training pipeline.

What's in the stack?

RustPythonPyTorchFFmpegCUDA

How it stacks up

runwayml/avtensorc4pt0r/piecorrode/refactoring-rust
Stars606061
LanguageRustRustRust
Setup difficultymoderateeasyeasy
Complexity4/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 1h+

Requires a matching PyTorch version, FFmpeg 7.1+ with shared libraries, and the Rust toolchain to build the package.

Apache 2.0 license: free to use, modify, and distribute, including commercially, with attribution and patent grant protections.

Wtf does this do

avtensor is a library from Runway that decodes video, audio, and images directly into PyTorch tensors, the array format used throughout machine learning code. It is written in Rust with Python bindings, and uses FFmpeg under the hood to do the actual decoding work. It is designed for building data-loading pipelines for training or running machine learning models, where getting media into tensor form quickly and efficiently matters a lot. Instead of decoding a video file and then separately converting it into a tensor, avtensor moves data straight from FFmpeg's decoded frames into a tensor in one step. It can read from local files, from cloud storage locations like Google Cloud Storage or S3 buckets, or from any regular web URL. While decoding, it can also resize video, change its frame rate, resample audio, and normalize loudness, all inside FFmpeg before the data ever becomes a tensor. It correctly converts color information using the video's own metadata, and it can tone-map high dynamic range video down to standard range. The project positions itself as an alternative to torchcodec, PyTorch's own official decoder, noting that both use FFmpeg and produce identical color output on CPU decoding, but avtensor adds native cloud storage support, decodes video and audio together in a single pass, and is noticeably faster when resizing during decode. It also supports NVIDIA GPU-accelerated decoding through NVDEC, including an option where decoded video frames stay entirely on the GPU rather than being copied back to the computer's main memory, which speeds up pipelines that also do their model training on the GPU. Installing avtensor requires Python 3.8 or newer, a compatible version of PyTorch, FFmpeg 7.1 or newer built with shared libraries, and the Rust toolchain at build time, since the Python package compiles against your local environment. It is released under the Apache 2.0 license.

Yoink these prompts

Prompt 1
Show me how to use avtensor to decode a video file into a PyTorch tensor in Python.
Prompt 2
How do I set up avtensor to decode a clip directly from an S3 bucket?
Prompt 3
Explain the difference between avtensor and torchcodec for a machine learning data pipeline.
Prompt 4
How would I enable GPU-resident decoding with avtensor using NVDEC?

Frequently asked questions

wtf is avtensor?

avtensor decodes video, audio, and images directly into PyTorch tensors using FFmpeg, built for fast machine learning data pipelines with cloud storage and GPU decode support.

What language is avtensor written in?

Mainly Rust. The stack also includes Rust, Python, PyTorch.

What license does avtensor use?

Apache 2.0 license: free to use, modify, and distribute, including commercially, with attribution and patent grant protections.

How hard is avtensor to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is avtensor for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.