Your Guide to setting up a video streaming server

As of January 2018, 85% of U.S. internet users watch online video. More and more people will expect your website to provide streaming video alongside text content.

You can host your video on sites like YouTube and Vimeo, but you’ll be at their mercy. They’ll show ads alongside your videos that could be from your competitors, you have no control over the other “related” videos they show beside yours, and they could take your video down with no warning.

Running your own server gives you complete control over your content so your visitors will experience it the way you want. Let’s look at how to set up your own streaming server.

What You Need for a Streaming Server

A streaming server delivers video content to your site’s visitors by sending a continuous “stream” of information. This is in contrast to a typical web page that has a fixed amount of information to be delivered. One of the most important things to consider when choosing your streaming server is the amount of data transfer your hosting plan provides. Streaming media can use a lot of bandwidth. If your plan has a transfer cap, you could find yourself facing some hefty overage charges.

The best solution is to get an unmetered server. Unmetered means there is no limit on the amount of data you can transfer every month. Maple-Hosting’s unmetered dedicated servers are perfect for a video streaming server. There’s no transfer limit, and we don’t slow down your transfer speeds if you hit a certain amount like some hosting companies.

Other Things to Consider

You also need to consider a few additional factors:

  • The quality of your stream (standard def, high def, 4K, etc.)
  • The number of viewers at any given time
  • Storage required for your media content
  • Access – private or open to the world

Stream quality and the number of viewers will determine how much bandwidth you need in terms of the port size. Maple-Hosting’s unmetered servers are available with port sizes from 1Gbps to 20Gbps. A larger port means your server will support higher quality and more simultaneous viewers. If you’re not sure how to determine what size port you need, get in touch with us, and we’ll help you pick the right server for your needs.

Setting Up Your Video Stream Server

To install the streaming packages that we’re going to cover here, your server will need to be up and running with the Linux operating system. Maple-Hosting offers various distributions and versions of Linux.

We’re going to cover the steps to set up your server using Ubuntu Linux. Ubuntu is based on Debian, so this process should work similarly with any Debian-based distribution. If you’re using a distribution that uses a different package manager, such as Red Hat’s RPM, you’ll need to adjust the commands to suit.

Install & Configure Nginx

You’ll be using the terminal to install the various packages needed to stream video so you’ll want to have SSH configured and be able to log in to your server. Maple-Hosting provides full root access to your server, so you’ll be able to set things the way you want.

First, install the Nginx web server. Nginx is a web server that runs on your server and serves up the web pages your visitors see when they land on your site.

sudo apt install nginx

Next, install the RTMP module that lets Nginx handle media streams. A typical web page loads a fixed amount of information then waits until your visitor clicks another link. Streaming video is a different beast because it needs to send information non-stop. This package adds that ability to the webserver.

sudo add-apt-repository universe

sudo apt install libnginx-mod-rtmp

Edit the web server’s config file so it can work with your stream:

sudo nano /etc/nginx/nginx.conf

At the bottom of that file, add the following lines:

rtmp {
server {
listen 1935;
chunk_size 4096;
application live {
live on;
record off; } } }

Save the changes using Ctrl-X, Y, then press Enter.

This configuration gives you a simple starting point. It doesn’t record your live stream and just offers basic functionality, but you can always add to it later, once you know it’s working and you decide exactly what features you want.

Once you’ve updated the configuration file, restart Nginx to have the changes take effect:

sudo systemctl restart nginx

Next, you’ll need to have something to stream. We’re going to go through the steps for installing software on your local PC to live stream to your viewers.

Install & Configure OBS

Open Broadcast Studio, or OBS, is a powerful application for supplying your server with the video for it to stream. You can download and install the version for your particular operating system from the OBS website.

When you launch OBS, you’ll get a wizard that will walk you through the setup. After the wizard finishes, you’ll need to give OBS a video source to send to your server.

For now, we’ll stream your desktop so click the + button under “Source”, choose “Screen Capture”, and pick the desktop you want to use. When you click OK, OBS should show your desktop.

Now that you have a “video” stream set up, you need to send it to your server. Click on File then Settings in OBS and click on the Stream section. Set the Stream Type to Customer Streaming Server.

In the URL field, enter the following:

rtmp:///live

For example, if your IP address is 1.2.3.4 you would enter rtmp://1.2.3.4/live.

Limiting Who Can View Your Stream

A stream key lets you restrict the streaming to only people who have the key. To set it up, enter your key in the “Stream key” box. It can anything you want but make sure it’s something you’ll remember.

Click Apply, then OK to save the changes. OBS is ready to send the stream to your server so you can click Start Streaming. To stop streaming, click the Stop Streaming button.

If you get any errors, go back and check all your entries in OBS to make sure there aren’t any typos.

Viewing Your Stream

To test your streaming video, you’ll need a media player that supports the RTMP protocol. The VLC media player is one of the best, so if you don’t already have it installed, you can download it from the VLC website.

Click on the Media menu then Open Network Stream and enter the path to your streaming server, with the Streaming Key added to the end if you set one up.

rtmp:///live/Streaming-Key

You should see the desktop you chose during the OBS setup, but this one is streaming from your server.

Alternative Streaming Options

There are other streaming options beside the one we’ve outlined here including Wowza Streaming Engine and Ant Media Server. Both of these alternatives offer some advantages.

Wowza is a commercial tool, meaning you have to pay for it. On the surface, that might seem like a disadvantage compared to a free option like OBS but part of what you’re paying for is the support behind the product. You’ll have access to tech support for assistance with any questions you have about the tool along with powerful features like on-the-fly transcoding that lets you stream almost any video format.

Ant Media Server offers the best of both worlds. It’s an open-source product, which means it’s available for free, but they also offer paid plans that provide technical support along with some extra features like live streaming to Facebook and YouTube.

Where to Go from Here

You might want to record live streams for people to watch later. Or maybe your company creates videos that you want your customers to be able to access through your website. Once your server is up and running, you can configure it to suit your needs by making changes to the RTMP configuration file.

If you’d rather not have to dig into the technical details of setting up your streaming server, Maple-Hosting can help. With our unmetered dedicated servers, you get a premium truly unmetered dedicated port on a dedicated server that was built for content streaming. Get in touch with us today, and we’ll help you get started.

Leave a comment about this article

This site uses Akismet to reduce spam. Learn how your comment data is processed.