I've been trying to get my videos mirrored for a while now but I cannot seem to fix it. I've tried the following question as well.
if let connection = movieFileOutput.connection(with: .video) {
if connection.isVideoMirroringSupported {
connection.isVideoMirrored = self.videoDeviceInput?.device.position == .front
}
}
if let connection = videoDataOutput.connection(with: .video) {
if connection.isVideoMirroringSupported {
connection.isVideoMirrored = self.videoDeviceInput?.device.position == .front
}
}
The video gets mirrored in the app but when downloading the video to my Photos app it's unmirrored again. How do I tackle this problem?
How my overall code looks:
automaticallyConfiguresApplicationAudioSession
is set tofalse
.- Configure the camera by getting device input and adding it to the
AVCaptureSession
- Setting up the movie output like setting bitrate and for iPads configuring orientation. Here I should also set the
.isVideoMirrored
property. - Setting the session preset.
Addition of audio session setup:
guard let audioDevice = AVCaptureDevice.default(
.builtInMicrophone,
for: .audio,
position: .unspecified
) else { return }
guard let audioInput = try? AVCaptureDeviceInput(device: audioDevice),
captureSession.canAddInput(audioInput) else { return }
guard captureSession.inputs.contains(audioInput) == false else { return }
captureSession.addInput(audioInput)