有什么办法可以迅速使用AVCaptureSession对象来逐帧获取图像吗? [英] Is there any way to get frame by frame using AVCaptureSession object in swift?
本文介绍了有什么办法可以迅速使用AVCaptureSession对象来逐帧获取图像吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须使用我的c ++函数处理iPhone相机捕获的帧.因此,我使用startRunning()
函数开始数据流,但是我可以用什么方式处理每一帧?
I have to process frames which are captured by iPhone camera using my c++ functions. So I use startRunning()
function to start the flow of data, but in what way I can process each frame?
推荐答案
是的,这很简单.您需要
Yes, it is pretty straight forward. You need to
- Create an AVCaptureVideoDataOutput object to produce video frames
- Implement a delegate for the AVCaptureVideoDataOutput object to process video frames
- In the delegate class, implement the method (captureOutput:didOutputSampleBuffer:fromConnection:) that is called when a sample buffer is written.
For more information you can read this part of the AVFoundation Programming Guide. The code samples are in Objective-C not swift but i think you get the idea.
这篇关于有什么办法可以迅速使用AVCaptureSession对象来逐帧获取图像吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文