Solution: WebRTC distribution - EyevinnOSC/community GitHub Wiki
Getting Started
This tutorial walks you through using Open Source Cloud for WebRTC based distribution in a standardized way. The solution is based on a single or multi-node distribution network of Symphony Media Bridges (SMB). SMB is an open source media server application that handles audio, video and screen sharing media streams in an RTC conference system. In combination with the SMB WHIP and SMB WHEP gateways available in Open Source Cloud the solution offers a standardized way for ingest and playback. Enabling the use of clients that is not tied to a specific media server.
The SMB distribution network is either hosted by yourself or managed by us a managed service. Contact our sales for more details on this option.
This solution is based on the following open source projects made available as a service:
And in this example we will use a Web WHIP client and Web WHEP player based on open source libraries developed by Eyevinn. For simplicity this example is also limited to a single-node distribution network.
Prerequisites
- If you have not already done so, sign up for an OSC account.
- 2 remaining services on your subscription plan or individually purchased the services included in this solution.
- Symphony Media Bridge SFU node online
Step 1: Create WHEP gateway
We will start by creating the WHEP gateway and before launching an instance we will create the secrets we need. Create two service secrets in the Symphony Media Bridge WHEP gateway service in the OSC web user interface.
smburl=https://smb-node1.example.org/
smbapikey=mysecret
Then we will create the WHEP gateway by clicking on the button "Create gateway" in the web user interface.
Then enter the following values in the create instance dialog.
Press the button Create and wait for the instance to be in status Running.
Copy to clipboard the URL to the instance.
Step 2: Create WHIP gateway
Next step is to create the WHIP gateway and first we need to create two service secrets in the Symphony Media Bridge WHIP gateway service in the OSC web user interface.
smburl=https://smb-node1.example.org/
smbapikey=mysecret
Then we will create the WHIP gateway by clicking on the button "Create gateway" in the web user interface. Then enter the following values in the create instance dialog.
As WhepEndpointUrl
we enter the address to the WHEP gateway that we copied to the clipboard.
Step 3: Send media
Now that we have a WHIP gateway up and running we can use a WHIP compatible client to send media to Symphony Media Bridge. An example of a web browser based WHIP client is available at https://web.whip.eyevinn.technology/ that we can use.
Enter the address https://demo-guide.eyevinn-smb-whip-bridge.auto.prod.osaas.io/api/v2/whip/sfu-broadcaster as WHIP URL in the client. Replace demo
with the name of your tenant. Enter the api-key guide that we chosen in the Authorization field. Then press the button Camera and you will receive a WHIP resource URL if everything is correctly working.
Scroll down the page and find the Resources section and you will find the id of the channel. In this case it starts with 26ef7e3...
Step 4: Playback media
To playback the media we can now go to a WHEP compatible web player. In this example we will use the open source Eyevinn Web Player that has inbuilt support for WHEP. In the example from the screenshot we will point the player to the WHEP URL at https://demo-guide.eyevinn-wrtc-egress.auto.prod.osaas.io/whep/channel/26ef7e3f-0540-41f0-bd33-b4939f956ffd.
Now you have successfully distributed a WebRTC stream from a web client to a web player over a Symphony Media Bridge powered distribution network.