Streamroot is happy to announce that it has partnered with WMSPanel’s Nimble Streamer media server for peer-assisted delivery. Nimble Streamer provides a lightweight, easy to configure solution that is based on forward-looking technologies — a perfect match for us!
In this tutorial, we will show you how to configure Nimble Live & VOD streams for optimized use with Streamroot peer-to-peer delivery. As you will see, the steps are rather simple, and the streams produced need little additional configuration to be fully compatible with Streamroot. In the last part of the tutorial, we’ll look at a few more advanced configurations, fine tuning, monitoring and content protection.
We should begin by noting that Nimble Streamer has many advantages: Unlike many media servers, it is freeware and works on a wide variety of operating systems. It is reliable, efficient and lightweight (it runs on very little resources!). The extensive documentation is easy to understand and to implement, so let’s get to it!
Create an account with WMSPanel and install Nimble.
Open an account on WMSPanel, the interface that will allow you to monitor the streams you create with Nimble Streamer. WMS Panel comes with a 2-week free trial — so don’t be shy! Create your account so you can follow along and configure your streams while reading this tutorial.
Once you’ve created your account, install Nimble on your machine. Nimble’s documentation has all the info you need to install Nimble on OS X, Windows and several Linux OS. The examples in this tutorial are taken from Nimble installed on a Ubuntu machine, but again you may use the OS of your choice.
Once that’s done, go to the Streamroot website to sign up for a free trial of our peer-to-peer portal so you can add your streams.
1. Set up a Nimble VoD or live stream
1.1 Create a VoD stream
Once you’ve installed Nimble on your server, it’s time to create a stream! This section concerns VoD, so if you prefer creating a live stream, skip to 1.2.
First, add your content to your machine. Upload your mp4 video files to a folder, for instance /streamer/vod/. If you don”t have a video file, you can use our sample video here.
In your WMP Panel Dashboard, click Nimble Streamer, then Edit Nimble Routes.
Now click Add VOD Streaming route.
A couple tips:
- The domain field is optional; leaving it blank will allow any domain to connect to your stream.
- The path field in section 1 is the path you will find in the URL of your stream.
- The path field in section 2 is where you must indicate the path of your content on your server.
- Finally, choose the server to be used for your streams.
To change formats, you can simply add the corresponding extension to end of your manifest URL:
For the purposes of this tutorial, we suggest that you work with an HLS stream.
Now that your stream has been created, configure the segment length for optimal peer exchanges. The default length is generally 10 seconds, but if using Streamroot, it is best to shorten the segments to 2 seconds. To do that, simply add this line in the nimble.conf file located in /etc/nimble/:
vod_chunk_duration = 2
You’re all set! Now let’s do a live stream, or you can skip directly to section 2 to configure your media server.
1.2 Create a live stream
To begin, let’s see how to set up your DASH or HLS stream from a RTMP stream. If you don’t have your own RTMP stream, try it with this sample stream here.
In your WMSPanel account, click on the Nimble Streamer menu and to go to the Live Streams Settings section.
Choose the server to configure in the top left.
When configuring In Global, select the formats you wish to enable (the “Protocols” section) and your stream settings.
Unlike the VoD configuration, you can choose your segment length directly in this window. For live streaming, in addition to segment length you will also need to choose a playlist length. For optimized P2P efficiency, choose a playlist or “chunk count” of 20 segments, and a segment length or “chunk duration” of 3 seconds, as show below.
HLS and DASH are two formats supported by the Streamroot p2p module. You can use other format like RTMP for fallbacks.
The next mandatory section is Live Pull Settings, where you will choose the RTMP/RTSP live stream you want to re-stream in DASH or HLS. Click on Add RTMP stream, enter the stream URL, choose an application name and a stream name.
Return to the Live Streams section in the Nimble Streamer menu at the top and click on the stream in Outgoing Streams. You should see your stream ready to be delivered. Click on the question mark to get your stream URL and see your stream in action. You will be able to choose between the formats you selected before. You’ll want to add at least the HLS and DASH stream, and the original RTMP as a fallback.
And there you go! Let’s now look at how to configure your server to work with Streamroot’s P2P module.
2. Configure your server headers
The Streamroot P2P module needs two things from your server: CORS requests and range requests. To make sure these are properly enabled, you’ll need to add two response headers in the file nimble.conf located in your Nimble server at /etc/nimble/ for Linux or in the corresponding location for other operating systems.
Copy these two headers into the file using the example below:
access_control_allow_origin = *
access_control_allow_headers = Range
Now that you’ve configured everything in Nimble, it’s time to add in Streamroot! To make sure that the configurations have worked properly, test your URL with this manifest validator. If anything has gone wrong, it will identify and explain the issue. Then hop over to your Streamroot portal account. Our documentation will guide you through the steps needed to add your manifests and have peer-to-peer traffic.
3. Advanced Nimble configurations
Before finishing up the tutorial, here are a few additional tips and advanced options for using Nimble and Streamroot together:
3.1 Hot-link protection & whitelisting
Protecting streams is a primary concern for broadcasters. Streamroot works to make sure our peer-to-peer solutions are compatible with content protection. AES encryption, HTML5-based DRMs, tokens and hot-link protection can all be used in conjunction with Streamroot.
Nimble offers a variety of forms of content protection, including hotlinking, geoblocking and IP range restriction. One of the main features is hot-link protection. To prevent users from pirating streams and publishing them on an other website, this technology uses a code snippet in your webpage to generate a signature for users trying watch your content. Nimble then checks the signature to authorize deny access to the user.
3.2 Nimble server as an HTTP origin server
If you wish to use a CDN to deliver your content, Nimble server can be used as an HTTP origin server and has recently released an article on CDN-friendly streaming with Nimble, explaining how to create aliases and use them as HTTP origins. More details can also be found in this article on using Nimble as an HTTP origin source.
3.3 Performance tuning & other options
To configure your Nimble server to scale effectively and use your hardware according to your traffic, have a look at Nimble page explaining CPU and RAM performance tuning. It talks about cache settings for live and VoD streams, chunk storage and calculating RAM use according to your streams. The Nimble Configuration article can then help you set up these parameters according to your needs.
Pretty easy, right? As you can see, configuring Nimble and Streamroot could not be simpler. Our technologies work together with minimal configuration and widespread compatibility. Thanks to Yury and the entire WMSPanel team for reaching out to us and making this partnership a reality!