Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
# 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