AddLiveStreamMerge

Updated at:

Adds a primary and secondary stream merge configuration.

Operation description

The queries per second (QPS) limit for a single user is 100. If the limit is exceeded, API calls are throttled, which may affect your services. Call this API operation at a reasonable frequency.

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 name.

example.com

AppName

string

Yes

The application name for the merged stream output. The AppName must match the AppName in the ingest URL for the template to take effect. You cannot set this parameter to an asterisk (*).

app

StreamName

string

Yes

The stream name for the merged stream output. The StreamName must match the StreamName in the ingest URL for the template to take effect. You cannot set this parameter to an asterisk (*).

StreamName

InAppName1

string

Yes

The application name of the primary stream for the merge input. The specified AppName must match the AppName in the ingest URL of the primary stream to take effect.

app1

InStreamName1

string

Yes

The name of the main live stream for stream mixing. The specified AppName must match the AppName in the ingest URL of the main stream for this parameter to take effect.

InStream1

InAppName2

string

Yes

The application name of the secondary stream for the merge input. The specified AppName must match the AppName in the ingest URL of the secondary stream to take effect.

app2

InStreamName2

string

Yes

The name of the backup live stream for stream mixing. The specified AppName must match the AppName in the ingest URL of the backup stream for the configuration to take effect.

stream2

StartTime

string

Yes

The start time of the stream merge.

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

2020-05-29T00:00:00Z

EndTime

string

Yes

The end time of the stream merge.

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

Note

The maximum time difference between the start time and the end time is 7 days.

2020-05-29T01:00:00Z

Protocol

string

No

The live stream protocol. Valid values:

  • rtmp (default)

  • rtc (supported, but requires you to submit a ticket for special configuration)

rtmp

LiveMerger

string

No

Specifies whether to use the merge mode. Valid values:

  • on: enables the merge mode. Stream switching is seamless.

  • off: default value. Uses the default mode. Stream switching is perceptible.
    Important If the codecs of the two source streams are different, use the off mode.

off

MergeParameters

string

No

The additional configuration parameters for stream switching.

alitest=xx

SelectAppName

string

No

The application name of the selected primary stream in manual mode.

appmain

SelectStreamName

string

No

The stream name of the selected primary stream in manual mode.

stream_main

SwitchMode

string

No

The switching mode for the primary and secondary stream merge. Valid values: manually (manual mode) and automatically (automatic mode).

Valid values:

  • manually :

    Manual switchover. The switchover between the primary and secondary streams is manually triggered by the caller.

  • automatically :

    Automatic switchover. The system automatically performs the switchover when an exception occurs in the primary or secondary stream.

manually

Note

The AppName, InAppName1, and InAppName2 parameters must be unique. The StreamName, InStreamName1, and InStreamName2 parameters must be unique.

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

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

Message

string

  • The additional information. Common scenarios include providing a brief description of a failed invoke to help the caller troubleshoot the issue.

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

OK

config invalid, degrade to no livemerger indicates that the configuration of the new liveswitch engine is incomplete, and the system automatically degrades 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.