Using the Incremental Adaptive Bitrate Playlists
Introduction
Incremental Adaptive Bitrate Streaming (ABR) is a feature in our transcoding API that allows you to add and remove resolutions, to and from existing HLS and DASH playlists, without re-encoding all of the existing resolutions. This tutorial will explain how to use the incremental_tag parameter to manage resolutions incrementally, based on your specific needs.
How it works
The Incremental ABR feature can be applied in various scenarios to encode playlist renditions more efficiently and better aligned with the viewer experience you want to create. Let's start by considering some common use-cases to better understand the wide range of applications for expanding your HLS and DASH playlists incrementally.
Common Use-Cases for Incremental ABR
- Encoding videos into multiple resolutions and bitrates can consume significant resources. Encoding only the key resolutions initially can reduce operational costs for videos that have not yet become popular.
- Storing multiple high-resolution renditions exclusively for videos with substantial viewership can significantly optimize storage costs.
- Lower resolutions can be made available to viewers very quickly due to the increased processing speed, allowing viewers to watch them shortly after being uploaded.
1Using the incremental_tag Parameter for Encoding
The incremental_tag is a unique identifier used to manage a sequence of transcoding jobs, allowing the addition of new resolutions to an existing HLS or DASH output. It helps the system understand what has already been encoded and what needs to be added.
Option 1: Specifying the incremental_tag Manually
You can provide a custom incremental_tag with a maximum of 64 characters to use the Incremental ABR feature. Here's how to set it up for your first job:
{
"output": "advanced_hls",
"incremental_tag": "my_incremental_tag_value_123",
"stream": [
{
"video_codec": "libx264",
"height": 360,
"bitrate": 950
}
]
}
This configuration starts a new job chain with a 360p resolution.
Option 2: Using auto
to set the incremental_tag
Using a simpler approach, you can set the incremental_tag to "auto"
, which allows the system to generate a unique tag automatically. The initial setup would look like this:
{
"output": "advanced_hls",
"incremental_tag": "auto",
"stream": [
{
"video_codec": "libx264",
"height": 360,
"bitrate": 950
}
]
}
In this case, the system generates an incremental_tag, which will be returned in the job status response as a part of the meta object in the response JSON:
"videos": [
{
"tag": "video-0-0-0",
...
"meta": {
"resolution_width": 1280,
"resolution_height": 720,
...
"incremental_tag": "9513cab812f0d4003c3ddd2c97bd073a-0",
},
...
}
]
2Adding or Removing Resolutions
Once your initial job is complete, you can add more resolutions using the same incremental_tag you specified in the initial job. If the tag was automatically generated using "auto"
, use the tag that was generated automatically.
Adding resolutions using the incremental tag
To add a 480p resolution to your initial 360p stream:
{
"output": "advanced_hls",
"incremental_tag": "my_incremental_tag_value_123",
"stream": [
{
"video_codec": "libx264",
"height": 480
},
{
"video_codec": "libx264",
"height": 360
}
]
}
Here, only the 480p stream is encoded incrementally; the 360p stream in the playlist is reused from the previous job. That means the system adds a link to the 360p stream to the newly created master playlist along with the link to the 480p stream.
Removing resolutions using the incremental tag
If in the future, you decide you want to remove a resolution, you can do so by specifying the same tag in a job with the resolution you want to remove missing from the stream object. For example, if you want to add a 720p resolution, while removing the 360p resolution, you can use the following request:
{
"output": "advanced_hls",
"incremental_tag": "my_incremental_tag_value_123",
"stream": [
{
"video_codec": "libx264",
"height": 720
},
{
"video_codec": "libx264",
"height": 480
}
]
}
In this case, the 720p resolution is added, while the 360p resolution is removed from the playlist.
Need More Help?
For additional information, tutorials, or support, visit the Qencode Documentation home page or contact Qencode Support at support@qencode.com.