Cloud Recording

Cloud Recording provides RESTful API, and you can use the function of Cloud Recording by sending network requests.

  • The cloud recording RESTful API only supports HTTPS protocol.
  • The cloud recording RESTful API provides callback service; notifications are available upon activation. You can choose whether or not to enable callback according to your needs.

img

1. Prerequisites

  • An application integrated with ThunderBolt SDKs already exists.
  • Third-party cloud storage service has already been enabled. Currently, only Alibaba Cloud OSS is supported.

2. Implementation

2.1 API Authentication

You can only send RESTful API requests after it has undergone Basic HTTP authentication with a certificate ID and certificate key; you must also fill in the HTTP request header's token field.
The certificate ID and certificate key can be found in the My Center background, on the API Certificate page. See specifics on token generation in Basic HTTP Authentication.

2.2 RESTful API Interactive Sequence Diagram

img

Update video mixing layout, layout updatemixrecord, is optional, and can be called multiple times throughout recording (between start and stop).

2.3 Step 1: Request Recording Resources

Call applyrecord to request a resource ID (resid) for cloud recording.

After calling this method, you can obtain this ID from the resid field in the HTTP response body. This resid remains valid for five minutes, so you need to use it for recording within that timeframe.

You can only use one resid at a time.

See detailed request and response samples in applyrecord Samples.

2.4 Step 2: Start Recording

Call startrecord within five minutes of obtaining the resid to join the channel and start recording.

After calling this method, you can get a recordid from the HTTP response body. This recordid is a unique identifier for a single recording period.

See detailed request and response samples in startrecord Samples.

2.5 Step 3: Stop Recording

Once recording has started, you can call stoprecord to stop recording.

When the channel remains idle (no users) beyond the preset time (default is 30s), cloud recording will also automatically exit the channel and stop recording. Contact Customer Support for special configurations.

See detailed request and response samples in stoprecord Samples.

2.6 Optional Step: Update Stream Mixing Layout

Once recording has started, you can call updatemixrecord to update the stream mixing layout for recording. See request and response samples in updatemixrecord Samples.

3 Recording Files

3.1 Naming Rules

  • Rules for naming mixed stream recording files: rid_{recordid}_{roomid}.m3u8
    For example: rid_ba1107310000565164da34f816f842da94d_abcabc.m3u8
  • Rules for naming source stream recording files: rid_{recordid}_{roomid}__uid_s_{uid}__uid_e.m3u8
    For example: rid_ba1107310000565164da34f816f842da94d_abcabc__uid_s_10266666__uid_e.m3u8

The meanings of the fields in the file name are as follows:
recordid: Recording task ID
roomid: ID of the room to be recorded
uid: User ID
rid, uid_s, uid_e: Fixed words

3.2 Upload Recording Files

The Jocloud background server performs TS slicing on the live media stream and continuously uploads it to the specified OSS storage path. One M3U8 file will be generated when the recording file is completed.

4. Notices

Was this page helpful?

Helpful Not helpful
Submitted! Your feedback would help us improve the website.
Feedback
Top
<