Set up WebRTC streaming with Wowza Streaming Engine Manager

Wowza Streaming Engine™ media server software version 4.7.7 and later supports WebRTC streaming, however, we recommend that you update to version 4.8.5 and later to capitalize on expanded functionality and enhancements to publisher reliability. WebRTC is a free, open-source project that enables real-time communication of audio, video, and data in web browsers and mobile applications. Wowza Streaming Engine can ingest source WebRTC audio and video content and deliver it to supporting players. It can also transmux or transcode WebRTC to other streaming protocols, including HLS, MPEG-DASH, RTMP, and RTSP. In addition, Wowza Streaming Engine can ingest a non-WebRTC source stream and play it back with WebRTC or WebRTC plus other scalable HTTP-based streaming protocols like HLS.

In this article, learn how to set up WebRTC streaming using Wowza Streaming Engine Manager. To configure XML files for WebRTC instead, see Set up WebRTC streaming with Wowza Streaming Engine.

Video tutorial: Using WebRTC with Wowza Streaming Engine


About WebRTC in Wowza Streaming Engine


Wowza Streaming Engine can ingest WebRTC content from mobile and desktop browsers that support the WebRTC APIs. Supported browsers include the latest versions of Chrome, Firefox, and Safari, as well as Edge version 79 and later. SSL/TLS encryption is required for the WebRTC workflow.

When ingesting source content as WebRTC, Wowza Streaming Engine uses a secure WebSocket connection to the browser to retrieve the Session Description Protocol (SDP) information. This signaling exchange requires that you set up a Wowza Streaming Engine HTTP provider for the connection. 

Once it's in Wowza Streaming Engine, the WebRTC content can be delivered to viewers as is, or it can be transcoded or transmuxed to other formats for delivery. 

Configure SSL/TLS encryption and an HTTP provider for WebRTC


Encryption is required for all components of the WebRTC workflow. You must have a secure HTTP (HTTPS) connection to a web camera for WebRTC publishing and playback. As a result, due to cross-domain issues, you'll need to configure an SSL certificate to secure the connection between the browser and Wowza Streaming Engine for the SDP data exchange.

We recommend the free Wowza StreamLock certificate to secure this connection.

  1. Obtain an SSL certificate, and configure Wowza Streaming Engine to use it for secure streaming. See Get SSL certificates from the Wowza Streaming Engine StreamLock service for detailed steps using Wowza StreamLock.
  2. When configuring host port 443 to use the certificate for WebRTC signaling, you must select Use WebRTC. This configures the HTTPWebRTCExchangeSessionInfo HTTP provider to support an SDP exchange for the WebRTC session. 
    1. In Wowza Streaming Engine Manager, click the Server tab, and then click Virtual Host Setup in the contents panel.
    2. In the Virtual Host Setup page, click Edit, click Add Host Port
    3. Enter the required settings, and ensure that Use WebRTC is selected.
    VHost configuration dialog
Note: If you plan to use your own SSL certificate instead, the following resources may help you convert your SSL certificate to the Java KeyStore (JKS) format that's required by Wowza Streaming Engine. Although it's possible to use self-signed certificates with WebRTC, note that you must ensure the browser you're using to test accepts traffic encrypted with any self-signed certificates in use.

Configure a live application for WebRTC


After the SSL/TLS encryption and the WebRTC HTTP provider are enabled on the Virtual Host Setup page, configure a live application for WebRTC streaming using Wowza Streaming Engine Manager. This example uses the live application that's included in the default Wowza Streaming Engine installation. 

  1. In Wowza Streaming Engine Manager, click the Applications tab at the top of the page and then select the live application in the contents panel.
  2. In the contents panel, click WebRTC.
  3. On the Setup tab, click Edit to configure WebRTC.

    WebRTC configuration page
     
  4. Under WebRTC Enabled Features, select the appropriate settings:
    1. Select Publish WebRTC to Wowza Streaming Engine to ingest WebRTC source streams to this application.
    2. Select Play WebRTC from Wowza Streaming Engine to deliver WebRTC content for playback from this application.
    3. Select Query published stream names to enable querying names of published WebRTC streams for this application.
  5. Under ICE Candidate Setup, specify the network connections over which WebRTC communication can occur. Click Add ICE Candidate and do the following:
    1. Select either UDP (recommended) or TCP as the ICE candidate transport protocol.
       
      Notes:
      • Firefox requires UDP. TCP is not supported.
      • If you use UDP ICE candidates, enabling NACK messages is recommended to allow for retransmission of lost packets. See the optional RTP properties in Configure a live application for information about how to enable NACK with Wowza Streaming Engine XML.
    2. Change the IP address to the publicly-accessible Wowza Streaming Engine server IP address.
    3. For TCP candidates, you must specify a port to use for WebRTC streaming. The default streaming port for Wowza Streaming Engine is 1935. For UDP candidates, the port is dynamically assigned.
       
      Note: Port 554 isn't supported for TCP ICE candidates.
    4. Click OK to save your ICE Candidate.
    5. If needed, add additional ICE Candidates, and adjust their preferred order using the Priority up and down arrows.
  6. If you have Publish WebRTC to Wowza Streaming Engine enabled, specify one or more Publish Video Codecs in the preferred order of use:
    1. Click Add Codec, and then select the codec from the drop down list.
    2. If necessary, adjust the order of the video codecs using the Priority up and down arrows.
    3. Click OK to save your Publish Video Codecs priority list.
  7. Click Save and then restart the application.

The application runs whenever Wowza Streaming Engine is running.

Note:  You can configure optional WebRTC properties that are not available in Wowza Streaming Engine Manager in the [install-dir]/conf/[applicationName]/Application.xml file. See Configure a live application to see descriptions of additional properties for WebRTC.

Test the WebRTC workflow


In production environments, WebRTC playback and publishing pages must be hosted on a web server utilizing SSL/TLS encryption. For testing and learning purposes, Wowza provides hosted WebRTC test pages for publish and playback so you can see WebRTC in action more quickly. 

Notes:
  • Wowza Streaming Engine 4.8.5 or later is required for the hosted WebRTC test pages.
  • You can use the the Wowza hosted WebRTC test pages with the latest version of Chrome, Firefox, Safari, and Microsoft Edge version 79 and later.
  • Screen share functionality for the hosted WebRTC publish and composite test pages is not available on mobile devices, Safari, or Firefox.

Publish a test stream to Wowza Streaming Engine

Publish a test composite stream to Wowza Streaming Engine

Publish a test meeting stream to Wowza Streaming Engine

Play a test stream from Wowza Streaming Engine

For more advanced learning and testing, Wowza Media Systems provides WebRTC examples on GitHub that demonstrate how to publish and play WebRTC streams with Wowza Streaming Engine. See Use WebRTC example pages with Wowza Streaming Engine.

More resources