mafioso mafioso - 4 months ago 15
iOS Question

How to take high quality videos/photos in swift?

How can I improve the camera quality? I want to take a pic/vid that shows up in fullscreen? If I set the session preset to AVCaptureSessionPresetPhoto it's high quality and fullscreen but just for photos and not for videos. I've tried everything else but nothing works.
Currently, it looks like this:

enter image description here

Answer

Use AVCaptureSessionPresetHigh

https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVCaptureSession_Class/index.html#//apple_ref/c/data/AVCaptureSessionPresetHigh

Then you need to set you video gravity for full screen to work.

captureVideoPreviewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
Comments