Closed jpdisco closed 1 year ago
Could you share the logs (put path to webcord.exe
in cmd.exe
and pass --verbose
as an argument)? I would like to see if there are any errors logged by Chrome engine.
I have searched the repository and cannot find information about hardware encoding with WebCord.
Yeah, GPU optimizations within the settings are most likely functional (experimentally, using flags, as long as there's a VA-API within the driver) on Linux, but these might do very little on Windows as I assumed Chrome will actually support hardware encoding out-of-the-box on Windows with the appropriate driver, so will do Electron. If that doesn't happen, I dunno I can do anything about it, I'm not experienced about Chrome issues with Windows as much as with Linux. And there's basically no toggle like you see in Discord's settings that I could use to guarantee hardware encoding is there, there might be an option to disable hardware acceleration but I guess it is normally enabled in the same way as it is in Chrome.
Take a note I didn't updated WebCord for some time, there's a chance both newer and older versions of Electron (and therefore of Chrome/Chromium engine) might work better on your hardware. There's also a chance that on different version of the driver hardware acceleration will work better – for some time I've actually experienced engine crashes around GPU process within Chrome/Electron due to a bug in driver and I was on NVIDIA as well (except I was on Linux). Driver update fixed it for me somehow, so you might try that on Windows as well.
So to summarize this, hardware acceleration is not easy and it never was on any of the browsers. I might close this issue ticket as I have nothing to do with it broken, it is more an issue within Chrome or maybe even the driver itself. Hopefully you still find my message rather helpful.
I'll try to play around with different electron versions and hopefully I can get something to work (I don't really know what I'm doing tho 😅).
Thanks for your response, I definitely understand that hardware acceleration is hard, I never managed to get it working when I used linux.
Here are the logs, I didn't notice anything interesting
A little bit of research suggests that discord uses their own native WebRTC libraries for hardware accelerated video encoding. This makes sense because it does not appear to work in any browser I tried and discord has an explicit toggle for it in voice and video settings. It would probably be hard to replicate their implementation unless Electron does it themselves.
I also experience this on linux. Doesn't seem like a webcord only problem either I have the issue on discord-screenaudio also.
Chrome 113+ has working hardware-accelerated video encoding on Linux with Intel graphics (NVIDIA doesn't support VA-API, AMD's VA-API driver is unsupported by Chrome currently). You need to pass the flag --enable-features=VaapiVideoDecodeLinuxGL,VaapiVideoEncoder,VaapiLowPowerEncoderGen9x
(the last feature is optional), this should be functional in Electron 25 when it's released.
I tested it with the Discord web client and confirmed it used my GPU for encoding in the background with CPU usage being reduced a fair bit.
Aknowledgements
[X] I have checked that there is no other issue describing the same or similar problem that I currently have, regardless if it has been closed or open.
[ ] This bug affects Discord website.
[ ] This issue is confirmed to be reproduceable when WebCord is packaged on at least all three latest supported Electron major releases.
[ ] This issue is reproduceable in Chrome, Chromium or any Chromium-based browser, e.g Brave or Edge (please write in Additional Context which browser you have used if it is neither Chrome nor unmodified Chromium).
[X] There are no fixes done to
master
which resolves this issue.[X] My issue describes one of the unstable and/or not fully implemented features.
[ ] I have found a workaround to mitigate or temporarily fix this issue in affected releases (please write it in Additional context section below).
Operating System / Platform
🪟️ Windows
Operating system architecture
x64 (64-bit Intel/AMD)
Electron version
22
Application version
master
Bug description
The screenshare performance when streaming (viewing is fine) with WebCord is very bad for me. The framerate is less than 1 fps when streaming a game but the official Discord client streams well and it looks smooth. Task manager suggests WebCord is not using hardware encoding. When playing a game my CPU may not be powerful enough to encode so the framerate drops, but when hardware encoding it is fine. I have searched the repository and cannot find information about hardware encoding with WebCord.
Additional context
NVIDIA GPU Using WebCord GPU optimize feature