Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Alright so I've had Linux Ubuntu 12.04 for over a year now and I still don't know anything about it. That only thing I can do with it is use the internet. I want to start streaming games that I play on my computer to, but I don't know how. All of the downloads are only for windows. I found a website that tells you how to do it, but since I know nothing about linux, I can't do it. I haven't been able to get past the first step yet. Can someone please give me a step by step tutorial on how to do it. Please do not think you are being to specific, because I am sure it will help me. The link to the website is this -

share|improve this question
possible duplicate of How do I stream to – Jorge Castro Aug 29 '15 at 15:18

You'll likely have to use ffmpeg or avconv and supply your key which can be found here:

Personally I use ffmpeg because avconv for some reason only displays my mouse on the stream when streaming from my laptop. A short example of this would be:

# stream key. You can set this manually.
STREAM_KEY=$(cat ~/.twitch_key)

# stream url. Note the formats for and
# twitch:"rtmp://$STREAM_KEY"
# justin:"rtmp://$STREAM_KEY"

ffmpeg \
-f alsa -ac 2 -i "pulse" \
-f x11grab -s $(xwininfo -root | awk '/geometry/ {print $2}'i) -r "30" -i :0.0 \
-vcodec libx264 -s "640x360" -vpre "fast" \
-acodec libmp3lame -threads 6 -qscale 5 -b 64KB \
-f flv -ar 44100 "$STREAM_URL"

There are several gists out there that bundle the whole process into a more understandable script. I couldn't find one that I liked so I created my own based on the code above:

You can see more about streaming to from ubuntu in this post:

share|improve this answer
Thanks for your help! This looks like something I could use. However, when I try your example, or the one you have linked to, I get the following error: [X11grab indev @ 0x1d05440] Unable to parse option value "1920x1080+0+0" as image size [X11grab indev @ 0x1d05440] Error setting option video_size to value 1920x1080+0+0. (full log here) What to do? – Nickolai Leschov Dec 3 '13 at 13:34
What did you use for your INRES and OUTRES variables? It's complaining about your defined size of "1920x1080+0+0". Either this is the wrong format or you've got some special characters instead of double quotes. Make sure you have double quotes only in the script. – alexgophermix Dec 3 '13 at 18:30
INRES=$(xwininfo -root | awk '/geometry/ {print $2}'i), OUTRES="640x360", as in your example. (xwininfo) – Nickolai Leschov Dec 3 '13 at 18:59
Ah, it looks like $(xwininfo -root | awk '/geometry/ {print $2}'i) is returning an inproperly formatted size on your machine. Try manually setting your desired input resolution instead. For example: "1920x1080". If you need it to automatically pull the dimensions of your screen try this instead: $(xdpyinfo | grep 'dimensions:'|awk '{print $2}') – alexgophermix Dec 3 '13 at 20:01
This works. Now it goes "File for preset 'fast' not found ". How do I check which presets are there? – Nickolai Leschov Dec 3 '13 at 21:55

protected by Community Nov 29 '14 at 17:40

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.