I didn't work for quite long time with Android Camera. However, as I remember
1) onPreviewCallback isn't called while you are recording
It's mentioned in couple of questions:
Camera onPreviewFrame not called
How to show real time filtered camera preview while recording videos?
2) I saw that it was handled in SipDroid and couple of other Android SIP clients following way (this was a 1-2 years ago, so this method could be outdates):
- A pipe was created
- Receiving socket of the pipe was wrapped in FileDescriptor and passed to MediaRecorder setOutputFile
- Sending socket of the pipe was constantly read in a thread.
- This way you can receive a content which is written to a file
- Now, the issue how to deal with the content (since, it's H.263 or H.264 encoded and could be mixed with the sound, if you record video with the sound).
- There were some heuristical algorithms which parsed the content (however, it's pain in the ass)
3) You can use onPreviewFrame + start AudioRecorder and encode it yourself (using ffmpeg or something like that) to mp4 file. This way you don't need to start MediaRecorder recording.