Overview
High-Efficiency Video Coding (HEVC), also known as H.265, is a video compression standard that reduces video file sizes allowing for higher quality playback.
The Brightcove Native SDK for Android uses the following HEVC selection process:
HEVC source selection
The HEVC source selection process starts after you make a request for a video using the Brightcove Catalog
.
Depending on your account configuration, the Catalog
response may contain several sources, with or without HEVC renditions. Here is an example:
"sources": [
{
"type": "application/dash+xml",
"src": "http://manifest.prod.boltdns.net/manifest/v1/dash/live-baseurl/clear/4800266849001/11023209-08e4-40d4-9a8b-25aa659421e2/2s/manifest.mpd?fastly_token=ZYZ",
"profiles": "urn:mpeg:dash:profile:isoff-live:2011"
},
{
"type": "application/dash+xml",
"src": "https://manifest.prod.boltdns.net/manifest/v1/dash/live-baseurl/clear/4800266849001/11023209-08e4-40d4-9a8b-25aa659421e2/2s/manifest.mpd?fastly_token=XYZ",
"profiles": "urn:mpeg:dash:profile:isoff-live:2011"
},
{
"type": "application/dash+xml",
"src": "http://manifest.prod.boltdns.net/manifest/v2/dash/live-baseurl/clear/avc1_hvc1_mp4a/4800266849001/11023209-08e4-40d4-9a8b-25aa659421e2/2s/manifest.mpd?fastly_token=XYZ",
"profiles": "urn:mpeg:dash:profile:isoff-live:2011"
},
{
"type": "application/dash+xml",
"src": "https://manifest.prod.boltdns.net/manifest/v2/dash/live-baseurl/clear/avc1_hvc1_mp4a/4800266849001/11023209-08e4-40d4-9a8b-25aa659421e2/2s/manifest.mpd?fastly_token=XYZ",
"profiles": "urn:mpeg:dash:profile:isoff-live:2011"
}
]
In this example, there are four DASH sources:
- One non-HEVC HTTP source
- One non-HEVC HTTPS source
- One HEVC HTTP source
- One HEVC HTTPS source
Notice that HEVC sources contain the string hvc
in the URL.
The Native SDK for Android source selector prefers HEVC sources. In the example above, it will select the HEVC HTTPS source.
The Native SDK continues with the default selection process as defined in the Android: Source Selection document:
- Prefer HTTPS over HTTP
- Prefer DASH over HLS
- If selecting HLS for playback, prefer the highest version of HLS available
HEVC rendition selection
Depending on your ingestion configurations, the HEVC source might be contained in different renditions. You may have the following:
Only HEVC renditions
When the video source’s renditions have only HEVC codecs, there is no rendition selection involved. The ExoPlayer selects the appropriate rendition given the device capabilities and the available bandwidth.
A mix of HEVC and other codecs
If the video source has renditions with a mix of HEVC and other codecs (like AVC), then a rendition selection process is invoked. When the Native SDK loads the source into the ExoPlayer, it performs a SelectionOverride for the video rendition to prefer HEVC over other codecs.
Given a video whose rendition formats are supported by the device, here is the rendition process:
- The Native SDK selects all HEVC renditions.
- It ignores non-HEVC renditions that duplicate an existing HEVC with the same resolution.
This forces ExoPlayer to prefer HEVC in most cases. Here are two possible scenarios:
Codec mix duplication
In this scenario, most of the HEVC and AVC codec’s resolutions are duplicated. For example:
AVC <Representation bandwidth="453000" height="270" width="480">
AVC <Representation bandwidth="704000" height="360" width="640">
AVC <Representation bandwidth="903000" height="360" width="640">
AVC <Representation bandwidth="1202000" height="540" width="960">
AVC <Representation bandwidth="1989000" height="720" width="1280">
AVC <Representation bandwidth="2478000" height="720" width="1280">
AVC <Representation bandwidth="3458000" height="720" width="1280">
AVC <Representation bandwidth="3761000" height="720" width="1280">
HVC <Representation bandwidth="304000" height="270" width="480">
HVC <Representation bandwidth="548000" height="360" width="640">
HVC <Representation bandwidth="993000" height="432" width="768">
HVC <Representation bandwidth="1301000" height="576" width="1024">
HVC <Representation bandwidth="1605000" height="720" width="1280">
HVC <Representation bandwidth="2809000" height="720" width="1280">
Given the above video renditions, the Brightcove Natvie SDK will select the following renditions:
AVC <Representation bandwidth="1202000" height="540" width="960">
HVC <Representation bandwidth="304000" height="270" width="480">
HVC <Representation bandwidth="548000" height="360" width="640">
HVC <Representation bandwidth="993000" height="432" width="768">
HVC <Representation bandwidth="1301000" height="576" width="1024">
HVC <Representation bandwidth="1605000" height="720" width="1280">
HVC <Representation bandwidth="2809000" height="720" width="1280">
Note that only one AVC rendition was selected, because its resolution does not duplicate an existing HEVC rendition.
Half and half
In this scenario, there are lower-resolution renditions with the AVC codec, and higher-resolution renditions with the HVC codec. For example:
AVC <Representation bandwidth="453000" height="270" width="480">
AVC <Representation bandwidth="704000" height="360" width="640">
AVC <Representation bandwidth="903000" height="360" width="640">
AVC <Representation bandwidth="1202000" height="540" width="960">
AVC <Representation bandwidth="3761000" height="720" width="1280">
HVC <Representation bandwidth="1301000" height="576" width="1024">
HVC <Representation bandwidth="1605000" height="720" width="1280">
HVC <Representation bandwidth="2809000" height="720" width="1280">
In this case, because there are no AVC codecs with resolutions duplicating HEVC renditions, the Native SDK selects all of the renditions, allowing ExoPlayer to select the renditions based on available bandwidth.
The Native SDK does not force HEVC selection in all cases in this scenario, to avoid capping the lowest rendition to a high-bitrate HEVC rendition. This would potentially cause a bad user experience with a poor network connection.