riolubruh / YABDP4Nitro

Yet Another BetterDiscord Plugin for Nitro features. Unlock screensharing modes, use cross-server and gif emotes and much more!
Other
732 stars 141 forks source link

[BUG] Screen share lag #181

Closed FoGTeR closed 2 months ago

FoGTeR commented 5 months ago

When the plugin is enabled, the screen demonstration lags. Severe freezes

riolubruh commented 5 months ago

A few questions: What resolution and fps are you streaming at? What bitrate are you streaming at? and what are your computer specs?

Melanderz commented 5 months ago

Can confirm that i have problem with lagging and kinda skipping while screensharing, do not matter what resolution or fps i´m doing but it goes away as soon i turn off the plugin.

riolubruh commented 5 months ago

I did experience a bit of skipping myself actually while I was screen sharing recently, now that I think about it. I'll try to figure out what code is causing it.

3941 commented 5 months ago

As long as you don't touch custom bitrate/fps or anything like that, streaming is just fine. I'm starting to believe they limited it server side and that's it. No more screwing around. You still get more bitrate on boosted/community servers, apparently.

Omniphantasm commented 2 months ago

Can confirm I got this issue as well and its bad

If I screenshare on Vanilla Discord it's perfectly fine no FPS issues. If I try to screenshare with YABD it'll work fine but entirely randomly it will suddenly drop framerate to like 2-5 FPS for 5-30 seconds before going right back to 144 FPS. This sporadic framerate issue continues until I log out and back into my Windows account at which point the FPS is perfectly fine unless I try to stream again at which point the sporadic issues return.

This doesn't happen if I use OBS to stream to Twitch at the same res/framerate though so seems to be something directly related to this plugin since its only one I'm using.

3941 commented 2 months ago

You can stream 144fps on vanilla? (you shouldn't, btw... that's crazy... 144fps video streams aren't really a thing)

riolubruh commented 2 months ago

Yeah FPS's that high are way too much for Discord to handle. Reminder that discord streaming is only designed with a max of ~60fps in mind. There's probably not much I can do as a plugin developer to prevent screen share issues if the users are the ones setting the options to absurd levels. Keep your bitrates, framerates, and resolutions realistic and Discord will behave. This issue mostly serves as a warning for people to not go crazy with the settings.

Omniphantasm commented 2 months ago

nono, You misunderstand. I'm not streaming the game at 144fps/1440p. I'm using the basic stream settings and just clicking 1080p/60FPS like it's vanilla Nitro.

Thing is it was fine until like the past month or so it's only recent that suddenly out of nowhere while Streaming/After I've streamed my framerate will randomly drop down to 2-5 FPS for 5-30 seconds at a time before returning back to the expected 144 FPS. The issue persists until I logout from Windows account and will immediately return the second I stream on Discord again.

Not sure what changed or when but it's 100 percent something that either changed with plugin or that Discord themselves fucked up with a recent update. If I do the exact same steps for streaming on a Vanilla account it doesn't have the issue which is why its so damn weird.

3941 commented 2 months ago

Hmmm... I do know that streaming high source framerates can be an issue for streams. Depending on the game, you might wanna limit your FPS. But the issues are usually with the stream, not the game, getting choppy. In general, not just Discord, so with OBS, too.

I don't really stream games. Mostly just movies for a small community (we do a movie night every week). And I don't have any issues with YABDP4Nitro (as long as I leave custom settings alone and only use the Nitro quality option). Streams are smooth and so is everything on my end. But I'm also not running my system at its limits, which high fps gaming will do to most systems.

Are you maybe streaming AV1 on one and h264 on the other? Also maybe try just streaming with BD, but with a disabled YABDP4Nitro. The thing is, I don't think @riolubruh has touched the stream parts of the plugin in a long while, so I doubt anything changed there.

Omniphantasm commented 2 months ago

Yeah I dunno, its just an issue that suddenly cropped up for me. Before a month or so ago it was working flawlessly. Now literally any game even if its something as simple as Resident Evil 5 which my system should be able to run like 5-6 copies of with no issue will just randomly tank framerate.

As for encoding I've tried the various ones on OBS and never run into the same issue. Maybe I just got a messed up install of Discord or something and need to wipe it entirely/reinstall it. Its only games that cause the issue though, I can stream movies/TV/Desktop just fine. Second I do a game though it just kills the framerate for the whole system, even if I alt tab out my mouse is a chunky mess at random intervals like my whole system is overloaded which is frankly impossible on my system.

Probably just some weird damn bug I've ran into.

riolubruh commented 2 months ago

Indeed, not much has changed on the plugin's end for quite some time. I think issues like this only started appearing after I made some changes to how quality ladders work, though. Maybe that's part of the issue?

riolubruh commented 2 months ago

Attached is a version of YABDP4Nitro with all changes to the ladder commented out. Please try this version and let me know if it helps the issue. Note that you may need to refresh/restart the client for changes to take effect. YABDP4Nitro.plugin.zip

Omniphantasm commented 2 months ago

With a cursory test of about an hour of gameplay on Jusant where it was happening the most consistently and frequently I haven't had it happen since tossing that one in and streaming for about an hour. I'll update if it does happen again but so far so good.

Edit: Had it happen once today during Valo but that was right as I alt tabbed and only lasted like a couple seconds so may not have been that. Didn't happen again over 3-4 hours of play/streaming. I'll stream more tomorrow and see what happens.

riolubruh commented 2 months ago

(Newest update shadow dropped the removal of the ladder changes)