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

Youtube videos seems to play at low bitrate #94

Open
outerwinnie opened this issue Jan 9, 2025 · 14 comments
Open

Youtube videos seems to play at low bitrate #94

outerwinnie opened this issue Jan 9, 2025 · 14 comments

Comments

@outerwinnie
Copy link

outerwinnie commented Jan 9, 2025

Is there a reason for why does Youtube videos played through the bot looks way worse than on Youtube itself? It also looks way worse than Twitch streams in the bot. I will post a few comparision:

Original video viewed in Youtube:
zen_2025-01-09-19-43-30

The bot playing that Youtube video:
Discord_2025-01-09-19-43-10

The bot playing a Twitch stream:
Discord_2025-01-09-19-52-14

Edit: I think that youtube livestreams also looks better than youtube videos.
Discord_2025-01-09-19-59-20

@ysdragon
Copy link
Owner

ysdragon commented Jan 9, 2025

Which version of the bot have you tested this on?
Can you test this using v1.1.6?

@outerwinnie
Copy link
Author

Which version of the bot have you tested this on? Can you test this using v1.1.6?

I'm using the image "quay.io/ydrag0n/streambot:latest". I'm assuming that is already the v1.1.6?

@ysdragon
Copy link
Owner

ysdragon commented Jan 9, 2025

Use the v1.1.6 tag.
as latest means to be the dev branch.
quay.io/ydrag0n/streambot:v1.1.6

@outerwinnie
Copy link
Author

Use the v1.1.6 tag. as latest means to be the dev branch. quay.io/ydrag0n/streambot:v1.1.6

I have just tried that version and it has the same issue:
imagen

@ysdragon
Copy link
Owner

Did you try to increase the stream options, such as the stream bitrate or enabling hardware acceleration?

@outerwinnie
Copy link
Author

outerwinnie commented Jan 10, 2025

Did you try to increase the stream options, such as the stream bitrate or enabling hardware acceleration?

I did increase the stream bitrate to 3000, but it doesn't make a difference (in YouTube videos), it's like the bot is not applying that bitrate when playing YouTube videos or are playing them in low resolution (480p or something like that).

I didn't enable hardware acceleration as I thought it wasn't supported in Docker. Is it supported? Is there a way to check if it's working?

Thanks!

@ysdragon
Copy link
Owner

I think this issue is related to ytdl-core, as it is limited to fetching a maximum quality of 360p for some videos, though this limitation does not apply to live videos.
I will look for a solution later to use ytdlp instead.

@ChamseddineDz
Copy link

Yt-dlp will result in the same result, there's inconsistency in the "resolution" chosen and idk why, even if you tried to use -f best/ba+bv, ( best will result in the highest available merged format, maybe 720 480 360 1080, depends, but ba+bv will give highest video resolution and audio bitrate, but needs a bit of merging on the fly ). Hope it helps!
@ysdragon

@ysdragon
Copy link
Owner

Yes, i will use merged formats (highest available video + highest available audio).

@ChamseddineDz
Copy link

ChamseddineDz commented Jan 20, 2025

Yes, i will use merged formats (highest available video + highest available audio).

This will work, but i do guess that it will need more resources?
Because transcoding on fly is a bit of headache

@ysdragon
Copy link
Owner

but i do guess that it will need more resources?

Yes, it will require resources depending on the parameters of each video.
Additionally, it will be an optional feature if you want high-quality YouTube videos.

@ChamseddineDz
Copy link

but i do guess that it will need more resources?

Yes, it will require resources depending on the parameters of each video. Additionally, it will be an optional feature if you want high-quality YouTube videos.

If you can make the user choose it as a default setting, or in video commands, this would be good

Repository owner deleted a comment from Marco5dev Feb 1, 2025
@vovanhau123
Copy link

but i do guess that it will need more resources?

Yes, it will require resources depending on the parameters of each video. Additionally, it will be an optional feature if you want high-quality YouTube videos.

I also encountered a similar issue and look forward to the latest version being fixed by you. I would like to suggest a method for retrieving the token with the following code, as it is simpler and faster (webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m).find(m=>m?.exports?.default?.getToken!==void 0).exports.default.getToken() Maybe I will fix it

@ysdragon
Copy link
Owner

but i do guess that it will need more resources?

Yes, it will require resources depending on the parameters of each video. Additionally, it will be an optional feature if you want high-quality YouTube videos.

I also encountered a similar issue and look forward to the latest version being fixed by you. I would like to suggest a method for retrieving the token with the following code, as it is simpler and faster (webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m).find(m=>m?.exports?.default?.getToken!==void 0).exports.default.getToken() Maybe I will fix it

It's already in the wiki and works perfectly!
https://github.com/ysdragon/StreamBot/wiki/Get-Discord-user-token#3-open-browser-devtools-and-run-the-code-discord-console---ctrl--shift--i

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