Instant live clipping
What is live clipping?
Live clipping is the process of capturing and creating short video clips from a live stream as it happens. This feature lets broadcasters instantly extract key moments, turning them into highlights, social media content, or on-demand clips. It eliminates the need to wait for the live stream to finish, making it perfect for sharing engaging moments in real time.
Additionally, when you create a live clip using the stream URL, the clip is automatically converted into an on-demand media file. This means that your extracted clip remains accessible even after the live stream ends, making it available for further viewing or sharing. You can also specify the access policy for the on-demand media that is generated by providing a query parameter (clipAccess
). If no custom policy is set, the access policy for the generated clip will default to the livestream’s access policy.
Step 1: Set up a live stream
To start creating live clips, first set up a livestream on FastPix by creating a live stream using the dashboard or using the API. Once the livestream is active, you can generate the Stream URL using the provided playback ID. This URL can be used in any HLS-compatible player and serves as the basis for generating live clips.
Your stream URL would look like this:
https://stream.fastpix.io/><playbackId>.m3u8
Step 2: Generate clips from live stream
Creating a live clip involves defining the clip's duration by appending query parameters to the Stream URL. FastPix simplifies this process by using start and end times in seconds.
PLEASE NOTE
When you generate a live clip using the Stream URL, the clip is automatically converted into an on-demand media file. This ensures that the clip remains accessible even after the live stream ends.
Use the Stream URL with query parameters
You can generate a live clip by adding start
and end
parameters to your Stream URL. These parameters define the beginning and end of your clip.
Example:
https://stream.fastpix.io/><playbackId>.m3u8?start=10s&end=70s
This URL extracts a 60-second clip starting from the 10-second mark to the 70-second mark.
PLEASE NOTE
The maximum duration for a clip is 60 seconds. If the start and end parameters exceed this limit, the clip will be automatically trimmed to 60 seconds.
Access policy for clips
You can also control the access policy of the generated on-demand media by specifying a clipAccess
query parameter. Please note, using the clipAccess
parameter separately will result in another on-demand clip. It's better to combine start
, end
, clipAccess
parameters all at once depending on your requirement.
https://stream.fastpix.io/<playbackId>.m3u8?start=10s&end=70s&clipAccess=private
- If
clipAccess=private
, the generated clip will be restricted to authorized users.
- If
clipAccess=public
, the generated clip will be accessible to anyone with the link.
- If no
clipAccess
parameter is provided, the access policy of the generated clip will default to the access policy of the livestream.
Step 3: Retrieve clip and playback
If you want to later retrieve the generated clip (stored as on-demand media) - use the get all clips from live stream API by passing the streamId
of the actual live stream. The response will give you a list of all clipped media IDs along with other details related to the clipped media.
To initialize playback of the media, take the underlying playbackId
from the specific clipped media and insert it in the stream URL below.
https://stream.fastpix.io/{PLAYBACK_ID}.m3u8
You can use this URL (with .m3u8 extension) in other video players as per your use case.
Otherwise, to directly stream your clipped media on a browser, you can also use the playback stream URL which is sharable. Simply preview your video by putting the playbackId
on the stream URL.
https://play.fastpix.io/?playbackId=963b0fad-cc52-47d7-a790-f9b6c2656219
Guidelines for start and end times
To ensure your live clips are generated correctly, follow these guidelines:
- Use positive values only: Both
start
andend
times must be positive integers, representing seconds in the livestream. Negative values are not allowed and will result in an error.
- Start time must be earlier than end time: The
start
time should always precede theend
time. Providing an end time that is less than the start time is invalid and will prevent the clip from being generated.
- Valid time range: Ensure the
start
and end times fall within the duration of the live stream. For example, if the live stream has only reached 20 seconds, specifyingend=30s
will result in an error.
Updated about 9 hours ago