OBS-studio-webrtc icon indicating copy to clipboard operation
OBS-studio-webrtc copied to clipboard

Potentially modify buffer sizes to reduce stuttering and performance issues on WebRTC

Open lizardpeter opened this issue 3 years ago • 1 comments

Hello,

I have some information that might help to improve WebRTC performance. I have been doing a lot of testing due to my need to get WebRTC working well at very high bitrates like 50000 kbps or higher and at high frame rates like 120 FPS or higher. I have what I would call almost a hard cap of around 25000 kbps with OBS WebRTC. No matter what I do, the stream starts to stutter if more bits are pushed.

However, I have done some testing with GStreamer on Linux and have managed to easily push upwards of 50000 kbps by modifying the UDP buffer size globally. Unfortunately, on Windows it seems like these values have to be implemented by the developer on newer versions of Windows (which I supposes is a better way to do it since it doesn't affect all programs). Can you developers look into increasing this UDP buffer or, better yet, allowing the user to customize it? I think this might solve the performance issues.

Thanks, Peter

lizardpeter avatar May 27 '21 20:05 lizardpeter

Hi Peter, Thanks for the information. On WebRTC library version m90, the outgoing socket buffer size is set to 65536 (value of constant kVideoRtpSendBufferSize). There is an experimental feature on Chromium browser to let the user set the outgoing socket buffer size through the command line parameter "WebRTC-SendBufferSizeBytes". However, it is experimental on Chromium and not yet available for WebRTC library. Ludo

ludocosmo avatar Jun 23 '21 06:06 ludocosmo