Note: In earlier versions of Wowza Streaming Engine (4.5.0.02 - 4.7.6), limited WebRTC functionality was supported as a preview technology. We recommend that you update to Wowza Streaming Engine 4.8.5 or later to capitalize on expanded functionality and enhanced reliability.
Web Real-time Communication (WebRTC) is an open-source project to enable real-time communication of audio, video, and data in web browsers and native apps. WebRTC is designed for peer-to-peer connections but includes fallbacks in case direct connections fail.
Wowza Streaming Engine 4.7.7 added support for WebRTC live streaming. Encryption is mandatory for WebRTC streams, so you must configure Wowza Streaming Engine to use secure sockets layer (SSL/TLS). When ingesting source content as WebRTC, Wowza Streaming Engine uses a WebSocket connection to the browser to retrieve the Session Description Protocol (SDP) information.
With Wowza Streaming Engine, you can ingest and play WebRTC streams with all major desktop and mobile browsers that support WebRTC APIs. Supported browsers include the latest versions of Chrome, Firefox, Safari, and Edge version 79 and later.
Note: There is a resolved known issue with publishing and playing WebRTC streams using Safari on iOS 15. See WebRTC publishing and playback fails with Safari on iOS 15 for updates.
WebRTC supported codecs
Note: Wowza Streaming Engine supports only H.264 codec when recording to an MP4 Format. You can still use VP8 or VP9 codecs, but the stream needs to be transcoded to H.264 for MP4 files.
- Wowza Streaming Engine only supports audio and video streaming via WebRTC. Support for a data channel, commonly used for text-based chat in WebRTC, hasn't been implemented.
- With Firefox, Wowza Streaming Engine only supports WebRTC over UDP. WebRTC sessions over TCP aren't supported.
WebRTC workflows in Wowza Streaming Engine
WebRTC ingest and output
As with any other protocol supported by Wowza Streaming Engine, the simplest workflow is to ingest a WebRTC stream and then deliver it to viewers in the same format. Note that WebRTC outputs can consume a lot of bandwidth.
One-to-few and few-to-few WebRTC broadcasts
You can ingest one or a few WebRTC streams and deliver them to a few viewers via WebRTC. As the number of connections grows, however, your performance may suffer.
Wowza Streaming Engine also supports ingesting source streams over RTSP, SRT, and RTMP and then outputting them for playback over WebRTC.
When ingesting WebRTC streams that you want to deliver to many viewers, we recommend that you use the Transcoder feature in Wowza Streaming Engine to transcode the WebRTC stream (both audio and video) into any standard output format, such as AAC audio with H.264 video, for best results. Then you can deliver the stream over HLS or MPEG-DASH, which enables you to scale your WebRTC solution without the significant bandwidth that would otherwise be required to deliver your streams to viewers with satisfactory quality.
To scale your delivery to viewers, you can also use the Stream Targets feature to send the stream to content delivery networks (CDNs) and services such as Wowza Video.
- To send a WebRTC stream from Wowza Streaming Engine to a Wowza CDN endpoint, you must transcode it to RTMP or HLS. Which protocol you should use depends on how you configure the Wowza CDN endpoint.
- If you transcode a WebRTC stream for adaptive bitrate playback over MPEG-TS HLS, you must transcode both the audio and video codecs.
WebRTC port configuration
When configuring Wowza Streaming Engine to ingest or play streams with WebRTC, you must ensure that certain ports are accessible for client connections.
Note: Publishing or playing WebRTC streams on a device with an endpoint security platform enabled may result in decreased video performance. During a deep packet inspection (DPI) process, the endpoint protection platform de-encrypts and then re-encrypts each AES-encrypted packet, which can cause packet delays and stuttering. To address this issue, configure your endpoint security platform to ensure that traffic over the following ports is available without deep packet inspection.
|During the WebRTC signaling process, Wowza Streaming Engine uses a secure WebSocket connection to establish a connection between peers. This requires a port for encrypted connections using SSL/TLS. By default, port 443 is used. The SSL/TLS port is defined in a HostPort entry in [install-dir]/conf/VHost.xml.
|6970 to 9999
|For WebRTC over UDP, Wowza Streaming Engine uses a default port range of 6970 to 9999. UDP ports are assigned dynamically, and each additional peer WebRTC connection increments the port number used. The starting port number is controlled by the DatagramStartingPort value specified in [install-dir]/conf/Server.xml.
|For WebRTC over TCP, Wowza Streaming Engine uses a non-SSL-protected streaming port for TCP-level connections. The TCP port is defined in a HostPort entry in [install-dir]/conf/VHost.xml. By default, port 1935 is used. TCP ports are referenced in the IceCandidateIpAddresses property in [install-dir]/conf/[application-name]/Application.xml.
Note: Port 554 isn't supported for TCP ICE candidates.
See Troubleshoot network errors for information about troubleshooting port configurations.