UpdateLiveAppRecordConfig

Updated at:

Updates the recording configuration for an application and saves the output to OSS.

Operation description

First obtain the streaming domain of the streamer, and then invoke this operation to update the recording configuration.

Rate limit

The rate limit for this operation is 30 calls per second per user. 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

live:UpdateLiveAppRecordConfig

update

*Domain

acs:cdn:*:{#accountId}:domain/{#DomainName}

None None

Request parameters

Parameter

Type

Required

Description

Example

DomainName

string

Yes

The streaming domain of the streamer.

example.com

AppName

string

Yes

The name of the application to which the live stream belongs.

liveApp****

OssEndpoint

string

Yes

The endpoint of OSS.

To store live recording files in OSS, you must create an OSS bucket in advance. For more information, see Configure OSS.

learn.developer.aliyundoc.com

StreamName

string

No

The name of the live stream.

teststream

StartTime

string

No

The start time of the recording. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

Note

The specified time must be within 7 days after the actual stream ingest start time. This parameter takes effect only for stream-level recording, which means the StreamName parameter is not empty.

2018-04-10T09:57:21Z

EndTime

string

No

The end time of the recording. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

Note

The difference between the EndTime and StartTime values must not exceed 7 days. If the difference exceeds 7 days, the recording duration is calculated as 7 days. This parameter takes effect only for stream-level recording, which means the StreamName parameter is not empty.

2018-04-16T09:57:21Z

OnDemand

integer

No

Specifies whether to enable on-demand recording. Valid values:

  • 0: Disabled.

  • 1: HTTP callback.

  • 2: Stream ingest parameter parsing.

  • 7: No recording by default. You can call the RealTimeRecordCommand operation to manually start or stop recording.

Note

If you set OnDemand to 1, you must call the AddLiveRecordNotifyConfig operation to configure the OnDemandUrl parameter first. Otherwise, recording is disabled by default.

1

DelayTime

integer

No

The stream interruption concatenation duration. If the duration of a stream interruption exceeds the specified concatenation duration, a new file is generated. Valid values: 15 to 21600. Unit: seconds.

180

RecordFormat

array<object>

No

The recording format details.

object

No

CycleDuration

integer

No

The recording length per epoch. Unit: seconds. If you do not specify this parameter, the default value is 21600, which indicates 6 hours.

Note
  • If a stream interruption occurs within a recording epoch but the stream ingest returns to Normal within the concatenation duration, the recording continues in the same file.

  • A recording file is generated only when the stream interruption duration exceeds the concatenation duration.

1

OssObjectPrefix

string

No

The name of the recording file stored in OSS.

The file name must be less than 256 bytes in size and supports variable matching. Supported variables include {AppName}, {StreamName}, {Sequence}, {StartTime}, {EndTime}, {EscapedStartTime}, and {EscapedEndTime}. The parameter value must contain {StartTime} or {EscapedStartTime}, and {EndTime} or {EscapedEndTime}.

record/{AppName}/{StreamName}/{Sequence}_{EscapedStartTime}_{EscapedEndTime}

Format

string

No

The recording format. M3U8, FLV, MP4, and CMAF are supported. Valid values:

Important You must specify at least one of the RecordFormat and TranscodeRecordFormat parameters. If you select the m3u8 or cmaf format, you must also specify the RecordFormat.N.SliceOssObjectPrefix and RecordFormat.N.SliceDuration request parameters.
  • m3u8.

  • flv.

  • mp4.

  • cmaf.

m3u8

SliceDuration

integer

No

The segment length. Unit: seconds.

Important This parameter takes effect only when the RecordFormat.N.Format parameter is set to m3u8 or cmaf.

If you do not specify this parameter, the default value is 30. Valid values: 5 to 30.

30

SliceOssObjectPrefix

string

No

The segment name.

Important You need to configure this parameter only when the RecordFormat.N.Format parameter is set to m3u8 or cmaf.
  • By default, a segment is generated every 30 seconds. The name must be less than 256 bytes in size and supports variable matching. Supported variables include {AppName}, {StreamName}, {UnixTimestamp}, and {Sequence}.

  • The parameter value must contain the {UnixTimestamp} and {Sequence} variables.

record/{AppName}/{StreamName}/{UnixTimestamp}_{Sequence}

TranscodeRecordFormat

array<object>

No

The transcoded stream recording details.

object

No

CycleDuration

integer

No

The recording length per epoch for the transcoding stream recording. Unit: seconds. If you do not specify this parameter, the default value is 21600, which indicates 6 hours.

21600

OssObjectPrefix

string

No

The name of the recording file for the transcoded stream stored in OSS.

  • The file name must be less than 256 bytes in size and supports variable matching. Supported variables include {AppName}, {StreamName}, {Sequence}, {StartTime}, {EndTime}, {EscapedStartTime}, and {EscapedEndTime}.

  • The parameter value must contain {StartTime} or {EscapedStartTime}, and {EndTime} or {EscapedEndTime}.

record/{AppName}/{StreamName}/{Sequence}_{EscapedStartTime}_{EscapedEndTime}

Format

string

No

The recording format for the transcoded stream. M3U8, FLV, MP4, and CMAF are supported. Valid values:

Important If you select the m3u8 or cmaf format, you must also specify the TranscodeRecordFormat.N.SliceOssObjectPrefix and TranscodeRecordFormat.N.SliceDuration request parameters.

  • m3u8.

  • flv.

  • mp4.

  • cmaf.

m3u8

SliceDuration

integer

No

The segment length for the transcoding stream recording. Unit: seconds.

Important This parameter takes effect only when the TranscodeRecordFormat.N.Format parameter is set to m3u8 or cmaf.

If you do not specify this parameter, the default value is 30. Valid values: 5 to 30.

30

SliceOssObjectPrefix

string

No

The segment name for the transcoded stream recording.

Important You need to configure this parameter only when the TranscodeRecordFormat.N.Format parameter is set to m3u8 or cmaf.
  • By default, a segment is generated every 30 seconds. The name must be less than 256 bytes in size and supports variable matching. Supported variables include {AppName}, {StreamName}, {UnixTimestamp}, and {Sequence}.

  • The parameter value must contain the {UnixTimestamp} and {Sequence} variables.

record/{AppName}/{StreamName}/{UnixTimestamp}_{Sequence}

TranscodeTemplates

array

No

The transcoding template group for the transcoded stream recording.

string

No

  • The transcoding template for the transcoded stream recording. You can specify up to 10 templates.

  • If you configure the TranscodeRecordFormat.N.xxx parameters, you must specify at least one transcoding template.

  • To record multiple or all transcoded streams, set TranscodeTemplates.1 to *****.

Note

The value of TranscodeTemplates cannot be raw because it is a reserved identifier.
The RepeatList format is represented by N in TranscodeTemplates.N. N is an incrementing number used to specify multiple values. Examples: TranscodeTemplates.1=sd, TranscodeTemplates.2=hd.

sd

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

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

Examples

Success response

JSON format

{
  "RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68F4CD8"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidOssBucket.Malformed Specified parameter OssBucket is not valid. The OSSBucket parameter is invalid. Check whether the OSS BUCKET parameter is correct.
400 InvalidOssBucket.NotFound The parameter OssBucket does not exist.
400 InvalidFormat.Malformed Specified parameter Format is not valid. Invalid value of Format. Check whether the Format parameter that you specified is correct.
400 InvalidCycleDuration.Malformed Specified CycleDuration Format is not valid. Invalid format of CycleDuration. Check whether the format of the CycleDuration parameter is correct.
400 InvalidSliceDuration.Malformed Specified SliceDuration Format is not valid. The specified SliceDuration parameter is invalid.
400 InvalidTemplateLength.Malformed Specified record template length is not valid.
400 InvalidTemplate.ForbidRaw Template named raw is Forbidden.
400 MissingTemplate Template is mandatory for this action. Missing transcoding template parameter configuration.
400 MissingOssObjectPrefix OssObjectPrefix is mandatory for this action.
400 MissingSliceOssObjectPrefix SliceOssObjectPrefix is mandatory for this action.
400 InvalidOssObjectPrefix.Malformed Specified parameter OssObjectPrefix is not valid.
400 InvalidSliceOssObjectPrefix.Malformed Specified parameter SliceOssObjectPrefix is not valid. The SliceOssObjectPrefix parameter is invalid. Check whether the SliceOssObjectPrefix parameter is correct.
400 ConfigAlreadyExists Config has already exist.
400 InvalidFormat.IllegalOperation Specified parameter Format can not be multiple.
400 InvalidDelayTime Specified Delaytime is invalid.
400 Live2Vod.ConfigAlreadyExists Had live2vod record config already.
400 InvalidStartTime.Malformed Specified StartTime is malformed.
400 InvalidEndTime.Malformed Specified EndTime is malformed.
400 InvalidEndTime.Mismatch Specified EndTime does not math the specified StartTime or current time.
400 InvalidStartTime.Mismatch Specified StartTime does not math the current time.
400 Forbidden Ram Permission is forbidden.
400 InvalidOssEndpoint.Malformed %s, please check and try again later. Invalid OssEndpoint, please check and try again.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.