BradLarson / GPUImage

An open source iOS framework for GPU-based image and video processing
http://www.sunsetlakesoftware.com/2012/02/12/introducing-gpuimage-framework
BSD 3-Clause "New" or "Revised" License
20.22k stars 4.62k forks source link

How to use GPUImageFramebuffer to get each frame's pixel data? #2497

Closed github2016-yuan closed 6 years ago

github2016-yuan commented 6 years ago

I have learned GPUImage for a few time and I found that most question focused on filter, for example GPUImage3x3ConvolutionFilter ,GPUImageBilateralFilter and so on. I know GPUImage Encapsulates OpenGL to make it easily to use. I come across a question now. I use GPUImageVideo to load a video and I want to get each frame of the video and then gain the pixel data of every frame. I think that GPUImageFrameBuffer may be useful but I do not know how to use it and I have not found any related codes until now. So I release a new issue here for some help. Any advice will be appreciated! Here is my code.

self.mGPUImageFramebuffer = [[GPUImageFramebuffer alloc] initWithSize:CGSizeMake(1920, 1080)]; CGImageRef ImageRef = self.mGPUImageFramebuffer.newCGImageFromFramebufferContents;

I just init the mGPUImageFramebuffer but do not get the data because I do not know how to get data from the video.