Skip to content

Setting Up a Livestream: Linux

Vilsol edited this page Jul 4, 2014 · 4 revisions

In this guide, you'll be learning the basics of getting a livestream started for the ten.java contest.

This should work for most distributions however I've only tested it on 64-bit Ubuntu 13.10 and 14.04.

Obtaining the stream key

This assumes you have a Twitch account.

Navigate to www.twitch.tv/broadcast/dashboard and click Show Key. Copy the key and save it for later.

Downloading and Configuring the Software

Wargio Option

We are going to be using Twitch Streamer for Linux by Wargio. It is available for free on GitHub.

Go to the GitHub repository for Twitch Streamer for Linux and save the files twitch_avconv.sh and twitch_ffmpeg.sh to your computer. You will only need one to livestream but I'd recommend trying them both out to see if one works better than the other. Alternatively, you can clone the repository with git clone https://github.com/wargio/Twitch-Streamer-Linux.git to save all the files.

Now create a file twitch_key in the same directory you saved the files to. Paste your stream key in the file.

Now open the bash file (twitch_avconv.sh or twitch_ffmpeg.sh) and configure it to your liking. The files are well-documented and there are comments explaining what to edit. If you don't wish to use a webcam, set the WEBCAM option to "".

Starting your Stream

To start the livestream, open the terminal (Ctrl+Alt+T if you're on Ubuntu), navigate to the folder with the bash files (cd Twitch-Streamer-Linux or whatever you named the folder) and start one of the two bash files: sh twitch_avconv.sh or sh twitch_ffmpeg.sh. If ALWAYS_FULLSCREEN is set to false, this will ask you to select a window to livestream. If it's set to true, it will capture the entire screen.

I recommend trying this out before the actual contest as you may run into issues the first time you're running this. There are two options available (avconv and ffmpeg) so if one fails, try the other.

If there's something I forgot to cover about getting the software set up, refer to the project's readme. If you have any problems, ask Google for help or poke DeprecatedNether on IRC.

Simple Screen Recorder option

Another option is by using the Simple Screen Recorder, and setting the output file as a stream link. You can start by downloading the software:

sudo add-apt-repository ppa:maarten-baert/simplescreenrecorder
sudo apt-get update
sudo apt-get install simplescreenrecorder simplescreenrecorder-lib:i386

After that you can setup a new profile with options something like this (As this stream will be all about coding, then you can lower the framerate and increase quality):

And then you want to fill in your stream details. First choose one of the 3 "Live Stream" presets, depending on how fast your internet connection is. Then you want to enter your stream URL. It consists of two parts, the stream server, and you stream key. You can find all of the streaming servers Here. The key looks something like rtmp://live-lhr.twitch.tv/app/live_xxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

The rest of the settings are as follows:

The custom options are preset=faster,minrate=1000,maxrate=1000,bufsize=1000,keyint=60 which depend on your internet speed.

To start streaming, simply press start recording, wait a few seconds and the stream will be online!

If anything doesn't work, you might find your answer here: http://www.maartenbaert.be/simplescreenrecorder/live-streaming/

If you have any questions (about the contest, git, Maven etc), please don't hesitate to send us a tweet @tenjava or ask in our IRC channel.

Clone this wiki locally