Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DASH track downloads are single-threaded #75

Open
592767809 opened this issue Mar 1, 2024 · 13 comments
Open

DASH track downloads are single-threaded #75

592767809 opened this issue Mar 1, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@592767809
Copy link

592767809 commented Mar 1, 2024

When I used three different downloaders to download on February 23, 2024, only one thread appeared to work. The more obvious phenomenon is that there is only one at any time of the cache directory.! Dev file. For different sites, this problem exists

operating system:window10 pro 19045.4046
python:3.9.8

Edit by rlaphoenix for reference:

v3.0.0 (and apparently same in v3.1.0):
Screenshot_5

v2.2.0:
Screenshot_6

@rlaphoenix
Copy link
Member

Did you try on the newly released v3.0.0 as it has fixes that your checkout may not have pulled. Can I ask which type of download were you doing? (i.e., single direct file, DASH, or HLS)

@592767809
Copy link
Author

I downloaded the type of DASH

@rlaphoenix rlaphoenix added the bug Something isn't working label Mar 1, 2024
@rlaphoenix
Copy link
Member

I downloaded the type of DASH

While my PC is not the fastest download-wise, it does seem to act like it's single-threaded. What about HLS? Do you experience the same thing? On my end, HLS seems fine.

@rlaphoenix rlaphoenix changed the title Download speed abnormal problem DASH track downloads are single-threaded Mar 1, 2024
@592767809
Copy link
Author

I have rarely downloaded the type of HLS, most of which are DASH types, and several ISM types (depending on DASH replica). All are the problems of single threads

@rlaphoenix
Copy link
Member

I am having trouble noticing why this issue is happening. Something seems to be pulling/waiting for main thread but I cannot see what. The HLS code if anything should be the one to worry me about this happening as it is much more complicated, yet it's the simpler DASH code that is problematic.

I will spend more time but if anyone here can spot a problem, feel free to make a PR.

@rlaphoenix
Copy link
Member

How is your download speeds on v3.2.0? Do you notice any changes or improvements?

@592767809
Copy link
Author

How is your download speeds on v3.2.0? Do you notice any changes or improvements?

My download speed is about a few MB per second, I don’t pay attention to the modification

@rlaphoenix
Copy link
Member

How is your download speeds on v3.2.0? Do you notice any changes or improvements?

My download speed is about a few MB per second, I don’t pay attention to the modification

Do you mean that you do not know if there's a change? Or that you do not notice a difference?

@592767809
Copy link
Author

How is your download speeds on v3.2.0? Do you notice any changes or improvements?

My download speed is about a few MB per second, I don’t pay attention to the modification

Do you mean that you do not know if there's a change? Or that you do not notice a difference?

In the previous version, the speed seems to have 50MB-60MB per second

@rlaphoenix
Copy link
Member

In the previous version, the speed seems to have 50MB-60MB per second

You are comparing against the same service/file? Some people have seen improvements in v3.2.0, but some have not. It is very random. I too have seen improvements but for some is still slower than expected. I do not currently know what is the reason.

@592767809
Copy link
Author

In the previous version, the speed seems to have 50MB-60MB per second

You are comparing against the same service/file? Some people have seen improvements in v3.2.0, but some have not. It is very random. I too have seen improvements but for some is still slower than expected. I do not currently know what is the reason.

It is the same file, but there is always only one in the cache directory.! DEV, and it appeared in order.

@rlaphoenix
Copy link
Member

rlaphoenix commented Apr 4, 2024

Ok, so it seems like it has something to do with the download function in core.downloaders.requests yielding download status updates. If we comment out all the yield operations, then we see multiple .!dev files meaning multiple downloads are happening.

However, without these yields, we cannot receive download speed and status information. The only information we can get is how many of the total downloads finished. But at least we now have some sort of reasoning for the slowdown. This slowdown also seems to occur on HLS just seemingly not as bad.

I ran an aria2c download (24 threads) on Disney+ 2160p video-track getting roughly 76 MB/s for 90% of the download. It finished downloading the track (and merging and decrypting) in 5 minutes and 44 seconds. Doing the same download with the same 24 threads on requests downloader and got an unknown amount of download speed since we cannot yield back updates but it finished at the same point in 5 minutes and 46 seconds. So I can assume it downloaded at basically the same average speed as aria2c, which was the expected speed for my network.

@rlaphoenix
Copy link
Member

@592767809 Can you try as of this commit and see if you get an improved download speed? I would also like to know what it averages speed-wise for you, and what you expect it to be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants