Created
September 27, 2013 19:40
-
-
Save xorrizon/6734100 to your computer and use it in GitHub Desktop.
Bash script for twitch streaming with ffmpeg.
Also uses offset to use my 2nd monitor
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 | |
| API_KEY="live_XXX" | |
| FPS="30" | |
| #INRES="1920x1200" | |
| INRES="1920x1080" | |
| OUTRES="$INRES" | |
| #OUTRES="640x400" | |
| #OFFSET="+0,0" | |
| OFFSET="+1600,0" # use xwininfo to get | |
| STREAM_URL="rtmp://live.twitch.tv/app/$API_KEY" | |
| #STREAM_URL=/media/home2/test.flv | |
| ffmpeg -f x11grab -s "$INRES" -r "$FPS" -i :0.0$OFFSET \ | |
| -f pulse -ac 2 -i default -vcodec libx264 -s "$OUTRES" \ | |
| -acodec libmp3lame -ab 128k -ar 44100 -threads 0 \ | |
| -f flv -pix_fmt yuv420p "$STREAM_URL" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment