Ios digital zoom for video recording. how to implement effectively?

I searched to find that sdk does not support digital zoom or not, you should do it indirectly. What I found in stackoverflow converts AVCaputureVideoPreviewLayer during recording and performs the corresponding post-conversion process on the output video (my real idea is to use the t21> conversion function.

The problem is how you can record all the continuous user-scale actions, which I think can be very difficult for very complex actions to scale and reduce the scale. I mean, for example, I create a slider for the user to control the scale, the user can slightly increase the scale of the slider by 4 times (say, the last 3 seconds) and, without releasing the slider, quickly reduce it to 2X (say, the last 0.5 seconds), I have to write down all these changes in accordance with the time th scale.

I really feel this record-breaking complex, in addition, you must also ensure that it does not cost too much resources to ensure the smooth operation of the video recording process! Or any other way to implement digital zoom? Grateful to any assistant!

+6
source share
1 answer

During recording, you can convert AVCaputureVideoPreviewLayer and use the scaling value to control frames in the AVCaptureVideoDataOutput AVCaptureVideoDataOutput . The delegate method captureOutput:didOutputSampleBuffer:fromConnection: can be used to process video frames. See AVFoundation Documentation AVFoundation Documentation , Media Capture> Video Frame Processing.

+1
source

Source: https://habr.com/ru/post/919600/


All Articles