Wowza Community

WebRTC Optimise for Latency


We have a self hosted Wowza Streaming Engine. We’ve built an application that you can think of as “just another web conferencing tool” ;-). WebRTC is published from a browser to the WSE, and that stream is then consumed over WebRTC by a different browser.

We’re seeing browser-to-browser latency of about 1 to 2 seconds. That’s ok - but we want it to go faster.

I’m aware of a number of optimisations within the WSE for buffer size and flushing - to reduce the latency of (for example) transcoding. However, I can’t find any reference to similar optimisations for WebRTC.

So firstly, can I optimise the buffer for WebRTC? and if so, how?
And secondly, are there any other optimisation suggestions for this workflow?


Hi @Simon_Haywood1, I’ll see what I can put together for a webrtc optimization article, but in the meantime, you could try adjusting your audio and video bitrates in the encoder and check the quality until you find the right balance. Another suggestion is to try UDP vs TCP as the Ice candidate (if you have TCP listed as first priority and UDP second).

Good suggestion. I’ll try UDP.

Are there any buffer-like settings I can tweak?


Yes! Webrtc does not like B-frames and that is something that can be disabled in the encoder settings. If you encode with H.264 Main or High profile, the stream will contain B - frames .WebRTC protocol which is developed for low latency would not be able to handle B-frames which are dependent to other later frames and it will cause jittering.

WebRTC sacrifices B-frames from the GOP structure to enable real-time delivery, which can impact quality.

We actually suggest UDP for WebRTC over TCP- it’s a bit faster and in Firefox browser, TCP is not supported with WebRTC.

And if you use UDP, make sure to enable Nack in Wowza (currently not enabled by default). It will help to compensate packet loss by requesting missed packets from the publisher. Instructions to do so on this page (search for Nack):

1 Like