PC Gaming and Streaming

Streaming to YouTube vs Twitch

I’m Back(?)

It’s been almost a year since my last entry which would imply that this blog isn’t that important to me.  I’d say more accurately, it’s less important to me than other things in my life.  Those would be things like my job, raising my dogs, taking care of my house, enjoying my new Corvette, etc.  It’s not that I don’t care to write in the blog, it’s just that I’ve been too damned busy, and, to be honest, I haven’t had much to write about.  I hope to change that to some extent.

Introduction

Over the last few months, I’ve dipped my toe into streaming my video game play to YouTube Live.  I’ve streamed stuff from Rainbow Six Siege, Star Citizen, and Battlefield 1.  I started doing this because I switched my game play recording software from NVidia’s Shadowplay to OBS Studio.  And OBS Studio showed me how stupidly easy it was (and still is) to send game play footage directly to YouTube.  Details of all of that will follow in this post, but there’s a question you might be thinking about, “What about Twitch?”  That’s why I’m writing this: to explain why not Twitch.  At least, not right now.

The Hardware and Software

Hardware Encoder

The important piece of hardware in this discussion is the GPU.  Specifically an NVidia GPU, 700-series or later.  NVidia began including a hardware h.264 video encoder with all of those GPUs.  This is sometimes referred to as HVENC (Hardware Video ENCoder) or NVENC (Nvidia Video ENCoder).  What the HVENC allows gamers and other content producers to do is record their game play directly from the GPU without any hit to the game’s frame rate.  It’s basically seamless.  The system’s CPU does play a small role in this because the encoded video needs to be written to disk as an MPEG4 file, and the audio also needs to be multiplexed into it.  These two tasks are CPU-bound, but produce nearly no load whatsoever.

The result is that if you’re playing your game at 1080p with super-high detail, and you’re using a high refresh rate LCD panel (eg: 144Hz), you can safely record your game play while retaining 144 frames per second.  And the resulting files will be relatively small.  The reason this works is because the h.264 hardware encoders aren’t used for anything when you’re playing a game.  They sit idle.

The Recording Software

When NVidia initially publicized the existence of those idle h.264 encoders on the GPUs, they did so with an application that was called Shadowplay, but is now referred to as Share.  It’s part of their GeForce Experience package.  What that software allows game players to do is record full games, or capture small chunks of a game, save it to disk, and edit it or upload it to YouTube at a later date.  And as mentioned above, that capturing puts nearly no load on the system whatsoever, so the player retains his frames per second.

Since that time, NVidia has published the APIs to make use of those encoders.  And with that, other applications have adopted them and can also produce h.264 game play without loading down the gamer’s system.  As I mentioned in the intro, I’m using OBS Studio now.  I find it far more flexible than NVidia’s OEM software for a bunch of reasons.  And like NVidia’s software: it’s free.

Streaming

As I mentioned previously, I started streaming my game play to YouTube a few months ago.  I do it just as a gag and for the fun of it.  There’s no intent to ever try to make money off of it.  I’m not going to attempt to sell ads on it, or any such thing.  I’m not interested.  My “9-5” job pays the bills, rewards me technically and mentally, and provides me enough wherewithal to dabble in hobbies like this.  Before I get into the details of all of that, I’ll explain 3 different ways to stream to the likes of YouTube or Twitch.  The concepts apply to both, it’s just that the results are vastly different.

Using the GPU

The HVENC hardware can be used to stream as well as record.  All it takes is the appropriate software (Share does it, OBS Studio does it, Playclaw does it, etc) and configuration, and you’re off and running.  The only load this will put on your entire system is the network, really.  Since the hardware is encoding the video without pestering your CPU, you won’t see a loss in frame rate.  Your basic limitation is, really, your upload bandwidth.  For me: that’s 150Mbit/sec.

There’s a slight down side to this approach, though.  Let’s revert back to Shadowplay (not Share, because I haven’t looked at it), for a moment.  When you enabled recording on Shadowplay, the default bit rate for the recorded video was 50Mbit/sec.  That’s not a misprint.  Fifty megabits per second.  Which is a lot for a video encode.  Why so high?  Simple: the NVidia encoders are just encoders.  They’re not compression machines.  They can’t take a nice, highly detailed video input (such as a game) and compress it down to fit into a lower bitrate file.  It’s not physically possible for them to do that: they’re just encoders.  The only thing they can do (and they do it phenomenally well) is take an incoming video stream, such as your game, and encode it into an h.264 output.  That’s it.

