Filter Live camera feed

冷暖自知 提交于 2019-12-10 17:41:30

问题


So i've been using UIImagepickercontroller to access the camera for photo and video capture, then i wanted to apply filters on those 2 sources, i succeeded with filtering token photos but i'am having trouble finding the solution for the rest, all i need is to access the raw image data : the live image feed that the camera is showing , apply the filter and then show the filtered ones instead. Any help or advice will be appreciated.


回答1:


UIImagePickerController doesn't give you low level access to the camera buffer.

You should setup a AVCaptureSession and use the delegate to process the CMSampleBufferRef

Take a look at the AVCam & SquareCam demos from Apple, they give a good introduction to video capture.

http://developer.apple.com/library/ios/#samplecode/AVCam/Introduction/Intro.html http://developer.apple.com/library/ios/#samplecode/SquareCam/Introduction/Intro.html

An easier solution is to use https://github.com/BradLarson/GPUImage

Thanks Adam



来源:https://stackoverflow.com/questions/11257991/filter-live-camera-feed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!