Although the MainConcept h264 codec is fine on its own, I always prefer to do my encoding and muxing (adding the audio to the video) out of my editing program (Premiere in my case). At least in the cases when I need h264 (Youtube, PS3, BluRay, iPhone, DXVA-compatible etc etc) or XviD.
I export raw video (YUV or YV12) and audio (wave) out of my editor. I then encode my video (depending on the needed format ofcourse) with MeGUI, a x264 GUI.
You can use “easy” presets or you can dig into the valleys of encoding complexity and adjust all settings you want. Talking heads require different settings (for example macroblock size) than high action footage or cartoon videos.
I then set a format for my audio (usually AAC) and queue my video and audio in the rendering queue. After rendering I have 1 audio file and 1 video file (although things like multitrack audio are possible too). After both have finished I mux them together and I end with a video file in an mkv or mp4 container or raw avc format.