WebRTC One To Many

3,658 views
Skip to first unread message

عرفان آذری راد

unread,
Apr 11, 2019, 8:43:23 AM4/11/19
to discuss-webrtc
hey lads
I need to implement a live streaming like youtube live (one to many)

I tried recording user camera in browser and sending it to server and then stream it from server to other clients who wanna watch it, but it seems there is no cross-browser and efficient way to do this (MediaRecorder works but not only it has lots of incompatibilities,. its support, especially across IOS devices is terrible)

now the only way in my mind is to use webRTC in a way that when a user wants to share his camera in live mode, a webrtc p2p connection is established between user and server, then server gets the stream in webrtc and forwards it to others (not sure to use webrtc here again or file streaming), looks pretty fine but I'm wondering if it will be possible for server to get lots of webrtc connections and media at the same time or if there will be any other problem that make this impossible or even anything that will affect the quality and performance 

any help is keenly appreciated 

thanks

hieu...@tamdongtam.vn

unread,
Apr 11, 2019, 9:23:14 PM4/11/19
to discuss-webrtc
Did you know this page:
https://www.webrtc-experiment.com/docs/
Take a look at this :D

عرفان آذری راد

unread,
Apr 12, 2019, 7:32:45 AM4/12/19
to discuss-webrtc
Thank you but yeah,  I know these all
I'm looking for some way to stream user media to server and then stream it from server to specific users
the p2p mesh or MCU usage is not my case
I wanna use a normal server to get and forward streams
more clearly, get user media, send it to server, get it on server, stream to users(not all of them)
It seems MediaRecorder  might be able to do this (however not sure about quality) but it has a very low browser support
actually I wanna know what exactly youtube use for live streaming or something easier which can do the same task

Christoph Eggert

unread,
Apr 13, 2019, 4:38:07 AM4/13/19
to discuss-webrtc
What you are looking for is an SFU if you want to go with WebRTC - a central server that users connect to via WebRTC and that just relays a stream to any interested party, so basically what you described. I personally can recommend mediasoup if you want to host this yourself, it's super light-weight with minimal performance requirements, extremely easy to use, and the devs usually give very quick feedback for questions. Third version of it is already available which is even more optimized for use cases like yours (though not documented yet) - offering ways for better load balancing etc. 

However, depending on the amount of participants you want to reach, there are probably better solutions for a mere live streaming use case, as WebRTC is focused on actual conferences where everyone potentially participates and not live streams like on Youtube or Twitch or whatever (I do not know which those would be though). I've seen a study that compared SFU solutions and even the better ones usually struggled starting with about 300 participants in general to still offer an optimal experience. I could imagine that mediasoup v3 will be able to break this with the new additions, but that's all just in theory and I'm not aware of any statistics yet how far this can go.

عرفان آذری راد

unread,
Apr 13, 2019, 7:47:36 AM4/13/19
to discuss-webrtc
thanks bro
really helpful

عرفان آذری راد

unread,
Apr 13, 2019, 7:47:38 AM4/13/19
to discuss-webrtc
thanks bro
really helpful

On Saturday, April 13, 2019 at 1:08:07 PM UTC+4:30, Christoph Eggert wrote:

Eric Davies

unread,
Apr 13, 2019, 1:38:07 PM4/13/19
to discuss-webrtc

