PinkFloydRocks PinkFloydRocks - 9 months ago 84
iOS Question

How to flip a video using AVFoundation

I've recorded a video with the front facing camera and the output is mirrored...

I've tried using

to flip the video but no luck.

Googling and searching Stack Overflow has been fruitless so I bet a simple, straight forward example of how to do this is something that would benefit many.


Theres no indication on what you are using to record the video, ill assume AVCaptureSession + AVCaptureVideoDataOutput

lazy var videoFileOutput: AVCaptureVideoDataOutput = AVCaptureVideoDataOutput()
let v = videoFileOutput.connectionWithMediaType(AVMediaTypeVideo)
v.videoOrientation = .Portrait
v.videoMirrored = true