Re: Single video encode for one-to-many broadcast

241 views
Skip to first unread message
Message has been deleted

Eric Davies

unread,
Oct 18, 2018, 2:29:32 PM10/18/18
to discuss-webrtc
Webrtc does peer to peer encryption, so you are always going to have encryption costs for each outgoing channel.
If I remember correctly, the video encoding is done on a per peer connection basis (you can specify different bitrates and codecs in the sdp after all) so unless they've managed some clever optimising, you are going to get encoding costs for each outgoing channel.
I would suggest that WebRTC isn't a good fit for what you are trying to do.

On Thursday, October 18, 2018 at 3:40:07 AM UTC-7, Chris Morris wrote:
I need to broadcast a VP8 video stream from one peer to many using a single bitrate video encode, without using a media server. At the moment, the video is encoded for each connected peer causing high CPU usage.

It seems one option is to run an SFU locally, but this seems overly complicated when all I need to do is forward the same stream to all connected peers.

I am using native C++ webrtc. Is this possible?

Lorenzo Miniero

unread,
Oct 19, 2018, 4:26:05 AM10/19/18
to discuss-webrtc
You most definitely need a server, for the reasons Eric listed. But since it's just going to relay media around, it's going to be a lightweight component. If you're not bound to use libwertc directly, you can have a look at the Streaming plugin in Janus, which is the component we implemented to do exactly what you refer to, one-to-many WebRTC broadcasting.

Lorenzo

anil2...@gmail.com

unread,
Oct 19, 2018, 5:03:29 AM10/19/18
to discuss-webrtc

one encoder  instance can be shared, this can be done by implementing encoder factory and encoder (encoder wrapper)
Encoder factory design has to be made in such a way it keeps giving same encoder instance.
this design requires handling of encoder destruction support like ref counted mechanism.

However, this implementation has draw back, as encoder setting for a peer connection will be applied for all the peers.
Even same would be the case of feeback "bitrate change" for peer encoder, etc.

Harald Alvestrand

unread,
Oct 19, 2018, 8:32:25 AM10/19/18
to discuss...@googlegroups.com
if you have plenty of time and tolerance for lag, you can run your video through a MediaRecorder and send out the resulting data over DataChannel.

The reason why WebRTC defaults to encoding once per PeerConnection is that the encoder needs to adapt to the available bandwidth; if you are sending to several peers simultaneously, and they don't get congested at the same time, this makes life complicated if you're using a single encoder.


--

---
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-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/bdd25dd2-35ab-4e1e-a7df-01e615943aec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages