All Products
Search
Document Center

ApsaraVideo Live:RealTimeRecordCommand

Dernière mise à jour :Jul 17, 2026

Performs on-demand manual recording. For example, dynamically starts or stops recording.

Operation description

  • Before using this operation, make sure that you fully understand the billing method and pricing of live stream recording. For billing details, see Live stream recording fees.

  • This operation can only control live streams for which a recording configuration has taken effect. Complete adding a recording configuration first.

  • Before calling this operation, make sure that the target stream (DomainName/AppName/StreamName) is in an active stream ingest state.

  • If a live stream is being recorded (through automatic recording or manual recording), you can call this operation to stop recording the stream. However, if you call this operation to start recording when recording is already started, the TaskAlreadyStarted error is returned, indicating that the task has already been started.

  • If a live stream that is manually started for recording is interrupted, recording stops. If automatic recording is not configured, recording does not automatically start after stream ingest resumes.

QPS limit

The single-user QPS limit for this operation is 50 calls per second. If this limit is exceeded, API calls are throttled, which may affect your business. Call this operation appropriately.

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

none

*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 action. Valid values:

  • start: forcibly starts recording. This must be called as the first operation and cannot be called again before stopping.

  • stop: forcibly pauses recording. After the stream interruption delay (180 seconds by default) elapses, a recording is generated. This can only be called after start or restart. To generate the file immediately after calling stop, call cancel_delay.

  • cancel_delay: immediately terminates the wait and generates a recording, completely stopping recording. This must be called after stop to generate the file in advance.

  • restart: forcibly restarts recording. If recording is in progress before restart, a file is immediately generated. This can only be called when the task is in the started or stopped state.

start

DomainName

string

Yes

The streamer's streaming domain.

example.com

AppName

string

Yes

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

liveApp****

StreamName

string

Yes

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

Note

This operation supports only single-stream operations and does not support wildcards.

liveStream****

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 MalformedParam %s, please check and try again later. Invalid parameter, please check and try again.
400 MissingParam %s, please check and try again later. Parameter is missing, please check and try again.
400 CodeConfigNotFound %s, please check and try again later. Configuration does not exist, please check and try again.
500 InternalError %s. error on the live liveapi server.
409 StreamNotFound %s, please check and try again later. Stream does not exist, please check and try again.
409 TaskAlreadyStarted %s, please do not start again. Task already started, do not start again.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.