Quick start - Storm Streaming Server

This guide will show you how to set up Storm Streaming Server and the Storm Player page in a matter of minutes. If you need a more detailed guide, please check our Docker Installation and Storm Player Installation guides.

Creating a Docker volume

A working Docker environment is required to start. If you don’t know how to start you can check our Docker Software Installation guide.

Let’s start with pulling the image and creating a container:

                        
docker run -it -d --name storm --hostname storm -e "JAVA_OPTS=-Xmx16G" -p 1935:1935 -p 8080:8080 docker.stormstreaming.com/stormstreamingserver/stormstreamingserver:latest
                    
As a basic explanation. The following command will create a docker container and forward following ports between host and container: 8080 (for HTTP/WebSockets), 1935 (for RTMP)

At this point a container should be up and running. We can test if everything is all-right with some basic functions for managing Docker.

  • To display all logs generated by the container (including Storm Streaming Server output):
                            
    docker logs storm
                        

  • To shut down the container:
                            
    docker stop storm
                        

  • To start the container back online:
                            
    docker start storm
                        

Creating a sample page with Strom Player

Sample HTML code:

                        
<!DOCTYPE html>
<html>
  <head>
    <title>My first player</title>
    <script src="https://cdn.stormstreaming.com/stormplayer/2-latest.min.js"></script>
  </head>
  <body>

    <script>

        const streamConfig = {
            role: "player",
            connectionType: "direct",
            stream: {
                serverList: [{
                    host: "localhost",
                    port: 8080
                }],
                sourceList: [{
                    protocol: "Storm",
                    streamName: "test",
                    application: "live"
                }]
            }
        };

        const stormPlayerConfig = {
            containerID: "playerDiv",
            width: 1280,
            height: 720,
            title: "Your first live stream",
            subtitle: "This is going to be epic!",
        };

        const player = stormPlayer(playerConfig, streamConfig);

  	</script>
  	<div id="playerDiv"></div>

  </body>
</html>
                    

Some explanation:

We use “localhost” as server host since Docker is running on the same machine. Port was set to 8080 to avoid issues with access rights required for acquiring port 80.

                        
{ host: "localhost", port: 8080}
                    

Our first stream will be called “test”, and it’ll be nested within “live” application.

                        
{ protocol: "Storm", streamName:"test", application:"live"}
                    

Broadcasting with OpenBroadcaster (OBS)

To start broadcasting we’ll need some RTMP-based encoder. OpenBroadcaster is among the most popular. Just grab the install and start the application: https://obsproject.com/

Once the application is opened, we need to modify connection and encoder settings. Select “Settings” from the bottom-right menu.

Connection data

Once Settings page is opened, please navigate to Stream tab. For “service” please select “Custom”. Now we need to enter Server URL and Stream Key:

Serverrtmp://localhost/liveServer is always made of a host domain and name of the application (in our case it’s “live”)
Stream KeytestThis is equal to streamName value in our JS code for the player
Table 1. Connection data table

Output data

On Streaming tab please select x264 as the encoder. You can also tune OBS with following parameters:

Rate ControlCBR
Bitrate25000 Kbps
Keyframe Interval1s
CPU Usage PresetUltrafast
ProfileMain
Tunezerolatency
Table 2. Output data table

Video

The last thing we need to do is to choose a resolution on Video tab. Please use 1280x720 for both Base and Output fields.

Now all you need to do is to click “OK” add some Sources to your video and click “Start Streaming”. After refreshing your HTML page player should be up & running.