Tutorial: Live Stream To Twitch TV With Ubuntu Linux



**UPDATE**
Seems like the syntax for avconv has been updated causing there to be no video to the Twitch stream. I’m working on updating the script with a video upate. Subscribe to get a notification of the update. Thanks.

A tutorial on how to live stream to Twitch.TV using Ubuntu Linux. Sorry for such bad instructions. I did this on a whim and didn’t think through exactly what needed to be done. Hopefully it makes sense and helps you. If you have questions, leave them in the comments. Happy streaming!

Note: Keep in mind that live streaming requires a good bit of resources. So don’t expect to get good results on a single core with built in graphics.

NOTE: If you get an error that has something like “Failed to set value ‘medium’ for option ‘preset’ ” in it then try typing “sudo apt-get install libavcodec-extra-53” in the terminal and re-running it. Thanks to Dakota Fuller for the tip.

——————————————LINKS——————————————

Osirez Tech: Record or Stream Desktop & Games (Ubuntu 13.04)
http://osireztech.blogspot.com/2013/09/record-or-stream-desktop-games-ubuntu.html

Twitch Script
https://gist.github.com/brodul/3178130

Twitch TV (streaming key)
http://www.twitch.tv/broadcast

source

28 comments

  • Sons Of Anarchy {SOA} 3 years ago

    hey osirez do you steam from 1 pc or 2 pc .. I'm looking at stream from 2 pc but I don't no how to set it up  and if the AVERMEDIA Game Broadcaster HD would work on obs

    Reply
  • razza 3 years ago

    mine comes up with this RTMP_ReadPacket, failed to read RTMP packet header
    rtmp://live.justin.tv/app/: Unknown error occurred

    Reply
  • Vinc3nt78 3 years ago

    When i launch obs " error failed to initialize vidéo: Unspecified error"

    Reply
  • Vinc3nt78 3 years ago

    I need help, when i start recording i got 5fps ….

    Reply
  • boki boka 3 years ago

    HOW DO I STOP IT STREAMING?

    Reply
  • boxman139 3 years ago

    Thanks, man. It works great. However, I did need to lower my resolution in the .sh file so I can preview my stream without derpyness. Otherwise, Works just as good as windows. Thanks!

    Reply
  • Osirez Tech 3 years ago

    +Anoni Mo I can't reply to your comment. Not sure why. But anyways your bitrate is dependent on your internet connection. Not your hardware. So if your having a problem on Windows then you'll probably have one on Linux.

    Reply
  • Icky Spliff 3 years ago

    Is this a good solution for when your graphics card is not good enough to broadcast through windows and it drops frames on HD? If the usual windows system method of broadcasting on Twitch does not allow you to get good bitrate streams… would doing it from linux allow you to increase the bit rate of the stream? or will the result be the same?

    Reply
  • Petter Thowsen 3 years ago

    My video is glitchy, audio works fine though. Using the settings you used on Ubuntu 14.04 x64.

    Reply
  • Scyqod 3 years ago

    Help please? o:

    Unrecognized option: 'preset'
    Failed to set value 'fast' for option 'preset'

    I have ubuntu version 12.04 LTS
    If that's the reason tell me.

    (My specs just in case)
    Intel Penitum G3240 3.2 GHz 2 Cores
    Kingston 8GB Ram 1600MHz
    Kingston SSDNow V300 120GB
    MSI Radeon HD 7770 GHz Edition

    And thats it :3

    Reply
  • Soul Smite 3 years ago

    preset value normal is unrecognized and fails to set value, what do i do?

    Reply
  • Chamunks Arkturus 3 years ago

    The video is a bit awkward but thank you very much all the same its surprising how many people stream from linux but cant manage to create a video tutorial for how…

    Reply
  • MinecraftManiac15 3 years ago

    is there a way to add a webcam box in the corner?

    Reply
  • TheScriptan 3 years ago

    Awesome!

    Reply
  • sacreno 3 years ago

    Hey Osirez,
    Thanks for the info and the hard work you put into finding and working on all of this. I have a problem I followed the tutorial to the T and I get this message when I run my twitch.sh file
    ./twitch.sh: line 20: avconv: command not found
    I have been searching the web for answers and have had no luck.

    Any thoughs?

    Thanks

    Reply
  • Hazted Cruz 3 years ago

    Ok so i fixed all that othere stuff but know Im getting this
    [rtmp @ 0x1030980] Server error: Authentication Failed.
    rtmp://live.justin.tv/app/ive_47988296_PtwQmUFXf8rnYylWr7zOusm813DK9L: Input/output error

    Reply
  • Hazted Cruz 3 years ago

    X Error of failed request:  BadMatch (invalid parameter attributes)
      Major opcode of failed request:  130 (MIT-SHM)
      Minor opcode of failed request:  4 (X_ShmGetImage)
      Serial number of failed request:  11
      Current serial number in output stream:  11

    Reply
  • classicrockonly 3 years ago

    Unrecognized option 'preset'
    Failed to set value 'medium' for option 'preset'

    Reply
  • Zelaf Ary 3 years ago

    when i stream the stream is just a black screen on twitch with it saying loading video and its live and everything and then script is reading the fps and stuff know any fix?

    Reply
  • MrSamsai 3 years ago

    This doesn't seem to work anymore. Are you aware of any fixes?

    Reply
  • Chris Bradshaw 3 years ago

    say I wanna stream something that takes up only a small portion of the screen (like ultima 4 in windowed mode) how would I stream just that window

    Reply
  • Osirez Tech 3 years ago

    Gaming as we know it is still pretty new to Linux so yea there aren't many streaming apps… yet. Especially when you think about how simple the script is and the process is that someone would have written a quick app for it. Simplescreenrecorder is supposed to be able to stream but i havent tried it yet.

    Reply
  • Insipid Cretin 3 years ago

    You know it's funny that there are no applications for Linux that are simple for things like streaming to twitch. You'd think there would be by now considering there are a few open source applications for Windows that do just that.
    Anyways this is was pretty helpful for me. I just wish there was a way to focus on a window without having to capture the entire desktop.

    Reply
  • Osirez Tech 3 years ago

    That is true. I just did that for the sake of keeping the tutorial simple. Thanks for pointing it out to others so that they'll know that they can move it.

    Reply
  • Green Reaper 3 years ago

    and the file twich.sh don't have to be on your Desktop you can put it in the Home folder

    Reply
  • Green Reaper 3 years ago

    I'll work on the livestream and see if i can get it two work … i have one for instagib.tv

    Reply
  • Osirez Tech 3 years ago

    ALSA is installed by default to Ubuntu. Are talking about Pulse Audio? Get that in the software center.

    Reply
  • Osirez Tech 3 years ago

    I've never used the LiveStream service before but I would imagine that you have to find out the correct RTMP address. This script also works for Justin.TV if your interested.

    Reply

Leave a Reply to Scyqod Cancel Reply

Your email address will not be published.