【发布时间】:2015-07-30 00:04:40
【问题描述】:
当我尝试在我的程序中制作摄像机时,我收到了这个错误:
E/MediaRecorder﹕启动失败:-19
代码是
try {
final SurfaceView sv = (SurfaceView) findViewById(R.id.srvView);
MediaRecorder mrec = new MediaRecorder();
mrec.setCamera(camera);
mrec.setAudioSource(MediaRecorder.AudioSource.MIC);
mrec.setVideoSource(MediaRecorder.VideoSource.CAMERA);
mrec.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
mrec.setVideoFrameRate(10);
mrec.setVideoSize(480, 320);
mrec.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mrec.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
mrec.setPreviewDisplay(mSh.getSurface());
mrec.setOutputFile("/mnt/sdcard/pro/andsend.avi");
mrec.prepare();
mrec.start();
} catch(Exception e)
{
e.printStackTrace();
}
我尝试更改序列并更改设置大小、帧速率等...
但是,我找不到问题所在。
有什么问题?
【问题讨论】:
标签: android mediarecorder