Building a Streaming Service — Part One: Am I F***ing Crazy?

(Editor’s Note: We have no af­fil­i­ate or mar­ket­ing con­nec­tions to WMSPanel or Softvelum LLC. We just pay for their ser­vice and en­joy it very much)

So I heard you’d like to build your own stream­ing ser­vice! Or at least hear about we start­ed build­ing ours. So I in­vite you along as I write a jour­nal of how we start­ed to build our own hum­ble self-hosted stream­ing ser­vice. This will be less a step by step how to, and more a sto­ry of why we did this and how we done did it. But hope­ful­ly this can still come to the as­sis­tance of some­one look­ing in the di­rec­tion of in­de­pen­dent streaming. 

Why would we even want to go through with self-hosting our own stream­ing ser­vice, and pay­ing for the priv­i­lege to boot?

Well, there are a few rea­sons. But the biggest would be that we are stub­born. On a per­son­al lev­el, if I was ever go­ing to do a new thing with SuperNerdLand, I would try to be as in­de­pen­dent as pos­si­ble. Thus why we rent a crim­i­nal­ly under-provisioned serv­er with a pret­ty open AUP (Acceptable Use Policy).

Along with be­ing stub­born, we have an in­de­pen­dent streak to a fault. Free ser­vices like Twitch and YouTube are great and all, but they also come with walls of ToS and com­mu­ni­ty guide­lines that are just too un­wieldy. I do not feel com­fort­able plac­ing all my con­tent in any of their bas­kets with how fick­le the en­vi­ron­ments are out there, and would pre­fer to not rely on them. Plus if a mem­ber of our site wants to stream a game that is ver­boten on Twitch then we need op­tions. It’s a big rea­son why we host our own video con­tent over on our “Tube” style site over here.

We have the hard­ware re­sources to start build­ing up self-hosted stream­ing just sit­ting there, so why not use it?

Something I can­not deny about these en­deav­ors, though, is that it is also just plain fun for me. I en­joy tin­ker­ing around, hack­ing things to­geth­er, and try­ing to learn how to be a bet­ter web­dev in gen­er­al. Building up a stream­ing in­fra­struc­ture pulls in many points of knowl­edge that I have al­ready, and even more that I get to learn along the way, which makes the jour­ney worth the price of entry. 

Before I get into the so­lu­tion that I de­cid­ed to de­ploy for us, let me talk about some of the req­ui­sites that I had for any­thing that we in­stalled or built for use.

First and fore­most was sup­port. If there wasn’t a ro­bust com­mu­ni­ty sup­port­ing the so­lu­tion, then I want­ed to at least make sure enough sup­port was avail­able from the de­vel­op­ers. This is where paid so­lu­tions can over­come free and hacked to­geth­er ones, but if you are skilled enough you may not even need the support. 

Second was the abil­i­ty to eas­i­ly stream cross-platform with­out get­ting into the need for fall­back play­ers. This lim­its the dy­ing (for play­back at least) RTMP stan­dard that re­lies on the even dead­er Flash en­vi­ron­ment, and also nix­es oth­er so­lu­tions. However we were go­ing to stream, I want­ed an HTML5 play­er that would play nice across Windows, Mac, and Linux as well as Android and iOS. 

I also felt it im­por­tant to make sure we could sup­port low la­ten­cy stream­ing. What do I mean by this? Put sim­ply, if your re­mem­ber when Twitch had a 15 – 30 sec­ond de­lay, and how they do not any­more, then you have ex­pe­ri­enced the great­ness of low la­ten­cy stream­ing. This gets the ac­tion clos­er to the view­er with de­lays from the stream­er of un­der 5 seconds.

And some­thing not to be tak­en light­ly for its place last here is scal­a­bil­i­ty. Yeah, I could feed an RTMP stream to my serv­er, and just wrap a play­er around it and be done with it. But that is su­per old form, and re­lies on Flash for play­back still. I could set­up ng­inx to lis­ten in and low la­ten­cy transcode it with FFMPEG into HLS and have bet­ter play­back sup­port, but how well could I scale that up if I re­al­ly want­ed to? The abil­i­ty to man­age and scale what­ev­er so­lu­tion we land­ed on mattered.

With that list of needs in mind, I went a‑looking around the in­ter­net. There were a cou­ple things I spot­ted, and didn’t go with… and then there was the winner. 

What didn’t we use at first?

Something that seemed su­per pow­er­ful, but was too pricey for me, was Wowza Streaming Engine. Looks like a fine piece of kit, with great re­views. The prob­lem be­ing I’m cheap at times, and Wowza had fea­tures that I frankly was nev­er go­ing to touch. Why pay for things I don’t need?

