Live Instant Clipping
BetaStream supports generating clips of live streams and recordings so creators and viewers alike can highlight short, engaging pieces of a longer broadcast or recording. Live instant clips can be created by end users and do not result in additional storage fees or new entries in the video library.
When configuring a Live input, ensure “Live Playback and Recording” (mode
) is enabled.
API keys are not needed to generate a preview or clip, but are needed to create Live Inputs.
Live instant clips are generated dynamically from the recording of a live stream. When generating clips manifests or MP4s, always reference the Video ID, not the Live Input ID. If the recording is deleted, the instant clip will no longer be available.
To help users replay and seek recent content, request a preview manifest by adding a duration
parameter to the HLS manifest URL:
duration
string duration of the preview, up to 5 minutes as either a number of seconds (”30s”) or minutes (“3m”)
When the preview manifest is delivered, inspect the headers for two properties:
preview-start-seconds
float seconds into the start of the live stream or recording that the preview manifest starts. Useful in applications that allow a user to select a range from the preview because the clip will need to reference its offset from the broadcast start time, not the preview start time.stream-media-id
string the video ID of the live stream or recording. Useful in applications that render the player using an input ID because the clip URL should reference the video ID.
This manifest can be played and seeked using any HLS-compatible player.
Reading headers when loading a manifest requires adjusting how players handle
the response. For example, if using HLS.js ↗
and the default loader, override the pLoader
(playlist loader) class:
To play a clip of a live stream or recording, request a clip manifest with a duration and a start time, relative to the start of the live stream.
time
string start time of the clip in seconds, from the start of the live stream or recordingduration
string duration of the clip in seconds, up to 60 seconds max
This manifest can be played and seeked using any HLS-compatible player.
An MP4 of the clip can also be generated dynamically to be saved and shared on other platforms.
time
string start time of the clip in seconds, from the start of the live stream or recording (example: “500s”)duration
string duration of the clip in seconds, up to 60 seconds max (example: ”60s”)filename
string (optional) a filename for the clip