title: How to convert to 16 bit pixel format for use in OpenGL ES 2.0 when reading frames from a video (AV Foundation)
body: <p>I'm using <strong>OpenGL</strong> to do some image processing on each frame of a 1280x720 quicktime video. The frames are then read back and a new video is created from these. The problem is the large amount of data that needs to be transfered to and from <strong>OpenGL</strong> (using <strong>glTexImage2D</strong> and <strong>glReadPixels</strong>), resulting in a very slow process.</p>
  
  <p>Currently, I'm using <strong>kCVPixelFormatType_32BGRA</strong> as the pixel format for my <strong>AVAssetReaderTrackOutput</strong> instance. To decrease time consumption, I would like to use a 16 bit pixel format instead. Unfortunately, changing to such a format gives me empty frames when calling <strong>AVAssetReaderTrackOutput's copyNextSampleBuffer</strong> method. Does anyone have experience with using a 16 bit pixel format in AV Foundation?</p>
  
  <p>If I can't get AV Foundation to change the format for me, I suppose I could convert from 32 bit to 16 bit "manually", maybe using NEON instructions? Any help is appreciated.</p>