Configure Nimble Live & VOD streams for optimized use with Streamroot peer-to-peer delivery

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.

Getting started

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.

Configure Nimble Live & VOD streams for Streamroot peer-to-peer delivery

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.

Example
If you specify /vod/ as the section 1 path and /home/streamer/vod as the section 2 path, your HLS video stream for the bunny.mp4 sample will have the following URL: http://your.server.ip:8081/vod/bunny.mp4/playlist.m3u8

Watch out! If your server has a private and a public IP, you need to use the public IP instead of your.server.ip in the example above.

To change formats, you can simply add the corresponding extension to end of your manifest URL:

[table id=2 /]

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.

Live stream Nimble global settings

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.

Example
if your application is called nimble-live-test and your stream is called stream1, then your HLS live stream URL will be: http://your.server.id/nimble-live-test/stream1/playlist.m3u8

Watch out! If your server has a private and a public IP, you need to use the public IP instead of your.server.ip in the example above.

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


Capture-d’écran-2015-06-19-à-17.43.581

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.

Be careful!
You might have to put your server’s public IP in your stream url instead of the private IP.

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.

Configure Nimble Live & VOD streams for Streamroot peer-to-peer delivery

Streamroot is also compatible with other protection features offered by Nimble such as geo-blocking and domain restrictions, as well as AES encryption.

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.

Conclusion

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!


1 thought on “Configure Nimble Live & VOD streams for optimized use with Streamroot peer-to-peer delivery”

  1. Pingback: How to encode Multi-bitrate videos in MPEG-DASH for MSE based media players (2/2) - Streamroot

Comments are closed.

Scroll to Top