title: Applying filters on a video file
body: <p>I want to apply filters (effects) on a video file while the video is playing.  </p>
  
  <p>I'm currently using @BradLarson 's (great) <code>GPUImage</code> framework to do so, the problem here is that the framework doesn't support audio playback while playing the video.  </p>
  
  <p>So I have two options:  </p>
  
  <p>1) Dive into the <code>GPUImage</code> code and change the <code>GPUImageMovie</code> so it will also process the audio buffers. This requires the knowledge of syncing the audio &amp; video frames, and unfortunately i don't have it. I saw some hacks that try to play the audio with <code>AVAudioPlayer</code> but with a lot of sync problems.  </p>
  
  <p>2) Use <code>CoreImage</code> framework instead of <code>GPUImage</code>.</p>
  
  <p>So I want to take a look at the second option of using the native iOS <code>CoreImage</code> and <code>CIFilter</code> to do the job.  </p>
  
  <p>The problem is, I couldn't find any example of how to do this with <code>CIFilter</code>, <strong>how do I apply filters on a video from a file</strong>?    </p>
  
  <p>Do I must use an <code>AVAssetReader</code> to read the video and process each frame? if so I'm back to my first problem of syncing the audio &amp; video.<br>
  Or is there a way to apply the filters chain directly on the video or on the preview layer? </p>
  
  <p>Appreciate any help :)</p>