Recording the acitivities done by the user.

I want to give user a feature where by user can click a button and what ever activities are performed by him will be recorded. When his clicks the stop button, a video file should be generated showing all the activities performed by the user.