Skip to content

Instantly share code, notes, and snippets.

@aikar
Created August 2, 2012 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aikar/3237217 to your computer and use it in GitHub Desktop.
Save aikar/3237217 to your computer and use it in GitHub Desktop.
INRES="1920x1080" # input resolution
OUTRES="1024x576"
FPS="23" # target FPS
QUAL="veryfast" # one of the many FFMPEG preset
ffmpeg -f x11grab -s "$INRES" -r "$FPS" -i :0.0+0,0 \
-f alsa -i hw:0 \
-f alsa -i pulse \
-vcodec libx264 -preset "$QUAL" -s "$OUTRES" \
-ac 2 -acodec libmp3lame -ar 44100 -threads 0 \
-filter:a "[1][2] amerge" \
-pix_fmt yuv420p -f flv "rtmp://live.twitch.tv/app/$STREAM_KEY" \
2>&1 | grep -v "live.twitch.tv"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment