Skip to content

Instantly share code, notes, and snippets.

@WilliamBundy
WilliamBundy / twitch.sh
Last active December 16, 2015 15:48
A short shell script for streaming with twitch.tv on linux. Requires avconv. Make a file called .twitch_key in the same directory as your script and store your twitch key in there.
#! /bin/bash
# these 3 lines need to be configured for your streaming area
TOPXY="1680,24"
INRES="1920x1056"
OUTRES="852x480"
FPS="30"
QUAL="medium"
STREAM_KEY=$(cat ~/.twitch_key)
avconv -f x11grab -s $INRES -r "$FPS" -i :0.0+$TOPXY -f alsa -ac 2 -i pulse -vcodec libx264 -s $OUTRES -preset $QUAL -acodec libmp3lame -ar 44100 -threads 4 -qscale 3 -b 712000 -bufsize 512k -f flv "rtmp://live.justin.tv/app/$STREAM_KEY"