All Products
Search
Document Center

ApsaraVideo Live:RealTimeRecordCommand

Last Updated:Aug 15, 2025

Controls recordings manually on demand. For example, you can start or stop recording at any time.

Operation description

  • Before you call this operation, make sure that you understand the billing methods and pricing of live stream recording. For more information, see Live recording fees.

  • This operation controls only live streams that have an active recording configuration. You must first add a recording configuration.

  • This operation can stop a live stream that is being recorded, either automatically or manually. However, calling this operation to start a recording that is already in progress returns a TaskAlreadyStarted error.

  • If a manually started recording is interrupted, the recording stops. If automatic recording is not configured, the recording does not automatically restart when the stream ingest resumes.

QPS limits

The queries per second (QPS) limit for this operation is 50 for each user. If you exceed the limit, throttling is triggered, which can affect your business. We recommend that you call this operation at a reasonable rate.

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:RealTimeRecordCommand

get

*Domain

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

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The region ID.

cn-shanghai

Command

string

Yes

The operation. Valid values:

  • start: Starts the recording.

  • stop: Pauses the recording. A recording file is generated after the stream interruption latency is reached.

  • cancel_delay: Resets the stream interruption latency and stops the recording. If the task is already stopped, a recording file is generated immediately.

  • restart: Restarts the recording. If a recording was in progress before the restart, a recording file is generated immediately.

Note

The stop operation pauses the recording and waits for 180 seconds by default before a recording file is generated. The cancel_delay operation changes the stream interruption latency from the default 180 seconds to 0. This means a recording file is generated immediately.

start

DomainName

string

Yes

The streaming domain.

example.com

AppName

string

Yes

The name of the application to which the stream belongs. You can find the AppName on the Stream Management page.

liveApp****

StreamName

string

Yes

The stream name. Make sure the StreamName is correct. You can find the StreamName on the Stream Management page.

Note

This operation supports only a single stream. Wildcard characters are not supported.

liveStream****

Response parameters

Parameter

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 MalformedParam %s
400 MissingParam %s
400 CodeConfigNotFound %s
500 InternalError %s
409 StreamNotFound %s
409 TaskAlreadyStarted %s

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.