Created
July 25, 2012 19:39
-
-
Save brodul/3178130 to your computer and use it in GitHub Desktop.
Twitch.tv script for streaming
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# originaly from http://tinyurl.com/twitch-linux from taladan | |
# www.youtube.com/user/taladan | |
# gist created by brodul | |
INRES="1280x800" # input resolution | |
#OUTRES="1024x640" # Output resolution | |
OUTRES="800x500" # Output resolution | |
FPS="30" # target FPS | |
QUAL="medium" # one of the many FFMPEG preset on (k)ubuntu found in /usr/share/ffmpeg | |
# If you have low bandwidth, put the qual preset on 'fast' (upload bandwidth) | |
# If you have medium bandwitch put it on normal to medium | |
# Write your key in a file named .twitch_key in your home directory | |
STREAM_KEY=$(cat ~/.twitch_key) # This is your streamkey generated by jtv/twitch found at: http://www.justin.tv/broadcast/adv_other | |
avconv \ | |
-f x11grab -s $INRES -r "$FPS" -i :0.0 \ | |
-f alsa -ac 2 -i pulse \ | |
-vcodec libx264 -s $OUTRES -preset $QUAL \ | |
-acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b 712000 -bufsize 512k \ | |
-f flv "rtmp://live.justin.tv/app/$STREAM_KEY" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You may try this one for noobies. :) https://github.com/xros/livestreamer