On front Camera when the phone rotate to left or right, the picture is upsidedown
when the on front camera and phone rotate to left or right , the picture is upside down, how to make the orientation of the picture just like the system camera APP ? that working fine then rotate phone up or down.
On front Camera when the phone rotate to left or right, the picture is upsidedown is due to mirror image,if we rectify the mirror image then the upside down problem will be solved. Below code will be useful to solve this problem.Add the below code in camera.m class with method named:CameraSource::reorientCamera() av.videoMirrored = ([device position] == AVCaptureDevicePositionFront);
CameraSource::reorientCamera() //...... for (AVCaptureVideoDataOutput* output in session.outputs) { if ([output isKindOfClass:[AVCaptureMetadataOutput class]]) { continue; } for (AVCaptureConnection * av in output.connections) { switch (orientation) { //..... } // make the front camera mirrored AVCaptureInput* currentCameraInput = [session.inputs objectAtIndex:0]; if(((AVCaptureDeviceInput*)currentCameraInput).device.position == AVCaptureDevicePositionFront){ [av setVideoMirrored:YES]; } }