-
Notifications
You must be signed in to change notification settings - Fork 2.7k
make frameRate check configurable on level up/down transitions #7585
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
Closed
sojeong-hwang
wants to merge
2
commits into
video-dev:master
from
sojeong-hwang:feature/abr-frameRate
+17
−2
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -813,6 +813,12 @@ class AbrController extends Logger implements AbrComponentAPI { | |||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| const ttfbEstimateSec = this.bwEstimator.getEstimateTTFB() / 1000; | ||||||||||||||||||||||||||
| const levelsSkipped: number[] = []; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| const isUpSwitchToLowerFrameRate = | ||||||||||||||||||||||||||
| this.hls.config.abrUpSwitchToLowerFrameRateMode === 'allow'; | ||||||||||||||||||||||||||
| const isDownSwitchToHigherFrameRate = | ||||||||||||||||||||||||||
| this.hls.config.abrDownSwitchToHigherFrameRateMode === 'allow'; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| for (let i = maxAutoLevel; i >= minAutoLevel; i--) { | ||||||||||||||||||||||||||
| const levelInfo = levels[i]; | ||||||||||||||||||||||||||
| const upSwitch = i > selectionBaseLevel; | ||||||||||||||||||||||||||
|
|
@@ -898,10 +904,13 @@ class AbrController extends Logger implements AbrComponentAPI { | |||||||||||||||||||||||||
| if ( | ||||||||||||||||||||||||||
| (currentCodecSet && levelInfo.codecSet !== currentCodecSet) || | ||||||||||||||||||||||||||
| (currentVideoRange && levelInfo.videoRange !== currentVideoRange) || | ||||||||||||||||||||||||||
| (upSwitch && currentFrameRate > levelInfo.frameRate) || | ||||||||||||||||||||||||||
| (upSwitch && | ||||||||||||||||||||||||||
| currentFrameRate > levelInfo.frameRate && | ||||||||||||||||||||||||||
| !isUpSwitchToLowerFrameRate) || | ||||||||||||||||||||||||||
| (!upSwitch && | ||||||||||||||||||||||||||
| currentFrameRate > 0 && | ||||||||||||||||||||||||||
| currentFrameRate < levelInfo.frameRate) || | ||||||||||||||||||||||||||
| currentFrameRate < levelInfo.frameRate && | ||||||||||||||||||||||||||
| !isDownSwitchToHigherFrameRate) || | ||||||||||||||||||||||||||
|
Comment on lines
+907
to
+913
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||
| levelInfo.supportedResult?.decodingInfoResults?.some( | ||||||||||||||||||||||||||
| (info) => info.smooth === false, | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think unblocking selection behavior via config is a good solution to working around content that does not follow best practices when providing frame rates at various bitrates (an example with 360-720p@30, 1080p@60, and [email protected] was given offline).
First, we could loosen the checks to allow switching between almost identical frame rates. That could allow switching straight to a higher bitrate at 29.997 from 30 fps. There would still be a chance to switch up to 60fps and then not switch up any higher. The user should be presented with the resolution and frame-rates to allow manual override in these cases. Allowing the client to automatically bounce back and forth between rates should be avoided.
Adding a
frameRate(preferred) andmaxFrameRateoptions to thevideoPreference: VideoSelectionOptionconfig options interface for initial selection and capping would be preferred. You might also consider making capping part of the fps-controller, (seecapLevelOnFPSDrop) but that would entail more of a refactor as that controller is meant to limit selection based on performance, not the variant frame-rate. It could do both, or either, if a simple flatcapLevelByFrameRateoption is preferred.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested-Workaround: If you really want to force hls.js to ignore levelframeRatethan change the parsed values after playback has started onhls.levelsto all be the same. It may seem like a hack, but it's a valid workaround afterlevel.supportedPromiseis resolved.