Setting up the Red5 Pro Server

The following document discusses setting up the Red5 Pro Server for local development.

Download the Red5 Pro Server Download the latest
Red5 Pro Server!

Register for a Developer or Professional Account

If you have not done so already, start an account at https://account.red5pro.com.

* The Developer Account allows for up to 10 concurrent connections, while the Professional license has no connection limit.


Requirements

The following are required to setup the Red5 Pro Server:

The Red5 Pro server requires Java 1.8+ or higher. Install Java 1.8+ or higher if not already installed on your machine.


Installation

The following default ports are required to be open on the target deployment system in order to allow for Live Streaming:

Please refer to the Operating System's documentation on opening ports. If developing and testing locally, most likely you will not have to expose these ports for remote subcription of streams.

  1. Download the Red5 Pro server from the downloads section of the Red5 Pro Accounts site.
  2. Unzip into a location on your local system. For the purposes of this tutorial, we will unzip the Red5 Pro server to: /Users/red5pro-user/red5pro on OSX or /home/red5pro-user/red5pro on Linux.
  3. Start the Red5 Pro server:
    • On OSX & Linux: Open Terminal, cd into your Red5 Pro install directory and issue this command: ./red5.sh
    • On Windows: Navigate to the Red5 Pro install directory in a File Browser and double-click on red5.bat
  4. After the server has started, open a web browser and navigate to http://localhost:5080
  5. If the server has started successfully, you should see the default landing page for the Red5 Pro server install
    • The landing page can be found at /webapps/root/index.jsp of your Red5 Pro installation. You can modify or remove it as desired. For now, we will use it to navigate around and demonstrate what the Red5 Pro server can do!
  6. Note: to stop the server on a local machine, you can either close the terminal window, or open a second terminal window, navigate to the same location and run ./red5-shutdown.sh (./red5-shutdown.bat on Windows)

Red5 Pro Application

Congratulations! You have successfully setup and run the Red5 Pro Server. The following sections get you started with testing the Streaming and Second Screen solutions the Red5 Pro Server provides.


Prerequisite

In order to follow along with the Streaming and Second Screen examples in this document you must already have a native client installed on your device (current support is for Android and iOS). In order to fulfill this requirement, you must build and install one of the following:

Download the iOS Red Pro Native Client Example Download the latest
Native Client Example for iOS
Download the Android Red Pro Native Client Example Download the latest
Native Client Example for Android

Live Streaming

Publish

  1. In a web browser, navigate to http://localhost:5080/live/ and take note of the IP address that is printed at the top of the page
    • For the purposes of this tutorial, the IP address is listed as 10.0.0.15 since we are running locally on our development machine
  2. Launch the Red5 Pro application on your device and select Publish from the menu
  3. In the Settings dialog shown in the Red5 Pro application on your device, change the Server field value to the IP address listed from Step 1
    • For the purposes of this tutorial, we changed the address value to 10.0.0.15
  4. From the Settings dialog, click Done
  5. In the lower right of the Red5 Pro application on your device is a Record/Stop button, click to start recording
  6. From the http://localhost:5080/live/ page, locate the Subscribe section and select Access the list of active streams here
  7. From the stream listing at http://localhost:5080/live/subscribe.jsp, select the myStream link listed
  8. Watch yourself!

Red5 Pro Application Red5 Pro Application Settings

Subscribe

  1. In a web browser, navigate to http://localhost:5080/live/ and take note of the IP address that is printed at the top of the page
    • For the purposes of this tutorial, the IP address is listed as 10.0.0.15 since we are running locally on our development machine
  2. From the http://localhost:5080/live/ page, locate the Broadcast section and select Start broadcast here
  3. The web browser will redirect to http://localhost:5080/live/broadcast.jsp with a host query
  4. You may be presented with various security alerts from the Flash Player and Browser requesting access to the camera and microphone. When prompted, accept them.
  5. In the streamName field, enter in myStream
  6. Click the Broadcast Now button on the page
  7. Launch the Red5 Pro application on your device and select Subscribe from the menu
  8. From the Settings Dialog of the Red5 Pro application on your device, change the Server field value to the IP address listed from Step 1 (this is the same value as the host query value for the broadcast page)
  9. From the Settings dialog, click Done
  10. From the Red5 Pro application, click Start Stream
  11. Watch yourself!

Second Screen

Please ensure that your device and computer are connected to the same WiFi network in order to properly engage with the SecondScreen experience

  1. In a web browser, navigate to http://localhost:5080/secondscreen/ and take not of the IP address that is printed at the top of the page
    • For the purposes of this tutorial, the IP address is listed as 10.0.0.15 since we are running locally on our development machine
  2. Select one of the HTML5 Control Basic Example listed
  3. The web browser will redirect to http://localhost:5080/secondscreen/hosts/basic/
  4. Launch the Red5 Pro application on your device and select Second Screen from the menu
  5. In the Settings dialog of the Red5 Pro application on your device, change the Server feild value to the IP address listed from Step 1
  6. From the Settings dialog, click Done
  7. Wait for the connection to the Second Screen Registry server to be established
  8. Once the device is connected, select HTML5 Control Basic from the list
  9. The control scheme defined for the HTML5 Control Basic application will be sent down to the device and communication between the device (aka Client) and the webpage (aka Host) is open
    • To test the communication from Host to Client, click the click me button on the webpage and view the messages receieved on the device
    • To test the communication from client to Host, click the PUSH button on the device and view the messages received on the webpage

Of course, this is just the tip of the iceberg, but it demonstrates the communication channel and LAN registry connection capabilities of Red5 Pro Second Screen.


Troubleshooting

The following sections may aide in troubleshooting any issues may come across in trying the previous examples.

If you have further questions, please contact us

Required Open Ports

The following default ports are required to be open in order to allow for Live Streaming and Second Screen:

NOTE: If you are running Red5 Pro on your local machine. You must be able to access the IP address of your host server with your mobile client, so your laptop/desktop needs to be on the same wifi network. See Red5 Pro WebRTC for additional requirements and restrictions.

How to modify default ports

Some firewalls or even service providers may block some of the Red5 Pro default ports, so you may want to modify those. There are two files that allow you to define the ports that Red5 Pro uses: {red5pro}/conf/red5.properties, and {red5pro}/conf/red5pro-activation.xml

red5.properties file : RTMP, HTTP, Websockets

To modify the default RTMP port, edit {red5pro}/conf/red5.properties RTMP section:

# RTMP
rtmp.host=0.0.0.0
rtmp.port=1935

To modify the default HTTP (or HTTPS) port, edit the HTTP section:

# HTTP
http.host=0.0.0.0
http.port=5080
https.port=5443

To modify the default Websockets port, edit the Websocket section:

# WebSocket
ws.host=0.0.0.0
ws.port=8081

Note: this is also where you define secure websockets (wss) if you need them.

red5pro-activation.xml file: RTSP, secondScreen, websocket (for HLS)

Modify the configuration bean if you wish to modify any of the default ports for RSTP, WebSockets for HLS, or Second Screen:

<bean name="configuration" id="configuration" class="com.red5pro.activation.Red5ProConfiguration">
<property name="rtsp" value="true"/>
<property name="secondscreen" value="true"/>
<property name="websockets" value="true"/>
<property name="rtspPort" value="8554"/>
<property name="secondScreenPort" value="8088"/>
<property name="websocketPort" value="6262"/>
<property name="enableRecording" value="true"/>
</bean>

Second Screen

  1. The Host and Client cannot connect over Second Screen
  2. The Host (webpage in browser on laptop/desktop) and Client (device) need to be on the same Wi-Fi network in order to communicate properly.