Seal icon indicating copy to clipboard operation
Seal copied to clipboard

Qualities in the “Format selection” window needs to be arranged well, each one under its own quality

Open Playerend opened this issue 1 year ago • 1 comments

Checklist

  • [ ] This feature I'm requesting is already implemented in yt-dlp.
  • [X] This feature is merely a UI/UX update.
  • [X] This feature is suitable for primary users with little knowledge about yt-dlp.
  • [ ] This feature is available for most websites, not only the video platform I use.
  • [ ] This feature is suitable for a large variety of videos.
  • [X] This feature is not going to conflict with many of the existing options.

Is your feature request related to a problem? Please describe.

No response

Describe the solution you'd like

Qualities in the “Format selection” window are randomly arranged and needs to be arranged well, each one under its own quality

Video link

No response

Additional context

No response

Playerend avatar Feb 01 '24 09:02 Playerend

I've also found the "messed-up" order of formats in the "format selection" window confusing for a long time, and wished it was more intuitive.

However today, by investing a lengthy afternoon studying https://github.com/yt-dlp/yt-dlp for the Xth time, I've gained a little deeper understanding of the intricacies of yt-dlp's format sorting, and what Seal's mysterious "Legacy" or "Quality" presets might imply.

The most crucial insight for me was the semantics of default values. For a simple example, consider e. g. the res key (meaning "video resolution, smaller side") and a video link with five available resolutions: 1080, 720, 480, 360, 240. If the sort key is just res, then resolutions are ordered from highest to lowest, i. e. 1080, 720, 480, 360, 240. If the sort key is res:640 instead, then resolutions are ordered as follows: 480, 360, 240, 720, 1080. IOW, those resolutions (1080, 720) that exceed the default value (640) are dropped and then appended to the remainder (480, 360, 240) in reverse order (720, 1080).

This seems complicated and counterintuitive for visual presentation and manual selection, but makes sense with auto selection or auto suggestion. It makes sure that "the highest resolution, but no greater than 640", is chosen, unless there is no such resolution, in which case "the smallest available resolution greater than 640" is chosen.

If you don't rely on auto selection or auto suggestion anyway but want to choose your preferred format from all available formats manually, you can get a plain, monotonously ordered formats listing by these steps:

  1. in the preconfigure popup, tap "Format sorting"
  2. in the little popup, press "Import"
  3. in the text line, delete all default values (i. e. values behind any colon or tilde) up to just before the following comma
  4. make sure the "Use format sorting" slider is enabled, then press "Save".

Step 3. example:

  • original line: vcodec:vp9.2,res:360,acodec:opus,abr~64
  • tweaked line, for monotonous sorting: vcodec,res,acodec,abr

Of course, you can also rearrange sort keys, delete some or add more, to your likings. The first key (e. g. vcodec) dominates the order, and the following keys (e. g. res,acodec,...) are subordinate, breaking ties etc. To reverse sort order of a particular key, precede it with +, e. g. vcodec,+res,acodec,abr lists entries mainly by video codec sorted from high to low, and within each video codec, by resolution sorted from low to high.

GfEW avatar Feb 10 '24 18:02 GfEW