Cloudflare Stream: Complete Video Platform Guide
Serverless video streaming platform with upload, encoding, delivery, and playback - all in one API.
⚠️ Important Disclaimer
This website is for educational and technical demonstration purposes only.
Billing metrics, pricing information, and cost calculations shown on this page may change without notice and should not be relied upon for financial planning or decision-making. Always refer to the official Cloudflare pricing page or your Account Team and your Cloudflare Dashboard for current, accurate pricing information. The purpose of this website is solely to showcase the technical aspects and capabilities of Cloudflare Stream.
📊 What is Cloudflare Stream?
Stream is an end-to-end video platform that handles:
- Upload: Direct uploads, link-based uploads, or creator uploads
- Storage & Encoding: Automatic multi-resolution encoding
- Delivery: Global CDN delivery via HLS/DASH
- Playback: Built-in player or use your own
- Analytics: Detailed viewing metrics
- Live Streaming: RTMPS/SRT live input with recording
🎬 Use Case 1: Stream Player (iframe Embed)
Best for: Quick implementation, zero coding, responsive player with controls
Basic Player
The Stream Player is a customizable HTML5 video player that works on all devices.
Player with Custom Controls
Add query parameters to customize player behavior:
Autoplay (muted)
Loop & Preload
Custom Primary Color & Start Time
Available Player Options
Pros & Cons
- ✓ Zero code required
- ✓ Responsive out of the box
- ✓ Automatic quality switching (ABR)
- ✓ Built-in controls
- ✓ Mobile & desktop optimized
- ✗ Limited UI customization
- ✗ Cloudflare branding in debug mode
📱 Use Case 2: Direct MP4 Download for Product Pages
Best for: Short videos, product demos, embedded content without player UI
Stream can provide direct MP4 downloads for use in native HTML5 video tags or for downloads. Perfect for short clips on product pages.
MP4 Download URL
Native HTML5 Video Player
Pros & Cons
- ✓ Simple HTML5 video tag
- ✓ Full control over player UI
- ✓ Works offline once downloaded
- ✓ No JavaScript required
- ✗ No adaptive bitrate
- ✗ Larger file size
- ✗ Requires downloads enabled
- ✗ Downloads count toward delivery minutes
🎥 Use Case 3: Custom Player with HLS/DASH
Best for: Custom branding, advanced features, third-party players
Use your own video player with Stream's HLS or DASH manifests. Compatible with VideoJS, JW Player, Plyr, and more.
HLS Manifest URL
DASH Manifest URL
Custom Player Example (HLS.js)
Pros & Cons
- ✓ Full UI customization
- ✓ Adaptive bitrate streaming
- ✓ Works with any HLS/DASH player
- ✓ Advanced analytics integration
- ✗ Requires JavaScript library
- ✗ More complex implementation
- ✗ Need to handle cross-browser support
✂️ Use Case 4: Media Transformations (/cdn-cgi/media)
Best for: Transform videos stored outside Stream - optimize, clip, resize, extract frames & audio
Use the /cdn-cgi/media path to dynamically transform videos from your origin (GCS, S3, R2, etc.) without writing code. Cloudflare caches transformed outputs globally.
- Still frame (image): 1 transformation
- Video/audio output: 1 transformation per second of output
- Each unique combination of input + options is billed once per month
URL Format
Original Video
Source: http://public-r2.vence.fun/vids/time.mp4 (20 seconds, stored in R2)
Transformation 1: Clip First 5 Seconds
Extract just the first 5 seconds as an optimized MP4
Transformation 2: Clip Middle Section (5s-10s)
Extract 5 seconds from the middle (seconds 5-10)
Transformation 3: Resize to Square (500x500)
Clip and resize to square format, perfect for social media
Transformation 4: Extract Still Frame
Extract a single frame as a JPEG image (perfect for thumbnails)
time=2s
time=7s
time=15s
Transformation 5: Resized Frame (300x200)
Extract and resize a frame - perfect for responsive thumbnails
Transformation 6: Silent Video (No Audio)
Remove audio track - reduces file size and perfect for autoplay
Transformation 7: Extract Audio Only
Extract just the audio as M4A file
Transformation 8: Mobile-Optimized (300px width)
Resize for mobile devices - smaller file, faster loading
Available Transformation Options
time - Start time (0-10m, e.g., 5s, 2m)
duration - Output duration (1s-60s)
width/height - Dimensions (10-2000px)
fit - contain, scale-down, cover
audio - true (default), false
format - jpg, png (for frames); m4a (for audio)
filename - Custom filename for downloads
Source Requirements
- Input video must be less than 100MB
- Maximum input duration: 10 minutes
- Recommended format: MP4 with H.264 video & AAC audio
- Origin must support HTTP HEAD and Range requests
- Zero Infrastructure: No encoding servers, storage management, or CDN configuration
- Automatic Caching: Transformed videos cached globally on Cloudflare's network
- URL-Based: No API calls or SDK required - just use a URL
- Cost Effective: Pay per unique transformation, not per view
🖼️ Use Case 5: Dynamic Thumbnail Generation
Best for: Video previews, poster images, animated GIFs
Static Thumbnails (Different Timestamps)
time=1s
time=3s
time=5s
Animated GIF Thumbnail
thumbnail.gif?time=1s&duration=3s&height=200
Thumbnail Parameters
height - Height in pixels
width - Width in pixels
fit - crop, clip, scale, fill
duration - For GIFs only (e.g., 3s)
fps - For GIFs only (default: 8)
🔒 Use Case 6: Signed URLs for Private Content
Best for: Paid content, authenticated users, geo-restrictions
Restrict video access using signed URLs. Perfect for:
- Subscription-based content
- Time-limited access (24-hour rental)
- Geographic restrictions
- IP-based access control
How It Works
- Enable "Require Signed URLs" on your video
- Generate a signed token via API or with a signing key
- Replace video UID with the token in player/manifest URLs
Access Control Options
Geo-blocking: Allow/block by country code
IP restrictions: Whitelist specific IP ranges
Downloadable: Control MP4 download access
📡 Use Case 7: Live Streaming
Best for: Events, webinars, real-time broadcasts
How Live Streaming Works
- Create a Live Input via API or dashboard
- Get RTMPS or SRT URL and Stream Key
- Broadcast from OBS, Wirecast, or FFmpeg
- Viewers watch via Stream Player or HLS/DASH
- Recording automatically saved after stream ends (ready in 60 seconds)
Live Streaming Features
- ✓ RTMPS & SRT protocols
- ✓ Automatic recording
- ✓ Adaptive bitrate (ABR)
- ✓ Low-latency HLS (beta)
- ✓ Same pricing as on-demand
- ✓ Recording ready in 60 seconds
- ✓ Automatic reconnection
- ✓ Live instant clipping
- ✓ Global edge delivery
- ✓ Simulcast to multiple destinations