If you want a lower bitrate while using the HVENC hardware, detail has to be removed from the output.  The result is an awful looking output.  In order to take that gorgeous game play you see and squish it into a lower bitrate with minimal loss in detail, you need your CPU to help.  But there are costs involved with that, too.

Using the CPU

You’ve decided a 50Mbit/sec bitrate output is just too large and you want it compressed further.  We’ll pick a random number like 4Mbit/sec (it’s not random, really.  Stick with me).  Well the GPU can’t do that.  The GPU is very specialized in its abilities to do things.  It does those special things intensely well, but compression isn’t one of them.  So with that, you use a different piece of recording software and ask the CPU to compress the output for you.

Great.  Except, now you’re not reliably getting 144 frames per second in your game.  Why?  What’s going on?  Well your CPU is working hard to keep up with the incoming game play, compress the snot out of it, and then write the resulting file to disk (or stream to the network).  And like or not, even the most GPU-intensive games will take a hit in frame rate when the system’s CPU is too busy.  The result will be a smaller output that might even look a bit better than the NVidia output.  But the cost of that was a hit to your in-game frame rate.

For an FPS gamer such as myself, that’s entirely unacceptable.

Using a Separate Streaming Machine

There’s a third option and that’s sending your game video and audio output to another machine entirely and letting it do the compression, multiplexing, and publishing.  If you build a PC to do this, it’ll need a reasonably fast and highly threaded CPU, and a capture card.  There are tons of options out there for both CPU and capture card; I’ll leave it as an exercise for the reader to do his or her own research.

In order to make this work properly, the gaming rig’s video card will need another output.  It’ll need to mirror the output that the game play is being displayed to out the second output, which will be fed into the streaming PC’s capture card.

With a separate machine in place, you can choose a CPU-bound compression and encoding mechanism for the stream output, and it won’t affect your game play in the slightest.  How far you can to compress the output is entirely up to the hardware you chose to build the streaming PC with.  The result will be a far better looking output that takes up significantly less bandwidth.  But the costs are fairly steep: you need a second PC.  Good CPUs aren’t cheap.  Neither are good capture cards.  Think on the order of $1000US.  For each.  And the second PC comes with all sorts of ancillary costs such as more noise and more heat.

There’s no free lunch here.

YouTube vs Twitch Streams

YouTube

I’ll start with YouTube since it’s the one I use and am most comfortable with it.  There are significant advantages to using YouTube as your streaming platform, but there are some drawbacks.  The biggest advantage is the seemingly limitless upload bandwidth.  Unlike Twitch, YouTube doesn’t place limits on its streamers when it comes to upload bandwidth (ie: video bitrate).  Why does this matter?  Well if you’ve followed along, you know that using the HVENC hardware on your GPU requires a very high bitrate to make the output look good, and it can do that without putting a load on your CPU.  Since YouTube will take any bitrate video from its streamers, you can send anything to them: any resolution, any frame rate, and any bitrate.  The result will be a gorgeous output for the stream audience, and the load on your machine will be minimal.

As an example to drive home the point, my stream outputs to YouTube are: 1440p (2560×1440), 60FPS, and 50Mbit/sec.  Since YouTube’s stream viewing is identical to its video viewing, the audience can click on the little gear on the lower right corner of the stream and choose what resolution they want to watch it at.  YouTube handles the scaling real time.

I have no special partnership with YouTube that allows me that freedom and flexibility.  It’s just included with the ability to stream to them.  In other words: anyone can do it.

The biggest downside to streaming to YouTube?  Audience size.  Compared to Twitch, no one really knows about YouTube steaming.  So the likelihood of you regularly having a 1000+ viewership on your stream is low.  It’s not impossible, mind you.  It’s just low.

Twitch

Over the course of the past couple of months, I’ve been working with a YouTube gamer and Twitch streamer by the name of XFactor.  His YouTube channel is here, and his Twitch channel here.  He only streams to Twitch, but also records and publishes videos on YouTube.  He plays a lot of Battlefield 1 (and Battlefield 4 before that, BF3 before that, etc).  It was through XFactor that I learned of this whole concept of a streaming PC and its importance.  Here’s why:

