Skip to content

Instantly share code, notes, and snippets.

@johnhamelink
Forked from agranig/hitbox-stream
Last active August 29, 2015 14:05
Show Gist options
  • Save johnhamelink/aad5477ad805cf59fa91 to your computer and use it in GitHub Desktop.
Save johnhamelink/aad5477ad805cf59fa91 to your computer and use it in GitHub Desktop.
# the key you get from http://www.hitbox.tv/settings/youruser/livestreams
HITBOX_KEY="youruser?key=xxxxx"
# top-left corner of capture window
CAPTURE_POS="250,200"
# width/height of capture window
CAPTURE_SIZE="1050x600"
# Audio bitrate
BITRATE="128k"
# Ensure pulseaudio has the loopback module enabled
pactl load-module module-loopback
# make sure to have a really recent ffmpeg version (0.10.12 works fine)
ffmpeg
-f alsa -ac 2 -i pulse -vb $BITRATE \
-f x11grab -show_region 1 \
-s ${CAPTURE_SIZE} -r 25 -i :0.0+${CAPTURE_POS} \
-vcodec libx264 -maxrate 400k -minrate 400k \
-acodec libmp3lame -ab 128k -ar 22050 \
-vsync 1 -async 1 \
-g 50 -bufsize 400k -pix_fmt yuv420p -f flv \
"rtmp://live.hitbox.tv/push/${HITBOX_KEY}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment