Support storyboards on very short shorts #3128
Merged
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.
Support storyboards on very short shorts
Pull Request Type
Related issue
Issue noticed in #3093
Description
For long videos, YouTube returns storyboards with an image for every 10 seconds, as you are unlikely to notice it as the progress bar can only be so wide, so making them more granular would be pointless. However for very short videos like the one in the test case below, which is only 13 seconds long, it's definitely worth having more granular thumbnails, so YouTube returns them in a sub one seconds intervals (for that video 0.14s), so that means that the interval value in the storyboards, which is an integer is 0. The current code relies on that interval always being larger than 0.
This pull request adds support for those 0 interval storyboards by dividing the length of the video by the number of thumbnails on the storyboards. Unfortunately YouTube also only returns very low quality thumbnails for those videos, so we can either leave them being tiny like they are now, or stretch them to be larger like YouTube does, which looks bad too.
Testing
https://www.youtube.com/shorts/Jj9PmISOzCQ
Desktop