ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.97k stars 10.01k forks source link

Is it possible to skip HDR video quality ? #16465

Open startas opened 6 years ago

startas commented 6 years ago

Is it possible to skip video formats with HDR ? If you look at the output from

youtube-dl --list-formats https://www.youtube.com/watch?v=tO01J-M3g0U

This video has many formats available, some of them are HDR. Now, i play video with

mpv --ytdl-format="bestvideo[height<=?1440][fps<=?60]+bestaudio/best" https://www.youtube.com/watch?v=tO01J-M3g0U

But is there a way to skip HDR video formats ?

startas commented 6 years ago

Ok, i found one way to do it - to add [format_id!=xxx] parameter, and add it for every video format with hdr, so as long as format_id is stable and same formats have same id, i can just manually skip all hdr formats, like [format_id!=336][format_id!=337] and so on.

aufkrawall commented 6 years ago

Maybe you want this? (bestvideo[vcodec=vp9]/bestvideo[ext=mp4]/bestvideo)+bestaudio/best

Tankamin commented 6 years ago

Where do i add (bestvideo[vcodec=vp9]/bestvideo[ext=mp4]/bestvideo)+bestaudio/best

after -formats? like -formats(bestvideo[vcodec=vp9]/bestvideo[ext=mp4]/bestvideo)+bestaudio/best

Thanks

Hrxn commented 6 years ago

Like this --format "(bestvideo[vcodec=vp9.2]/bestvideo[vcodec=vp9][fps>30]/bestvideo[vcodec=vp9][height>=1080]/bestvideo[fps>30]/bestvideo[height>720])+(bestaudio[acodec=opus]/bestaudio)/best"

You can also put this into your youtube-dl.conf to make this preference permanent. This config file needs to be placed into your $HOME directory.

Tankamin commented 6 years ago

Like this --format "(bestvideo[vcodec=vp9.2]/bestvideo[vcodec=vp9][fps>30]/bestvideo[vcodec=vp9][height>=1080]/bestvideo[fps>30]/bestvideo[height>720])+(bestaudio[acodec=opus]/bestaudio)/best"

You can also put this into your youtube-dl.conf to make this preference permanent. This config file needs to be placed into your $HOME directory.

Thank you!! :)

Tankamin commented 6 years ago

I got it working but after a few videos, i received: ERROR: unable to download video data: <urlopen error EOF occurred in violation of protocol (_ssl.c:600)>

I don't know what this is... any ideas?

Hrxn commented 6 years ago

It depends... better post the full output with --verbose here.

But this looks like some issue with HTTPS and cert validation, could be caused by old Python 2.x versions. This was pretty common on macOS/OS X, iirc.

Tankamin commented 6 years ago

It depends... better post the full output with --verbose here.

But this looks like some issue with HTTPS and cert validation, could be caused by old Python 2.x versions. This was pretty common on macOS/OS X, iirc.

Thanks. I'm on Windows. I restarted it and it's going so far with no issues. Thanks.