Stream recordings of live streams
FastPix automatically records every live stream. Once the live stream ends, it is stored as an on-demand media asset, allowing users to replay it anytime. This functionality ensures that all live content is preserved and can be accessed even after the stream has concluded.
How Live Stream Recording Works
- All live streams are automatically recorded—there is no need to manually start recording.
- Once the live stream ends, it is stored as a media asset and assigned a
mediaId
. - The
mediaId
is required to fetch recording details and construct the playback URL. - Recorded media is available on-demand through API requests.
Retrieve a recorded stream
After a live stream is completed, follow these steps to access and replay the recording:
Step 1: Get the Media ID
There are two ways to obtain the mediaId of the recorded live stream:
Via webhook event:
- When a live stream recording is ready, FastPix triggers a webhook event.
- The event payload contains the mediaId of the recorded media.
Via live stream API:
- Use the Get stream by ID endpoint to retrieve live stream details.
- Once the recording is available, the response includes the mediaId.
Step 2: Fetch media details
Once you have the mediaId
, use the Get media by ID endpoint to retrieve playback details.
Response:
This response will include the playbackId
, which is necessary to construct the stream URL.
{
"success": true,
"data": {
"thumbnail": "https://images.fastpix.io/837f028b-dcaf-4c23-b368-3748641f74ac/thumbnail.png",
"id": "cfeec1a3-6cbd-40df-a425-2ed7f8f72ced",
"workspaceId": "6dc2b4e0-0615-42fd-a580-1f4aad932dfe",
"metadata": {
"key1": "value1"
},
"maxResolution": "1080p",
"sourceResolution": "1080p",
"status": "Ready",
"sourceAccess": false,
"playbackIds": [
{
"id": "837f028b-dcaf-4c23-b368-3748641f74ac",
"accessPolicy": "public",
"accessRestrictions": {
"domains": {
"defaultPolicy": "allow",
"allow": [],
"deny": []
},
"userAgents": {
"defaultPolicy": "allow",
"allow": [],
"deny": []
}
}
}
],
"tracks": [
{
"id": "f301a2a1-b40d-40fa-b419-4d0cd92a62f8",
"type": "video",
"width": 1920,
"height": 1080,
"frameRate": "30/1",
"closedCaptions": false
}
],
"isAudioOnly": false,
"subtitleAvailable": true,
"duration": "00:00:10",
"frameRate": "30/1",
"aspectRatio": "16:9",
"createdAt": "2025-01-09T06:44:44.617138Z",
"updatedAt": "2025-01-09T06:44:53.742648Z"
}
}
Step 3: Construct the playback URL
Using the playbackId
, generate the playback URL to stream the recorded media:
https://stream.fastpix.io/{PLAYBACK_ID}.m3u8
You can use this URL (with .m3u8 extension) in other video players as per your use case.
Refer to the player guide for more details on integrating with the FastPix video player. You can further customize your player interface and video playback experience as per your requirements.
To directly stream your video 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
Updated 11 days ago