Real time dual recording and compression is
incredibly CPU intensive. You'd be better off to just record footage and compress it at a later time or your video may be unwatchable. If you don't want to take my word for it just know that I
have this CPU in my recording and streaming PC and even it can barely handle the intensive load at 1080p (1920x1080).
If you don't have at least a quad core processor don't even bother. If you have a fairly decent quad core processor you may be able to do this at 720p (1280×720) at 30 frames per second.
Programs like XSplit or Xfire's recording feature (ya wtf who knew) can do what you want though. Pretty much any desktop streaming program can.