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
- 01Feed inThe production encoder sends the programme feed to a Stream live input over RTMPS or SRT. Stream records it as it goes.
- 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.
- 03Mark the clipThe viewer marks a start and a length and presses Clip. The page sends the times to the Worker.
- 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.
- 05Share linkThe viewer gets a link to a clip page and an MP4 download for posting elsewhere.
- 06Play the clipWhoever opens the link plays the clip as HLS, generated from the live recording.
- 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
Other projects
More video work on Cloudflare.
- Sub-second live with WHIP and WHEPLive auctions, Q&A and watch-alongs where a few seconds of delay is too much
- One live feed to many platformsSend one encoder feed to your own site and to YouTube, Twitch and others at once
- Serverless video platformUploads, encoding, captions and signed playback with no servers to run
- FFmpeg encoding on Cloudflare ContainersYour own ladder and packaging, started by an upload, served from R2
- Searchable video archiveFind the moment in hours of recordings by what was said
- Thumbnails and previews by URLHover previews, thumbnails and storyboards for a clip library, with no batch jobs
DRM solutions
Three corporate use cases, each with a Widevine demo that runs in your browser and checks what your device supports.
Talk about your video project
Tell us what you are building, or what is not working in the platform you have.
128 City Road, London, EC1V 2NX, United Kingdom
17420568
Registered in England and Wales