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

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

Open
3 of 6 tasks
Playerend opened this issue Feb 1, 2024 · 1 comment
Labels
enhancement New feature or request new issue This issue is not triaged

Comments

@Playerend
Copy link

Playerend commented Feb 1, 2024

Checklist

  • This feature I'm requesting is already implemented in yt-dlp.
  • This feature is merely a UI/UX update.
  • 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.
  • 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 Playerend added enhancement New feature or request new issue This issue is not triaged labels Feb 1, 2024
@Playerend Playerend changed the title Qualities need to be arranged well according to every quality Qualities in the “Format selection” window needs to be arranged well, each one under its own quality Feb 4, 2024
@GfEW
Copy link

GfEW commented Feb 10, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new issue This issue is not triaged
Projects
None yet
Development

No branches or pull requests

2 participants