RTMP Streaming & Browser Recording
Introduction
RTMP Streaming can be used to live stream your video conferencing apps to platforms like Facebook, YouTube, Twitch, etc. Browser Recording can be used to record your video conferencing apps to a file, for subsequent access. You can start either RTMP Streaming or Browser Recording or both for any room
Pre-requisites
- Management token
- Single click meeting url to directly enter a room
APIs
Start Streaming/Recording
https://prod-in2.100ms.live/api/v2/beam
This endpoint is used to start live streaming/recording
Headers
Name | Value | Required |
---|---|---|
Content-type | application/json | Yes |
Authorization | Bearer <management token> | Yes |
Body Parameters
Name | Type | Description | Required |
---|---|---|---|
operation | string | Must be "start" | Yes |
room_id | string | The room id of the room which we need to start streaming/recording | Yes |
meeting_url | string | Single click meeting url which we need to start streaming/recording (see below for more details) | Yes |
rtmp_url | string | The RTMP output url to which the meeting will be streamed. Required when RTMP streaming needs to be started. Supports rtmp:// & rtmps:// | No |
record | bool | Flag to enable browser recording | No |
meeting_url
This is a url which lands into the meeting directly. If you are using 100ms apps then this will be like - https://<domain>.app.100ms.live/preview/<room_id>/<role>?token=beam_recording
. Example - https://myname.app.100ms.live/preview/61101349d0f56e684b608c08/beam?token=beam_recording
cURL
curl \ --location \ --request POST 'https://prod-in2.100ms.live/api/v2/beam' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <management_token>' \ --data-raw '{ "operation": "start", "room_id": <rooom_id>, "meeting_url": <meeting_url>, "rtmp_url": <rtmp_url>, "record": true }'
Stop Streaming/Recording
https://prod-in2.100ms.live/api/v2/beam
This endpoint is used to stop live streaming/recording
Headers
Name | Value | Required |
---|---|---|
Content-type | application/json | Yes |
Authorization | Bearer <management token> | Yes |
Body Paramters
Name | Type | Description | Required |
---|---|---|---|
operation | string | Must be "stop" | Yes |
room_id | string | The room id of the room for which we need to stop streaming/recording | Yes |
cURL
curl \ --location \ --request POST 'https://prod-in2.100ms.live/api/v2/beam' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <management_token>' \ --data-raw '{ "operation": "stop", "room_id": <rooom_id> }'
Recording upload destination
By default recordings will be uploaded to 100ms storage and a presigned URL for the same will be provided to customers via a webhook. The presigned url will expire in 12hours. Customers can also configure the recordings to be stored in their cloud storage. The configuration for the same can be provided when creating the room.
Recording mp4 will be placed at - s3://<location>/<prefix>/beam/<room_id>/<start_date>/Rec-<unique_id>-<epoch>.mp4
. Example s3://test-bucket/test-prefix/beam/61101349d0f56e684b608c08/2021-July-21/Rec-61307a53b0f915dbebde5763-1626898422000.mp4