All Products
Search
Document Center

ApsaraVideo Live:CreateRoomRealTimeStreamAddress

Last Updated:Nov 14, 2024

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

  1. Call this operation to generate an ingest URL in the RTMP format.
  2. Ingest a stream by using the ingest URL. Other users in the channel can watch the stream.
  3. Stop ingesting the stream. Other users in the channel see that the user who ingested the stream leaves the channel.
Note
  • 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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
live:CreateRoomRealTimeStreamAddressnone
*Rtc
acs:live::{#accountId}:rtc/{#AppId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
AppIdstringYes

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
ChannelIdstringYes

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
UserIdstringYes

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
DisplayNamestringYes

The name of the RTMP stream. The name can be up to 40 characters in length.

rtmp-dname
ExpireTimeintegerNo

The validity period of the RTMP URL. Unit: seconds. The default value is 36,000 seconds, which is 10 hours.

43200

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

F8DB7E25-6A35-161A-AA41-B7A658AF****
RtmpAddressstring

The RTMP ingest URL.

rtmp://rtcpush****.rtmp.alivecdn.com/rtcdev****/H4sIAAAA****_6pWSlayUipJLS5R0lEqRTBTEMwiJSul1CRTMxNjsyQTM****-PUZCMz8yTDZLNkAwMDA6M0I0ulWgA****__wEAAP__a_e7YkkAAAA?auth_key=1700492701-6e33-0-c6d7e3a93dc2dbe3af42f6259ccd****

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError messageDescription
400InputInvalid%s.Illegal input parameters
403NoAuth%s.No permission
404ResourceNotExist%s.The requested resource does not exist, please check and try again
500ServerError%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 timeSummary of changesOperation
No change history