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

Improve the format selection logic and syntax #5242

Open
haasn opened this issue Mar 20, 2015 · 3 comments
Open

Improve the format selection logic and syntax #5242

haasn opened this issue Mar 20, 2015 · 3 comments
Labels

Comments

@haasn
Copy link
Contributor

@haasn haasn commented Mar 20, 2015

This is a combination of three similar feature requests, all aimed at improving the ability to specify the particular format(s) chosen by youtube-dl.

  1. I want an operator that says “choose the better of the two”. For a motivating use case, non-DASH formats are better than (equivalent) DASH formats when used in mpv (eg. allows seeking and accurate duration information) as well as standalone (they can be streamed instantly, rather than needing to wait for both components to finish downloading before remuxing them). The syntax I imagine could be something like this: best|bestvideo+bestaudio. It would pick the one with highest overall quality, preferring the leftmost if they're identical. (Ideally there should also be some slight tolerance for considering formats “equal”)
  2. I want to be able to set my heuristics for audio and video tracks independently. The way I imagine this working is by being able to “group” together a format selection using parentheses, like this: (bestvideo[tbr<13000][height>720]/bestvideo[tbr<13000][fps>30])+(bestaudio[ext=webm]/bestaudio)
  3. The “quality” assessment should be multiplied by a format-specific weight, since eg. 128 kbps Opus is definitely better than 128 kbps MP3, and eg. 21 Mbps VP9 ought to be better than 22 Mbps AVC. This should probably be user-configurable, and would coincidentally allow me to easily “prefer free formats” by giving them (significantly) higher weights than corresponding non-free formats.
@haasn haasn changed the title Add ability to specify DASH format selection independently Improve the format selection syntax Mar 20, 2015
@haasn haasn changed the title Improve the format selection syntax Improve the format selection logic and syntax Mar 20, 2015
@jaimeMF jaimeMF added the request label Mar 20, 2015
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Aug 3, 2015

Grouping with parentheses will be supported in the next version, open a new issue if you find any problem.

@realnc
Copy link

@realnc realnc commented Nov 17, 2015

Thanks!

Just an idea: It might be more elegant to support / in more places. Example:

bestvideo[ext=webm/mp4/*]

Would mean: prefer webm, if not available then mp4, if also not available, then use whatever is there.

@keybounce
Copy link

@keybounce keybounce commented Jun 23, 2016

Yes, please, a way to say "Take the 480p mp4 if it exists, 480p dash second choice", while still fetching audio.

As referenced in that other thread, I was doing:
-f "best[height<=480]/bestvideo[height<=480]+bestaudio"
because I wanted 480, ideally already "put together" without having to recode/re-assemble. I had already learned the hard way the need to have best video + best audio (downloaded too many silent movies without the pairing).

Switching to
-f "bestvideo[height<=480]+bestaudio/best[height<=480]"
will work, but I can see it forcing dual downloads and recombines more often than it will need to.

EDIT: Re-reading that first post -- Is that why sometimes I can watch a video while it's downloading, and sometimes I have to wait for it to finish before I can start? (I've stopped trying to watch while downloading).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.