AVAssetDownloadConfiguration: How many video variants are actually downloaded when multiple variants exist in the HLS master playlist?

Hi,

I’m trying to better understand how AVAssetDownloadConfiguration selects video variants when downloading HLS content for offline playback.

Suppose I have an HLS master playlist (.m3u8) that contains several video variants defined with #EXT-X-STREAM-INF.

For example, the master playlist may contain multiple video streams like this:

  • Same resolution, different BANDWIDTH
  • Or different resolutions (for example 720p, 1080p, etc.)

My question is:

How many video variants are actually downloaded when using AVAssetDownloadConfiguration without specifying any variantQualifiers?

In other words:

  • If the master playlist contains multiple video variants, will the download task fetch only one variant, or multiple variants?
  • Does the behavior differ depending on whether the variants differ only by BANDWIDTH or also by RESOLUTION?

What I observed in testing

In my tests, I always end up with only one video variant downloaded, specifically the one with the highest BANDWIDTH parameter. In the m3u8 files I tested, all video variants had identical parameters (resolution, codec, frame rate, etc.) and differed only by the BANDWIDTH attribute in the master playlist.

However, when inspecting the downloaded .movpkg, I noticed something interesting in boot.xml.

It lists two video streams:

  • one with complete="true" (the one with highest bandwidth)
  • another with complete="no" (the one with lowest bandwidth)

I actually had 3 video streams listed in m3u8, but the one with middle bandwidth wasn't listed in boot.xml file at all.

There are also additional streams for audio and subtitles in boot.xml file.

This made me wonder whether the system initially attempts to download another video variant (possibly a lower bitrate one), but then switches to the highest-quality variant and only completes that one.

Additional question about variantQualifiers

If I provide a predicate such as:

NSPredicate(format: "peakBitRate > 0")

which should theoretically match all variants, will the download task attempt to download all matching video variants, or will it still select only one?

Summary

So the main questions are:

  1. Without variantQualifiers, does AVAssetDownloadConfiguration always download a single video variant, and if so, how is it chosen?
  2. Does the behavior differ if variants have different resolutions vs only different bitrates?
  3. When a predicate matches multiple variants, can multiple video variants actually be downloaded in a single .movpkg?
  4. Why might boot.xml list multiple video streams when only one appears to be fully downloaded?

Any clarification on the intended behavior would be greatly appreciated.

Thanks!

AVAssetDownloadConfiguration: How many video variants are actually downloaded when multiple variants exist in the HLS master playlist?
 
 
Q