While capturing data from Front camera I am always getting Mirror image, how can I get what I am seeing in my preview window. I have set videoMirrored
to be TRUE
. Following is the code snippet:
AVCaptureConnection *lConnection = nil;
for ( AVCaptureConnection *connection in [lHandle->m_output connections]) {
for ( AVCaptureInputPort *port in [connection inputPorts] ) {
if ( [[port mediaType] isEqual:AVMediaTypeVideo] ) {
lConnection = connection;
break;
}
}
}
if ([lConnection isVideoOrientationSupported])
[lConnection setVideoOrientation:AVCaptureVideoOrientationPortrait];
if ([lConnection isVideoMirroringSupported])
[lConnection setVideoMirrored:TRUE];
Changing setVideoMirrored
to True/False
also doesn't change anything
(isVideoMirroringSupported
returns Success)
Flip the mirrored image with the following code.
UIImage * flippedImage = [UIImage imageWithCGImage:picture.CGImage scale:picture.scale orientation:UIImageOrientationLeftMirrored];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With