Digit Geek
OBS Studio Live YouTube
Digit Geek > Recent Articles > Technology > How to livestream your gameplay on YouTube with OBS Studio

How to livestream your gameplay on YouTube with OBS Studio

The following tutorial will help you setup OBS Studio to build your own streaming PC to broadcast on YouTube.

Over the years, YouTube has witnessed a rise of channels hosting their gameplay religiously, whether live or pre-recorded ones. In fact, the most subscribed YouTuber, PewDiePie, rose to fame with his Let’s Play videos. Earlier, streamers relied on recorded footage but now, it has become effortless to livestream your gameplay, accessible to everyone and not just to professionals. You’ll find premium software bundled with gaming laptops or even games, that have far easier setup controls. But for this workshop, we will explore a free and open source alternative, and probably the most popular broadcasting service called Open Broadcast Software, or just OBS.

Before we begin, there are a few things you need to keep in mind. You’ll obviously need a good gaming PC and a high-bandwidth internet connection for a seamless and good quality stream. But you don’t need to worry if you have a poor internet connection because we were able to stream at lower bandwidths of around 1Mbps and on a system running a Second Gen Intel Sandy Bridge CPU. Although the stream might be strong but depending on your ISP, your game pings might get affected. In one of our test cases, the ISP was able to simultaneously maintain a stable ping and stream as well. The shortcoming with low bandwidth connections would be poor, pixelated streams, even though your stream could be running at 1080p and 60fps.

A better setup would also require you to have another display so that you could be playing on one display while controlling and watching your stream on the other. The best solution for a high quality and seamless streaming experience would be the use of a dedicated streaming PC, where you play the game on one PC while the streaming PC captures your game and streams it online. This workshop will only be looking at how to stream using a single PC.

Downloading OBS

Currently, there are two downloadable versions of OBS – OBS Classic and Studio. Classic is the original software the project was started while Studio is the revamped version. The advantages of Studio is that the entire software has been rewritten from scratch and the Settings menu has also been overhauled to make things easier. Another advantage would be pre-installed plugins, because earlier, you had to install them individually in Classic.

Now, the question is whether you should download Classic or Studio and the answer is simple. New users should definitely download Studio since fiddling around with the different streaming and encoding settings is a tad bit easier than Classic. The main reason would be the discontinuation of updates from Classic whereas Studio has been witnessing a healthy update cycle.

You can download OBS Studio from here.

Setting up scenes and sources

When you start up OBS, you’ll be presented with a blank window and four sections below it. In the Settings menu, the General tab includes a few useful features and also an option pick between a light and dark theme, a feature missing on Classic. A scene is a collection of elements from different sources that ultimately forms the final screen that is streamed to your viewers. Multiple scenes can be added to a single stream and switched accordingly using hotkeys in between the stream. It’s smarter to assign a purpose to every scene rather than adding multiple scenes for every single source since there’s no restriction on the number of sources in one single scene. This will make it less complicated to switch scenes when you’re in the middle of a live stream. Sources are elements where your content will be pulled such as your desktop screen, webcam, mic audio, desktop audio, browser window, etc.

OBS Studio Live YouTube

As a means of making your live stream look good, we would recommend using animated intros, borders and overlays for your sources. These aren’t a necessity but your viewers will love the customisation based on your channel’s theme. The animated intro also acts as a buffer for the times when you’re about to begin your live stream. Rather than showing your desktop, you could display the animated splash screen in a loop.

Create the first scene and name it something like Intro. Animated intros or any kind of video element can be added as a Media Source. If you want to save on bandwidth, and add just a standby image instead of a looping video, you can add one or more from Image or Image Slide Show. In the same way, you can also add text using the Text (GDI+) source. Along with an intro source, you can also add another image or media source as Standby for the times when you need to take a break but still continue streaming or make changes in OBS on the fly.

OBS Studio Live YouTube

Moving on to adding your gameplay as a scene, we’ll create a new scene and name it Game. Naming and assigning hotkeys is important at the beginning to prevent any confusion later after you’ve added multiple scenes and sources. To display your game, you have three options including Display Capture, Game Capture or Window Capture. Out of the three, Game Capture is what you should be opting for but there were times where a blank screen was output and the stream lagged during switching. If it doesn’t work out for you, Display Capture should be your option, the only problem here could be your entire desktop screen will be visible to the viewers. But this can also be prevented by switching to your Standby screen or intro when you’re using the desktop and switching to the Desktop Capture after opening up the game using hotkeys which register globally over any running process. If you wish, you can also add your webcam feed as a source using Video Capture Device. You can then move, crop and resize the webcam feed wherever you want on the screen. To follow the channel’s theme, you could add a border as an Image source around the webcam feed and also a logo somewhere in the scene.

There are many variations that you can try out by adding multiple sources to the same scene and finding the best composition you need. Once you’re satisfied on the scenes, you can assign hotkeys to them under Settings to switch between them without opening up OBS. Avoid assigning hotkeys that might be already used by the game or desktop. This will create unnecessary confusion mid-stream.

OBS Studio Live YouTube

Adding stream settings

Your stream settings include the services to where you’ll be livestreaming. You can choose from Twitch, YouTube, and even Facebook Live. For this case, we’ll select YouTube/YouTube Gaming and continue with the default Primary YouTube ingest server. Your stream key is unique to your channel and needs to be entered in order to connect the live stream feed to your YouTube account. Head over to your channel settings or Creator Studio in YouTube, then Livestreaming, and enable Live streaming privileges. It’s fairly easy to setup and once you’re through, scroll to the bottom of the dashboard and you’ll find your stream key. Click on reveal and copy-paste the key in OBS and hit Apply. You need to keep your stream key private since anyone with access to it will get access to stream content on your channel. If you wish to add Stream settings for other services, the process is similar and all you need to do is find the stream key in the service’s dashboard and add it to OBS. For Twitch, you’ll need to download a separate tool called Twitch Bandwidth Test to figure out the best server.

