sipsorcery icon indicating copy to clipboard operation
sipsorcery copied to clipboard

Buffering on the WebRTC

Open mateusz-osojca opened this issue 3 years ago • 3 comments

Is there any way to switch off totally buffering on the WebRTC side? Im using the H.264 under the hood with "zerolatency" option but anyways I think that jitter is comming to play on the WebRTC side and does some buffering. Software that I write requires real time even if under certain conditions we will have bad quality or loosing frames.

mateusz-osojca avatar Aug 19 '22 09:08 mateusz-osojca

There isn't any buffering going on this library. A jitter buffer has been deliberately ommitted and left up to the application (i've personally always found them to cause as many problems as they solve).

The only exception is the optional reorder buffer which isn't used unless ypur application explicitly requests it.

For video streams the RTP packets do need to be buffered until a complete frame is received but there's no way around that and the latency is between the start and end packets on a frame should be very low.

sipsorcery avatar Aug 20 '22 09:08 sipsorcery

How can I enable this reader buffer ? I am using PeerConnection and adding MediaStreamTracks but I don't see how to enable this buffer.

The reason of wanting to check it with this buffer is I am on troubles of receiving video with artefacts that looks fine before sending it, and wondering if the packets aren't arriving on right order..

forlayo avatar Dec 02 '22 12:12 forlayo

Ok I saw it, sorry:

pc.VideoStream.AddBuffer(TimeSpan.FromSeconds(2));

forlayo avatar Dec 02 '22 12:12 forlayo