Created
November 25, 2012 10:11
-
-
Save lifning/4142976 to your computer and use it in GitHub Desktop.
Scripts for streaming to twitch.tv on Linux.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
JTV_STREAM_KEY=$(cat ~/Dropbox/jtv-key) | |
JTV_STREAM_URL=rtmp://live.justin.tv/app/${JTV_STREAM_KEY} | |
exec glc-capture --disable-audio -f 30 -z none -o /dev/stdout -s "${@}" \ | |
| glc-play /dev/stdin -y 1 -o /dev/stdout \ | |
| ffmpeg \ | |
-f yuv4mpegpipe -i /dev/stdin \ | |
-f pulse -itsoffset 0.2 -sample_rate 22050 -i default \ | |
-f flv -vcodec libx264 -vf "scale=-1:360" -r 30 \ | |
${JTV_STREAM_URL} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
JTV_STREAM_KEY=$(cat ~/Dropbox/jtv-key) | |
JTV_STREAM_URL=rtmp://live.justin.tv/app/${JTV_STREAM_KEY} | |
zenity --info --text='Click OK, then click the window you want to stream.' | |
XINFO=$(xwininfo -stats) | |
X=$(echo "${XINFO}" | fgrep 'Absolute upper-left X:' | awk '{print $4}') | |
Y=$(echo "${XINFO}" | fgrep 'Absolute upper-left Y:' | awk '{print $4}') | |
W=$(echo "${XINFO}" | fgrep Width | awk '{print $2}') | |
H=$(echo "${XINFO}" | fgrep Height | awk '{print $2}') | |
exec ffmpeg \ | |
-f x11grab -s ${W}x${H} -r 15 -i :0.0+${X},${Y}+${W}x${H} \ | |
-f pulse -sample_rate 22050 -i default \ | |
-f flv -vcodec libx264 -vf "scale=-1:360" -pix_fmt yuv420p -r 15 \ | |
${JTV_STREAM_URL} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Intriguing approach to this solution. I shall be interested to try it out.