BradLarson / GPUImage2

GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing.
BSD 3-Clause "New" or "Revised" License
4.88k stars 611 forks source link

Apply CIFilter to frames in a Live video feed? #13

Closed weixiyen closed 8 years ago

weixiyen commented 8 years ago

Is there a way to apply a CoreImage filter to every frame and have that output to a renderView?

Also, is there a way to get a CMSampleBuffer back from the new filtered frame to pass into my custom encoder?

Thanks again for a great library.

BradLarson commented 8 years ago

If you want to run Core Image filters, I'd recommend using Core Image directly and avoid working with this framework. You don't really need it at that point.

You could look at the code for the MovieOutput to see how to grab frame data and encode it into pixel buffers for use in encoding. Building something based on that for your custom encoder might be the best, although I'd strongly look at using the raw bytes.