Skip to content
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

fix: don't save bandwidth and throughput for really small segments #1024

Merged

Conversation

gesinger
Copy link
Contributor

@gesinger gesinger commented Dec 4, 2020

Description

Really small segments can mess with our ABR algorithm by not reflecting our bandwidth and throughput accurately for the majority of segments.

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
  • Reviewed by Two Core Contributors

@gkatsev gkatsev added this to the 2.4 milestone Dec 4, 2020
Copy link
Contributor

@brandonocasey brandonocasey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also wondering about partial segment durations or ll-hls which can have really tiny segment durations.

// With most content hovering around 30fps, if a segment has a duration less than
// one frame, the bandwidth and throughput calculations will not accurately reflect
// the rest of the content.
const MIN_SEGMENT_DURATION_TO_SAVE_STATS = 1 / 30;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it make sense to use FRAME-RATE from the playlist if it exists here so that this doesn't mess with calculations for 60fps content? Could be a future optimization too I guess.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should just be 1 / 60 instead? Not sure if that would be too low though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured even for 60 fps content we'd probably be safe (it's possible, though I'd imagine unlikely, for someone to send less than 2 frames of content, even at 60fps), but it could be worth noting here. 1 / 60 may be cutting it close, as it should work when rounded, but might be problematic if truncated or floored.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about it again though, maybe it is worth it to just use 1/60. Will give it some testing.

@gkatsev
Copy link
Member

gkatsev commented Dec 4, 2020

I'm not sure we need to care about LL-HLS for this, but we'll want to note it for when we do work on LLHLS.

@gesinger
Copy link
Contributor Author

gesinger commented Dec 7, 2020

@gkatsev , I think we should be OK for LL-HLS as we'll have to parse EXT-X-PART differently to note the duration. Though if we try to reuse the normal segment parsing and properties names then we may have to consider it. Though even then I think we'll be alright with 1 frame at 30fps or 2 frames at 60fps (I guess people can send just 1 or 2 frames at a time for LL-HLS, but I imagine it as unlikely).

Also fix VTT loader bandwidth save call
@gkatsev gkatsev merged commit a29e241 into videojs:main Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants