AddLiveStreamMerge

更新时间:
复制 MD 格式

Call AddLiveStreamMerge to add a primary/backup stream merge configuration.

Operation description

Exceeding the API limit of 100 QPS per account triggers throttling, which may disrupt your service. Please make calls reasonably.

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

create

*Domain

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

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The region ID.

cn-shanghai

DomainName

string

Yes

The streaming domain.

example.com

AppName

string

Yes

The AppName of the output stream. For the configuration to take effect, this AppName must match the one in the ingest URL. Wildcards (*) are not supported.

app

StreamName

string

Yes

The StreamName of the output stream. For the configuration to take effect, this StreamName must match the one in the ingest URL. Wildcards (*) are not supported.

StreamName

InAppName1

string

Yes

The AppName of the primary input stream. This value must match the AppName in the ingest URL for the primary stream.

app1

InStreamName1

string

Yes

The StreamName of the primary input stream. This value must match the StreamName in the ingest URL for the primary stream.

InStream1

InAppName2

string

Yes

The AppName of the backup input stream. This value must match the AppName in the ingest URL for the backup stream.

app2

InStreamName2

string

Yes

The StreamName of the backup input stream. This value must match the StreamName in the ingest URL for the backup stream.

stream2

StartTime

string

Yes

The start time of the stream merge.

The time must be in UTC and specified in the ISO 8601 standard format: yyyy-MM-ddTHH:mm:ssZ.

2020-05-29T00:00:00Z

EndTime

string

Yes

The end time of the stream merge.

The time must be in UTC and specified in the ISO 8601 standard format: yyyy-MM-ddTHH:mm:ssZ.

Note

The interval between StartTime and EndTime cannot exceed 7 days.

2020-05-29T01:00:00Z

Protocol

string

No

The live stream protocol for the input streams. Valid values:

  • rtmp (Default)

  • rtc

rtmp

LiveMerger

string

No

The engine to use for stream merging.

  • on: The new liveswitch engine.

  • off: A legacy engine (such as rtmpr). This is the default.

off

MergeParameters

string

No

Parameters that define the failover conditions. A failover is triggered when one of the following conditions is met:

  1. An explicit stream disconnection occurs, such as an end-of-file (EOF) or network error.

  2. The stutter rate exceeds 60% in the last 5 seconds.

  3. A stream pulling timeout occurs if no frame data is received for 2 consecutive seconds.

  4. The average frame rate over the period specified by ali_max_no_frame_timeout drops below ali_low_frame_rate_threshold. This condition applies even if there is no stream disconnection or stuttering. If you set ali_max_no_frame_timeout, the timeout for Condition 3 is also updated to this value.

  5. If block_all_jitter is set to 1, Conditions 2, 3, and 4 do not apply.

  • ali_max_no_frame_timeout: an integer from 2 to 10.
    ali_low_frame_rate_threshold: an integer from 1 to 200.
    block_all_jitter: 0 or 1.

ali_low_frame_rate_threshold=10&ali_max_no_frame_timeout=5&block_all_jitter=0

Note

The values for AppName, InAppName1, and InAppName2 must be unique. Similarly, the values for StreamName, InStreamName1, and InStreamName2 must be unique.

Response elements

Element

Type

Description

Example

object

RequestId

string

The unique ID of the request.

16A96B9A-F203-4EC5-8E43-CB92E68F****

Message

string

  • A message that indicates the result of the request. If the request fails, this message helps the caller identify the issue.

  • Valid values: OK, config invalid, degrade to no livemerger.

OK

The message "config invalid, degrade to no livemerger" means the configuration for the new liveswitch engine is incomplete, causing an automatic downgrade to the legacy engine.

Examples

Success response

JSON format

{
  "RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68F****",
  "Message": "OK"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidStartTime.Malformed Specified parameter StartTime is not valid.
400 InvalidEndTime.Malformed Specified parameter EndTime is not valid.
400 InvalidStartTime.ValueNotSupported The specified value of parameter StartTime is not supported. The value specified for the StartTime parameter is invalid.
400 InvalidParam Parameter invalid. Illegal input parameters
400 QuotaExceeded.Merge Exceed max merge count limit
400 ConfigAlreadyExists Config has already exist.
400 Duration.Exceed Duration between StartTime and EndTime is too long.
400 InvalidParam.CodeIllegalDuration %s. The value of start time should be less than the value of end time .
500 InternalError The request processing has failed due to backend service exception.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.