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:
Without variantQualifiers, does AVAssetDownloadConfiguration always download a single video variant, and if so, how is it chosen?
Does the behavior differ if variants have different resolutions vs only different bitrates?
When a predicate matches multiple variants, can multiple video variants actually be downloaded in a single .movpkg?
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!
Video
RSS for tagDive into the world of video on Apple platforms, exploring ways to integrate video functionalities within your iOS,iPadOS, macOS, tvOS, visionOS or watchOS app.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Created
Hello,
I've been very familiar with the UVC Support in iPadOS ever since it launched in iOS 17. There are a number of people that use the software I've developed built around UVC and there are often queries about 8-Bit vs. 10-Bit.
My understanding is that the newest UVC Spec is 1.5 which was standardised in 2012 and almost every UVC Capture Card runs at 8-Bit.
The only 10-Bit Capture Card that is on my radar is the AJA U-Tap SDI, however it looks like this is 10-Bit up until the UVC Part where the 10-Bit Input is downsampled to 8-Bit. Though I have read in certain places that it works as a 10-Bit Capture Card on macOS but not on iPadOS.
I was just wondering if 10-Bit via UVC is even possible on iPadOS? If there was indeed a true 10-Bit Source being passed into an iPad, would iPadOS allow it or would it be downsampled by AVFoundation so it can show up as a valid external video input?
All USB Capture Cards that I have encountered use one of the following formats:
kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange
kCVPixelFormatType_420YpCbCr8BiPlanarFullRange
kCVPixelFormatType_32BGRA
So if a UVC Device delivered a 10-Bit Format, would that be accessible by iPadOS or would it fallback to these 8-Bit Formats by default?
Thanks!