All Products
Search
Document Center

ApsaraVideo Live:RealTimeRecordCommand

Last Updated:Feb 03, 2026

Controls recordings manually on demand. You can start or stop recording at any time.

Operation description

  • Before you call this API, review the billing methods and pricing of live stream recording. For more information, see Billing of live stream recording.

  • This API applies to live streams that have an active recording configuration. You must first add a recording configuration.

  • You can use this API to stop a recording that was started either automatically or manually. However, if you call this API to start a recording that is already in progress, the system 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 stream ingest resumes.

QPS limits

You can call this operation up to 50 times per second per account. Requests that exceed this limit are dropped and you may experience service interruptions.

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

  • start: Starts the recording. This command must be the first one called for a session and cannot be called again before a stop command is issued.

  • stop: Stops the recording. A recording file is generated after the configured stream merge window (default: 180 seconds). Call this command only after start or restart. To generate the recording file immediately, call cancel_delay after this command.

  • cancel_delay: Immediately finalizes the recording file, terminating the waiting period. This must be called after stop to generate the file ahead of schedule.

  • restart: Restarts the recording. If a recording is already in progress, this command first finalizes the current recording file and then immediately starts a new one. This can only be called when the recording session is in a started or stopped state.

start

DomainName

string

Yes

The main streaming domain.

example.com

AppName

string

Yes

The AppName of the live stream. View AppNames on the Stream Management page.

liveApp****

StreamName

string

Yes

The stream name. Make sure the StreamName is correct. View StreamNames on the Stream Management page.

Note

This API only supports operations on a single stream. Wildcard are not supported.

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.