You can sign up to get a daily email of our articles, see the Mailing List page!
Support us on Patreon to keep GamingOnLinux alive. This ensures we have no timed articles and no paywalls. Just good, fresh content! Alternatively, you can support us on Paypal and Liberapay!
I’ve had a number of requests to get a guide up on how to livestream from Linux to Twitch. It’s damn easy, so here’s how to do it.

Note: While this is aimed at Twitch, the process is exactly the same for any streaming service OBS Studio supports (apart from grabbing the streaming key of course, that's different for each service). OBS Studio supports Youtube, Twitch, hitbox, beam.pro and more out of the box.

First, download OBS Studio which on Arch is available in the repository, but for Ubuntu head to this page and follow the instructions for adding the repository and installing it.

Now, make sure you’re signed up on Twitch. Then head to the "Dashboard", and select the "Stream Key" tab. See these images below:
imageimage
Once there, hit the Show Key button and copy the entire thing. The Stream Key is yours and yours alone, do not share it. It's essentially the password to livestream to your Twitch channel. Make sure there’s no hidden space at the end of what you copy, as that will register as a character in OBS Studio and then your stream won't work. It's a small thing, but it has happened to numerous people.

Once you open OBS Studio, hit the "Settings" button on the right and then select the "Stream" tab on the left:
imageimage
Paste in the Stream Key I told you to copy earlier and pick a Server close to you.

Next, you need to actually sort out the video settings for what you’re going to be sending to the Twitch servers. Go to the "Video" tab on the left. You want to make sure you resolution is correctly set. Streaming at 1080p (1920x1080) is quite demanding on your hardware, so you will likely want it at 720p like this:
image
The “Output (Scaled) Resolution” is what you will be sending to your viewers. Also, you likely want it set to “30” for FPS, as having it higher is also more demanding on your system.

Next up, you need to sort out the Bitrate settings for the the video you send to the Twitch servers. For 720p you should set between 1800-2500 and for 1080p you should set between 3000-3500 (find more suggested settings from Twitch here and here):
image
The higher the number, the higher the quality of your video will be, but it will depend on you having a good internet upload speed. A good rule to follow for those on low-speed connections, is to set the bitrate to half of your maximum upload speed. So if you get 5mb/s download, a 2500 bitrate should do. Don't go higher than 3500, as that's Twitch's limit and they frown upon it.

Now that's all the work behind closed doors sorted, you need to actually show something to your audience. The best option in my opinion, is not to livestream your whole screen. Instead, I use the Window Capture option, then everything else can stay private and messages from applications you left open won't end up in the middle of the screen for all to see. Doing this is also simple! On the main OBS Studio screen, click the little + under the "Sources" panel to add it:
image
Give it a name and then you will be greeted with this:
image
Just pick which application or game you want from the "Window" dropdown box and then that will be shown to your viewers.

Once that's done, close the Settings panel and hit "Start Streaming" and that's all there is to it.

I have also set up a Twitch Community named "Linux-Streamers". If you want to stream to that community where others can find you, head to your "Dashboard" once again and scroll down a bit to see this:
image
Just enter "Linux-Streamers" and then hit "Update Information". This will then show on your livestream below the video and you will show up in the community when streaming.

Happy streaming Linux gamers!
14 Likes, Who?
Comments
Page: 1/2»
  Go to:

g000h 7 March 2017 at 8:46 pm UTC
Thanks for sharing. Always good to have information like this in case I'd need it.

One thing I think a lot of new Linux gaming users would like is information about setting up graphics drivers on Linux. What to do if your display manager stops working, how to install a proprietary driver (and get rid of it again), all those tricky things.
barotto 7 March 2017 at 8:47 pm UTC
If only I had a half decent line... I can barely watch streams at low quality lol
I can't even play games
meggerman 7 March 2017 at 8:54 pm UTC
This could be one of the situations where a Ryzen CPU would benefit with its many cores and threads.
Dribbleondo 8 March 2017 at 7:34 am UTC
You may wanna send Ubuntu users to the compile page instead, or a version of OBS 17+, which doesn;t have the X11 RAM memory flooding error.
CJOR 8 March 2017 at 2:45 pm UTC
Great! Thanks for the Twitch Community!
Leeo97one 9 March 2017 at 5:52 pm UTC
Good guide, it should be on the Wiki ;-)
14 14 March 2017 at 4:36 pm UTC
View PC info
  • Supporter
Scaling the output resolution is more demanding on local hardware but saves on upload bandwidth. If you wanted to save on processing time, you'd need to change the resolution in your game itself.

Depending on the game you're playing, you may want to use CPU or GPU encoding... whichever has more processing power to spare.
GloriousEggroll 16 March 2017 at 4:52 pm UTC
side note, if you want web notifications (such as from twitchalerts), you can also install the qt webkit browser source plugin.

github source:
https://github.com/bazukas/obs-qtwebkit

arch AUR:
pacaur -S obs-qtwebkit-git

then open obs, right click sources>add browser source and paste your url

side note #2: if you have an nvidia 600 series or higher gpu with the proprietary drivers, you can use nvenc to encode your stream in obs instead of x264, which is particularly useful if you don't have a strong cpu. nvenc uses dedicated encoding hardware on nvidia maxwell gpus (and higher) which does not take away from gpu performance. this is also what nvidia uses for shadowplay. amd has something similar as well which can also be used in OBS, but i don't remember the name of it.


Last edited by GloriousEggroll at 16 March 2017 at 4:57 pm UTC
Binogure 16 March 2017 at 6:56 pm UTC
Is it only a gaming-community streamers, or can I stream my sketch done via Krita with the Linux-Streamers flag ? ?
  Go to:
While you're here, please consider supporting GamingOnLinux on Patreon or Liberapay. We have no adverts, no paywalls, no timed exclusive articles. Just good, fresh content. Without your continued support, we simply could not continue!

We also accept Paypal donations and subscriptions! If you already are, thank you!

Due to spam you need to Register and Login to comment.


Or login with...

Livestreams & Videos
Community Livestreams
  • GOG Guest Stream: Resonance
  • Date:
See more!
Popular this week
View by Category
Contact
Latest Forum Posts
Facebook