zaps166 / QMPlay2

QMPlay2 is a video and audio player which can play most formats and codecs.
GNU Lesser General Public License v3.0
855 stars 177 forks source link

Slow download speed #701

Open cipricus opened 6 months ago

cipricus commented 6 months ago

I know that the program uses yt-dlp that can speed up downloads in many cases. When I use it in terminal with the necessary arguments to download an audio stream faster, I can get up to 40 MB/sec or more. Normal Firefox download is about 2-4 MB/s. But download in qmplay2 is under 100-200 KiB/s.

Can this be improved?

zaps166 commented 6 months ago

QMPlay2 doesn't split download to parts, so software like aria2 or yt-dlp are much faster. However Firefox and QMPlay2 should be similar.

cipricus commented 6 months ago

QMPlay2 doesn't split download to parts, so software like aria2 or yt-dlp are much faster. However Firefox and QMPlay2 should be similar.

I thought QMPlay2 uses yt-dlp to download anyway (I think it asks for or installs yt-dlp, right?) and I was about to ask if adding arguments for multiple threads is possible.

As for same speed as Firefox, I've just tested again with a random video (https://www.youtube.com/watch?v=yTRYZ_IotWY): Firefox downloaded in a few secs at a speed at 20-30MB/s. QMPlay2 still downloads as I type here at about 100-200 KiB/s.

I am looking for a (non-browser) player to play youtube (mostly sound) and QMPlay2 seems perfect for me, but sometimes I'd like to download and this speed is very frustrating (I can use yt-dlp separately but I do that when in the browser).

zaps166 commented 6 months ago

How do you download in Firefox? You paste extracted link or use extension to download?

I just tried paste extracted link to aria2 command line - when I set to split download, it downloads with full speed of my network.

cipricus commented 6 months ago

How do you download in Firefox?

Normal download, but the link of downloadable file is read by an addon (SaveFrom.net helper; I could use Video Download Helper too; I don't think any of these use multi-thread method to increase speeds, they just give access to download link).

I just tried paste extracted link to aria2 command line - when I set to split download, it downloads with full speed of my network.

That is analog to my use of yt-dlp in terminal (yt-dlp --concurrent-fragments 20), no surprise there, right? But what's the relation between aria2 or yt-dlp and the way QMPlay2 does its downloads? Is there one? Should I adjust some setting?

I see that on some links Firefox can (without any multi-thread boost) take advantage of almost my full available speed.

My problem is that QMPlay2 takes SO little advantage of that.

It may be the large speed reported in Firefox is too high, because composed/adjusted by the fact that the youtube stream is already in part buffered/downloaded in cache! (??) -- Even, so, I don't think that could account for the huge difference in speeds.

cipricus commented 1 month ago

QMPlay2 doesn't split download to parts, so software like aria2 or yt-dlp are much faster. However Firefox and QMPlay2 should be similar.

Doesn't QMPlay2 use yt-dlp to download? I do use yt-dlp outside QMPlay2, but given the player uses yt-dlp already as a dependency (https://github.com/zaps166/QMPlay2?tab=readme-ov-file#youtube) why not take advantage of the capabilities of this tool?