sellMedia
movie

Cloudflare Stream

Add live and on-demand video to your app with one API — no servers, no encoding pipeline to babysit.

$5/ 1,000 min stored
$1/ 1,000 min delivered
FreeEncoding & ingest
30GBMax upload size
lightbulb

What is Cloudflare Stream?

Cloudflare Stream is an all-in-one video platform: you upload a video (or start a live broadcast) and Cloudflare encodes it, stores it, and delivers it worldwide with a ready-made player you can embed in one line.

Encoding (also called transcoding) means converting your raw video into multiple sizes and a streaming-friendly format. Stream does this automatically, so the same upload plays smoothly on a phone on slow data or a laptop on fast Wi-Fi.

local_shipping

Think of it like a video factory + courier

You drop off one master tape. The factory makes copies in every quality, and a global courier hands the right copy to each viewer based on their screen and internet speed — instantly.

help

Why use it?

Running your own video infrastructure is hard and expensive: encoding servers, storage, a streaming protocol, a player, and bandwidth bills. Stream replaces that whole stack with one API and predictable per-minute pricing.

auto_awesome

Encoding included

Uploads are transcoded into an adaptive bitrate ladder automatically. Encoding and ingest are free.

smart_display

Free player

A polished, mobile-friendly player ships with it — embed via an iframe, no coding required.

payments

Simple pricing

Pay only for minutes stored and minutes watched. No surprise egress (bandwidth) fees.

lock

Access control

Signed URLs let you protect paid or private videos so only authorized viewers can play them.

target

When should you use it?

school

Online courses

Host lesson videos that stream smoothly to students on any device or connection.

sensors

Live streaming

Broadcast events, webinars, or gaming live, then keep the recording on demand.

ondemand_video

Creator platforms

Let users upload clips with one-time URLs and play them back instantly.

campaign

Marketing & product

Embed product demos or hero videos without slowing down your site.

rocket_launch

How to get started

We'll upload a video, wait for it to finish encoding, then embed the player. You only need an API token and your Account ID from the Cloudflare dashboard.

  1. Set your credentials

    Export your API token and Account ID so the commands below can use them. The token is like a password for your code.

    bash
    export CLOUDFLARE_API_TOKEN="your-token-here"
    export ACCOUNT_ID="your-account-id-here"
  2. Upload a video file

    For files under 200 MB you can post the file directly. The -F file=@ part attaches a local video.

    bash
    curl -X POST \
      https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/stream \
      -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
      -F file=@/path/to/video.mp4
  3. Or copy from a URL

    Already have the video online? Tell Stream to fetch it. The response includes a uid — the video's unique id.

    bash
    curl -X POST \
      https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/stream/copy \
      -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
      -d '{"url":"https://example.com/video.mp4","meta":{"name":"My first video"}}'
  4. Check it is ready

    Encoding takes a moment. When status.state is 'ready' and readyToStream is true, you can play it.

    json
    {
      "result": {
        "uid": "6b9e68b07dfee8cc2d116e4c51d6a957",
        "readyToStream": true,
        "status": { "state": "ready" }
      },
      "success": true
    }
  5. Embed the player

    Paste this iframe into your page. Replace <CODE> with your customer code and <UID> with the video uid. Done — a full adaptive player appears.

    html
    <iframe
      src="https://customer-<CODE>.cloudflarestream.com/<UID>/iframe"
      title="My first video"
      allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;"
      allowfullscreen="true"
      style="border: none; width: 100%; aspect-ratio: 16/9;">
    </iframe>
upload

Big files? Use tus

For uploads over 200 MB (up to a 30 GB max), Stream supports the tus protocol, which resumes the upload if your connection drops.

school

Key concepts

graphic_eq

Adaptive bitrate 自適應位元率

The player automatically switches between quality levels based on the viewer's network — fewer buffering spinners.

sync_alt

Transcoding 轉碼

Converting your original into multiple resolutions and a streaming format (HLS/DASH). Stream does this for you.

playlist_play

HLS / DASH

Streaming protocols that chop video into small chunks so playback can adapt quality on the fly.

fingerprint

Signed URLs 簽章網址

Time-limited tokens that restrict who can watch — perfect for paid or private content.

drive_folder_upload

Direct creator upload 直接上傳

One-time upload URLs you give users so they upload to Stream without seeing your API token.

sensors

Live input 直播輸入

A reusable endpoint you stream to (via RTMPS/SRT) for live broadcasts, with optional recording.

tips_and_updates

Tips & pricing

savings

How billing works

You pay $5 per 1,000 minutes of video stored per month, and $1 per 1,000 minutes delivered (watched). Uploading and encoding are always free, and there are no separate bandwidth charges.

inventory_2

Storage is prepaid

Stored minutes are bought in advance. If you run out, you can't upload new videos or start live streams until you add more storage or delete old videos.

  • Live and on-demand video are billed the same way — by minutes stored and delivered.
  • Max single upload is 30 GB; use tus for anything large to get resumable uploads.
  • Add captions/subtitles and a thumbnail to make videos more accessible and clickable.
  • Use signed URLs for paid content so links can't be freely shared.