Creates an ingest URL for an RTMP stream in a channel.
Operation description
Call this operation to generate an RTMP ingest URL.
Ingest a stream to the RTMP URL. Other users in the channel can view this stream.
Stop stream ingest. Other users in the channel see the RTMP stream user leave the channel.
You can repeat steps 2 and 3 while the RTMP URL is valid.
Call DescribeChannelParticipants to query the channel user list and periodically check whether the RTMP stream user is still in the channel. If the user is no longer in the channel, stream ingest may have been interrupted. Stop stream ingest and go back to step 2 to re-ingest.
Before you begin
When using ApsaraVideo Real-time Communication, you typically join a channel and ingest RTC streams through the Alibaba Cloud ARTC SDK. However, in certain special scenarios, Alibaba Cloud allows you to use the RTMP protocol for stream ingest (such as OBS stream ingest). Alibaba Cloud then converts the RTMP stream to an RTC stream for distribution and user joining. You can use this operation to implement this capability. This operation generates an RTMP ingest URL. After you complete stream ingest, Alibaba Cloud automatically converts the stream to an RTC stream. If your business is a pure live streaming scenario, do not use this operation. Refer to Generate ingest URLs and streaming URLs to quickly implement RTMP stream ingest and live playback.
Rate limit
The single-user queries per second (QPS) limit for this operation is 100. If the limit is exceeded, API calls are throttled, which may affect your business. Call this operation appropriately.
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 ApsaraVideo Real-time Communication application. Only a single ID is supported. The value can contain uppercase and lowercase letters, digits, underscores, and hyphens (-), with a maximum of 64 characters. You can view your application IDs by navigating to ApsaraVideo Live > Live+ > Real-time Communication > Application Management. If no application exists, create one by clicking Create Application. |
yourAppId |
| ChannelId |
string |
Yes |
The ID of the channel to join. Only a single ID is supported. The value can contain uppercase and lowercase letters, digits, underscores, and hyphens (-), with a maximum of 64 characters. |
yourChannelId |
| UserId |
string |
Yes |
The user ID for the RTMP stream ingest. This value must not duplicate any other user ID in the channel. The value can contain uppercase and lowercase letters, digits, underscores, and hyphens (-), with a maximum of 64 characters. |
rtmp-uuid |
| DisplayName |
string |
Yes |
The display name of the RTMP stream in the channel. Maximum length: 40 characters. |
rtmp-dname |
| ExpireTime |
integer |
No |
The validity period of the RTMP URL. Unit: seconds. Default value: 36000 (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.