This page has a counterpart, Theora, for Ogg Theora video. Many of the techniques on Theora can be used to also encode WebM.

ffmpeg

ffmpeg -i input.avi \
-vpre libvpx-720p \
-quality realtime \ # best, good, or realtime; can also use qmin/qmax
-threads 3 \
-acodec libvorbis -ab 128k -ar 44100 \
-f webm -y output.webm

See:

MEncoder

mencoder -ovc lavc -oac lavc -of lavf -lavfopts format=webm -lavcopts threads=4:acodec=vorbis:vcodec=libvpx -ffourcc VP80 input.avi -o output.webm

Confirmed working with r31918. More information available with this mailing list thread.