2

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?

Maru
  • 121

1 Answers1

2

The best quality is usually the one that is automatically downloaded. Normally, you don't have to worry about it.

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 these days I'd recommend using the yt-dlp program instead. It offers more features and is better maintained than the original.

In general, the VP9- and Opus-encoded formats will be the one offering better quality; 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". Basically, choose WebM formats over MP4, and choose the highest resolution/bitrate combination available.

It's important to note that 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 those to vary.

In the above example, 247 would be the best video quality.

slhck
  • 228,104
  • 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 09:58
  • 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. - youtube-dl but would download .webm instead of MP4/M4a although the 2 are better than .webm. The answer is also: youtube-dl -f 137+140 link – BabyBoy May 01 '22 at 12:30
  • @Lano Why do you assume that MP4/m4a are better than the WebM variants? It's actually the opposite: YouTube saves those VP9 encodings only for the popular and high-resolution videos because they offer better quality at lower file sizes. – slhck May 02 '22 at 07:33