Skip to content

Instantly share code, notes, and snippets.

@myusuf3
Created September 30, 2012 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myusuf3/3808287 to your computer and use it in GitHub Desktop.
Save myusuf3/3808287 to your computer and use it in GitHub Desktop.
#! /bin/bash
INRES="1920x1080" # input resolution
#OUTRES="1024x640" # Output resolution
OUTRES="1920x1080" # Output resolution
FPS="30" # target FPS
# 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 -itsoffset 00:00:01 \
-f alsa -ac 2 -i pulse \
-vcodec libx264 -s $OUTRES \
-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