better way of recording network stream

I found that, instead of using vlc player, will be better to use Mplayer. I changed  "vlc = subprocess.Popen(['vlc', '--demux', 'h264', '-'], stdin=subprocess.PIPE)" with this "mpl = subprocess.Popen(["mplayer", "-fps", "31", "-cache", "1024", "-"],stdin=sub\| process.PIPE)" end now it works witout any significant latency (need to press rigth arrow to wiev litest frames).