Skip to content

Instantly share code, notes, and snippets.

@Zap123
Created November 6, 2014 20:45
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 Zap123/c805defe4044a0b9ce7e to your computer and use it in GitHub Desktop.
Save Zap123/c805defe4044a0b9ce7e to your computer and use it in GitHub Desktop.
Hitbox Livestreaming Script
# Hitbox.tv livestreaming script
# based on : https://wiki.archlinux.org/index.php/Streaming_using_twitch.tv
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="2" # max 6
CBR="1000k" # constant bitrate (should be between 1000k - 3000k)
QUALITY="ultrafast" # one of the many FFMPEG preset
AUDIO_RATE="44100"
STREAM_KEY="$1"
avconv -f x11grab -s "$INRES" -r "$FPS" -i :0.0 -f alsa -i pulse -f flv -ac 2 -ar $AUDIO_RATE \
-vcodec libx264 -g $GOP -keyint_min $GOPMIN -b $CBR -minrate $CBR -maxrate $CBR -pix_fmt yuv420p\
-s $OUTRES -preset $QUALITY -tune film -acodec libmp3lame -threads $THREADS -strict normal \
-bufsize $CBR "rtmp://live.hitbox.tv/push/$STREAM_KEY"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment