使用camera.setDisplayOrientation()
和recorder.setOrientationHint()
methdos来旋转一个视频,同时捕获本身。
camera = Camera.open();
//Set preview with a 90° ortientation
camera.setDisplayOrientation(90);
camera.unlock();
recorder = new recorder();
recorder.setCamera(camera);
recorder.setAudioSource(recorder.AudioSource.MIC);
recorder.setVideoSource(recorder.VideoSource.CAMERA);
recorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_720P));
recorder.setPreviewDisplay(mPreview.getHolder().getSurface());
recorder.setOutputFile(getOutputMediaFile(MEDIA_TYPE_VIDEO).toString());
//Rotate video by 90 degree
recorder.setOrientationHint(90);