I have an Adobe Air Flash, Action script 3.0 application. I need to save the webcam (or rather a series of bitmap as frames) to a video file. The video file needs to be comp
AIR/Flash don't give you access to any local video encoders, so compressing the video is the hard part of this problem.
For the rest, grab video frames using the BitmapData.draw() function. You can then draw the text into the same bitmapdata.
For uncompressed video, you can do something like this: http://www.joristimmerman.be/wordpress/2008/12/18/flvrecorder-record-to-flv-using-air/.
Theoretically, you can write a video encoder in ActionScript. The fact that nobody has done so tells me that you would run into problems (either technicaql or legal -- for some codecs). In AIR a better course of action would be to use the NativeProcess API or a native extension to offload the encoding to native code. This requires releasing the AIR app itself as a native app and creating a separate version for each platform you support. (By adding dependencies on native code, you lose the cross-platform benefits of AIR.)
In Flash (on the Web), the typical way to do this is to send the camera stream to a server and do your processing there.