-
Notifications
You must be signed in to change notification settings - Fork 17
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
Bot downloads YT videos with extreme compression #105
Comments
Hey, I'm about 90% sure that that is a limitation on YouTube's end. I made the bot so that it downloads the best format that contains both video and audio, and historically YouTube served that up to 720p. From what I've seen recently they've lowered that. To support higher resolutions, the bot would have to download the separate video and audio streams and either re-encode oder remux the two. Re-encoding takes a bunch of resources and time and remuxing behaves weirdly with some players and platforms in my experience so I'm not sure if I want to do either. If you can provide an example link I can show you what formats YouTube makes available. Or run |
In my testing, the settings -f "bv*[filesize<2000M]+ba" --remux-video mp4 -S "height:1080" serve up a good resolution with a filesize under the self-hosted botAPI limit, and remuxing doesn't seem to take that much CPU time or storage. |
Yeah remuxing is quick but sometimes behaves weird in some players. Unfortunately introducing runtime options per-user to the bot would make it a bunch more complicated and I'm not sure if remuxing should be the default. I am not completely against it either though. Maybe as a global configuration option on the container? |
That last option would definitely be a welcome change, if possible! |
I was beginning to implement this, but I realized that for regular downloads, the bot doesn't even download anything to the server, but hands the direct stream URL directly to telegram, effectively skipping a step. This was the hacky trick I used to make this bot a lot faster. So I think I won't implement this because it would defeat the point of having a fast downloading solution as it would add multiple points of slowdowns. There's also some throttling YouTube seems to apply to certain formats, so a download that takes just a couple of seconds on the current release, took a solid 4 minutes to download on "max" settings. The resulting file is 566MB instead of 30MB and their resolutions are 2160p and 360p respectively. Furthermore, the resulting video looks fine but plays without audio on my Windows 10 desktop and looks stretched but with working audio on my iPhone. This is what I meant by weird playback behavior due to remuxing. Here is the modified
|
The bot downloads videos (from youtube specifically) with a resolution of 640x480, no matter the length of the video and compresses the video to fit within the confines of a 74.3Mb cap (observed via passing multiple YT URLs to the bot). The BotAPI server is confirmed to be running and am using the most up-to-date image for the downloader.
The text was updated successfully, but these errors were encountered: