Skip to content

Instantly share code, notes, and snippets.

@matburt
Last active December 24, 2015 18:29
Show Gist options
  • Save matburt/6843739 to your computer and use it in GitHub Desktop.
Save matburt/6843739 to your computer and use it in GitHub Desktop.
Stream to twitch from Linux
#!/bin/bash
API_KEY="<twitch api key>"
FPS="15"
INRES="1920x1080"
OUTRES="1920x1080"
OFFSET="2560,0"
ffmpeg -f x11grab -s "$INRES" -r "$FPS" -i :0.0+$OFFSET \
-f alsa -ac 2 -i default -vcodec libx264 -s "$OUTRES" \
-acodec libmp3lame -ab 128k -ar 44100 -threads 0 -pix_fmt yuv420p \
-f flv "rtmp://live.twitch.tv/app/$API_KEY"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment