下面的代码是解决:
用前置摄像头录制视频录制后,在预览时出现的左右颠倒问题
/**
解决前置摄像头录制视频左右颠倒问题
*/
- (void)videoMirored {
AVCaptureSession* session = (AVCaptureSession *)self.session;
for (AVCaptureVideoDataOutput* output in session.outputs) {
for (AVCaptureConnection * av in output.connections) {
//判断是否是前置摄像头状态
if (self.isDevicePositionFront) {
if (av.supportsVideoMirroring) {
//镜像设置
av.videoMirrored = YES;
}
}
}
}
}