Using Millicast WebRTC with Simulcast

Overview

What’s Simulcast and why you may want it.
Simulcast is a mechanism in WebRTC by which a device/client/user will be sending a video stream that contains multiple bitrates in it. The quality of the viewers stream will be determined by network conditions or device type.

With simulcast, a WebRTC client will generate these multiple bitrates, where each offers a different video quality – the higher the bitrate the higher the quality.
These video streams are then received by the SFU, and the SFU can pick and choose which stream to send to which participant/viewer. This decision is usually made based on the available bandwidth, but it can (and should) make use of a lot of other factors as well – display size and video layout on the viewer device, CPU utilization of the viewer, etc.
The great thing about simulcast? The SFU doesn’t work too hard. It just selects what to send where.

This guide will help you set up Millicast simulcast feature with our web based publisher and OBS WebRTC

Resolution and bitrate

The publisher can select the COG to manually set the highest quality resolution and bitrate.

Setting Millicast Publisher to use Simulcast

You have already created your first stream label and can find additional help here.

  1. Select>Broadcast>COG
  2. Select>Simulcast>On
  3. Select>Bandwidth>Custom>6000
  4. Enter Width>Height>FPS and Update

In this example you will be sending a high quality stream with levels and you will want to ensure you have adequate bandwidth. The server will send out multiple levels or bitrates from the incoming stream. SFU will then determine the correct level or bitrate and resolution based on the device or available bandwidth.

The following example will be using codec H.264 with a bit rate high enough to fulfill the multiple levels with a high quality stream.

You are now ready to send your live stream and can select the start button.

Viewing

You started your live stream and can select the share button to launch your Millicast viewer.
You can now select the COG button on the bottom right of the player to view the streaming levels.
Viewers will receive the highest quality stream, based on these variables.

  • The stream quality sent by the sender.
  • The stream quality requested by the receiver.
  • The stream quality estimated based on the receiver's available bandwidth.
    In addition viewers can use COG on the bottom right of the player to view and select the streaming levels.

On the Millicast viewer you can also see each bitrate throughput by selecting a quality level and media stats with the COG. The image is showing the high quality selected with a video bitrate at 3.72 Mbps with the resolution sent at 1080p.

Setting OBS-WebRTC up to use Simulcast

Download and install the free Millicast WebRTC version of OBS from your Millicast portal or download it here.
Additional help can be found here Using OBS with Millicast.
You will need your stream name and token from your Millicast stream label created in the portal.

1 Start OBS WebRTC and select Settings>Stream.

  1. Enter your Millicast Stream Name and Publishing Token.
  2. Select codec h264.
  1. Select the Advanced Settings button and check Simulcast.
  2. Apply your settings.

Next we are going to set the output settings in OBS:

  1. Select Output and set the Output Mode to Advanced.
  2. Encoder (if available) NVIDIA NVENC H.264
  3. Rate Control> CBR
  4. Bitrate> 6000 Kbps>OK

Additional options can be applied and here we will be matching the Base Resolution to your Output Resolution.

You are now ready to start your stream.

Viewing

You can now open the Millicast viewer and select the COG to view the multiple bit rates.
Here, in this image, the medium quality is selected with a smaller bit rate and resolution.

Video

Here is a video showing the simulcast playback using the Millicast hosted viewer that is built on the Millicast Javascript SDK:


Did this page help you?