android camera error 1001 - what the heck is that?

后端 未结 4 1377
独厮守ぢ
独厮守ぢ 2020-12-19 04:53

I\'ve searched all over on the web and I can\'t find out what that 1001 error is. A few seconds after that I get the camera 100 error but I can\'t find out what the first er

4条回答
  •  一整个雨季
    2020-12-19 05:07

    In my case, in Samsung S3, the video-size parameter was not set and this led to the 1001 error. Setting the video size on the media recorder using preview size fixed the issue. However, this change may fail on other devices since the parameter may or may not be available/set in all devices. The following code addresses most of the devices:

    if(params.get("video-size") != null && params.get("video-size").isEmpty()) {
        int videoWidth = params.getPreviewSize().width;
        int videoHeight = params.getPreviewSize().height;
        mediaRecorder.setVideoSize(videoWidth, videoHeight);
    } else {
        mediaRecorder.setVideoSize(profile.videoFrameWidth, profile.videoFrameHeight);
    }
    

提交回复
热议问题