Skip to content

Instantly share code, notes, and snippets.

@WilliamBundy
Last active December 16, 2015 15:48
Show Gist options
  • Save WilliamBundy/5458018 to your computer and use it in GitHub Desktop.
Save WilliamBundy/5458018 to your computer and use it in GitHub Desktop.
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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment