-
Notifications
You must be signed in to change notification settings - Fork 1
/
stream.sh
18 lines (16 loc) · 859 Bytes
/
stream.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
INRES=$(xwininfo -root | awk '/geometry/ {print $2}'i)
# input resolution
#OUTRES="1024x640" # Output resolution
OUTRES="800x500" # Output resolution
FPS="30" # target FPS
QUAL="ultrafast" # one of the many FFMPEG preset on (k)ubuntu found in /usr/share/ffmpeg
# If you have low bandwidth, put the qual preset on 'fast' (upload bandwidth)
# If you have medium bandwitch put it on normal to medium
# 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 \
-f alsa -ac 2 -i pulse \
-vcodec libx264 -s $OUTRES -preset $QUAL \
-acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b 712000 -bufsize 512k \
-f flv "rtmp://live.twitch.tv/app/$STREAM_KEY"