-
-
Notifications
You must be signed in to change notification settings - Fork 574
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
Streaming to multiple users results in high CPU usage #160
Comments
Yes, the user that shares their screen will encode, encrypt and upload the video stream for each connected user. The CPU usage can be optimized by reducing the frame rate or resolution (#84). Screego could also take responsibility for distributing the videostream, meaning the user that shares will upload the stream to screego, and screego forwards it to all connected users. |
Am I understanding this right that screengo encodes the video for every viewer instead of just once? |
I cannot say for sure, because this is done in the browser implementation of WebRTC, but I'd expect it is encoded for every viewer. Basically, screego obtains a MediaStream via MediaDevices#getDisplayMedia and then forwards this stream via RTCPeerConnection#addTrack. When both peers do the WebRTC handshake, they choose a codec they both support. This means if the video is streamed to multiple peers which support different codecs, the browser has to encode it multiple times with different codecs. If the browser is smart is enough to cache the encoded stream, when another peer uses the same codec I don't know, but given the high cpu usage I'd expect it's encoded again. |
It is true. We test it in our lab, when multiple user connected, the share screen pc almost freezed. If there are any way to fix it? |
Currenty not, you can use Jitsi or another sharing tool, they proxy the traffic through the server, so the one that shares the screen doesn't have to encode the video multiple times. |
Using other sharing tools,Can you provide an example or link |
Hello,
I noticed when I am streaming to multiple users that my CPU usage grows proportionally, when I stream to 6 People my CPU is at 100%.
Is it possible that the stream needs to be encoded and encrypted for every viewer?
Is there anything I can do to optimize this?
Kind Regards,
Chris
The text was updated successfully, but these errors were encountered: