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

Youtube-dl only download specific codec if it has best resolution #26444

Closed
2 tasks done
SageSystems opened this issue Aug 26, 2020 · 3 comments · Fixed by pukkandan/youtube-dl#5
Closed
2 tasks done
Labels

Comments

@SageSystems
Copy link

SageSystems commented Aug 26, 2020

Checklist

  • [X ] I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Question

OK so I've been using youtube-dl --cookies cookies.txt -f '(bestvideo[vcodec*=av01]/bestvideo[vcodec=vp9]/bestvideo)+(bestaudio[acodec=opus]/bestaudio[acodec=vorbis]/bestaudio[acodec=aac]/bestaudio)/best' --sub-lang en --embed-subs --add-metadata %video% -o '%(title)s.%(ext)s' to download videos and have a question, when such a video has an av1 encode that is below the best resolution (let's say it has av1 144p but vp9 1080p) how would I tell it to download the best (less preferred) codec (in the case of the previous example vp9), instead of the lower quality (more preferred) codec?

@pukkandan
Copy link
Contributor

pukkandan commented Aug 30, 2020

There is sadly no easy way to do this.

  1. You can either make a list of all format codes like this guy
    or
  2. You could use a large format selection with seperate codec check for each resolution. Something like:
    ((bestvideo[vcodec*=av01]/bestvideo[vcodec=vp9]/bestvideo)[height>2160]/(bestvideo[vcodec*=av01]/bestvideo[vcodec=vp9]/bestvideo)[height>1080]/.../(bestvideo[vcodec*=av01]/bestvideo[vcodec=vp9]/bestvideo)[height>144]/(bestvideo[vcodec*=av01]/bestvideo[vcodec=vp9]/bestvideo))+bestaudio...

@SageSystems
Copy link
Author

Sorry to hear that, but thanks for the workarounds

@pukkandan
Copy link
Contributor

pukkandan commented Oct 17, 2020

If you are willing to use #25959, you can use --format-sort "height,codec" to select the best codec av01>vp9>avc1...

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

Successfully merging a pull request may close this issue.

2 participants