The AVCamDemo you are talking about is close to what you need to do, and should be able to use this as a link, among which are the following classes that you need to use to achieve what you are trying ... All classes are part of AVFoundation , you need
AVCaptureVideoDataOutput and AVCaptutureAudioDataOutput - use these classes to get raw samples from your camcorder and microphone
Use AVAssetWriter and AVAssetWriterInput to encode raw samples into a file - the following example mac OS X project shows how to use these classes (the sample should work for ios too), however they use AVAssetReader for input (it will encode the video file) instead of the camera and microphone .. You can use the outputs mentioned above as input in your case to write what you want
That should be all you need to achieve what you want to do ...
Here is a link showing how to use VideoDataOutput
Hope this helps
source share