views:

145

answers:

3

Hello all

I'm currently developing an app that has a camera functionality, with a custom camera screen, featuring a preview screen and an overlay.

I'm using the AVFoundation classes and methods as per the eradication of UIScreenCapture.

The problem I have is that the preview data I get from AVCaptureSession is too zoomed in. If i take a picture with that screen, and another with the iPhone's default camera app, without moving the iPhone, the difference in zoom is far too much.

I need the zoom of my app to be the same as is default for iPhone camera app.

I've tried changing the AVCaptureVideoPreviewLayer.videoGravity, to any of it's 3 possible values, to no avail.

Please, any leads on this problem are truly appreciated.

A: 

Is the aspect ratio of your preview pane identical to that of the camera capture data? If not, the OS may be changing the zoom to fit the data rect into your requested aspect ratio.

hotpaw2
A: 

I am having the same issue with my application. Does anyone knows how to zoom out or switch off the zooming function programatically in order to get the both preview equal (default camera view and the video camera prevew).

ichathura
A: 

Turned out to be a resolution issue. It was fixed by using

myCaptureSession.sessionPreset = AVCaptureSessionPreset640x480

Note that iPhone 3g does not support that, so you have to ask wheter the device supports it

[[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo] supportsAvCaptureSessionPreset:AVCaptureSessionPreset640x480]
Arcantos