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 use concatenating rules to construct 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 you have completed the prerequisites such as domain name resolution and URL signing. This topic describes how to construct an ingest URL and a streaming URL for a stream by using the concatenating rules.

Limits

You can construct multiple ingest or streaming URLs to create multiple live streams at the same time. However, each domain name allows a maximum of 20 streams or 10 transcoded streams at the same time. Make sure that such limits do not affect your live streaming services. If you require larger quotas, submit a ticket.

Construct ingest and streaming URLs

You can use the URL generator in the ApsaraVideo Live console or use the concatenating rules to construct ingest and streaming URLs.

  • For more information about how to use the URL generator in the ApsaraVideo Live console to construct ingest and streaming URLs, see Use the URL generator.
  • Before you construct an ingest URL or a streaming URL for a stream by using the concatenating rules, check whether the stream requires transcoding and whether the URL signing feature is enabled. Then, obtain an ingest domain, a streaming domain, an application name, a stream name, a transcoding template ID, and an access token. The transcoding template ID and access token are optional. The following table describes the concatenating rules.
    URL type Concatenating rule Sample URL
    Ingest URL Ingest domain + Application name + Stream name + Access token Ingest URLs support the Real-Time Messaging Protocol (RTMP) and Real-Time Streaming (RTS) formats. Ingest URLs in the RTS format are used for RTS. Before you use ingest URLs in the RTS format, you must enable the RTS feature.
    • Ingest URL in the RTMP format: rtmp://demo.aliyundoc.com/app/stream?auth_key= {Access token}
    • Ingest URL in the RTS format: artc://demo.aliyundoc.com/app/stream?auth_key= {Access token}
    • Ingest URL in the SRT format: artc://example.aliyundoc.com/app/stream?auth_key={Access token}
    Streaming URL Streaming domain + Application name + Stream name + Access token

    Streaming URLs support the RTMP, Flash Video (FLV), M3U8, and RTS formats. Streaming URLs in the RTS format are used for RTS. Before you use streaming URLs in the RTS format, you must enable the RTS feature.

    • Streaming URL in the RTMP format: rtmp://example.aliyundoc.com/app/stream?auth_key= {Access token}
    • Streaming URL in the FLV format: http://example.aliyundoc.com/app/stream.flv?auth_key= {Access token}
    • Streaming URL in the M3U8 format: http://example.aliyundoc.com/app/stream.m3u8?auth_key= {Access token}
    • Streaming URL in the RTS format: artc://example.aliyundoc.com/app/stream?auth_key= {Access token}
    Streaming URL for transcoding Streaming domain + Application name + Stream name_Transcoding template ID + Access token Streaming URLs for transcoding support the RTMP, FLV, M3U8, and RTS formats. Streaming URLs for transcoding in the RTS format are used for RTS. Before you use streaming URLs for transcoding in the RTS format, you must enable the RTS feature. To transcode a stream, you must append _Transcoding template ID to the stream name.
    • Streaming URL for transcoding in the RTMP format: rtmp://example.aliyundoc.com/app/stream_{Transcoding template ID}?auth_key={Access token}
    • Streaming URL for transcoding in the FLV format: http://example.aliyundoc.com/app/stream_{Transcoding template ID}.flv?auth_key={Access token}
    • Streaming URL for transcoding in the M3U8 format: http://example.aliyundoc.com/app/stream_{Transcoding template ID}.m3u8?auth_key={Access token}
    • Streaming URL for transcoding in the RTS format: artc://example.aliyundoc.com/app/stream_{Transcoding template ID}?auth_key={Access token}
    Note
    • ApsaraVideo Live determines whether a stream is unique based on the stream name instead of the application name. If you have specified a unique application name, you must also specify a unique stream name to ensure that the stream is unique.
    • Replace the content in braces {} with an actual value.
    • If you need only to pull streams, the ingest domain is not required.
    • 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 Signed URLs.
    • You must provide a transcoding template ID to construct a streaming URL for transcoding. 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.