80,366
社区成员
发帖
与我相关
我的任务
分享
mCamera.unlock();
mRecorder = new MediaRecorder();
mRecorder.setCamera(mCamera);
mRecorder.setPreviewDisplay( mHolder.getSurface() );
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
// mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
mRecorder.setVideoSize(320, 240);
// mRecorder.setVideoFrameRate(15);
mRecorder.setOutputFile( filePath );
try{
mRecorder.prepare();
}catch( Exception e )
{
// Do something
}
mRecorder.start();