Created
April 10, 2012 20:23
-
-
Save memborsky/2354214 to your computer and use it in GitHub Desktop.
Streaming to justin.tv with ffmpeg in linux
This file contains 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/sh -xe | |
INFO=$(xwininfo -frame) | |
API_KEY="YOUR_API_KEY_GOES_HERE" | |
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
Original version of this script was provided by @rtyler on his blog.