2 yiranhaiziqi yiranhaiziqi 于 2016.02.22 18:16 提问

Android 使用MediaRecorder 录像,无法对焦 5C

代码如下,求指导。没有对焦,画面是不清晰的,求指教如何让他对焦。

 if (mediaRecorder == null) {
                    mediaRecorder = new MediaRecorder();    //-----
                }
                mediaRecorder.reset();
                mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); //从照相机采集视频
                mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
                //mediaRecorder.setOrientationHint(180);
                try {
                    mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_720P));
                }catch (Exception e){
                    Toast.makeText(CameraVideoActivity.this,"不支持720p,切换到480P",Toast.LENGTH_SHORT).show();
                    mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_480P));
                }

                /*mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
                mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
                mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_WB);
                mediaRecorder.setVideoSize(1280, 720);
                mediaRecorder.setVideoFrameRate(10);
                mediaRecorder.setVideoEncodingBitRate(5 * 1024 * 1024);*/
                File videoFile = new File(filePath, fileName + ".3gp"); //保存路径及名称
                mediaRecorder.setOutputFile(videoFile.getAbsolutePath());

                mediaRecorder.setPreviewDisplay(holder.getSurface());
                try {
                    mediaRecorder.prepare();//预期准备
                } catch (Exception e) {
                    e.printStackTrace();
                }
                mediaRecorder.start();//开始刻录
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!