TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
29.51k stars 2.95k forks source link

Inefficient video stream selection by downloader #2934

Open opusforlife2 opened 4 years ago

opusforlife2 commented 4 years ago

I've noticed with many videos that the 360p video stream is larger than the 480p (sometimes even 720p!) stream. This is because the downloader seems to select the stream with the bigger file size (VP8, AVC) instead of smaller (VP9, AVC).

Almost invariably, there are 3 streams for every video URL which have combined video and audio, and these are usually selected for download over their more efficient counterparts. In the case of youtube-dl, this is what happens if you use the best flag instead of bestvideo+bestaudio flag (which is the default).

I've seen cases where the 720p video (with audio) is double the size of the 720p60 video stream.

I have no way to check (#2385), but does this happen in the case of video streaming as well?

kapodamy commented 4 years ago

In the dropdown of the download dialog is showed a calculated size (video_only_stream_size + audio_only_stream_size) for streams that are individual. example youtube-dl https://youtube.com/watch?v=BbI9xkzNHQI -F details For the 360p, NPE gives priority to the video with audio track (itag 18) over the video only track which is smaller (itag 134)

opusforlife2 commented 4 years ago

@kapodamy I did test and see the same with youtube-dl, as you say. Shouldn't the NPE go for the more efficient encode for that resolution? Or, in yt-dl terms, bestvideo+bestaudio instead of best?

kapodamy commented 4 years ago

no idea

opusforlife2 commented 4 years ago

... I think it should. Saves on data and storage space. Especially in case of 720p.

opusforlife2 commented 3 years ago

@wb9688 Tagging you here, since you mentioned automatically fetching this stuff as part of your DASH plans.