1

I'm using youtube-dl and ffmpeg to get videos/frames of videos from the web. I was told that youtube (and others) use adaptive bitrate streaming, so depending on the network conditions of the user the bitrate should drop/rise, then even though resolution stays the same, image quality should change.

That got me wondering if youtube-dl has some mechanism for downloading videos with the same (presumably best) bitrate.


So my questions are:

1) When downloading videos through youtube-dl, because of ABR, the quality of the downloaded video depends on network conditions?

2) The following shell script will get a frame of a video at 1:30, will the image quality of this frame be affected by ABR?

MP4URL=`youtube-dl -g MYVIDEOLINK`
ffmpeg -ss 1:30 -i $MP4URL -frames:v 1 myframe.png

3) If one of the previous questions is true: Is there a way to ensure a network independent quality? How?

1 Answer 1

1

Adaptive streaming is accomplished by switching between pre-encoded streams of different bitrates and/or resolutions. But the bitrate within any given pre-encoded stream does not vary too much.

YT-DL, with your command, will select the 'best' video stream, usually the one with the highest bitrate and resolution, and return its URL. This URL is a direct resource address, and there will be no switching when downloading it, even if your network gets congested.

2
  • That does makes sense. I thought youtube-dl only evaluated resolution and extension since video formats are always categorized by resolution and extension. But having a deeper look in the 'format selection' docs section, it seems like it does take bitrate into account, but keeps it hidden? Is that it? Aug 17, 2019 at 18:41
  • Running youtube-dl URL -F will show all the variants it detects. One of them will be marked as the best.
    – Gyan
    Aug 17, 2019 at 18:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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