OBS Studio Live YouTube

Experimenting with encoding

Getting the right encoding settings takes a lot of time unless someone else with the same configuration as yours has posted the optimal settings. Your encoder settings are highly dependent on the game you’re playing, whether it’s an FPS or an MMO or an RTS game. The reason is different genres have different rendering speeds and accordingly, the encoding needs to be capable of outputting it. Another factor would be how powerful your hardware is, essentially your CPU and GPU. The Stream Settings Estimator web tool will give you exact numbers on the settings you need to populate in OBS. Head over to the Output menu under Settings in OBS and select the Simple mode since we won’t be changing anything under the Advanced mode. You’ll have to enter your video bitrate in kbps at which your stream will be sent to YouTube or other streaming services. YouTube has completely listed down the settings you’ll need to enter for different resolutions and frame rates here.

You’ll need to factor in your internet bandwidth as well since the above recommendation doesn’t consider it. Your video bitrate should be around 80-85% of your upload bandwidth that can be acquired and calculated by running Speedtest. Do note, Twitch has restrictions to a video bit rate of 3,500 kbps (unless you’re a partner). Facebook Live has many restrictions on encoding settings such as no support for hardware encoding, a maximum audio bitrate of 128, maximum resolution of 720p at 30 fps, and maximum video bit rate of 4,000 kbps.

OBS Studio Live YouTube

Choosing whether you want to use software or hardware encoding depends on your rig. If you have a strong CPU like an Intel i7, then you can pick the x264 encoder with audio bitrate at 160 and Encoder Preset on fast. You’ll need to check whether your CPU is capable of handling the different Encoder Presets where ultrafast doesn’t stress the CPU whereas slower in intensive. You should definitely opt for x264 encoding if you don’t have a discrete GPU.

But if you do have a decent or powerful GPU, you could enable hardware encoding and the corresponding encoder to your GPU (AMD or NVIDIA) will appear. Here, you can again experiment with the encoder presets from High Quality to Low-latency High Performance. In our testing, we found the hardware encoder to be better at streaming with the GTX 1080 even though we had the i7-3960X.

Audio and video settings

There isn’t much in the audio and video settings since everything will be set to default. You can choose between the sample rates and reassign your desktop audio and mic sources. In audio, Studio sees an update over Classic to support multiple sources for desktop audio and mics. Click on the drop-down menu for Desktop Audio Device and Mic/Auxiliary Device, and select your devices rather than letting the default setting stay for better control over your stream.

OBS Studio Live YouTube

The video settings essentially ask you to set the resolution and fps that you want to output on your stream. It could be 1920×1080 at 60fps or 1280×720 at 60fps, depending on your internet bandwidth and PC specs. Choose the Downscale Filter as Lanczos only if you have a powerful rig.

OBS Studio Live YouTube

Previews, dry runs and going live

Before you go live to your audience, it’s important to test whether scene transitions are functioning properly. You can right-click on each scene and go to Fullscreen Projector that will give you a preview of how that scene will look like in the stream. You should do this for every scene, just to be sure. The best way to check whether all your hotkeys work is to record a session. When all the scenes and sources are final, hit the Start Recording button and it will save a local copy of the entire session. You can refer to the recorded video to discover flaws and then move on to a dry run online.

Do note that even the first dry run on your YouTube channel will send a notification to your subscribers (if you have any) that you’ve gone live. Hence, it would be advisable to use a secondary undisclosed YouTube channel to experiment.

OBS Studio Live YouTube

After you’ve entered all the settings in YouTube as mentioned above, hit Start Streaming in OBS and the top bar in the YouTube Live dashboard should turn green or yellow or red. The different colours depict the quality of the stream where green is the best and red is the worst. A preview should appear in the window below where you can see the scenes from OBS. Start the game you want to stream and switch to that particular scene if you’re using Game Capture. Since the game will run in fullscreen, the best way to check whether your live stream is functional is to watch it live from a mobile device, preferably on a different connection (cellular) or you could ask a friend to watch. You can try switching between the scenes and testing all the hotkeys, and also observe whether the stream suffers frame drops or freezes. If you notice these problems, then you’ll have to go back to tweaking the encoder settings and more tests.

If you have a strong internet bandwidth that can handle both the streaming and watching simultaneously, then you can have the YouTube Live dashboard running on another monitor if you have one. This will enable you to watch and reply to your chat messages and keep an eye on the stream’s health. It is also essential to check your audio levels for each audio input source. Sometimes, your in-game audio could be overpowering your mic input and you will have to reduce the volume for your desktop or in-game audio source. You’ll also need to check for dropped frames in your stream at the bottom and there are numerous reasons to blame for it. You can check out this comprehensive post that tries to solve this problem.

Once your live stream is lag-free, you’re ready. Now it’s time to truly go live and face the world to display your high level of skills or the lack of it?

This article was first published in January 2017 issue of Digit magazine. To read Digit’s articles first, subscribe here or download the Digit e-magazine app for Android and iOS. You could also buy Digit’s previous issues here.

Abhijit Dey

Abhijit Dey

While indulging deep into conspiracy theories surrounding comic book movie plots, he can be found rewatching them looking for easter eggs. Otherwise, his weekends are spent on gaming and browsing memes.