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 normal transcoding template. For more information about the differences between an adaptive bitrate streaming template and a normal transcoding template, see Implement adaptive bitrate streaming with ApsaraVideo VOD.
You can create up to 20 transcoding template groups within an Alibaba Cloud account by using the ApsaraVideo VOD console. You can add up to 10 video packaging templates in each transcoding template group.
You are charged for transcoding operations. For more information, visit the ApsaraVideo VOD pricing page.
Procedure
Create a transcoding template group for adaptive bitrate streaming.
NoteIf you require only packaging templates for adaptive bitrate streaming, you do not need to create regular transcoding templates. You need to delete all existing regular transcoding templates to avoid unnecessary transcoding fees.
Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose .
On the Transcoding Template Groups page, click Create Transcoding Template Group.
On the page that appears, specify a name for the template group.
In the Video Packaging Template section, click Add Template, and set the parameters.
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 use the recommended value.
You can configure Basic Parameters, Video Parameters, Audio Parameters, Advanced Parameters, and Conditional Transcoding Parameters in the same way as you create regular transcoding templates. For more information about how to configure these parameters, see Configure regular transcoding templates.
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.
After the parameters are configured, click Save.
Transcode a video into streams of different bitrates.
In the ApsaraVideo VOD console, choose
.On the Audio/Video page, find the video that you want to transcode, and click Media Processing in the Actions column.
In 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 then click OK to start media processing.
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
, 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.The URL of the adaptive bitrate stream in the preceding figure is used for playback.
On the Basic tab of the Online Settings page in ApsaraVideo Player, enter the URL of the adaptive bitrate stream and view the video playback effect on the Preview tab.