回答

2

你可能想看看AOSP VideoCamera activity是如何实现这一点:

if (info.facing == CameraInfo.CAMERA_FACING_FRONT) { 
     rotation = (info.orientation - mOrientation + 360) % 360; 
    } else { // back-facing camera 
     rotation = (info.orientation + mOrientation) % 360; 
    } 

有在my answer for another question here一些更多的细节。

+0

我尝试使用 'mrec.setOrientationHint(0);' 在'私人void startRecording()'函数,但它不允许我启动视频 –

+0

什么是mOrientation?你能提供完整的代码吗?我正在尝试从过去两天重新支持它 –

+0

@RahulKhurana,我将过时的omapzoom链接更新为androidxref,以便您查看完整的代码。 – Joe

1

添加这个你开始你下面setVideoSource录像

mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); 
if (cameraId == 1) { 
    mediaRecorder.setProfile(CamcorderProfile 
     .get(CamcorderProfile.QUALITY_LOW)); 
    mediaRecorder.setOrientationHint(270); 
} else if (cameraId == 0) { 
    mediaRecorder.setProfile(CamcorderProfile 
     .get(CamcorderProfile.QUALITY_HIGH)); 
    mediaRecorder.setOrientationHint(orientation); 
} 

mediaRecorder.setOrientationHint(270);是前置摄像头倒挂问题

+0

我试过了。但它只是创建视频的镜像。 –