1

I would like to download a youtube video with the best video quality and audio quality. Based on this answer, I would like to pick the best video and best audio, then merge them together. However, I'm unsure which one will be the best choice. The -F command gave me the following information

249          webm       audio only DASH audio   54k , opus @ 50k, 8.60MiB
250          webm       audio only DASH audio   68k , opus @ 70k, 10.98MiB
171          webm       audio only DASH audio  123k , vorbis@128k, 19.82MiB
140          m4a        audio only DASH audio  131k , m4a_dash container, mp4a.40.2@128k, 23.65MiB
251          webm       audio only DASH audio  132k , opus @160k, 21.46MiB
160          mp4        256x144    144p  110k , avc1.4d400c, 30fps, video only, 6.48MiB
278          webm       256x144    144p  119k , webm container, vp9, 30fps, video only, 15.64MiB
242          webm       426x240    240p  219k , vp9, 30fps, video only, 16.57MiB
133          mp4        426x240    240p  275k , avc1.4d4015, 30fps, video only, 14.96MiB
243          webm       640x360    360p  409k , vp9, 30fps, video only, 25.87MiB
134          mp4        640x360    360p  520k , avc1.4d401e, 30fps, video only, 26.78MiB
244          webm       854x480    480p  749k , vp9, 30fps, video only, 37.32MiB
135          mp4        854x480    480p  975k , avc1.4d401f, 30fps, video only, 38.80MiB
136          mp4        1280x720   720p 1343k , avc1.4d401f, 30fps, video only, 52.98MiB
247          webm       1280x720   720p 1509k , vp9, 30fps, video only, 65.66MiB
17           3gp        176x144    small , mp4v.20.3, mp4a.40.2@ 24k, 13.90MiB
36           3gp        320x180    small , mp4v.20.3, mp4a.40.2, 41.49MiB
18           mp4        640x360    medium , avc1.42001E, mp4a.40.2@ 96k, 68.85MiB
43           webm       640x360    medium , vp8.0, vorbis@128k, 96.53MiB
22           mp4        1280x720   hd720 , avc1.64001F, mp4a.40.2@192k (best)

I assume 247 = best video available. However, I'm not sure what 1509k mean? After selecting this, Mediainfo told me that the video has 477kb/s. Was I doing something wrong?

2
  • Please define "the best" – Albin Dec 21 '18 at 14:25
  • 1
    @Albin Video: Highest possible resolution and bitrate Audio: Highest possible quality (I'm not sure if opus 160k and mp4a.40.2 192k is similar?) – Maru Dec 21 '18 at 14:35
2

Please read the youtube-dl documentation:

By default youtube-dl tries to download the best available quality, i.e. if you want the best quality you don't need to pass any special options, youtube-dl will guess it for you by default.

Note that if you have a specific requirement regarding video and audio codecs or formats used, you should set the format:

You can also use a file extension (currently 3gp, aac, flv, m4a, mp3, mp4, ogg, wav, webm are supported) to download the best quality format of a particular file extension served as a single file, e.g. -f webm will download the best quality format with the webm extension served as a single file

YouTube will offer VP9-encoded video and Opus-encoded audio when querying a WebM format; these are the itags starting with a "2". As these are way more efficient (i.e., offer better quality at the same size) than the H.264- and AAC-encoded video and audio streams starting with "1", you could choose -f webm for any download.

Also, there are more options for querying the format.

2
  • I have read the document, but after checking the overall bitrate from the command without any option, the downloaded video was only 477kb/s, so I thought I did something wrong since -F tell me that there is 720p 1509k. Choosing 247 as a video also gave me the same result, Is this mean that 477kb/s cause from VP9? – Maru Dec 21 '18 at 14:15
  • 1
    The bitrate that is indicated by the -F option is only a rough indication of the targeted bandwidth, but has little to do with the actual video bitrate that you get once you've downloaded everything. You can expect there to be huge variations. The 247 format should still be the “best" one in this case. – slhck Dec 22 '18 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.