Can we make a SFU using WebRTC API

611 views
Skip to first unread message

Vincent Bian

unread,
Mar 15, 2018, 6:51:17 AM3/15/18
to discuss-webrtc
Hi,

Does anyone develop SFU application with current WebRTC native c++ API? Thanks.
As I think current WebRTC  only offer API  with  original video frame not encoded  video stream.  Should we have plan to add interface that can support SFU application.

Regards,
Vincent


Günter Berner

unread,
Mar 15, 2018, 7:09:10 AM3/15/18
to discuss-webrtc
Hi,

what is "SFU"?

Regards,
Günter

Harald Alvestrand

unread,
Mar 15, 2018, 7:14:59 AM3/15/18
to WebRTC-discuss
SFU = Selective Forwarding Unit - something that forwards only part of the media packets sent to it.

There are opensource SFUs available (jitsi, meetecho?) - some of them are used in the tests run inside the KITE test framework.


--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/8b5df46e-92b6-4de6-9631-8367c47ba4ed%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Brant Jameson

unread,
Mar 15, 2018, 4:10:42 PM3/15/18
to discuss-webrtc
As Harald mentioned, there's a couple of opensource SFUs available.  To my knowledge the best ones are Jitsi and Janus.

Jason Thomas

unread,
Mar 16, 2018, 11:29:01 AM3/16/18
to discuss-webrtc
Not without alteration.

Internally WebRTC's internal audio/video pipelines are directly tied to encoder/decoders.

PeerConnectionFactory allows you to provide a video decoder/encoder factory, so you can short circuit the logic here, and grab the encoded frames, mock up a stream, and feed them directly into it as a relay, creating a new PeerConnection and setting those streams onto it.

The audio end is more difficult. There isn't a codec factory, so you will have to short circuit the logic there probably by alteration of libwebrtc.

The final question is RTCP termination, and how to override the mechanisms for quality/bandwidth control to not create a "One goes out, they all go out." situation.

Since libwebrtc will be the SFU, it will receive RTCP feedback from its remote peer for the content it is proxying, and vice versa.

For a 1-1 situation, it needs to be able to forward the RTCP feedback to the remote peer.

For multipoint, it needs to perform some logic to determine if one of the peers is problematic, and stop sending it video, switch off its video feed, or attempt to switch to a lower bitrate video stream. Basically it needs to act as a conduit that attempts to predict why/how packet loss is occurring, and keep as many audio/video feeds operating normally at at the highest possible quality for each peer.

How exactly to hijack the RTCP feedback mechanisms in libwebrtc, I think that again will likely require some customization/hooks into libwebrtc.

- Jason Thomas.

Vincent Bian

unread,
Mar 16, 2018, 9:28:33 PM3/16/18
to discuss-webrtc
Thanks.

To bypass video encoder, I should provide a fake encoder. How can I feed encoded video to the fake encoder, which interface to call without alteration of  libwebrtc. Should I provide a fake video capture too?

For SFU, audio can be processed just like MCU(audio mixing), need not forward, I think.
Reply all
Reply to author
Forward
0 new messages