I'm not sure if there are any other Linux users here but I got Mame streaming fairly decently on my laptop running Linux mint using the following bash script if it helps anyone else out.
-j
-----------------------------------
#! /bin/bash
FPS="30" # target FPS
QUAL="libx264-ipod640" # one of the many FFMPEG preset on (k)ubuntu found in /usr/share/ffmpeg
# Get Game Window
echo "Click, with the mouse, on the Window that you want to Stream"
rm -f twitch_tmp 2> /dev/null
xwininfo -stats >> twitch_tmp
TOPXY=$(cat twitch_tmp | awk 'FNR == 8 {print $4}')","$(cat twitch_tmp | awk 'FNR == 9 {print $4}')
INRES=$(cat twitch_tmp | awk 'FNR == 12 {print $2}')"x"$(cat twitch_tmp | awk 'FNR == 13 {$2=$2+0+10; print $2}')
rm -f twitch_tmp 2> /dev/null
echo " "
STREAM_KEY=<YourKeyHere>
ffmpeg -f x11grab -s "$INRES" -r "$FPS" -i :0.0+$TOPXY -f alsa -ac 2 -i pulse -vcodec libx264 -vpre "$QUAL" -crf 30 -x264opts keyint=50:min-keyint=20 -s $INRES -acodec libmp3lame -ar 22050 -threads 4 -qscale 5 -b 712000 -f flv "rtmp://live.justin.tv/app/$STREAM_KEY"
------------------------------