android mediarecorder错误(MediaRecorder启动失败:-19) [英] android mediarecorder error (MediaRecorder start failed : -19)
本文介绍了android mediarecorder错误(MediaRecorder启动失败:-19)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我尝试在程序中制作摄像机时,出现此错误:
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();
}
我尝试更改顺序并更改设置大小,帧频等...
但是,我找不到问题.
出什么问题了?
解决方案
请参阅我的答案: I try to change the sequence and change the set size, Frame Rate etc... But, I can't find the problem. What's the problem? see my answer : android-mediarecorder-start-failed-19 error code -19 comes about when there is a problem with the size of the video as set by 这篇关于android mediarecorder错误(MediaRecorder启动失败:-19)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! 解决方案 MediaRecorder#setVideoSize()
查看全文