Home Features Docs Blog Support GitHub

Using AVCapturePhotoOutput to capture live photos


(Guilherme Campos Hazan) #1

Hi,

Can anyone share a code to capture live photos from the iOS camera?

I’m using this:

           captureSession = AVCaptureSession.alloc().init();
           captureSession.setSessionPreset(AVFoundation.AVCaptureSessionPresetPhoto());

           capturePhotoOutput = AVCapturePhotoOutput.alloc().init();

           NSArray<? extends NSNumber> formats = capturePhotoOutput.availableRawPhotoPixelFormatTypes();
           NSNumber availableRawFormat = formats.firstObject();

But availableRawFormat returns null.

thanks

guich

(Eugene) #2

Have you followed all the steps described here?
https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/capturing_still_and_live_photos/capturing_and_saving_live_photos

There is also new ios 9 stuff