There was also a prod­uct called Red 5, with their free and paid ver­sions. It would have got­ten us off the ground, but it just didn’t have all that I want­ed. No of­fense to them, but it all just wasn’t jiv­ing with me. Not when their cheap­est Pro pack­age comes in at $29.99 and lim­its you to 100 con­nec­tions. Forget that.

I looked at webtorrent/P2P stream­ing for a quick sec­ond, and I am very con­fi­dent about its fu­ture. The so­lu­tion we went with even sup­ports it. But I need a more sta­ble de­liv­ery method now. 

Beyond just build­ing some­thing up with ng­inx, FFMPEG and duct tape, there was a so­lu­tion I had found that re­al­ly hit all my needs right on the packaging.

And that was how we start­ed us­ing Nimble Streamer and WMSPanel. 

Those two prod­ucts are pro­vid­ed by Softvelum LLC, with Nimble Streamer be­ing the free­ware stream­ing com­po­nent and WMSPanel act­ing as a cPanel-like piece of con­trol soft­ware to con­fig­ure and man­age var­i­ous as­pects of your stream­ing in­fra­struc­ture. They even give a two-week free tri­al of the WMSPanel com­po­nent, which is cer­tain­ly a bonus. It be­ing half the price of Wowza while also pro­vid­ing dang near any­thing I could want to start out with cinched the deal.

So what all it can be used for, and what we are us­ing it for are cer­tain­ly dif­fer­ent sto­ries. For what all WMSPanel and Nimble Streamer can do, I’ll just di­rect you to their site so they can sell themselves.

What are we able to use it for now with our re­sources my knowledge? 

Nothing more than ex­act­ly what I need­ed from my list­ed re­quire­ments at the start, and then some.

Our Live page. Isn’t it pretty?

So we have our Live page that you can see us stream to with in­creas­ing reg­u­lar­i­ty as the year goes on. And do­ing it with WMSPanel al­lows us to feed our RTMP stream from the source into FFMPEG to transcode into an ABR (adap­tive bi­trate) stream, which al­lows us to still cater to folks with low-bandwidth. And while Softvelum does of­fer their own transcoder with its own con­trol pan­el area, I’ve al­ready told you that I’m a cheap bas­tard and it comes with ex­tra cost. I’ve al­ready set­up a good FFMPEG con­fig­u­ra­tion to en­code every­thing ef­fi­cient­ly while main­tain­ing the the low la­ten­cy stream­ing that I de­sired by us­ing it in com­bi­na­tion with Softvelum’s SLDP out­put (comes free with WMSPanel). 

WMSPanel also gives us the abil­i­ty to re­stream to var­i­ous oth­er plat­forms eas­i­ly, so we can act as our own Restream.io even. So if we choose, we can keep stream­ing to our Twitch chan­nel for users who pre­fer that platform. 

Something that is more ben­e­fi­cial for me, than for the au­di­ence gen­er­al­ly, is that there are DVR set­tings for the back-end too. This is great for hav­ing a fail-safe record­ing of any­thing we do in case we for­get to record while we stream, a Twitch archive goes weird, or any oth­er num­ber of sit­u­a­tions that arise which need a recording. 

Then there is the API avail­able. Something I didn’t even knew I would need at first, but it is bun­dled right in with it all for free. I’m too dumb right now to work with it in full ca­pac­i­ty, but as I Learn To Code™ (or get some­body way bet­ter than me at this stuff) I can start to re­al­ly fill out our abil­i­ty to cus­tomize our de­liv­ery and fea­tures in a hard­core fash­ion. Right now I am like smol baby with that stuff, but I’m learning!

So all in all I’ve been su­per im­pressed by the of­fer­ing from Solftvelum, and my abil­i­ty to set­up stream­ing in­stances 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 oth­er users stream­ing on our servers with­out us need­ing to poke the back­end man­u­al­ly all the time. Good stuff.

And all of this comes with the abil­i­ty to scale very nice­ly. WMSPanel and Nimble Streamer are built to work with edge servers and all sorts of video en­cod­ing and de­liv­ery work­flows, so what we can do with it all is pret­ty much lim­it­ed only to our imag­i­na­tions and budget. 

I don’t want to risk this get­ting over long, so I will leave off here be­fore I get into hard­er de­tails of how I set spe­cif­ic things up, like my use of FFMPEG for transcod­ing or how I set­up web play­ers for streams.

If any­body has any ques­tions about any­thing just hit us up in the com­ments be­low, or throw a bird at us on Twitter!

Next Time On SUPERNERDLAND…

 

NERD SHIT!

The fol­low­ing two tabs change con­tent below.
Josh has worked in IT for over 15 years. Graduated Broadcasting school in 2012 with a fo­cus on A/V pro­duc­tion. Amateur pho­tog­ra­ph­er with a pas­sion to make things work… by any means nec­es­sary. Editor-in-Chief and do-er of tech things at SuperNerdLand

Latest posts by Josh Bray (see all)

Scroll to top