ApsaraVideo Live allows you to ingest and play live streams on demand without the need to create resources in advance. After you add an ingest domain and a streaming domain, you can generate an ingest URL and a streaming URL. Before you start, make sure that both the ingest domain and streaming domain have Internet content provider (ICP) filings and that the settings such as domain name resolution and URL signing are complete. This topic describes how to generate an ingest URL and a streaming URL for a stream.
Usage notes
You can generate multiple ingest or streaming URLs to run multiple live streams at the same time. However, each ingest domain allows a limited number of concurrent streams. For more information, see Limits. Before you start live streaming, make sure that such limits meet your business requirements. If you want to modify the limits, contact us.
If you use a transcoding template or enable URL signing, replace the content in braces {} with the actual value. An access token is an encrypted string that is generated based on the URL signing algorithm. You must enable the URL signing feature to generate an access token. You can enable the URL signing feature in the ApsaraVideo Live console and obtain the access token. For more information, see Configure URL signing. You can also use the MD5 algorithm to generate the access token. For more information, see Construct a signed URL.
Method 1: Generate ingest and streaming URLs in the console
You can use the live URL generator in the ApsaraVideo Live console to generate ingest and streaming URLs. For more information, see Live URL generator.
Method 2: Construct ingest and streaming URLs
Before you construct an ingest URL or a streaming URL by using the concatenation rules, confirm whether the live stream requires transcoding and URL signing. Then, obtain the ingest domain, streaming domain, application name, stream name, transcoding template ID, and access token. The transcoding template ID and access token are optional. The following table describes the concatenation rules.
URL type | Concatenation rule | Sample URL |
Ingest URL | Ingest domain + Application name + Stream name + Access token |
|
Streaming URL | Streaming domain + Application name + Stream name + Access token |
|
Transcoded stream URL | Streaming domain + Application name + Stream name_Transcoding template ID + Access token | You must add
|
URL for delayed streaming | Streaming domain + Application name + Stream name-alidelay + Access token | You must add
|
Subtitle stream URL | Streaming domain + Application name + Stream name_Subtitle template name + Access token | You must add "_Subtitle template name" after the stream name in a subtitle stream URL.
|
Before you use a URL in the Real-Time Streaming (RTS) format, you must enable the RTS feature. For more information, see Enable RTS.
ApsaraVideo Live determines whether a stream is unique based on the stream name instead of the application name. If you specify a unique application name, you must also specify a unique stream name to ensure that the stream is unique. If you want applications with different application names under a domain name to ingest the same stream, contact us to enable the application isolation feature.
If you need to only pull streams, the ingest domain is not required.
You must provide a transcoding template ID to generate a transcoded stream URL. You can specify or view the ID of a transcoding template in the ApsaraVideo Live console. For more information, see Configure default transcoding. You can also call the AddCustomLiveStreamTranscode or DescribeLiveStreamTranscodeInfo operation to specify or obtain the ID of a transcoding template.
A URL for delayed streaming can take effect only after you configure stream delay. You can configure this feature in the ApsaraVideo Live console. For more information, see Configure stream delay. If stream delay is not configured for the streaming domain or live streaming has not started, the URL for delayed streaming cannot be pulled.
For information about how to use code to generate ingest and streaming URLs, see How do I use PHP or Java code to generate an ingest URL and a streaming URL? .