Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Comprehensive Cloudflare platform skill covering Workers, D1, R2, KV, AI, Durable Objects, and security.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/stream/README.md
1# Cloudflare Stream23Serverless live and on-demand video streaming platform with one API.45## Overview67Cloudflare Stream provides video upload, storage, encoding, and delivery without managing infrastructure. Runs on Cloudflare's global network.89### Key Features10- **On-demand video**: Upload, encode, store, deliver11- **Live streaming**: RTMPS/SRT ingestion with ABR12- **Direct creator uploads**: End users upload without API keys13- **Signed URLs**: Token-based access control14- **Analytics**: Server-side metrics via GraphQL15- **Webhooks**: Processing notifications16- **Captions**: Upload or AI-generate subtitles17- **Watermarks**: Apply branding to videos18- **Downloads**: Enable MP4 offline viewing1920## Core Concepts2122### Video Upload Methods231. **API Upload (TUS protocol)**: Direct server upload242. **Upload from URL**: Import from external source253. **Direct Creator Uploads**: User-generated content (recommended)2627### Playback Options281. **Stream Player (iframe)**: Built-in, optimized player292. **Custom Player (HLS/DASH)**: Video.js, HLS.js integration303. **Thumbnails**: Static or animated previews3132### Access Control33- **Public**: No restrictions34- **requireSignedURLs**: Token-based access35- **allowedOrigins**: Domain restrictions36- **Access Rules**: Geo/IP restrictions in tokens3738### Live Streaming39- RTMPS/SRT ingest from OBS, FFmpeg40- Automatic recording to on-demand41- Simulcast to YouTube, Twitch, etc.42- WebRTC support for browser streaming4344## Quick Start4546**Upload video via API**47```bash48curl -X POST \49"https://api.cloudflare.com/client/v4/accounts/{account_id}/stream/copy" \50-H "Authorization: Bearer <TOKEN>" \51-H "Content-Type: application/json" \52-d '{"url": "https://example.com/video.mp4"}'53```5455**Embed player**56```html57<iframe58src="https://customer-<CODE>.cloudflarestream.com/<VIDEO_ID>/iframe"59style="border: none;"60height="720" width="1280"61allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;"62allowfullscreen="true"63></iframe>64```6566**Create live input**67```bash68curl -X POST \69"https://api.cloudflare.com/client/v4/accounts/{account_id}/stream/live_inputs" \70-H "Authorization: Bearer <TOKEN>" \71-H "Content-Type: application/json" \72-d '{"recording": {"mode": "automatic"}}'73```7475## Limits7677- Max file size: 30 GB78- Max frame rate: 60 fps (recommended)79- Supported formats: MP4, MKV, MOV, AVI, FLV, MPEG-2 TS/PS, MXF, LXF, GXF, 3GP, WebM, MPG, QuickTime8081## Pricing8283- $5/1000 min stored84- $1/1000 min delivered8586## Resources8788- Dashboard: https://dash.cloudflare.com/?to=/:account/stream89- API Docs: https://developers.cloudflare.com/api/resources/stream/90- Stream Docs: https://developers.cloudflare.com/stream/9192## Reading Order9394| Order | File | Purpose | When to Use |95|-------|------|---------|-------------|96| 1 | [configuration.md](./configuration.md) | Setup SDKs, env vars, signing keys | Starting new project |97| 2 | [api.md](./api.md) | On-demand video APIs | Implementing uploads/playback |98| 3 | [api-live.md](./api-live.md) | Live streaming APIs | Building live streaming |99| 4 | [patterns.md](./patterns.md) | Full-stack flows, TUS, JWT signing | Implementing workflows |100| 5 | [gotchas.md](./gotchas.md) | Errors, limits, troubleshooting | Debugging issues |101102## In This Reference103104- [configuration.md](./configuration.md) - Setup, environment variables, wrangler config105- [api.md](./api.md) - On-demand video upload, playback, management APIs106- [api-live.md](./api-live.md) - Live streaming (RTMPS/SRT/WebRTC), simulcast107- [patterns.md](./patterns.md) - Full-stack flows, state management, best practices108- [gotchas.md](./gotchas.md) - Error codes, troubleshooting, limits109110## See Also111112- [workers](../workers/) - Deploy Stream APIs in Workers113- [pages](../pages/) - Integrate Stream with Pages114- [workers-ai](../workers-ai/) - AI-generate captions115