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

  1. Management token
  1. Single click meeting url to directly enter a room

APIs

Start Streaming/Recording

POST
https://prod-in2.100ms.live/api/v2/beam

This endpoint is used to start live streaming/recording

Headers

NameValueRequired
Content-type
application/jsonYes
Authorization
Bearer <management token>Yes

Body Parameters

NameTypeDescriptionRequired
operation
stringMust be "start"Yes
room_id
stringThe room id of the room which we need to start streaming/recordingYes
meeting_url
stringSingle click meeting url which we need to start streaming/recording (see below for more details)Yes
rtmp_url
stringThe RTMP output url to which the meeting will be streamed.
Required when RTMP streaming needs to be started.
Supports rtmp:// & rtmps://
No
record
boolFlag to enable browser recordingNo
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

POST
https://prod-in2.100ms.live/api/v2/beam

This endpoint is used to stop live streaming/recording

Headers

NameValueRequired
Content-type
application/jsonYes
Authorization
Bearer <management token>Yes

Body Paramters

NameTypeDescriptionRequired
operation
stringMust be "stop"Yes
room_id
stringThe room id of the room for which we need to stop streaming/recordingYes

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.

Create 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

Postman Collection