my Video Recorder app does not record video it only records the audio with the file extension of .mp4. There’s no error returned in logcat. So, I can’t figure it out whats wrong with my code.
Anyone knows this issue? Or any suggestions on what to use to record a video.
Here’s my code:
public class VideoHolderCallback implements SurfaceHolder.Callback{
MediaRecorder recorder;
...
public void configureRecorder(){
recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
recorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));
recorder.setOutputFile(filePath);
recorder.setPreviewDisplay(holder.getSurface());
recorder.prepare();
recorder.start();
}
...
}
“Video capture using the Android framework requires careful management of the Camera object and coordination with the MediaRecorder class”
“Unlike taking pictures with a device camera, capturing video requires a very particular call order. You must follow a specific order of execution to successfully prepare for and capture video with your application, as detailed below.”
please look at the instructions and code snippets given here(also make sure you have ) http://developer.android.com/guide/topics/media/camera.html#capture-video
also make sure you have the required manifest declarations
http://developer.android.com/guide/topics/media/camera.html#manifest