Twitch’s input limit is a paltry 3.5Mbit/sec.  It’s really low.  Pathetically so, in my opinion.  They claim it’s that low because, through their immense research (cough when you read that in your head), they’ve determined that the average viewer doesn’t have a high enough bandwidth connection to deal with a higher bitrate when they watch.  So to prevent the viewer from buffering, Twitch has decided to limit the streamer’s upload bitrate.  They do that instead of offering the viewer a way to lower the resolution or quality, like YouTube does.

What are the advantages of Twitch?  Well the big one is that it’s an accepted standard for streaming.  The audience size on Twitch is massive in comparison to YouTube.  And that’s a big deal because Twitch also makes it relatively easy for the content producer to earn money for streams.  Channel subscribers end up paying the content producer a small amount of money every month (around $5US) and this can add up quick to a nice little chunk of cash every month.  In return, the subscribers get special channel-specific benefits like access to graphical emotes, the ability to post links in the chat window, and other things.

Ultimately, if a streamer wants a big audience, Twitch is the place to be.  And it’s also a way he or she can make some decent money assuming the content is high enough quality to draw in the audience.

That Bitrate Though…

And this is where the separate streaming PC comes into play.  As I mentioned, I’ve been working with XFactor for the last few months, helping him build a new streaming rig to replace his aging one.  The reason is that he wanted a much more powerful CPU than what he had, as well as a nicer video capture card.  This all so that he can compress the hell out of his Battlefield 1 game play and send it to Twitch within their small bitrate limit.

The results have been astounding and immediately noticeable.  His previous machine was running at nearly 100% constantly during his streams, and the output would end up getting pixelated or blurry every so often.  Further, it would display screen tear, which is when he’d flick his mouse quickly to turn his character rapidly, but the video encoding and compression couldn’t keep up with it in real time.  All of those problems have been eliminated.

He’s still only sending a 720p/60FPS stream to Twitch, which I think is sub-optimal.  His new rig (which is based off an overclocked Intel 6950X) can easily compress a 1080p/60FPS stream down far enough to fit within the bitrate limits.  So I’m actively encouraging him to increase that.  But even so, his new 720p streams are dramatically better than the previous ones from a quality perspective.

Quality vs Quantity

I’ve seen a similar competition in my life time, and it was ages and ages ago: the whole Betamax vs VHS thing for VCRs.  Some readers may be too young to remember that, but during the earlier 80s, long before DVDs and Blurays (or downloading your favorite movie off a pirate site), there were two competing technologies for home video: Betamax and VHS.  We know now that VHS won.  But it wasn’t because VHS was better.  In fact, it was worse in just about every way from a video quality perspective (within the limits of a magnetic tape, mind you).  Betamax had it beat in almost every way.

The killer was the cost of entry into Betamax for the hardware.  The end user’s Betamax machine was vastly higher quality and built to a far higher standard than the competing VHS player.  But the home market didn’t care about that.  They wanted “cheap and easy to use”.  So with that, VHS won leaving the superior-quality Betamax in the dust bin of history.

I liken YouTube’s streaming to Betamax and Twitch’s to VHS.  The audience is on Twitch.  Not exactly for the same reasons, of course: the audience doesn’t pay a thing for either.  But just from sheer numbers (such as with the sheer numbers of VHS buyers back in the 80s), I suspect the lesser technology of Twitch is going to continue to be the dominant platform for streamers.

Unfortunate, really.

I’m on YouTube

For the time being, I’m going to continue using YouTube.  I don’t have a second PC built to act as a streaming rig, and I don’t really want to affect my in-game frame rate.  So I’ll continue sending YouTube a 50Mbit/sec stream directly from my GPU’s hardware encoder, and viewers can watch at whatever resolution they feel comfortable with.

In the future, I might decide to build a streaming PC.  If so, then I’ll start sending streams to Twitch as well as YouTube.  Yep, I’ll do both because I have enough upstream bandwidth to handle it.  Viewers will have the ability to watch the same, exact stream on both Twitch and YouTube and make up their own minds which they’d rather watch.  Sadly, I suspect the answer will still be Twitch, even though it’ll be clear as day YouTube’s quality is vastly higher.

1 thought on “Streaming to YouTube vs Twitch

Leave a Reply