iphone - AVCaptureVideoPreviewLayer: taking a snapshot -


I'm trying to emulate the animation seen in the default camera app, where the snapshot of the camera viewfinder is animated. The corner of

The AVCaptureVideoPreviewLayer object that holds the key to solving this problem is not very open for these requirements: Trying to make a copy with a new copy of it.

  - (id) initWithLayer: (id) layer  

.. without an image snapshot, gives an empty layer, so clearly there is some dark magic here .

Your clue / bouquet is most welcome.

M

Here are the possible solutions, no great IMO is not:

  • You can add an AVCaptureSession for both an AVCaptureStillImageOutput and AVCaptureVideoDataOutput When you set sessionPreset to AVCaptureSessionPresetHigh , you will start receiving the frame by the API, and when you switch to AVCaptureSessionPresetPhoto So you can take the actual picture, before taking the picture, you can auto on the video Can catch a frame, get a frame, and then return to the camera. The main warning is that it takes "long" time (a few seconds) to switch between the video camera and photo camera for the camera.

  • Another option is to use only the camera output ( AVCaptureStillImageOutput ), and UIGetScreenImage to get the phone's screen capture Use Then you can take out the control and only leave the image. If you are showing UI controls on the image then it becomes complicated Also, according to the post, Apple started rejecting an application using this function (it was always iffy).

  • In addition to AVCaptureVideoPreviewLayer A UIView or CALayer is posted to save in UIImage. But it all produces clear or white images I tried to reach the layer, the layer of view, superlear , presentation lair , model layer , But to no avail. I think the data in AVCaptureVideoPreviewLayer is very intrinsically, and in fact the regular layer is not part of the infrastructure.

Hope it helps, Oeded.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -