Skip to content

Instantly share code, notes, and snippets.

@rtyler
Created August 28, 2012 04:55
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 rtyler/3495063 to your computer and use it in GitHub Desktop.
Save rtyler/3495063 to your computer and use it in GitHub Desktop.
Code streaming scripts
#!/bin/sh
FONT="xft:ProFont:antialias=true:pixelsize=20:hinting=true"
FONT_BOLD="${FONT}"
exec urxvt-256color -fn "${FONT}" -fb "${FONT_BOLD}" $@
#!/bin/sh -xe
INFO=$(xwininfo -frame)
API_KEY=REDACTEDLOL
WIN_GEO=$(echo $INFO | grep -oEe 'geometry [0-9]+x[0-9]+' | grep -oEe '[0-9]+x[0-9]+')
WIN_XY=$(echo $INFO | grep -oEe 'Corners:\s+\+[0-9]+\+[0-9]+' | grep -oEe '[0-9]+\+[0-9]+' | sed -e 's/\+/,/' )
FPS="15"
INRES='1680x1010'
OUTRES='1280x720'
ffmpeg -f x11grab -s "$INRES" -r "$FPS" -i :0.0+$WIN_XY \
-f alsa -ac 2 -i default -vcodec libx264 -s "$OUTRES" \
-acodec libmp3lame -ab 128k -ar 44100 -threads 0 \
-f flv "rtmp://live.justin.tv/app/$API_KEY"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment