Skip to content

Instantly share code, notes, and snippets.

@leanfj
Created August 22, 2018 02:13
Show Gist options
  • Save leanfj/29510be5daa86ae55e8668042546309a to your computer and use it in GitHub Desktop.
Save leanfj/29510be5daa86ae55e8668042546309a to your computer and use it in GitHub Desktop.
live() {
INRES="1680x1050"
OUTRES="1280x720"
FPS="30"
GOP="60
GOPMIN="30"
THREADS="2"
CBR="2500k"
QUALITY="superfast"
AUDIO_RATE="44100"
STREAM_KEY=""
SERVER="live"
ffmpeg -f x11grab -s "$INRES" - r "$FPS" -i :0.0+1366,0 \
-f pulse -ac 2 -ar 44100 -i alsa_input.pci-0000_00_1b.0.analog-stereo \
-vcodec libx264 -g $GOP -keyint_min $GOPMIN -b:v $CBR -minrate $CBR -maxrate $CBR -pix_fmt yuv420p\
-s $OUTRES -preset $QUALITY -tune film -acodec libmp3lame -threads $THREADS - strict normal \
-bufsize $CBR -f flv "rtmp://$SERVER.twitch.tv/app/$STREAM_KEY"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment