Generates a Real-Time Messaging Protocol (RTMP) ingest URL for a channel.
Operation description
Usage notes
To use the interactive streaming feature, you must use ApsaraVideo Real-time Communication (ARTC) SDK to join a channel and ingest streams over Real-Time Communication (RTC). In specific scenarios, you can ingest streams over Real-Time Messaging Protocol (RTMP) by using tools such as Open Broadcaster Software (OBS). Then, ApsaraVideo Live automatically converts the RTMP streams to RTC streams and distributes the RTC streams to viewers. You can call this operation to generate an ingest URL in the RTMP format. After you ingest RTMP streams, ApsaraVideo Live automatically converts the streams to RTC streams. Do not call this operation if you require only regular live streaming. To quickly ingest RTMP streams and start live streaming, see Get started with ApsaraVideo Live.
Procedure
- Call this operation to generate an ingest URL in the RTMP format.
- Ingest a stream by using the ingest URL. Other users in the channel can watch the stream.
- Stop ingesting the stream. Other users in the channel see that the user who ingested the stream leaves the channel.
-
You can repeat Steps 2 and 3 within the validity period of the ingest URL.
-
We recommend that you call the DescribeChannelParticipants operation to query online users in the channel at regular intervals. This way, you can check whether the user who ingests the stream is still in the channel. If the user who ingests the stream is not in the channel, the stream may be interrupted. In this case, we recommend that you stop ingesting the stream and perform Step 2.
QPS limit
You can call this operation up to 100 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see QPS limits.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
live:CreateRoomRealTimeStreamAddress | none | *Rtc acs:live::{#accountId}:rtc/{#AppId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
AppId | string | Yes | The ID of the ARTC application. You can specify only one application ID. The ID can be up to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). | yourAppId |
ChannelId | string | Yes | The ID of the channel. You can specify only one ID. The ID can be up to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). | yourChannelId |
UserId | string | Yes | The ID of the user who ingests the stream over RTMP. The user ID must be different from IDs of other users in the channel. The ID can be up to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). | rtmp-uuid |
DisplayName | string | Yes | The name of the RTMP stream. The name can be up to 40 characters in length. | rtmp-dname |
ExpireTime | integer | No | The validity period of the RTMP URL. Unit: seconds. The default value is 36,000 seconds, which is 10 hours. | 43200 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "F8DB7E25-6A35-161A-AA41-B7A658AF****",
"RtmpAddress": "rtmp://rtcpush****.rtmp.alivecdn.com/rtcdev****/H4sIAAAA****_6pWSlayUipJLS5R0lEqRTBTEMwiJSul1CRTMxNjsyQTM****-PUZCMz8yTDZLNkAwMDA6M0I0ulWgA****__wEAAP__a_e7YkkAAAA?auth_key=1700492701-6e33-0-c6d7e3a93dc2dbe3af42f6259ccd****"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InputInvalid | %s. | Illegal input parameters |
403 | NoAuth | %s. | No permission |
404 | ResourceNotExist | %s. | The requested resource does not exist, please check and try again |
500 | ServerError | %s. | Unknown error, please try again later or submit a ticket for consultation. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|