UIImagePicker Adjusting Focus Observer? - ios

Is there a way to find out if the camera is currently focusing with UIImagePicker? Similar to the way the adjustingFocus observer works with AVFoundation.
I'm currently using AVFoundation, but I would like to be able to have the image quality that is achieved with UIImagePicker.
Thanks!

You need to define your exact requirement here - what is that you want adjusting focus observer for? As the name suggests, it is a way to signal you that AVCaptureDevice (reference to "real" device - one of these devices) is adjusting its focus. UIImagePicker is nothing but a file open dialog, not a real device. It works on top of either camera or static list of image files. While in camera mode, you can observe adjustingFocus.
In case that is your requirement, here is nearest you can refer to.
Refer to UIImagePickerController documentation to define how you can implement this for your own needs.

Related

How to implement apple like camera app using AVCaptureSession?

In the iOS(9) camera app the controls overlay does not rotate but when 'Record' is selected the video is outputted with the correct orientation. Has anyone got any ideas how apple implemented this.
You've got a few different options to achieve the same effect:
You can rotate the camera, but keep the UI the same, when the device itself is rotated so that it matches UIDevice.currentDevice().orientation.
You could store the device orientation at the time of capture and then rotate the video afterwards.
You could even set the capture connection of the capture session to match the devices orientation while keeping the preview connection the same. Check this out for a similar question
I implemented exactly what you're looking for using 2 different UIWindow instances, one for the video preview layer and one for the UI to be displayed on top of it. The UIWindow with the UI needs to have a transparent background in order for the preview layer to remain visible.

AVCaptureSession VS UIImagePickerController camera preview

I'm developing an application similar to Instagram iOS app. Instagram have a custom camera preview. I want to develop something similar and the question is - what to use better for this purpose - UIImagePickerController with custom cameraOverlayView property or should I use AVCaptureSession ? Maybe someone have such experience and can give me an advice. Will be appreciate.
AVCaptureSession is more customisable than UIImagePickerController. In case of speed, there is not much difference. If you are using AVCaptureSession it is possible to switch between whiteBalanceMode, focusMode and exposureMode when taking still images. Also we can specify the quality of the taking photo. In case of UIImagePickerController, the camera view will be presented and we can add overlay on it. But in case of AVCaptureSession, we can manage the camera as a normal view and add controls over it. So I think AVCaptureSession will be more suitable for your requirement.
The below link will give you more details about implementing AVCaptureSession.
https://developer.apple.com/library/prerelease/ios/samplecode/AVCam/Introduction/Intro.html

iPhone: taking a photos programmatically in burst mode

In one of my project I have to use the iPhone Camera in "Burst Mode". How it could be done, if possible?
There isn't a direct way to do it. However, you can work still achieve what you want with a small hack.
Make sure AVCaptureDevice has its activeFormat property set to the best resolution. Then you need to process say 10 frames/second. You can access the frames with the delegate method: captureOutput:didOutputSampleBuffer:fromConnection:
And for the sound you can just run a shutter sound with every processed frame.

How to check when UIImagePickerController changes type of camera?

I have an UIImagePickerController and want to know, when a user changes from the back to front camera (and back)?
Is it possible to get this information?
As second part.
After taking a picture UIImagePickerController shows a preview with (Retake and Use Photo Buttons). Is it possible to detect when this view is shown?
You can write your own camera overlay view to have total control over the camera switching and preview behavior. Without a custom camera overlay view, I think you're limited to just receiving the user's final choice in the UIImagePickerControllerDelegate callback.

iOS App: AVFoundation Video camera recording delegates

I am trying to develop an app that records the video using the rear camera.
I want the video to be tweaked (adding overlay image, green screen) before saving it to a file.
I am using AVFoundation, and have researched anywhere, but I still cant make the correct codes to preview and record (without the tweaking)
Some codes that Iget from the internet use BufferDelegate, the rest are using RecordingDelegate.
Do I need to use both to achieve what I want? or is it just one ofthem?
Could you please pinpoint me how I can achieve this?

Resources