youtube.lua: open video format selection to "adaptive" streams
This:
- adds support for YouTube Shorts URLs
- disables throttling parameter descrambling for now, since it's broken
- cleans up some stuff
- introduces
&fmt={audio,video,hd}
URL parameters
For long now, YouTube has had two lists of stream formats in its configuration JSON, respectively labeled "formats" and "adaptiveFormats". The former is what we've traditionally been using, but has been on the decline (and maybe on the way out), in particular since it stopped offering 1080p or higher. The latter offers all formats and resolutions, but as audio-only or video-only elementary streams. The new URL parameters allow selecting those streams, either individually or combined using an input slave.
Note that this URL parameter isn't coming out of nowhere; so far you could always pass something such as &fmt=18
in the YouTube URL to force 360p resolution. There is no proper configuration mechanism for individual lua scripts, so overloading this parameter seems like a good solution.
Input-slave-based playback is experimental and not enabled by default. I believe that this offers a worse user experience at equal resolution than classic multiplexed streams, for example the end of videos doesn't play smoothly. Is it better to use video as main stream and audio as input slave, or the contrary? Is there an open ticket for input slave playback performance? This would be a good test case.
This also provides more ways to manually mitigate the data throttling issue.
Merge request reports
Activity
added Component::LUA scripts label
added MRStatus::Reviewable label
- Resolved by Pierre Ynard
This looks very cool. I just wish it was LGPL...
/cc @fkuehne
changed milestone to %4.0
added MRStatus::InReview label and removed MRStatus::Reviewable label
- Resolved by Pierre Ynard
I like your continued work on this. Thanks a lot!
Regarding the tickets you are asking for, I'm not aware of any so it would be nice if you could create them.
For using the audio vs. the video track as main vs secondary input, it should be equal. @tguillem's opinion on this especially regarding the new clock in VLC 4 would be valuable.
added MRStatus::Acceptable label and removed MRStatus::InReview label
added MRStatus::Accepted label and removed MRStatus::Acceptable label
MR Acceptance result
This MergeRequest has been Accepted! Congratulations.MR acceptance checks details:
-
MR should be considered mergeable by Gitlab -
Last pipeline should be successful -
MergeRequest should have at least one external review and/or vote -
All threads should be resolved, and score >= 0 -
MergeRequest should have no activity (threads/votes) for (24h/24h)
-
added 167 commits
-
bfbc00ba...61c9cbe2 - 156 commits from branch
videolan:master
- 5bab6131 - youtube.lua: support YouTube Shorts URLs
- 9bbdd152 - youtube.lua: disable broken "n" descrambling for now
- 91aac3a2 - youtube.lua: disable broken call in dead code
- 12b739ef - youtube.lua: declare proper local scope for working variables
- b5c12e5e - youtube.lua: update comments about fmt URL parameter
- 7d9722f2 - youtube.lua: lazy initialization for fetching descrambling javascript
- b9163199 - youtube.lua: split stream format selection into separate function
- aa2032bb - youtube.lua: generic support for YouTube "adaptive" formats
- 94d5e1aa - youtube.lua: &fmt={audio,video} URL parameters for "adaptive" formats
- b88da371 - youtube.lua: split stream URL parsing into separate function
- e9705c55 - youtube.lua: &fmt=hd URL parameter to leverage "adaptive" formats
Toggle commit list-
bfbc00ba...61c9cbe2 - 156 commits from branch
- Resolved by Jean-Baptiste Kempf
Backport ?
mentioned in issue #27227
mentioned in issue #10237