Mediarecorder启动失败-19Mediarecorder

2023-09-06 19:17:50 作者:凉风有信

我正在运行的start()用于mediarecorder时收到此错误。

I am getting this error when running start() for mediarecorder.

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类 我的code:

I am extending mediarecorder class My code:

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针对视频流 打开Android摄像头   Android的MediaRecorder - "启动失败:-19" 但非他们的工作对我来说... 运行在ARCHOS G9 80,安卓3.2 任何一个有什么想法?

I saw these pages Error opening android camera for streaming video Android MediaRecorder - "start failed: -19" But non of them worked for me... Running on archos 80 g9, android 3.2 Any one got any ideas?

推荐答案

通过去除固定

super.setVideoFrameRate(quality.frameRate);