Yeah, it's free.
I use VirtualDUB, which doesn't support much other than avi and mpg, but if you find some program that can encode into other formats, I don't see why it wouldn't work.
Easiest way to aquire a good ui for encoding h264, is to install K-Lite, and making sure to check everything...