You can create clips from active Livepeer Studio streams via the API. A clip is a segment of the stream (e.g. The last N seconds or a chosen range) and is stored as an asset that you can play back like any VOD asset.Documentation Index
Fetch the complete documentation index at: https://na-36-docs-v2.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
How clipping works
- Clips are created from the viewer’s perspective: e.g. “last 30 seconds” is the last 30 seconds that viewer saw (based on their playhead).
- You send start and end timestamps (UNIX milliseconds). These typically come from the player (e.g. HLS.js
playingDateor the Livepeer Player’s clip trigger). - Livepeer creates an asset for the clip. You can poll the asset or listen for the
asset.readywebhook to know when the clip is playable.
Create a clip via API
Use the Create Clip API with:playbackId- The active stream’s playback ID.startTime- Start of the clip (UNIX ms, from playhead).endTime- End of the clip (UNIX ms).name- (Optional) Name for the clip asset.
startTime is at or after the stream start and endTime is not in the future.
Example (Node.js)
With the Livepeer Player
The Player’s Clip trigger can provideplaybackId, startTime, and endTime. Call the Create Clip API from your backend (with the same parameters) and validate input (e.g. Max clip length, rate limiting).
Monitor clip status
- Polling - Call
GET /asset/{assetId}untilasset.statusisready. - Webhooks - Subscribe to
asset.ready(and optionallyasset.failed). Use theassetIdfrom the create-clip response to match the event. - The clip asset has
source.type === "clip"and asessionIdso you can tell it’s a clip.
playbackId with the Playback Info API or the Player to play it.