Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ios digital zoom for video recording. how to implement efficiently?

I've searched to find that sdk do not support digital zoom in or out, you have to do it indirectly. The way I found on stackoverflow is transform the AVCaputureVideoPreviewLayer while recording, and do the corresponding transform postprocess to the output video(my present idea is use AVMutableVideoCompositionLayerInstruction's transform ramp function.).

The problem is how can you record all the continuous course of user's zoom activity, which I think can be a sirious of very complex zoom in and zoom out behaviors I mean, for example, I design a slider for user to control the zoom, user may hold the slider zoom in 4x slowly(say last 3 seconds) and, without release the slider, quickly zoom out to 2X(say last 0.5 seconds), I have to record all this changes according the timeline.

I really feel this record complex, in addition you also have to guarantee it doesn't cost too much resources to keep smooth performance of video recording process! Or any other way of implementation of digital zoom? Grateful to any helper!

like image 953
user1362942 Avatar asked Jul 03 '12 15:07

user1362942


1 Answers

You could transform AVCaputureVideoPreviewLayer while recording and use the zoomvalue to manipulate the frames in the AVCaptureVideoDataOutput delegate. The delegate method captureOutput:didOutputSampleBuffer:fromConnection: can be used to process frames of video. See AVFoundation documentation AVFoundation documentation, Media Capture > Processing Frames of Video.

like image 141
Marcel Avatar answered Oct 16 '22 23:10

Marcel