shaka-player
shaka-player copied to clipboard
How can I query for the active codec and bandwidth being played in a mixed-codec, multi-period manifest?
Have you read the Tutorials? Yes
Have you read the FAQ and checked for duplicate open issues? Yes
If the question is related to FairPlay, have you read the tutorial?
N/A
What version of Shaka Player are you using? 4.9.0 and main
What browser and OS are you using? Chrome Version 125.0.6422.113 (Official Build) (arm64) macOS Ventura 13.6
Please ask your question
My question is related to Shaka's period flattening and representation matching. During playback, when a variant has multiple codecs that it could change between, is there a way to query for the true codec and bandwidth being played?
- I have a DAI manifest (DASH, static, multi-period) with representations of different video codecs per period.
- When Shaka flattens the periods, it matches representations from each period and creates a single outputStream.
- The single outputStream could include multiple different codecs and bandwidths that could be played.
- That outputStream eventually becomes a variant track with a single video codec and bandwidth value.
- The alternate, matched representations that the variant could be playing are obfuscated.
During playback, is there a way to access the obfuscated representations during the periods in which they are being played?
Example
- My manifest has 3 periods:
pre-roll-1-ad-1
,pre-roll-1-ad-2
,0
. - Periods
pre-roll-1-ad-1
andpre-roll-1-ad-2
only havehev
andavc
representations, they do not havedvhe
representations. - Period
0
hasdvhe
representations. - I want to play the Dolby Vision version of the content, so I configure the player with
preferredVideoCodes = ['dvhe']
. - Since the pre-roll periods do not contain
dvhe
representations, I seehev
representations from the pre-roll periods have been matched to thedvhe
outputStreams as the alternate representations. - During playback of the pre-rolls, if I query for the active variant track
player.getVariantTracks().find((track) => track.active)
, I will see that advhe
codec variant is playing. I know that is not accurate because the manifest does not havedvhe
representations in the pre-roll periods. If I inspect the network for the segments being download and buffered, I can confirm that it's thehev
segments being played.
In the case of the above screenshot, depending on the presentation time, this variant labeled with a dvhe
codec could be playing an hev
codec with a bandwidth of 4.2mb
or it could be playing the actual dvhe
codec with a bandwidth of 5.8mb
. Is there a way to access the true codec and bandwidths being played?