PinkFloydRocks PinkFloydRocks - 1 year ago 119
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.

Answer Source

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
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download