回答

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

我試過了。但它只是創建視頻的鏡像。 –