Kdenlive, Cinelerra, Lives, etc. are the apps appropriate for this task. In the hardware side you need a proper video adapter (i.e., video capture card and cables) to bring out your video/audio output to the digital card inputs.
Using a Webcam for such purpose is quite inappropriate as you will lose frequency bandwidth. (i.e., Your monitor Hz trying to sync with your webcam Hz)