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

slow download speed #72

Open
1 of 2 tasks
mfolnovic opened this issue May 12, 2023 · 10 comments
Open
1 of 2 tasks

slow download speed #72

mfolnovic opened this issue May 12, 2023 · 10 comments

Comments

@mfolnovic
Copy link

mfolnovic commented May 12, 2023

app version: 1.0.0

  • twitch api key set
  • youtube api key set

issue description: When i either download through browser, through podcast addict or if I copy/paste ffmpeg command and run it locally, the download speed is ~35KB/s. My internet speed is 1000/500 (Mbit/s).

Is there a configuration I'm missing?

Thanks for really useful product!

2023-05-12T04:52:36.239Z INFO  [app] app version 1.0.0
2023-05-12T04:52:36.274Z INFO  [app] starting server at http://0.0.0.0:8080
2023-05-12T04:52:36.274Z INFO  [actix_server::builder] starting 4 workers
2023-05-12T04:52:36.274Z INFO  [actix_server::server] Actix runtime found; starting in Actix runtime
2023-05-12T04:52:43.117Z INFO  [app] processing transcode at 192k for https://www.youtube.com/watch?v=BMr7Bz8eGus
2023-05-12T04:52:43.117Z INFO  [vod2pod_rss::transcoder] detected youtube url, need to find the stream url if not in cache
2023-05-12T04:52:46.076Z INFO  [vod2pod_rss::transcoder] generated ffmpeg command:
ffmpeg -ss 0 -i https://rr4---sn-8p2oxu-15bs.googlevideo.com/videoplayback/... -acodec libmp3lame -ab 192k -f mp3 -bufsize 5760 -maxrate 5760k -timeout 300 -hide_banner -loglevel error pipe:stdout
2023-05-12T04:52:46.080Z INFO  [vod2pod_rss::transcoder] streaming to client
@madiele
Copy link
Owner

madiele commented May 12, 2023

I tried measuring the output of the raw ffmpeg command and yes, it seems to never go beyond 40KB/s, I'll have to check if there is some kind of option I'm missing for ffmpeg or that is just how fast you can go, I'll let you know if I found a fix

@madiele
Copy link
Owner

madiele commented May 12, 2023

seems to be youtube that is throttling, if you check in the yt-dlp github you'll see some mentions of it, we'll have to wait for a new yt-dlp version to come out with the fix. In the mean time it will be slow...

I suggest you watch the repo for new releases to get notified when an update comes out, I will also update all the dependencies, can't say if that will work but there is a chance.

Sorry I could not help.

@madiele madiele closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2023
@madiele
Copy link
Owner

madiele commented May 13, 2023

I just added automatic pull requests with depend-a-bot when yt-dlp gets updated so that when they release a new version I get notified and i can make a new image quickly that hopefully fixes the issue✌️

@madiele
Copy link
Owner

madiele commented Jun 25, 2023

The beta image now has a new yt-dlp version, check if that has improved something

Just add :beta to the end of the image section of the docker-compose file

@mfolnovic
Copy link
Author

While I'm running :latest, it works (although slow).

When I update to :beta and try to download a podcast, I get an error in response "Exec format error (os error 8)".

Logs:

2023-06-25T14:44:34.280Z INFO  [app] app version 1.0.3-beta-5a25fe9
2023-06-25T14:44:34.298Z INFO  [app] detected version change (1.0.2 != 1.0.3-beta-5a25fe9) flushing redis DB
2023-06-25T14:44:34.299Z INFO  [app] starting server at http://0.0.0.0:8080
2023-06-25T14:44:34.299Z INFO  [actix_server::builder] starting 4 workers
2023-06-25T14:44:34.299Z INFO  [actix_server::server] Actix runtime found; starting in Actix runtime
2023-06-25T14:44:39.717Z INFO  [app] processing transcode at 192k for https://www.youtube.com/watch?v=X2RdwmPqBvQ
2023-06-25T14:44:39.718Z INFO  [vod2pod_rss::transcoder] detected youtube url, need to find the stream url if not in cache

If it helps, I'm running this on unraid.

@madiele
Copy link
Owner

madiele commented Jun 25, 2023

seems like a new bug, I'll see if I can fix it

@madiele
Copy link
Owner

madiele commented Jun 25, 2023

@mfolnovic should be fixed now

@jclendineng
Copy link

Can we re-open this? There are options we can use in yt-dlp to tweak the speeds, can we add yt-dlp options through here or would we need to compile ourselves with the options?

yt-dlp/yt-dlp#10443 has some useful options that seem to fix the slowness issues.

--throttled-rate 500K -R infinite --socket-timeout 1
or similar options

@madiele
Copy link
Owner

madiele commented Aug 8, 2024

Interesting, I'll reopen sure ✌️

As for when I'll find the time to look into this, no clue, but an option to add extra args to yt-dlp is not a bad idea and should be easy to add, if anyone wants to take a shot at it look at contributing.md for a guide on how to setup the dev environment, I'm open to PRs

@madiele madiele reopened this Aug 8, 2024
@primeapple
Copy link
Contributor

While I couldn't change the DL Speed, I had some success with changing the size of the downloaded audio.

Setting the following environment variable:

      - YOUTUBE_YT_DLP_GET_URL_EXTRA_ARGS=["-f", "bestaudio[format_note~=original]/bestaudio", "-S", "+size"]

This allows to sort by the smallest filesize available by YT. This is only the -S part. The other is to prefer the original language in case there are multiple language audiotracks available.

Maybe it helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants