title: VTCompressionSessionEncodeFrame error code -12902
body: <p>I have a function that takes a CVImageBufferRef and passes it to my VTCompressionSession for processing.</p>
  
  <p>The VTCompressionSession is started and my call to VTCompressionSessionCreate is successful.</p>
  
  <p>I am retrieving a video URL from the photo library and processing it using the following:</p>
  
  <pre><code>- (void)processImageBuffersFromURL:(NSURL *)url withBlock:(void (^)(CVImageBufferRef bufferRef))block {
      AVAsset *asset = [AVAsset assetWithURL:url];
      AVAssetTrack *track = [[asset
                              tracksWithMediaType:AVMediaTypeVideo]
                             objectAtIndex:0];
  
      AVAssetReaderTrackOutput
      *readerTrack = [AVAssetReaderTrackOutput
                      assetReaderTrackOutputWithTrack:track
                      outputSettings:@{(id)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange)}];
      AVAssetReader *reader = [AVAssetReader assetReaderWithAsset:asset
                                                            error:nil];
      [reader addOutput:readerTrack];
      [reader startReading];
  
      CMSampleBufferRef sample = NULL;
  
      while ((sample = [readerTrack copyNextSampleBuffer])) {
          CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sample);
          block(imageBuffer);
      }
  }
  </code></pre>
  
  <p>The block basically just calls</p>
  
  <pre><code>    SInt32 status = VTCompressionSessionEncodeFrame(_compressionSession, imageBuffer, CMTimeMake(self.currentFrameNumber++, 30), kCMTimeInvalid, NULL, (__bridge void *)self, NULL);
  </code></pre>
  
  <p>and the status is -12902.  I looked on <a href="http://www.osstatus.com/search/results?platform=all&amp;framework=all&amp;search=-12902" rel="nofollow">this site</a> for information about the status, and I can't find any other relevant information. The site says that the error is <code>kVTParameterErr</code>.</p>
  
  <p>My VTCompressionOutputCallback is not being called.</p>
  
  <p>Can anyone explain this error code to me?</p>