WebRTC Video Broadcasting

HOME © Muaz Khan . @WebRTCWeb . Github . Latest issues . What's New?

How it works?

  1. It broadcasts media in one-way direction over number of peers.
  2. All peers can view/watch/listen the broadcast, anonymously.
  3. "Anonymously" means viewers will NEVER be prompted to allow webcam or mic or screen.
  4. Assume like a radio station inside the browser. Remember, it works only browser-to-browser.

Latest Updates


Enter your email too; if you want "direct" reply!

How it works?

It is one-way broadcasting; media stream is attached only by the broadcaster.

It means that, if 10 people are watching your one-way broadcasted audio/video stream; on your system:

  1. 10 RTP ports are opened to send video upward i.e. outgoing video
  2. 10 RTP ports are opened to send audio upward i.e. outgoing audio

And on participants system:

  1. 10 RTP ports are opened to receive video i.e. incoming video
  2. 10 RTP ports are opened to receive audio i.e. incoming audio

Maximum bandwidth used by each video RTP port (media-track) is about 1MB. You're streaming audio and video tracks. You must be careful when streaming video over more than one peers. If you're broadcasting audio/video over 10 peers; it means that 20MB bandwidth is required on your system to stream-up (broadcast/transmit) your video. Otherwise; you'll face connection lost; CPU usage issues; and obviously audio-lost/noise/echo issues.

You can handle such things using "b=AS" (application specific bandwidth) session description parameter values to deliver a little bit low quality video.

// removing existing bandwidth lines
sdp = sdp.replace( /b=AS([^\r\n]+\r\n)/g , '');

// setting "outgoing" audio RTP port's bandwidth to "50kbit/s"
sdp = sdp.replace( /a=mid:audio\r\n/g , 'a=mid:audio\r\nb=AS:50\r\n');

// setting "outgoing" video RTP port's bandwidth to "256kbit/s"
sdp = sdp.replace( /a=mid:video\r\n/g , 'a=mid:video\r\nb=AS:256\r\n');

Possible issues:

  1. Blurry video experience
  2. Unclear voice and audio lost
  3. Bandwidth issues / slow streaming / CPU overwhelming

Solution? Obviously a media server or remote-stream-forwarding!