Core Image: From CIImage to Metal and Beyond 路 Route Video Frames through Core Image |

This is a companion discussion topic for the original entry at

Hi Sam,
I followed the steps in your tutorial, I have a few questions hope you can help

  1. How do I change filters on button click?? Like I have 5 filters and I want t to apply/remove based on button click
  2. Is there a way to add the slider to increase/decrease the effect on live filter?
    3 How do you export into video?? Can we achieve that??

I鈥檓 really new to IOS so sorry in advance if I sound stupid :blush:

hi @niraj0107

It鈥檚 been a while since I looked at this, but here are my best ideas of answers:

  1. I have a feeling that you鈥檒l need to tear down the old filter pipeline and create a new one instead. So create a new set of filters, and replace the ones you鈥檝e already got. I could be wrong, but I鈥檓 reasonably confident that that鈥檒l work at the very least.
  2. Yes! You can create a slider, and then update attributes of a filter live. If you look at this project I created for a conference, there is a macOS app called GreatWhenItWorks, which demonstrates how you can use sliders with Core Image. It鈥檚 not quite the same, because it鈥檚 macOS, and not iOS, but it should be suitably similar to give you an idea.
  3. You can export the video yes. You need to take a look into building an AVFoundation pipeline to capture the video, and stream it to disk / across the network. There is some documentation here I think: Apple Developer Documentation

Sorry to not give you really simple answers, but hopefully I鈥檝e pointed you in roughly the right direction鈥攇ood luck!