Skip to content

Media and streaming

Deliver video, images, and rich media at scale with encoding, optimization, and global distribution. Cloudflare Stream handles video upload, encoding, and adaptive bitrate delivery. Images transforms and optimizes images on-the-fly. R2 stores media files with zero egress fees. Cache serves content from 300+ edge locations. Hotlink Protection and signed URLs secure media from unauthorized access.

Architecture patterns

Video platform

Build a complete video hosting and delivery solution:

  • Stream handles upload, encoding, and adaptive bitrate delivery
  • Stream Live enables live streaming with automatic recording
  • Signed URLs protect content with token authentication

Image optimization pipeline

Serve optimized images without pre-generating variants:

  1. R2 stores original high-resolution images
  2. Images transforms images on-the-fly based on URL parameters
  3. Workers applies custom logic for format selection and caching

User-generated content

Handle media uploads from users at scale:

  1. R2 receives uploads directly via presigned URLs
  2. Workers validates and processes uploaded content
  3. Stream or Images optimizes media for delivery

Prerequisites

Create a new application

Use an existing application