ProjectsLive

Instant clips from a live stream

Viewers clip the moment they just saw and share it while the event is still on

Example design

  1. 01Feed inThe production encoder sends the programme feed to a Stream live input over RTMPS or SRT. Stream records it as it goes.
  2. 02Watch and scrub backViewers watch the live stream. The clip tool loads a preview of the last five minutes so they can find the moment.
  3. 03Mark the clipThe viewer marks a start and a length and presses Clip. The page sends the times to the Worker.
  4. 04Check and saveThe Worker checks the clip is 60 seconds or shorter, applies a per-user rate limit, and saves the clip's times in D1.
  5. 05Share linkThe viewer gets a link to a clip page and an MP4 download for posting elsewhere.
  6. 06Play the clipWhoever opens the link plays the clip as HLS, generated from the live recording.
  7. ifA highlight runs longer than a minuteInstant clips stop at 60 seconds. Longer highlights are cut after the event with Stream's clipping API, which makes a new video from a start and end time.

The problem

During a live match or launch event, the moments people want to share happen without warning. If clips have to wait for an editor to download the recording and cut it, they arrive after the conversation has moved on. Cloudflare Stream can generate a clip of a live stream from its recording on request. A viewer who reacts late can scrub back a few minutes, mark the moment and get a link straight away.

What it uses

Stream
Live input, recording, the preview manifest, clip manifests and clip MP4s
Workers
Clip requests, limits and the clip pages
D1
Clips, who made them, and their times

The decisions, and why

Clip lengthUp to 60 seconds
That is Stream's limit for instant clips, and it suits a shareable moment.
Finding the momentFive minute look-back
The preview manifest replays the last five minutes, so someone who reacts late can still find what they saw.
StorageNone per clip
Stream generates each clip from the recording when it is played, so ten thousand clips add no storage and no new videos to the library.
Clip pagesCreated by the Worker
Stream will serve a clip to anyone who can watch the stream. The Worker decides which clips get a shareable page, and applies rate limits and moderation to those.

Limits to plan around

  • Instant clips are at most 60 seconds long.
  • The preview manifest covers the last five minutes of the stream.
  • This needs an RTMPS or SRT input, because Stream does not record WebRTC inputs.

What you get

  • Clip tool for the live player
  • Worker for clip requests, limits and clip pages
  • D1 schema for clips
  • Moderation hooks for clips that need taking down
  • Post-event highlight workflow using the clipping API

Related product

Live Edge: low-latency live with event-grade redundancy.

Read about Live Edge

Talk about your video project

Tell us what you are building, or what is not working in the platform you have.

Registered office
VI Data Services Ltd
128 City Road, London, EC1V 2NX, United Kingdom
Telephone

020 8058 7616

Company number

17420568
Registered in England and Wales