djazz

Livestream to Twitch script

May 29th, 2013
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.68 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Stream from Linux to Twitch/Justin
  4.  
  5. INRES="1366x768" # input resolution
  6. OFFSET="0,0"
  7. OUTRES="1280x720"
  8. FPS="15" # target FPS
  9. QUAL="ultrafast"  # one of the many FFMPEG preset
  10. STREAM_KEY="live_PUT-YOUR-STREAM-KEY-HERE"
  11. URL="rtmp://live.justin.tv/app/$STREAM_KEY"
  12.  
  13. avconv -f x11grab -s "$INRES" -r "$FPS" -i :0.0+$OFFSET -b 256k \
  14.     -vcodec libx264 -crf 30 -b:v 1000k -s "$OUTRES" \
  15.     -f flv "$URL"
  16.  
  17.  
  18. # Same but with audio
  19.  
  20. #avconv -f x11grab -s "$INRES" -r "$FPS" -i :0.0+$OFFSET -b 256k \
  21. #    -f alsa -ac 2 -i pulse -ar 44100 -itsoffset -25 \
  22. #    -vcodec libx264 -crf 30 -b:v 1000k -s "$OUTRES" \
  23. #    -acodec libmp3lame -b:a 128k \
  24. #    -f flv "$URL"
Add Comment
Please, Sign In to add comment