Red5 Pro WebRTC
Red5 Pro Server Release 2.0.0 (WebRTC Beta2) includes WebRTC support and front-end integration of the Red5 Pro HTML5 SDK.
WebRTC (Web Real-Time Communication) is supported by the Chrome, Firefox and Opera browsers on desktop. In addition, the Chrome browser on Android supports WebRTC. Safari and Internet Explorer do not support WebRTC (but reportedly, Microsoft Edge does).
Broadcasting/subscribing of WebRTC to WebRTC, WebRTC to HLS, WebRTC to Flash, and Flash to WebRTC are all supported.
Subscribing to a WebRTC publisher using the Red5 Pro Android or iOS SDK client is supported. In addition, subscribing with WebRTC to a stream published with Red5 Pro Android or iOS SDK client is supported.
WebRTC Broadcaster/Subscriber combinations supported, in a nutshell:
- WebRTC <==> WebRTC
- WebRTC <==> Flash
- WebRTC <==> Red5 Pro iOS SDK
- WebRTC <==> Red5 Pro Android SDK
- WebRTC ==> HLS
WebRTC runs on the standard HTTPS port (443). To run Red5 Pro WebRTC server you need to have a valid SSL Certificate for a registered URL. Red5 Pro with SSL walks you through setting up the certificate on your server. Additionally, as with other Red5 Pro server distributions, you will need to install Java (minimum version 8.0).
If you are running the server, without an SSL cert, on your local machine or on a server:
- You will be able to publish/subscribe locally (between browsers).
- You will be able to subscribe to a stream that is being published from localhost (e.g.: http://localhost:5080/live/broadcast.jsp) from a device within the same network (pointing to the IP address of your machine, not to localhost). To subscribe from a mobile device, either via browser on Android, or via SDK client on iOS or Android, the device must be on the same Wifi network as the desktop.
- You will not be able to publish via a WebRTC client that is not local to the machine.
Installing Red5 Pro With WebRTC
We recommend running WebRTC on linux, due to CPU and memory requirements. Please see Installing Red5 Pro on an Ubuntu Linux Server
If you want to run Red5 Pro WebRTC on your windows desktop for development purposes, you will need to install Microsoft Visual Studio redistributables if you don't have Visual Studio on your machine.
Red5 Pro WebRTC Ports
The following Inbound ports need to be open on your server/firewall for Red5 Pro features to work on a WebRTC server using SSL:
|80||modified web access of Red5 Pro||TCP|
|443||standard HTTPS port||TCP|
|1935||default Red5 Pro RTMP port||TCP|
|8554||default RTSP port||TCP|
|6262||websockets for HLS||TCP|
|8081||websockets for WebRTC||TCP|
|8083||secure websockets for WebRTC||TCP|
|40000-60000||TURN/STUN/ICE port range||UDP|
Cloud Hosted Server Settings
Most hosted Virtual Machines will have a private and public IP address assigned to the instance. ICE negotiation can run into problems if the server doesn't know which is which.
local.private.ip.address.here with the server's public and private IP addresses, respectively.
# Forcing a public IP address #force.public.ip=yourpublic.ip.address.here # Forcing a private IP address #force.local.ip=local.private.ip.address.here # Configure port availability checking #check.port.availability=true
Amazon Web Services
Because of the specific way that AWS treats private/public IP addresses of its virtual instances, it is necessary to use a special ICE process for AWS servers.
red5pro/conf/webrtc-plugin.properties, under the
# ICE section:
Change the default
Red5 Pro HTML5 SDK
You can use the Red5 Pro HTML5 SDK to develop your browser-based application. The Red5 Pro HTML5 Streaming Example App contains a simple project with a number of examples that can be used for testing and reference with the Red5 Pro HTML SDK.
The app is also included as a webapp with the server release for developer testing, and can be accessed at
http://localhost:5080/webrtcexamples/ if you are running the server locally).
You will find some more details on the Red5 Pro HTML5 SDK here.
Failover for Publish and Subscribe
The Red5 Pro broadcaster (
https://yourserverurl/live/broadcast.jsp) and subscriber (
https://yourserverurl/live/subscribe.jsp) use the Red5 Pro HTML5 SDK which allows for fallback player support. Our examples are programmed with the following default fallback order:
Test Supported Resolutions for your WebCam
Here's a very handly link to test what resolutions your webcam supports: webrtchacks.github.io/WebRTC-Camera-Resolution/
WebRTC Internals - browser diagnostics
This will show you more details on your WebRTC connection, and can help to troubleshoot any issues.
How to Select WebCam in WebRTC (Chrome)
Firefox will prompt you for permissions to access the camera/microphone - at which time you can select your preferred webcam. In Chrome, you will need to select which camera to use via the camera icon in the address bar.