youtube-dl DASH video and audio in highest quality without human intervention
Just use -f bestvideo+bestaudio/best
for highest resulting quality available.
If you wanted to prefer MP4 format containers instead of WebM, use:
-f bestvideo[ext!=webm]+bestaudio[ext!=webm]/best[ext!=webm]
.
Or you could just use,
youtube-dl https://www.youtube.com/watch?v=blabla
This will download the highest quality video and audio and merge them automatically. And I think I have heard somewhere that you need ffmpeg installed to have this automatic behavior. But I bet most systems have it already.
youtube-dl -f best 'youtube_URL'
or,
youtube-dl -f 'bestvideo+bestaudio/bestvideo+bestaudio' --merge-output-format mp4 'youtube_URL'
or,
youtube-dl -f 'bestvideo[ext=webm]+bestaudio[ext=m4a]/bestvideo+bestaudio' --merge-output-format mp4 'youtube_URL'
Hope it helps!
I've found some weird cases where the default (see #5447, #5456) bestvideo+bestaudio/best
would download 720p video even when a 1080p was available. The reason that the bitrate on the 720p was very slightly higher, therefore it seemed better quality for youtube-dl. I prefer the higher res, also all other fancy youtube downloader applications downloaded the 1080p (as control).
Therefore I propose and use this:
-f ("bestvideo[width>=1920]"/bestvideo)+bestaudio/best
It will look for the best, at least 1920 wide video. If that's not available, it'll resort to what it would normally choose. The /best part at the end is part of the default config.
On a side note I recommend putting the %(format_id)s
somewhere in the filename, so you know what that file is using. If you later want to re-download a bunch of videos without using archive, with --no-overwrites
, a better/different quality will form a new filename next to the old one (so you can compare or whatever).