ApsaraVideo VOD provides video packaging templates that you can use to generate adaptive bitrate files. Adaptive bitrate files contain information such as the bitrates and resolutions of audio and video streams. The player automatically selects the most suitable stream to play based on your network conditions.

Usage notes

  • Video packaging templates do not support HLS encryption. If you require HLS encryption, use a regular transcoding template.
  • You are charged for transcoding operations. For more information, visit the ApsaraVideo VOD pricing page.

Procedure

  1. Create a transcoding template group for adaptive bitrate streaming.
    Note If you require only packaging templates for adaptive bitrate streaming, you do not need to create general transcoding templates. You must delete all existing general transcoding templates. Otherwise, you may be charged for these general transcoding templates.
    1. Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose Configuration Management > Media Processing > Transcoding Template Groups.
    2. On the Transcoding Template Groups page, click Create Transcoding Template Group.
    3. On the page that appears, specify a name for the template group.
    4. In the Video Packaging Template section, click Add Template, and set the parameters of the video packaging template that you want to create.
      • In the Basic Parameters section, Encapsulation Format is fixed to hls. The Video Packaging section contains the following parameters:
        • Packaging Type: The value is fixed to HLS packaging.
        • Bandwidth Threshold: the network bandwidth based on which media players select video streams of specific bitrates. Unit: bit/s. We recommend that you retain the default value.
      • You can configure Basic Parameters, Video Parameters, Audio Parameters, Advanced Parameters, and Conditional Transcoding Parameters in the same way as you create general transcoding templates. For more information about how to configure these parameters, see Configure transcoding template groups.
      • You can use Add Template to create multiple video packaging templates with different bitrates, resolutions, and video qualities based on your business requirements. Video qualities include high definition, standard definition, and low definition.
    5. After the parameters are configured, click Save.
  2. Transcode a video into streams of different bitrates.
    1. In the ApsaraVideo VOD console, choose Media Files > Audio/Video.
    2. On the Video and Audio page, find the video that you want to transcode, and click Media Processing in the Actions column.
    3. On the Media Processing dialog box, set Processing Type to Use Transcoding Template Group, select the transcoding template group that you created in Step 1, and click OK to start media processing.
    Start media processing in the console
  3. View video streams.
    • The following figure shows the video streams that are generated after adaptive bitrate streaming is implemented. In this example, two streams use fixed bitrates while one stream adapts its bitrate based on network bandwidths.

      In the ApsaraVideo VOD console, choose Media Files > Audio/Video, find the video that you processed in the previous step, and click Manage in the Actions column. On the page that appears, click the Video URL tab.

      Results_1
    • In the following figure, the adaptive bitrate stream is used for playing the video file.

      On the Basic tab of the Online Settings page in ApsaraVideo Player, enter a URL for video playback, and then view the video playback effect on the Preview tab. In this example, the URL of the adaptive bitrate stream is used for video playback.