Created
January 17, 2014 05:31
-
-
Save ckdarby/8468835 to your computer and use it in GitHub Desktop.
Linux streaming Twitch
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 | |
# gist created by ckdarby | |
INRES="1920x1080" | |
OUTRES="1920x1080" | |
FPS="60" | |
QUAL="ultrafast" | |
SOUNDSOURCE="alsa_output.pci-0000_00_1b.0.analog-stereo.monitor" #pactl list sources | grep Name | |
# 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 -f pulse \ | |
-i $SOUNDSOURCE \ | |
-async 30 \ | |
-vcodec libx264 -preset $QUAL \ | |
-acodec libmp3lame -ac 2 -ar 44100 \ | |
-b 2000k -minrate 2000k -maxrate 2000k -bufsize 2000k \ | |
-strict normal \ | |
-loglevel verbose \ | |
-f flv "rtmp://live-jfk.twitch.tv/app/$STREAM_KEY" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment