StartCloudRecord

Updated at:

Starts a cloud recording task.

Operation description

Usage notes

This operation starts a cloud recording task for an online channel.

QPS limit

The queries per second (QPS) limit for a single user is 10. If the limit is exceeded, API calls are throttled, which may affect your services. Call this operation at a reasonable frequency.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

rtc:StartCloudRecord

create

*App

acs:rtc:*:{#accountId}:app/{#AppId}

None None

Request parameters

Parameter

Type

Required

Description

Example

AppId

string

Yes

The application ID. You can create and query the ID in the console. Only a single ID is supported.

eo85****

ChannelId

string

Yes

The ID of an existing channel. Only a single ID is supported.

testid

TemplateId

string

Yes

The template ID.

567

TaskId

string

No

The task ID of the cloud recording task. Only a single ID is supported. The ID can contain letters, digits, underscores (_), and hyphens (-), and can be up to 55 bytes in length.

123

CropMode

integer

No

The crop mode. Valid values:

  • 1: Crops the video while keeping the aspect ratio.

  • 2: Keeps the aspect ratio and adds padding (default).

  • 3: Stretches the video to fill the pane.

Valid values:

  • 1
  • 2
  • 3

2

ReservePaneForNoCameraUser

boolean

No

Specifies whether to reserve a pane for a user who does not publish a camera stream. Default value: true. A value of true indicates that a pane is reserved. A value of false indicates that no pane is reserved.

ShowDefaultBackgroundOnMute

boolean

No

Specifies whether to display the default background image of the pane when the user is muted. Valid values:

  • true: Displays the default background image (default).

  • false: Does not display the default background image. The custom background image of the pane is still displayed.

SubHighResolutionStream

boolean

No

Specifies whether to subscribe to high-resolution streams. Valid values:

  • false: Subscribes to streams of different resolutions based on the pane area (default).

  • true: Uses the highest resolution stream published by the client as padding.

StartWithoutChannel

boolean

No

Specifies whether to allow starting the task when the channel does not exist. Valid values:

  • true: Yes.

  • false: No (default).

StartWithoutChannelWaitTime

integer

No

The wait time for the task when the channel is not started, in seconds. This parameter takes effect only when the StartWithoutChannel parameter is set to true. Valid values: 30 to 120.

30

Annotation

string

No

Specifies whether to enable the annotation feature.

Valid values:

  • disable
  • enable

disable

StorageConfig

object

Yes

The storage configuration.

testid

Vendor

integer

Yes

The storage platform. Valid values:

vendorObject storage serviceRemarks
1AliYun OSSAlibaba Cloud
2Apsara Stack OSSAlibaba Cloud Apsara Stack

1

Region

integer

Yes

The storage region.

RegionAlibaba Cloud OSS
0CN_Hangzhou
1CN_Shanghai
2CN_Qingdao
3CN_Beijing
4CN_Zhangjiakou
5CN_Huhehaote
6CN_Shenzhen
7CN_Hongkong
8US_West_1
9US_East_1
10AP_Southeast_1
11AP_Southeast_2 (Deprecated. Do not use.)
12AP_Southeast_3
13AP_Southeast_5
14AP_Northeast_1
15AP_South_1 (Deprecated. Do not use.)
16EU_Central_1
17EU_West_1
18EU_East_1(ME_East_1)
19AP_Southeast_6
20CN_Heyuan
21CN_Guangzhou
22CN_Chengdu
23CN_Nanjing
24CN_Fuzhou
25CN_Wulanchabu
26CN_Northeast_2
27CN_Southeast_7
28CN_Wuhan_LR
100oss-cn-hzjbp
101oss-cn-shanghai-finance-1
102oss-cn-shenzhen-finance-1
103oss-cn-beijing-finance-1
104oss-cn-hzfinance
105oss-cn-shanghai-finance-1-pub
106oss-cn-szfinance
107oss-cn-beijing-finance-1-pub
RegionApsara Stack OSS
0default

0

Bucket

string

Yes

The name of the bucket.

test-bucket-for-recording

AccessKey

string

Yes

The AccessKey. Make sure that the RAM user associated with the AccessKey pair is granted the write permissions on the object storage service of the corresponding cloud provider. Otherwise, the result files fail to be written.

LTAX***

SecretKey

string

Yes

secretKey

APb6qWYEzKtYxE***

Endpoint

string

No

The private endpoint for Apsara Stack.

https://aliyuns.dalian.oss.com

Panes

array<object>

No

The pane settings. You can configure up to 16 panes.

eo85****

array<object>

No

VideoOrder

string

No

The fill order when SourceType is set to video. Valid values:

  • screenFirst: Screen sharing takes precedence. This is the default value.

  • cameraFirst: The camera takes precedence.

Valid values:

  • cameraFirst
  • screenFirst

cameraFirst

SourceType

string

No

The media type of the pane. Valid values:

  • video: The user camera or screen sharing stream. This is the default value.

  • camera: The camera stream.

  • screen: The screen sharing stream.

  • whiteboard: The whiteboard.

Valid values:

  • video
  • camera
  • screen
  • whiteboard

video

Images

array<object>

No

The local image watermarks for the pane.

object

No

PaneImageCropMode

integer

No

The crop mode of the image. Valid values:

  • 1: Crops the image while maintaining the aspect ratio.

  • 2: Maintains the aspect ratio and adds borders.

  • 3: Stretches the image to fill the pane.

Valid values:

  • 1
  • 2
  • 3

2

Alpha

number

No

The transparency of the image.

0.9

X

number

Yes

The x-coordinate.

0.2

Y

number

Yes

The y-coordinate.

0.2

Height

number

Yes

The height.

0.2

Width

number

Yes

The width.

0.2

Layer

integer

No

The z-axis layer.

0

Url

string

Yes

The URL of the image. The image content cannot be updated during stream ingest.

https://aliyun.com/123xx.jpg

Display

string

No

The condition for displaying the watermark. Valid values:

  • streamOnly: The watermark is displayed when the current user has a video stream. This is the default value.

  • backup: The watermark is displayed when the current user does not have a video stream.

  • always: The watermark is always displayed.

Valid values:

  • streamOnly
  • backup
  • always

backup

Texts

array<object>

No

The local text watermarks for the pane.

array<object>

No

BoxBorderw

integer

No

The border width of the text box.

5

FontColor

object

No

The font color.

R

integer

No

The red component.

255

B

integer

No

The blue component.

255

G

integer

No

The green component.

255

Texture

string

Yes

The content of the watermark.

Text watermark

Layer

integer

No

The z-axis layer.

0

Font

integer

No

The font. Valid values:

  • 0: Alibaba PuHuiTi Regular

  • 1: Alibaba PuHuiTi Light

  • 2: Alibaba PuHuiTi Medium

  • 3: Alibaba PuHuiTi Bold

  • 4: Alibaba PuHuiTi Heavy

  • 5: Alimama ShuHeiTi

  • 6: DingTalk JinBuTi

  • 7: Alimama DaoLiTi

  • 8: Alimama DongFangDaKai

  • 9: Alimama FangYuanTi

0

BoxColor

object

No

The color of the text box.

R

integer

No

The red component.

255

B

integer

No

The blue component.

255

G

integer

No

The green component.

255

FontSize

integer

No

The font size.

36

Alpha

number

No

The transparency of the watermark.

0.9

X

number

Yes

The x-coordinate.

0.2

HasBox

boolean

No

Specifies whether to display a text box.

Y

number

Yes

The y-coordinate.

0.2

BoxAlpha

number

No

The transparency of the text box.

0.6

Display

string

No

The condition for displaying the watermark. Valid values:

  • streamOnly: The watermark is displayed when the current user has a video stream. This is the default value.

  • backup: The watermark is displayed when the current user does not have a video stream.

  • always: The watermark is always displayed.

Valid values:

  • streamOnly
  • backup
  • always

backup

PaneCropMode

integer

No

The crop mode of the image. Valid values:

  • 1: Crops the image while maintaining the aspect ratio.

  • 2: Maintains the aspect ratio and adds borders.

  • 3: Stretches the image to fill the pane.

Valid values:

  • 1
  • 2
  • 3

3

PaneId

integer

Yes

The ID of the pane. The value starts from 0.

0

Source

string

No

The media source of the pane. You can specify a user ID. To specify a specific user type, you can use wildcard configurations. The following wildcard types are supported:

  • $ActiveSpeaker: the current speaker in the channel.

  • $ScreenShare: the user who is sharing the screen. If multiple users are sharing their screens in the channel, the panes are filled in chronological order.

22

Backgrounds

array<object>

No

The local background images for the pane.

object

No

Alpha

number

No

The transparency of the image.

0.9

X

number

Yes

The x-coordinate.

0.2

Y

number

Yes

The y-coordinate.

0.2

PaneBackgroundCropMode

integer

No

The crop mode of the image. Valid values:

  • 1: Crops the image while maintaining the aspect ratio.

  • 2: Maintains the aspect ratio and adds borders.

  • 3: Stretches the image to fill the pane.

Valid values:

  • 1
  • 2
  • 3

2

Height

number

Yes

The height.

0.2

Width

number

Yes

The width.

0.3

Layer

integer

No

The z-axis layer.

0

Url

string

Yes

The URL of the image.

https://aliyun.com/123xx.jpg

Display

string

No

The condition for displaying the background image. Valid values:

  • streamOnly: The background image is displayed when the current user has a video stream. This is the default value.

  • backup: The background image is displayed when the current user does not have a video stream.

  • always: The background image is always displayed.

Valid values:

  • streamOnly
  • backup
  • always

backup

Whiteboard

object

No

The whiteboard configurations.

WhiteboardId

string

No

The ID of the whiteboard. Default value: default.

default

ReservePaneForOfflineUser

boolean

No

Specifies whether to reserve the pane as a placeholder for users who have not joined the meeting. Default value: true. A value of true indicates that if the specific user or wildcard user specified for the pane is offline, the pane is forcibly reserved as a placeholder. A value of false indicates that if the specific user or wildcard user specified for the pane is offline, video streams are displayed based on the automatic fill order.

Images

array<object>

No

The global image watermarks.

disable

object

No

Alpha

number

No

The transparency of the image.

0.9

X

number

Yes

The x-coordinate.

0.2

Y

number

Yes

The y-coordinate.

0.3

Height

number

Yes

The height.

0.2

ImageCropMode

integer

No

The crop mode of the image. Valid values:

  • 1: Crops the image while maintaining the aspect ratio.

  • 2: Maintains the aspect ratio and adds borders.

  • 3: Stretches the image to fill the pane.

Valid values:

  • 1
  • 2
  • 3

2

Width

number

Yes

The width.

0.2

Layer

integer

No

The z-axis layer.

0

Url

string

Yes

The image URL. The image content cannot be updated during stream ingest.

https://aliyun.com/123xxx.jpg

Backgrounds

array<object>

No

The local background images for the pane.

object

No

BackgroundCropMode

integer

No

The crop mode of the image. Valid values:

  • 1: Crops the image while maintaining the aspect ratio.

  • 2: Maintains the aspect ratio and adds borders.

  • 3: Stretches the image to fill the pane.

Valid values:

  • 1
  • 2
  • 3

2

Alpha

number

No

The transparency of the image.

0.9

X

number

Yes

The x-coordinate.

0.2

Y

number

Yes

The y-coordinate.

0.2

Height

number

Yes

The height.

0.2

Width

number

Yes

The width.

0.2

Layer

integer

No

The z-axis layer.

0

Url

string

Yes

The URL of the image.

https://aliyun.com/123.jpg

Texts

array<object>

No

The global text watermarks.

array<object>

No

BoxBorderw

integer

No

The border width of the text box.

5

BoxColor

object

No

The color of the text box.

R

integer

No

The red component.

255

B

integer

No

The blue component.

255

G

integer

No

The green component.

255

FontSize

integer

No

The font size.

36

Alpha

number

No

The transparency of the watermark.

0.1

FontColor

object

No

The font color.

R

integer

No

The red component.

255

B

integer

No

The blue component.

255

G

integer

No

The green component.

255

X

number

Yes

The x-coordinate.

0.2

HasBox

boolean

No

Specifies whether to display a text box.

Y

number

Yes

The y-coordinate.

0.2

Texture

string

Yes

The content of the watermark.

Text watermark

Layer

integer

No

The z-axis layer.

0

Font

integer

No

The font. Valid values:

  • 0: Alibaba PuHuiTi Regular

  • 1: Alibaba PuHuiTi Light

  • 2: Alibaba PuHuiTi Medium

  • 3: Alibaba PuHuiTi Bold

  • 4: Alibaba PuHuiTi Heavy

  • 5: Alimama ShuHeiTi

  • 6: DingTalk JinBuTi

  • 7: Alimama DaoLiTi

  • 8: Alimama DongFangDaKai

  • 9: Alimama FangYuanTi

0

BoxAlpha

number

No

The transparency of the text box.

0.6

ClockWidgets

array<object>

No

The global clock watermark.

array<object>

No

BoxBorderw

integer

No

The border width of the text box.

5

BoxColor

object

No

The color of the text box.

R

integer

No

The red component.

255

B

integer

No

The blue component.

255

G

integer

No

The green component.

255

FontSize

integer

No

The font size of the clock.

30

Zone

integer

No

The time zone.

8

Alpha

number

No

The transparency of the image.

0.9

FontColor

object

No

The font color.

R

integer

No

The red component.

255

B

integer

No

The blue component.

255

G

integer

No

The green component.

255

X

number

Yes

The x-coordinate.

0.2

HasBox

boolean

No

Specifies whether to display a text box.

Y

number

Yes

The y-coordinate.

0.2

Layer

integer

No

The z-axis layer.

0

Font

integer

No

The font. Valid values:

  • 0: Alibaba PuHuiTi Regular

  • 1: Alibaba PuHuiTi Light

  • 2: Alibaba PuHuiTi Medium

  • 3: Alibaba PuHuiTi Bold

  • 4: Alibaba PuHuiTi Heavy

  • 5: Alimama ShuHeiTi

  • 6: DingTalk JinBuTi

  • 7: Alimama DaoLiTi

  • 8: Alimama DongFangDaKai

  • 9: Alimama FangYuanTi

0

BoxAlpha

number

No

The transparency of the text box.

0.6

RegionColor

object

No

The global frame background color.

R

integer

No

The red component.

255

G

integer

No

The green component.

255

B

integer

No

The blue component.

255

BgColor

object

No

The global background color.

R

integer

No

The red component.

255

G

integer

No

The green component.

255

B

integer

No

The blue component.

255

LayoutSpecifiedUsers

object

No

The specified user list for layout generation, which includes Blacklist/Whitelist.

Whitelist: specifies the users whose video streams are subscribed to in the room.

  • After the settings are applied, padding is automatically performed in sequence based on this list.

  • When switching between multiple layouts in a template, only users in the whitelist are calculated.

Blacklist: specifies the users whose video streams are not subscribed to in the room.

  • When switching between multiple layouts in a template, only users not in the blacklist are calculated.

Type

string

Yes

The type of the user list. Valid values:

  • black: Blacklist.

  • white: Whitelist.

Valid values:

  • white
  • black

white

Ids

array

Yes

The list of specified user IDs.

string

Yes

The specific user ID.

123

RecordMode

integer

No

The recording mode. Valid values:

  • 0: Mixed-stream recording. This is the default value.

  • 1: Single-stream recording. Single-stream recording does not support updates.

Valid values:

  • 0
  • 1

1

SingleStreamingRecord

object

No

The parameters for single-stream recording.

AvMerge

boolean

No

Specifies whether to merge the audio file into the video file. Default value: false.

SpecifiedStreams

array<object>

Yes

The streams specified for single-stream recording.

object

No

StreamType

string

Yes

The type of the stream. Valid values:

  • mic: Audio stream.

Valid values:

  • mic
  • camera
  • screen-cast

mic

Type

string

No

The blacklists and whitelists type for single-stream recording streams. Valid values:

  • white: Whitelist. Indicates that the stream is recorded.

Valid values:

  • white

white

Ids

array

Yes

The list of user IDs.

string

Yes

The user ID.

aaaaaaAaaAa_1111111111111

TranscodingParameters

object

No

The transcoding parameters. By default, single-stream recording writes files in MP3 format. Specify this parameter if transcoding is required.

Audio

object

No

The audio encoding settings.

Bitrate

integer

No

The bitrate, in kbps.

Valid values:

  • 64
  • 128
  • 192

128

Codec

string

No

The audio codec format. Valid values:

  • mp3

  • aac

Valid values:

  • mp3
  • aac

mp3

SampleRate

integer

No

The sample rate. Valid values:

  • 8000

  • 16000

  • 32000

  • 44100

  • 48000

Valid values:

  • 16000
  • 32000
  • 48000
  • 8000
  • 44100

48000

Container

string

No

The container format for the recording file. Valid values:

  • mp3

  • aac

  • mp4

  • ts

Valid values:

  • mp3
  • aac
  • mp4
  • ts

aac

Important Additional information

The total number of local image watermarks, local background image watermarks, global image watermarks, and global background images cannot exceed 16.

Advanced watermark layer description

The image generated by the RTC media server is rendered in the following steps:

Render video -> Render image -> Render text.

Video, image, and text are completely separate. In the entire image, the priority is text > image > video.

  1. Render video: Render the video frames based on the customer-defined layout.

    a. The layers of images in the grid and global images are arranged uniformly.

    b. Layer 0 is at the bottom. A larger layer value indicates a higher position. The valid values for layer range from 0 to 100.

  2. Render image Images include custom PNG/JPG images provided by the user.

    a. Render the images based on user-configured information such as width, height, position, and opacity.

    b. Layer 0 is at the bottom. A larger layer value indicates a higher position. The valid values for layer range from 0 to 100.

  3. Render text Text is divided into three types: region text, global text, and timestamp text.

    a. Text of the same type is rendered based on the layer order. Layer 0 is at the bottom. A larger layer value indicates a higher position. The valid values for layer range from 0 to 100.

    b. The priority of different types of text is as follows: timestamp text > global text > area text. When texts overlap, the text with a lower priority is overwritten.

Display of overlapping areas:

  1. For overlapping areas, if no special configuration is applied, the content with higher priority overwrites the content with lower priority.

  2. To prevent content with lower priority from being overwritten by content with higher priority, set the opacity attribute of the content with higher priority to 0.

Validation rules for single-stream recording containers and audio encoding formats

Single-stream recording allows you to specify the encoding format and container format of the recorded file. Different container formats support different stream types and encoding formats. The single-stream recording API operation validates the relevant parameters and rejects unsupported combinations.

Rule 1: Stream types and supported container formats

Stream typeContainer format
Audio-only stream (stream type is mic only)aac, mp3, mp4, ts
Video-only stream or audio and video stream (stream type includes camera or screen-cast)mp4, ts

Rule 2: Container formats and supported audio encoding formats

Container formatAudio encoding format
mp3mp3
aacaac
tsmp3, aac
mp4aac

Response elements

Element

Type

Description

Example

object

result

TaskId

string

The task ID of the current cloud recording.

123

RequestId

string

The request ID.

16A96B9A-F203-4EC5-8E43-CB92E68F4CF8

Examples

Success response

JSON format

{
  "TaskId": "123",
  "RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68F4CF8"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.