CoSMoSoftware / OBS-studio-webrtc

This is a fork of OBS-studio with generic support for webrtc. It leverages the same webrtc implementation most browsers use.
http://www.cosmosoftware.io
GNU General Public License v2.0
587 stars 131 forks source link

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

Open lizardpeter opened 3 years ago

lizardpeter commented 3 years ago

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

ludocosmo commented 3 years ago

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