title: GPUImage Video with transparency over UIView
body: <p>I am working on an iOS project that uses AV-Out to show contents in a 1280x720 window on a second screen. </p>
  
  <p>I have a <code>MPMoviePlayerController</code>'s view as background and on top of that different other elements like <code>UIImages</code> and <code>UILabels</code>.
  The background movie plays in a loop.</p>
  
  <p>Now I want to overlay the whole view including all visible elements with another fullscreen animation that has transparency so that only parts of the underlying view are visible.</p>
  
  <p>I first tried a png animation with <code>UIImageView</code>.
  I was surprised to find that actually works on iPhone5, but of course the pngs are so big in size that this uses way too much ram and it crashes on everything below iPhone4s.
  So i need another way.</p>
  
  <p>I figured out how to play a second movie at the same time using AVFoundation.
  So far, so good. Now i can play the overlay video, but of course it is not trasparent yet.</p>
  
  <p>I also learned that with the <code>GPUImage</code> library I can use <code>GPUImageChromaKeyBlendFilter</code> to filter a color out of a video to make it transparent and then combine it with another video. </p>
  
  <p>What i don't understand yet is the best way to implement it in my case to get the result that i want.</p>
  
  <p>Can i use the whole view hierarchy below the top video as first input for the <code>GPUImageChromaKeyBlendFilter</code> and a greenscreen-style video as second input and show the result live in 720p? how would i do that?</p>
  
  <p>Or would it be better to use <code>GPUImageChromaKeyFilter</code> and just filter the greenscreen-style video, and play it in a view above all other views? Would the background of this video be transparent then?</p>
  
  <p>Thanks for your help!</p>