運行startrecorder()時出現此錯誤。Mediarecorder啓動失敗-19
06-28 18:46:22.570: E/MediaRecorder(9540): start failed: -19
06-28 18:46:22.570: W/System.err(9540): java.lang.RuntimeException: start failed.
我伸出mediarecorder類
我的代碼:
camera = Camera.open(cameraId);
super.setCamera(camera);
super.setVideoSource(MediaRecorder.VideoSource.CAMERA);
super.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
if (mode==MODE_DEFAULT) {
super.setMaxDuration(1000);
super.setMaxFileSize(Integer.MAX_VALUE);
} else {
// On some phones a RuntimeException might be thrown :/
try {
super.setMaxDuration(0);
super.setMaxFileSize(Integer.MAX_VALUE);
} catch (RuntimeException e) {
Log.e(TAG,"setMaxDuration or setMaxFileSize failed !");
}
}
super.setVideoEncoder(videoEncoder);
if(surfaceHolder!=null)
super.setPreviewDisplay(surfaceHolder.getSurface());
//super.setVideoSize(quality.resX,quality.resY);
super.setVideoFrameRate(quality.frameRate);
super.setVideoEncodingBitRate(quality.bitRate);
我看到這些網頁
Error opening android camera for streaming video
Android MediaRecorder - "start failed: -19"
但他們不爲我工作...
上運行archos 80 g9,android 3.2 任何人有任何想法?
發表了一些代碼。 –
您應該發佈準備MediaRecorder的代碼並設置相機,這是造成問題的原因。你還應該在日誌中加入更多的方法。 – Guardanis