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

How to select highest resolution up to 1440p with preference to VP9 over AVC and OPUS over VORBIS over AAC? #11872

Closed
mzso opened this issue Jan 29, 2017 · 10 comments

Comments

@mzso
Copy link

@mzso mzso commented Jan 29, 2017

Hi!

I think I crammed everything I want to achieve into the title. Can I do this with a single command line?

Basically I want only up to 1440p because my machine tends to have trouble playing videos above.

Unfortunately VP9/opus/vorbis streams are often missing. In which case the fallback is necessary to AVC/AAC. But only when, and only for which stream is missing. And I most certainly never want VP8.

Also sometimes DASH formats are completely missing. In which case non-dash AVC formats come into play.
Also resolution is more important than format. So if for some weird reason the 1080p VP9 streams are missing AVC should be downloaded.

@mzso
Copy link
Author

@mzso mzso commented Jan 29, 2017

This is as far as I got:

youtube-dl -f "bestvideo[height<=1440,ext=webm]+bestaudio[ext=webm]/best[height<=1440]" --write-description --write-sub --write-thumbnail --embed-thumbnail --embed-subs --sub-lang en,hu --merge-output-format mkv -o "%(title)s.%(ext)s" <url>

It has several issues. Doesn't differentiate between vp9/vp8 opus/vorbis. So I don't even know what will happen, probably some cases I would get vp8, which is bad. Probably it would fall back to AVC if both the opus and vorbis streams were missing. (I don't know how likely that is)
It cannon embed the thumbnail into mkv, only mp4. But mp4 doesn't support the webm codecs as far as I know. So no thumbnail, or no vp9/opus/vorbis. (Actually it doesn't seem to work with mp4 either.) I get some atomicparsley error.

For whatever weird reason it changes the file modification date to god knows what date, certainly not the date the video was uploaded, or the date current date which I would expect. Something I certainly never configured.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jan 29, 2017

-f '(bestvideo[vcodec=vp9]/bestvideo[vcodec^=avc]/bestvideo[vcodec!=vp8])[height<=1440]+(bestaudio[acodec=opus]/bestaudio[acodec=vorbis]/bestaudio[acodec^=m4a]/bestaudio)/(best[vcodec=vp9]/best[vcodec^=avc]/best[vcodec!=vp8])[height<=1440]'
@dstftw dstftw closed this Jan 29, 2017
@mzso
Copy link
Author

@mzso mzso commented Jan 29, 2017

Thanks!

Do you have any idea while the last modified date of the resulting file is screwed up?
For example for this video: https://www.youtube.com/watch?v=BnXXuDl30JY I get the date "2014.08.05" for unkown reasons. The date of the description or thumbnail image is not screwed up.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jan 29, 2017

--no-mtime.

@mzso
Copy link
Author

@mzso mzso commented Jan 29, 2017

Thanks again!
That solves everything that seems solvable.

@mzso
Copy link
Author

@mzso mzso commented Jan 30, 2017

Can I prevent deleting stuff that were embedded? (I only want embed subs or artwork as a safety measure so that I won't loose them)

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jan 30, 2017

-k.

@mzso
Copy link
Author

@mzso mzso commented Jan 30, 2017

@dstftw commented on 2017. jan. 30. 18:25 CET:

-k.

Not quite what I wanted. I don't want the video, audio streams. Oh, well...

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jan 30, 2017

--write-thumb --write-sub --write-auto-sub.

@mzso
Copy link
Author

@mzso mzso commented Jan 30, 2017

@dstftw commented on 2017. jan. 30. 18:31 CET:

--write-thumb --write-sub --write-auto-sub.

Indeed. But if I also use "--embed-subs" the external subtitle is deleted.

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
2 participants
You can’t perform that action at this time.