4 ms·
-f also supports some symbolic names, which is very handy because it allows you to easily get the best possible quality without having to check the formats ever
by pilif 11y ago
-f also supports some symbolic names, which is very handy because it allows you to easily get the best possible quality without having to check the formats every time:
-f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]'
this is what I'm using in my case (on youtube).
Posting this here, because it's not obvious from the docs that this works.
- masklinn 11y agoFWIW > Since the end of April 2015 and version 2015.04.26 youtube-dl uses -f bestvideo+bestaudio/best as default format selection […] If ffmpeg or avconv are installed this results in downloading bestvideo and bestaudio separately and muxing them together into a single file giving the best overall quality available. Otherwise it falls back to best and results in downloading the best available quality served as a single file. best is also needed for videos that don't come from YouTube because they don't provide the audio and video in two different files.
- pilif 11y agobestvideo+bestaudio has been flip-flopping ver time and releases between mp4 and webm though. As I'm mostly using this for consumption on an iPad, I prefer mp4, so I'm happy to have found a way to get the best possible mp4 version without having to go format hunting.
- dstryr 11y agoI'm pretty sure the '-f best' setting is the default for updated versions of ytdl, so no real need for that.
- Kristine1975 11y agoUnless you always want to download the best mp4, not webm (or vice versa).