(Editor’s Note: We have no affiliate or marketing connections to WMSPanel or Softvelum LLC. We just pay for their service and enjoy it very much)
So I heard you’d like to build your own streaming service! Or at least hear about we started building ours. So I invite you along as I write a journal of how we started to build our own humble self‐hosted streaming service. This will be less a step by step how to, and more a story of why we did this and how we done did it. But hopefully this can still come to the assistance of someone looking in the direction of independent streaming.
Why would we even want to go through with self‐hosting our own streaming service, and paying for the privilege to boot?
Well, there are a few reasons. But the biggest would be that we are stubborn. On a personal level, if I was ever going to do a new thing with SuperNerdLand, I would try to be as independent as possible. Thus why we rent a criminally under‐provisioned server with a pretty open AUP (Acceptable Use Policy).
Along with being stubborn, we have an independent streak to a fault. Free services like Twitch and YouTube are great and all, but they also come with walls of ToS and community guidelines that are just too unwieldy. I do not feel comfortable placing all my content in any of their baskets with how fickle the environments are out there, and would prefer to not rely on them. Plus if a member of our site wants to stream a game that is verboten on Twitch then we need options. It’s a big reason why we host our own video content over on our “Tube” style site over here.
We have the hardware resources to start building up self‐hosted streaming just sitting there, so why not use it?
Something I cannot deny about these endeavors, though, is that it is also just plain fun for me. I enjoy tinkering around, hacking things together, and trying to learn how to be a better webdev in general. Building up a streaming infrastructure pulls in many points of knowledge that I have already, and even more that I get to learn along the way, which makes the journey worth the price of entry.
Before I get into the solution that I decided to deploy for us, let me talk about some of the requisites that I had for anything that we installed or built for use.
First and foremost was support. If there wasn’t a robust community supporting the solution, then I wanted to at least make sure enough support was available from the developers. This is where paid solutions can overcome free and hacked together ones, but if you are skilled enough you may not even need the support.
Second was the ability to easily stream cross‐platform without getting into the need for fallback players. This limits the dying (for playback at least) RTMP standard that relies on the even deader Flash environment, and also nixes other solutions. However we were going to stream, I wanted an HTML5 player that would play nice across Windows, Mac, and Linux as well as Android and iOS.
I also felt it important to make sure we could support low latency streaming. What do I mean by this? Put simply, if your remember when Twitch had a 15 – 30 second delay, and how they do not anymore, then you have experienced the greatness of low latency streaming. This gets the action closer to the viewer with delays from the streamer of under 5 seconds.
And something not to be taken lightly for its place last here is scalability. Yeah, I could feed an RTMP stream to my server, and just wrap a player around it and be done with it. But that is super old form, and relies on Flash for playback still. I could setup nginx to listen in and low latency transcode it with FFMPEG into HLS and have better playback support, but how well could I scale that up if I really wanted to? The ability to manage and scale whatever solution we landed on mattered.
With that list of needs in mind, I went a‐looking around the internet. There were a couple things I spotted, and didn’t go with… and then there was the winner.
What didn’t we use at first?
Something that seemed super powerful, but was too pricey for me, was Wowza Streaming Engine. Looks like a fine piece of kit, with great reviews. The problem being I’m cheap at times, and Wowza had features that I frankly was never going to touch. Why pay for things I don’t need?
There was also a product called Red 5, with their free and paid versions. It would have gotten us off the ground, but it just didn’t have all that I wanted. No offense to them, but it all just wasn’t jiving with me. Not when their cheapest Pro package comes in at $29.99 and limits you to 100 connections. Forget that.
I looked at webtorrent/P2P streaming for a quick second, and I am very confident about its future. The solution we went with even supports it. But I need a more stable delivery method now.
Beyond just building something up with nginx, FFMPEG and duct tape, there was a solution I had found that really hit all my needs right on the packaging.
And that was how we started using Nimble Streamer and WMSPanel.
Those two products are provided by Softvelum LLC, with Nimble Streamer being the freeware streaming component and WMSPanel acting as a cPanel‐like piece of control software to configure and manage various aspects of your streaming infrastructure. They even give a two‐week free trial of the WMSPanel component, which is certainly a bonus. It being half the price of Wowza while also providing dang near anything I could want to start out with cinched the deal.
So what all it can be used for, and what we are using it for are certainly different stories. For what all WMSPanel and Nimble Streamer can do, I’ll just direct you to their site so they can sell themselves.
What are we able to use it for now with our resources my knowledge?
Nothing more than exactly what I needed from my listed requirements at the start, and then some.
So we have our Live page that you can see us stream to with increasing regularity as the year goes on. And doing it with WMSPanel allows us to feed our RTMP stream from the source into FFMPEG to transcode into an ABR (adaptive bitrate) stream, which allows us to still cater to folks with low‐bandwidth. And while Softvelum does offer their own transcoder with its own control panel area, I’ve already told you that I’m a cheap bastard and it comes with extra cost. I’ve already setup a good FFMPEG configuration to encode everything efficiently while maintaining the the low latency streaming that I desired by using it in combination with Softvelum’s SLDP output (comes free with WMSPanel).
WMSPanel also gives us the ability to restream to various other platforms easily, so we can act as our own Restream.io even. So if we choose, we can keep streaming to our Twitch channel for users who prefer that platform.
Something that is more beneficial for me, than for the audience generally, is that there are DVR settings for the back‐end too. This is great for having a fail‐safe recording of anything we do in case we forget to record while we stream, a Twitch archive goes weird, or any other number of situations that arise which need a recording.
Then there is the API available. Something I didn’t even knew I would need at first, but it is bundled right in with it all for free. I’m too dumb right now to work with it in full capacity, but as I Learn To Code™ (or get somebody way better than me at this stuff) I can start to really fill out our ability to customize our delivery and features in a hardcore fashion. Right now I am like smol baby with that stuff, but I’m learning!
So all in all I’ve been super impressed by the offering from Solftvelum, and my ability to setup streaming instances damn near on the fly. If I learn the API well enough, it looks like I should be able to even build things that are more catered to other users streaming on our servers without us needing to poke the backend manually all the time. Good stuff.
And all of this comes with the ability to scale very nicely. WMSPanel and Nimble Streamer are built to work with edge servers and all sorts of video encoding and delivery workflows, so what we can do with it all is pretty much limited only to our imaginations and budget.
I don’t want to risk this getting over long, so I will leave off here before I get into harder details of how I set specific things up, like my use of FFMPEG for transcoding or how I setup web players for streams.
If anybody has any questions about anything just hit us up in the comments below, or throw a bird at us on Twitter!
Next Time On SUPERNERDLAND…