How can I save a webcam recording to a video file in Unity?

Right now I am able to actually start my webcam to work but I will actually need to record the webcam the moment it started and save the recording as a video file. Does anyone have any idea how can I actually do this?

Save yourself a lot of time and trouble and get this: http://www.renderheads.com/portfolio/UnityAVProMovieCapture

I needed the same functionality and found AVPro Live Camera plugin as a separate product: