-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose peak bitrate in Format when available (as well as average bitrate) #2863
Comments
Also prevent BANDWIDTH's regex from matching the AVERAGE-BANDWIDTH attribute. Issue:#2863 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=157219453
The change above updates ExoPlayer to use It's somewhat unclear to me that there's a need to also include the peak bitrate in the |
@ojw28 - Yes, we intend to use it in our custom ABR algorithm(esp with fmp4) and is also considered as a useful input in our VBR instrumentation data. Thanks. |
Also prevent BANDWIDTH's regex from matching the AVERAGE-BANDWIDTH attribute. Issue:#2863 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=157219453
@ojw28 any idea when is this planned tentatively ? |
Fixes google#2863 Exposes `peakBitrate` value when both `BANDWIDTH` and `AVERAGE-BANDWIDTH` attributes are available. The `bitrate` property will always carry the average bandwidth of the `Format` instance, while `peakBitrate` will carry the value for the respective attribute, when present; according to tools.ietf.org/html/draft-pantos-http-live-streaming-23#page-28
@julioz (and anyone else who's interested) - I've been looking at how to best merge some version of #6706. It's clear we need two (possibly three to avoid changing behavior in a subtle way) fields in HLS
DASH
SmoothStreaming
Other containers
Some thoughts:
Proposal:
One caveat here is that code implementing adaptive algorithms will need to be careful to fallback to using the other field in the case that the one it would use ideally is set to @julioz - Any thoughts on this proposal? |
@ojw28 The proposal sounds very reasonable to me. It does introduce a small extra bit through the learning curve of the API: I assume most consumers read (I did spend a few moments pondering whether we should instead keep |
The functional change is to set the bitrate fields to Format.NO_VALUE in the case that they're non-positive in the header data. Else it's very easy to to take the fields and copy them directly into Format as incorrect values. Issue #2863 PiperOrigin-RevId: 292920141
Issue: #2863 PiperOrigin-RevId: 294531127
Issue: #2863 PiperOrigin-RevId: 294661214
Package private for now. It will be made visible in a child CL. Issue: #2863 PiperOrigin-RevId: 296255558
- Deprecate old Format.createXXX methods - Deprecate most Format.copyXXX methods - Stop using deprecated Format.copyXXX methods in the library Note: Replacing library usages of Format.createXXX method will be done in follow up CLs. These changes aren't purely mechanical because we need to decide which out of peakBitrate and averageBitrate to set in each case where currently a single bitrate is provided. Issue: #2863 PiperOrigin-RevId: 296450935
Issue: #2863 PiperOrigin-RevId: 296482726
This is done in |
Apple spec talks about having average bandwidth and peak bandwidth in master playlist as below -
'You should include the average bit rate as well as the peak bit rate. This is especially important if your peak is more than 20% different from your average. Specifying the average allows the client to make more intelligent decisions about which variant to play.'
Ref -
https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#page-28
https://developer.apple.com/library/content/technotes/tn2224/_index.html#//apple_ref/doc/uid/DTS40009745-CH1-BITRATERECOMMENDATIONS
Exoplayer seems to be expecting only average Bandwidth in the master playlist as the regex in HLSplaylistParser is "BANDWIDTH=(\d+)\b".
For supporting VBR we need a) regex fix to extract average bitrate and peak bitrate, b) data holder in Format object for peak bitrate
Sample snippet from a master .m3u8 file -
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2095000,SUBTITLES="subs",AVERAGE-BANDWIDTH=1945000,RESOLUTION=1280x720
I am looking at Exo v2.3.1.
Thanks, _jue
The text was updated successfully, but these errors were encountered: