Skip to content

Instantly share code, notes, and snippets.

@hazelybell
Created October 29, 2016 00:33
Show Gist options
  • Save hazelybell/0402c055b9f59463579062cf9bd74d00 to your computer and use it in GitHub Desktop.
Save hazelybell/0402c055b9f59463579062cf9bd74d00 to your computer and use it in GitHub Desktop.
INRES="1920x1080" # input resolution
OUTRES="1920x1080" # output resolution
FPS="15" # target FPS
GOP="30" # i-frame interval, should be double of FPS,
GOPMIN="15" # min i-frame interval, should be equal to fps,
THREADS="6" # max 6
CBR="800k" # constant bitrate (should be between 1000k - 3000k)
QUALITY="faster" # one of the many FFMPEG preset
AUDIO_RATE="44100"
STREAM_KEY="live_XXXXXXXX_YYYYYYYYYYYYYYYYYYYY" # use the terminal command Streaming streamkeyhere to stream your video to twitch or justin
SERVER="live" # twitch server in frankfurt, see http://bashtech.net/twitch/ingest.php for list
avconv -i rtp://@:1991/ -f alsa -i default \
-f flv -ac 2 -ar $AUDIO_RATE \
-vcodec libx264 -g 50 \
-b:v $CBR -maxrate:v 3000k -bufsize:v 3000k \
-b:a 128k \
-pix_fmt yuv420p \
-preset $QUALITY -tune animation \
-acodec libmp3lame \
-threads $THREADS \
-map 0:v -map 1:a -map -0:a \
"rtmp://$SERVER.twitch.tv/app/$STREAM_KEY" \
-stats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment