Search code examples
youtube-dl

Why does Youtube-dl not download stated bitrate?


These are the streams of a video I wanted to download:

249 webm audio only DASH audio 58k , opus @ 50k, 1.42MiB 250 webm audio only DASH audio 75k , opus @ 70k, 1.87MiB 140 m4a audio only DASH audio 128k , m4a_dash container, mp4a.40.2@128k... *251 webm audio only DASH audio **146k** , opus @**160k**, 3.69MiB 171 webm audio only DASH audio 148k , vorbis@128k, 3.74MiB 160 mp4 256x144 144p 122k , avc1.4d400c, 30fps, video only, 2.98MiB 278 webm 256x144 144p 150k , webm container, vp9, 30fps, video only... 242 webm 426x240 240p 323k , vp9, 30fps, video only, 6.02MiB 133 mp4 426x240 240p 325k , avc1.4d4015, 30fps, video only, 7.10MiB 243 webm 640x360 360p 648k , vp9, 30fps, video only, 11.02MiB 134 mp4 640x360 360p 738k , avc1.4d401e, 30fps, video only, 16.86MiB 244 webm 854x480 480p 983k , vp9, 30fps, video only, 19.61MiB 135 mp4 854x480 480p 1228k , avc1.4d401f, 30fps, video only, 29.77MiB 247 webm 1280x720 720p 1912k , vp9, 30fps, video only, 38.31MiB 136 mp4 1280x720 720p 2348k , avc1.4d401f, 30fps, video only, 53.75MiB 248 webm 1920x1080 1080p 3244k , vp9, 30fps, video only, 67.41MiB 137 mp4 1920x1080 1080p 4427k , avc1.640028, 30fps, video only, 94.91MiB 17 3gp 176x144 small , mp4v.20.3, mp4a.40.2@ 24k, 2.38MiB 36 3gp 320x180 small , mp4v.20.3, mp4a.40.2, 8.17MiB 18 mp4 640x360 medium , avc1.42001E, mp4a.40.2@ 96k, 26.56MiB 43 webm 640x360 medium , vp8.0, vorbis@128k, 34.45MiB *22 mp4 1280x720 hd720 , avc1.64001F, mp4a.40.2@**192k** (best)

Ok so first I downloaded the last one but when I checked mediainfo of the file I got

Video

_

Audio

  • ID : 2
  • Format : AAC
  • Format/Info : Advanced Audio Codec
  • Format profile : LC
  • Codec ID : mp4a-40-2
  • Duration : 3 min 55 s
  • Bit rate mode : Variable
  • Bit rate : 126 kb/s
  • Channel(s) : 2 channels
  • Channel positions : Front: L R
  • Sampling rate : 44.1 kHz
  • Frame rate : 43.066 FPS (1024 SPF)
  • Compression mode : Lossy
  • Stream size : 3.52 MiB (6%)
  • Title : ISO Media file produced by Google

And when I downloaded 251 which should have been 160kbps-opus format (or 148 I don't really know) I got

General

  • Format : WebM
  • Format version : Version 4 / Version 2
  • File size : 3.69 MiB
  • Duration : 3 min 55 s
  • Overall bit rate : 132 kb/s
  • Writing application : google/video-file
  • Writing library : google/video-file

Audio

  • ID : 1
  • Format : Opus
  • Codec ID : A_OPUS
  • Duration : 3 min 55 s
  • Channel(s) : 2 channels
  • Channel positions : Front: L R
  • Sampling rate : 48.0 kHz
  • Bit depth : 16 bits
  • Compression mode : Lossy
  • Language : English
  • Default : Yes
  • Forced : No

As far as I can tell the command Bestaudiodoesn't work anymore with the new update

At least by the last one it says "overall bitrate" so maybe... but the first one was completely out of the ball-park.

I've tried this with other videos and I get the same results... guess I'll settle for the opus one in the future...


Solution

  • OK I think I've got this figured out. Basically it's not youtube-dl's fault that you're me getting lower bitrates, it's youtube's fault.

    Let me clarify, I came to this conclusion because I had the same question when I was downloading youtube videos with vlc media player (which supposedly gets the source link) and was always getting about 128kbps. Basically Youtube, since about 2 years ago, started transcoding all of their videos to 128kbps*.

    The metadata that youtube-dl shows which contains higher bitrates is just outdated. (Or youtube-dl's retrieval system is; one of the two.)

    (Btw videos that were uploaded between mid-2016 and begin-2019 that didn't get a lot of views (then) still have a fair chance of containing the aac 192k bitrate stream, you just have try your luck.)

    Also, someone told me it's possible to get higher bitrates depending on youtube's servers and your bandwidth. "If the connection slows down, YouTube switches to formats with lower bitrates"... but I'm not sure this has anything to do with the download streams.


    *(Youtube's gone sh*t basically)