This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 1st, 2014  |  syntax: Bash  |  size: 1.16 KB  |  views: 90  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #! /bin/bash
  2. OFFSET_A_X=$(xwininfo -name DOTA\ 2\ -\ OpenGL | awk 'NR==4' | awk '{print $4}')
  3. OFFSET_A_Y=$(xwininfo -name DOTA\ 2\ -\ OpenGL | awk 'NR==5' | awk '{print $4}')
  4. OFFSET_R_X=$(xwininfo -name DOTA\ 2\ -\ OpenGL | awk 'NR==6' | awk '{print $4}')
  5. OFFSET_R_Y=$(xwininfo -name DOTA\ 2\ -\ OpenGL | awk 'NR==7' | awk '{print $4}')
  6. OFFSETX=$(echo $OFFSET_A_X+$OFFSET_R_X | gp | awk 'NR==15' | awk '{print $3}')
  7. OFFSETY=$(echo $OFFSET_A_Y+$OFFSET_R_Y | gp | awk 'NR==15' | awk '{print $3}')
  8. INRES="$(xwininfo -name DOTA\ 2\ -\ OpenGL | awk 'NR==8' | awk '{print $2}')x$(xwininfo -name DOTA\ 2\ -\ OpenGL | awk 'NR==9' | awk '{print $2}')" # input resolution
  9. OUTRES="1280x720" # output resolution
  10. QUAL="fast" # ultrafast < fast < normal <?> medium
  11. VBITRATE="500k"
  12. ABITRATE="96k"
  13. STREAM_KEY=$(cat ~/.twitch_key)
  14.  
  15. ffmpeg \
  16.     -f x11grab\
  17.     -s $INRES\
  18.     -i :0.0+$OFFSET_A_X,$OFFSET_A_Y\
  19.     -threads 0\
  20.     \
  21.     -f alsa -ac 2 -i default\
  22.     -ar 22050\
  23.     -ab $ABITRATE\
  24.     -c:a libmp3lame\
  25.     \
  26.     -vb $VBITRATE\
  27.     -c:v libx264\
  28.     -pix_fmt yuv420p\
  29.     -s $OUTRES\
  30.     -preset $QUAL\
  31.     \
  32.     -f flv "rtmp://live.twitch.tv/app/$STREAM_KEY"
clone this paste RAW Paste Data