Controlling web cam video frame rate from external trigger

I want to control a video camera to capture between 10 and 40 fps using an external trigger that may vary in real time while video is being captured.  I'd also like to be able to control the "exposure" time for each frame of video, and possibly vary it in real time, while video is being captured.

Does anyone know if it is possible to control a web cam this way?  Does varying the frame rate in a video affect playback of the video (will it play at all?).  Are there any specific web cams that lend themselves to this sort of control better than others?