AddLiveAppSnapshotConfig

Updated at:

Configures snapshot settings. The output is saved to OSS and takes effect after the stream is re-ingested.

Operation description

  • Make sure that you fully understand the billing methods and pricing of live stream snapshots before you call this operation. For billing details, refer to Billing of live stream snapshots.

  • ApsaraVideo Live stream snapshot feature requires snapshot files to be stored in a bucket. Therefore, you must activate OSS and have at least one bucket to store these snapshot files. For more information, refer to Configure OSS.

  • Live stream snapshots are stored in OSS, which incurs storage fees. For billing details in OSS, refer to Storage fees.

  • The OSS bucket must be in the same region as ApsaraVideo Live center of the streaming domain name. Cross-region snapshots are not supported.

QPS limits

The QPS limit per user for this operation is 30 calls per second. If the limit is exceeded, API calls are throttled, which may affect your business. 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:AddLiveAppSnapshotConfig

create

*Domain

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

None None

Request parameters

Parameter

Type

Required

Description

Example

DomainName

string

Yes

The primary streaming domain name.

example.com

AppName

string

Yes

The name of the application to which the stream belongs. The template takes effect only when the AppName matches the AppName in the ingest URL. The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It cannot start with a hyphen or an underscore. You can also set this parameter to an asterisk (*) to match all application names.

liveApp****

TimeInterval

integer

Yes

The snapshot interval. A snapshot is captured at each interval. Unit: seconds. Valid values: 5 to 3600.

5

OssEndpoint

string

Yes

The endpoint of the OSS bucket.

After the configuration is complete, you can find the specified configuration in the OSS console based on the callback information. The OSS endpoint must be created in advance. For more information about how to create an OSS endpoint, refer to Configure OSS.

cn-oss-****.aliyuncs.com

OssBucket

string

Yes

The name of the OSS bucket.

After the configuration is complete, you can find the specified configuration in the OSS console based on the callback information. The OSS bucket must be created in advance. For more information about how to create an OSS bucket, refer to Configure OSS.

liveBucket****

OverwriteOssObject

string

No

The file name for overwritten snapshots. Each snapshot overwrites this file.

  • The name must be less than 256 bytes in length.

  • Only JPG images are supported.

  • Variable matching is supported, including {AppName} and {StreamName}.

{AppName}/{StreamName}.jpg

SequenceOssObject

string

No

The file name for real-time snapshots.

Each snapshot is stored with an incremented sequence number. You can call the DescribeLiveStreamSnapshotInfo operation to query snapshot files within a specific time period.

  • The name must be less than 256 bytes in length.

  • Only JPG images are supported.

  • Variable matching is supported, including {AppName}, {StreamName}, {UnixTimestamp}, and {Sequence}. You must specify at least one of {UnixTimestamp} and {Sequence}.

snapshot/{AppName}/{StreamName}/{UnixTimestamp}.jpg

Callback

string

No

The callback URL for snapshots.

https://learn.aliyundoc.com

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 InvalidOverwriteOssObjectOrSequenceOssObject.Malformed Specified paramters OverwriteOssObject or SequenceOssObject should have one. You can specify only one of the OverwriteOssObject and SequenceOssObject parameters.
400 InvalidOssBucket.Malformed Specified parameter OssBucket is not valid. The OSSBucket parameter is invalid. Check whether the OSS BUCKET parameter is correct.
400 InvalidOssEndpoint.Malformed Specified parameter OssEndpoint is not valid.
400 InvalidOverwriteOssObject.Malformed Specified parameter OverwriteOssObject is not valid. The OverwriteOSSObject parameter is invalid. Check whether the OverwriteOSSObject parameter is correct.
400 InvalidSequenceOssObject.Malformed Specified parameter SequenceOssObject is not valid. Invalid value of SequenceOssObject. Check whether the SequenceOssObject parameter that you specified is correct.
400 InvalidOssBucket.NotFound The parameter OssBucket does not exist.
400 ConfigAlreadyExists Config has already exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.