There is a trick whereby you can have one person sending a webrtc stream to a few others, who in turn forward it to a bunch of others. The original version (I believe) was done by Muaz Khan (https://www.webrtc-experiment.com/), but I understand that David Critchley (https://ca.linkedin.com/in/davecritchley) has taken that concept and made it robust so that downstream users get reconnected if an upstream user drops out (I believe he made it open source but I don't know where it would be so talk to him). There will be varying amounts of latency of course depending on far downstream you were.

My personal suggestion would be to use HLS streaming which would involve sending video to server which chops it up into little chunks of mp4 files and provides them through a regular webserver which browsers then pulls them down in sequence, buffers and displays seamlessly. Then you just have the issue of being able to scale up a webserver. Look for HLS.js . Its easier than it sounds.

عرفان آذری راد

unread,
Apr 13, 2019, 4:46:26 PM4/13/19
to discuss-webrtc
cool
I'll check
thanks

Guy Mininberg

unread,
Apr 15, 2019, 5:01:46 PM4/15/19
to discuss...@googlegroups.com
Hi 
You can use existing library that gives you this service like opentok


--

---
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/cd6206ff-a2eb-43b6-9c23-09cae7574c6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

عرفان آذری راد

unread,
Apr 16, 2019, 8:00:29 AM4/16/19
to discuss-webrtc
yeah but they are expensive for me, it seems to be possible with a linux VPS and node.js on it, browser gets media with mediarecorder API, sends webm blobs to node, node.js creates dash and HLS from webm file and finally stream it to viewer browsers (however stll I have no Idea how to handle dash and hls when new blobs come from webcam) 
if this method has any major problem, please mention 
thanks
To unsubscribe from this group and stop receiving emails from it, send an email to discuss...@googlegroups.com.

Eric Davies

unread,
Apr 16, 2019, 10:43:06 AM4/16/19
to discuss...@googlegroups.com
>  (however stll I have no Idea how to handle dash and hls when new blobs come from webcam) 
Thats what you use the hls.js for.

You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/JZh0Eqwj3x4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/c5af6247-18a2-45bd-b0b6-5e896a934507%40googlegroups.com.

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


--
Eric Davies

leeoxiang

unread,
Apr 16, 2019, 11:14:45 PM4/16/19
to discuss-webrtc
it is doable,  you can transcode webrtc to hls.  

see my demo   https://github.com/notedit/media-server-go-demo/tree/master/webrtc-to-hls

在 2019年4月16日星期二 UTC+8下午8:00:29,عرفان آذری راد写道:

عرفان آذری راد

unread,
Apr 22, 2019, 4:34:28 AM4/22/19
to discuss-webrtc
thank you all guys
finally found some way to solve the problem
great thanks to Nginx, I installed and configured Nginx RTMP so that it communicates with my node.js server and I have full control over streams, that's great and works pretty fine
now my users can use RTMP streaming clients to send video to my servers
the great advantages of RTMP are its full support over all devices (there are free RTMP streaming clients for all kinds of OS on all devices), compatibility with the one and only OBS which is great for live streaming, it creates HLS and Dash manifest and segments automatically and another cool benefit is that it is also compatible with netcams
WebRTC is great for real time one to one chat but in one to many (one-directional) situations where a delay of few seconds is nothing important, it fails, why should I use WebRTC for this when RTMP exists

Alexandre GOUAILLARD

unread,
Apr 22, 2019, 8:51:13 AM4/22/19
to discuss...@googlegroups.com

--

---
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/1c68eda1-94be-430c-a2d9-b15295803813%40googlegroups.com.

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


--
Alex. Gouaillard, PhD, PhD, MBA
------------------------------------------------------------------------------------
President - CoSMo Software Consulting, Singapore
------------------------------------------------------------------------------------

عرفان آذری راد

unread,
Apr 22, 2019, 11:22:38 AM4/22/19
to discuss-webrtc
as I understood after skimming generally, the reasons against RTMP where totally against using RTMP to deliver streams to users but as I mentioned, I use RTMP to deliver streams from recorder client to server and HLS (and dash if supported) to deliver streams from server to player clients
but about this part in the link you give:
"RTMP does not elegantly support advanced resolutions, in part due to lack of HEVC support but also because RTMP cannot be used at high bitrates due to bandwidth limitations"
what resolutions are considered as advanced and will this also affect the model I use (RTMP for recorder to server and HLS fro server to player) ?
thanks

On Monday, April 22, 2019 at 5:21:13 PM UTC+4:30, Alexandre GOUAILLARD wrote:
‪On Mon, Apr 22, 2019 at 3:34 PM ‫عرفان آذری راد‬‎ <webac...@gmail.com> wrote:‬
thank you all guys
finally found some way to solve the problem
great thanks to Nginx, I installed and configured Nginx RTMP so that it communicates with my node.js server and I have full control over streams, that's great and works pretty fine
now my users can use RTMP streaming clients to send video to my servers
the great advantages of RTMP are its full support over all devices (there are free RTMP streaming clients for all kinds of OS on all devices), compatibility with the one and only OBS which is great for live streaming, it creates HLS and Dash manifest and segments automatically and another cool benefit is that it is also compatible with netcams
WebRTC is great for real time one to one chat but in one to many (one-directional) situations where a delay of few seconds is nothing important, it fails, why should I use WebRTC for this when RTMP exists


On Thursday, April 11, 2019 at 5:13:23 PM UTC+4:30, عرفان آذری راد wrote:
hey lads
I need to implement a live streaming like youtube live (one to many)

I tried recording user camera in browser and sending it to server and then stream it from server to other clients who wanna watch it, but it seems there is no cross-browser and efficient way to do this (MediaRecorder works but not only it has lots of incompatibilities,. its support, especially across IOS devices is terrible)

now the only way in my mind is to use webRTC in a way that when a user wants to share his camera in live mode, a webrtc p2p connection is established between user and server, then server gets the stream in webrtc and forwards it to others (not sure to use webrtc here again or file streaming), looks pretty fine but I'm wondering if it will be possible for server to get lots of webrtc connections and media at the same time or if there will be any other problem that make this impossible or even anything that will affect the quality and performance 

any help is keenly appreciated 

thanks

--

---
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...@googlegroups.com.

عرفان آذری راد

unread,
Apr 22, 2019, 11:24:57 AM4/22/19
to discuss-webrtc
and about OBS for webrtc, yeah you're right but are there WebRTC compatible client apps for all OS and devices? 

Alexandre GOUAILLARD

unread,
Apr 22, 2019, 1:32:18 PM4/22/19
to discuss...@googlegroups.com
I never found a webrtc compatible client app for my Sega Genesis, or the QNIX operating system, nor amigaOS, so you are correct and the answer to your question, as written, is indeed:
No, there is no webrtc client app for ALL OS and devices.

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/e7dbad9e-7c5b-44dd-ac10-741b8a8c8364%40googlegroups.com.

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

عرفان آذری راد

unread,
Apr 25, 2019, 5:21:51 PM4/25/19
to discuss-webrtc
No need to go that far, no dummy gives a f*** to those you mentioned. just mention free and compatible webRTC clients for IOS, Android and windows and some server-side solutions
I'm really interested in webRTC but it does not seem compatible for my case

Alexandre GOUAILLARD

unread,
Apr 25, 2019, 7:25:44 PM4/25/19
to discuss...@googlegroups.com
I just answered your question the way you wrote it, in a polite and respectful way. If you want a more precise answer, ask a more precise question. 

Your language is uncalled for. Please stay respectful and use correct language on this mailing list at anytime.

Now, you do not seem to understand that webrtc, unlike flash or RTMP, does not mandate signaling. Practically it means that when it comes to RTMP the only thing you have to do is to point to an IP and a port and it connects. With WebRTC every single implementation will have a different way to establish the connection. By definition and by design, you CAN NOT have a generic webrtc client. Some see it as a feature, some see it as a bug, that's the way it is.

1. As early as 2014, some have compiled list of servers and services, including clients that supports webrtc. You can find one of those here:

2. Specifically for you question about one to many, you can check the following 4 vendors which achieve millions of viewers with webrtc with a quality, a latency, and a browser compatibility:
- red5 / ant live open source media servers
- limelight Networks (https://www.limelight.com/resources/tech-brief/realtime-streaming/) using modified red5 technology,
- phenixRTS.com
All those 4 had live demos at NAB 2019 a few weeks back in Las Vegas.

3. Or again, that discussion on Hacker News a few days back.

Those three items and list above appear on the top or a simple google request ......

Feel free to ignore all that, and do whatever you want.  This is a free world after all and this is your service. However I would strongly suggest not to jump to conclusion. The jump from "I did not find something" to "it does not exist" is not always logical. Sometimes, one just did not understand / miss something, or just did not find it.

Good Luck



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/dabaaeb0-ecf6-450c-bb3b-e6b40f753f54%40googlegroups.com.

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

عرفان آذری راد

unread,
Apr 26, 2019, 7:04:49 AM4/26/19
to discuss-webrtc
first of all, I never said there is no way if you read my posts, you'll see
and about my words, I had no purpose, it's just the way I talk, sorry if bothered you
and about webRTC, I have understand it completely, tested it, implemented it, and even tested with STUN and TURN servers,I know webRTC has no standard for signalling and leaves it to us to do however we want, so don't judge before asking 
from the word client, I mean some app to communicate signalling stuff with server and establish a webrtc connection to server (send user media to server), and from the words 'server-side solutions' I mean some open source written server-side programs or some way to write such a thing to get webRTC media and forward it to others
and before you judge again and say 'IT SEEMS YOU DO NOT KNOW ABOUT webRTC' I should mention that I know webRTC can function without need for 'server to forward media' and the recorder can send media directly to all those watching media (in a P2P mode) but this is really foolish for a live broadcast cause it will lead to uncontrolled bandwidth usage for recorder and clearly will fail
and I also know I can use MCU or SFU but as I have mentioned before, I need something completely free which MCU or SFU does not seem to be (no need to mention Asterisk)
so with these all in mind, I think there is no doubt that RTMP is the best (with HLS for playing) and webRTC will fail
as you mentioned you're free to ignore but explain and bring reasons to reject, do not try to just constrain your idea with some bombast language which is impolite
thank you for your help

Lorenzo Miniero

unread,
Apr 27, 2019, 1:41:30 PM4/27/19
to discuss-webrtc
If you say that there is no free MCU or SFU, then Alex is right, you didn't do your homework: you may think you did, but you didn't. That said, your attitude is completely unacceptable in a community like this, so I would consider a change of tone in your next posts if you still want help from people here.

Lorenzo
Message has been deleted
Message has been deleted

عرفان آذری راد

unread,
Apr 27, 2019, 4:57:48 PM4/27/19
to discuss-webrtc
maybe you should consider your tone much more
someone who comes here is not looking for some teacher to check homeworks
and I did not say there is no free MCU or SFU, totally RTMP is much cheaper and easier to use, at least until webRTC becomes more handy for these cases
I no more need your help by the way
great thanks to those who helped
good luck
Reply all
Reply to author
Forward
0 new messages