This topic describes how to configure multi-bitrate transcoding and generate a multi-bitrate streaming URL.

Prerequisites

The multi-bitrate transcoding feature is enabled for your domain name. To use the multi-bitrate transcoding feature to transcode streams for a domain name for the first time, you must submit a ticket. You can configure multi-bitrate transcoding templates for the domain name before you submit the ticket. After the multi-bitrate transcoding feature is enabled for the domain name, the templates immediately take effect on the domain name. The multi-bitrate transcoding feature is enabled by domain name. To use the multi-bitrate transcoding feature to transcode streams for another domain name, you must submit another ticket.

Background information

The bandwidth may sharply vary with network environments. Insufficient bandwidth affects the playback effect on terminals. If a stream may be played by users with varying bandwidth conditions, you can transcode the stream to multiple bitrates to match the bandwidth. After you configure multi-bitrate transcoding for a stream, a player automatically switches to the most appropriate stream based on the network bandwidth. This can improve the playback effect.

Create a multi-bitrate transcoding template group

  1. Log on to the ApsaraVideo Live console.
  2. In the left-side navigation pane, click Domains to go to the Domain Management page.
  3. Find the streaming domain that you want to configure and click Domain Settings.
    001
  4. Choose Templates > Transcoding Settings.
  5. Click the Multi-bitrate Transcoding tab. Then, click Add.
  6. Create a multi-bitrate transcoding template group.
    1. Configure the basic information for the multi-bitrate transcoding template group.
      Multi-bitrate transcoding template group: basic information
      The following table describes the parameters of the basic information.
      Parameter Description
      AppName The transcoding template takes effect only when the value of this parameter is the same as the application name that is specified in the pushing URL.
      Template Group ID The ID of the transcoding template group. The template group ID is required to generate multi-bitrate streaming URLs. The value of this parameter can contain digits, letters, and hyphens (-), and can be up to 10 characters in length.
      Container Format Only HTTP Live Streaming (HLS) is supported.
      Trigger Transcoding Multi-bitrate transcoding can be triggered only upon stream pushing, and cannot be triggered upon streaming. You are charged for using multi-bitrate transcoding.
      Timestamp Alignment After you turn on this option, you are not allowed to set the group of pictures (GOP) for templates. Instead, the GOP of the source video is used.
    2. Click Add and set the parameters for the transcoding template.
      The parameters vary based on the template type. The following table describes the template parameters.
      Parameter Description
      Settings ID The ID of the transcoding template.

      The value of the Settings ID parameter is used to construct a URL for a live stream that requires transcoding. For more information about how to construct a URL, see Ingest and streaming URLs. You can append the template ID to the streaming URL to watch the transcoded stream in the specified resolution.

      Important The template ID must be different from default transcoding template IDs. The default transcoding template IDs include lld, lsd, lhd, lud, ld, sd, hd, and ud.
      Template Type Transcoding type:Narrowband HD™ templates and audio-only templates are supported.

      Audio-only transcoding templates are used to remove the video of the input stream and generate an audio-only stream in the Opus format.

      Resolution The resolution of the output stream. Unit: pixels. Different types of resolutions correspond to different prices. The following types of resolutions are supported:
      • Low definition (LD): 640 × 480 and lower
      • Standard definition (SD): 1280 × 720 and lower
      • High definition (HD): 1920 × 1080 and lower
      • 2K: 2560 × 1440 and lower
      • 4K: 3840 × 2160 and lower
      Note When you use multi-bitrate transcoding, you are charged based on the resolution types specified in the multi-bitrate transcoding template,but not based on the resolution types specified in the Narrowband HD™ template for common transcoding. The Narrowband HD™ template supports the following resolutions: LD, SD, HD, and ultra high definition.

      The resolution of an output stream is determined based on the range where the long side and short side of the video image fall.

      In the following example, the resolution of 1280 × 720 is used to demonstrate how the resolution of an output stream is determined.
      • If the long side of the video image contains no more than 1,280 pixels and the short side of the video image contains no more than 720 pixels, the resolution of the output stream is SD.
      • If the long side of the video image contains more than 1,280 pixels, or the short side of the video image contains more than 720 pixels, the resolution of the output stream is higher than SD.
      Video Bitrate The bitrate that corresponds to the resolution. Unit: Kbit/s. The following list describes the bitrate ranges for different resolutions:
      • LD: 100–800 Kbit/s
      • SD: 200–1,500 Kbit/s
      • HD: 500–4,000 Kbit/s
      • 2K: 2,000–8,000 Kbit/s
      • 4K: 4,000–30,000 Kbit/s
      Video Frame Rate The frame rate of the output stream. Unit: frames per second. The frame rate of the output stream must be smaller than or equal to the frame rate of the input stream.
      Video GOP The group of pictures (GOP) indicates the interval between two I-frames. The GOP of the output stream must be smaller than or equal to the GOP of the input stream. The GOP of the output stream cannot exceed 3 seconds. This ensures low latency.
      Encoding Standard (applicable only to Audio Only) Only Advanced Audio Coding (AAC) is supported.
      Codec (applicable only to Audio Only)
      • LC-AAC: advanced audio coding with low complexity. The transcoding efficiency is high.
      • HE-AAC: advanced audio coding with high efficiency. The sound effect for HE-AAC is better than that for LC-AAC when the audio bitrate is lower than 128 Kbit/s.
      Bitrate (applicable only to Audio Only) The audio bitrate. Valid values: 8 to 1000.
      Channels (applicable only to Audio Only) The number of sound tracks. Valid values: 1 and 2.
      Maximum Bandwidth We recommend that you set this parameter to a value that is higher than the video bitrate.
  7. Click OK.

Generate a multi-bitrate streaming URL

Sample URL:

http://test****.aliyun.com/appnanme/steamname_groupid.m3u8?aliyunols=on&auth_key=123456789
  • The aliyunols field is required and has a fixed value of on.
  • Specify the appname, streamname, and groupid fields based on your stream information.
  • For more information about authentication, see Ingest and streaming URLs.

You can also use the URL generator to generate a multi-bitrate streaming URL based on the configurations of your multi-bitrate transcoding template group. For more information, see Live URL generator.