Creates 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.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
live:CreateRoomRealTimeStreamAddress |
none |
*Rtc
|
None | 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 elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
F8DB7E25-6A35-161A-AA41-B7A658AF**** |
| RtmpAddress |
string |
The RTMP ingest URL. |
rtmp://rtcpush****.rtmp.alivecdn.com/rtcdev****/H4sIAAAA****_6pWSlayUipJLS5R0lEqRTBTEMwiJSul1CRTMxNjsyQTM****-PUZCMz8yTDZLNkAwMDA6M0I0ulWgA****__wEAAP__a_e7YkkAAAA?auth_key=1700492701-6e33-0-c6d7e3a93dc2dbe3af42f6259ccd**** |
Examples
Success response
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 |
| 500 | ServerError | %s. | Unknown error, please try again later or submit a ticket for consultation. |
| 403 | NoAuth | %s. | No permission |
| 404 | ResourceNotExist | %s. | The requested resource does not exist, please check and try again |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.