← Back
Cloudflare
Cloudflare Workers gains Media Transformations binding for video processing

New Media Transformations Binding

Cloudflare has launched a Media Transformations binding for Workers, enabling developers to transform videos directly within their Worker scripts. This new capability supports videos stored anywhere, including private sources like R2 buckets, eliminating the need for external transformation services.

Key Capabilities

The Media Transformations binding supports several transformation modes:

  • Video mode: Resize, crop, and optimize videos into MP4 format with configurable duration
  • Frame mode: Extract still images from video for analysis or classification
  • Spritesheet mode: Generate multiple frames in a single output for timeline previews
  • Audio mode: Extract audio tracks as M4A files for transcription or processing

Integration and Usage

Developers can enable the binding by adding a simple media configuration to their Wrangler configuration file (both wrangler.jsonc and wrangler.toml are supported). Once configured, the MEDIA binding provides a fluent API for chaining input, transform, and output operations directly in Worker code.

The binding integrates naturally with Workers AI, enabling workflows like extracting frames for image classification or extracting audio for transcription—all within the edge environment.

Use Cases

Common applications include optimizing videos stored in R2 for re-use, transforming private video content without exposing it to external APIs, and automating video analysis pipelines with Workers AI integration.