3

This is crash when i want to create a VTCompressionSessionRef by use VTCompressionSessionCreate, who can tell me why?????

 dispatch_sync(aQueue, ^{

        // Create the compression session
        OSStatus status = VTCompressionSessionCreate(NULL, width, height, kCMVideoCodecType_H264, NULL, NULL, NULL, didCompressH264, (__bridge void *)(self),  &EncodingSession);
        NSLog(@"H264: VTCompressionSessionCreate %d", (int)status);

        if (status != 0)
        {
            NSLog(@"H264: Unable to create a H264 session");
            error = @"H264: Unable to create a H264 session";

            return ;

        }
}

status is always -12912 when it crashed.

ArK
  • 20,698
  • 67
  • 109
  • 136

1 Answers1

0

According to VideoToolbox/VTErrors.h:

kVTVideoEncoderMalfunctionErr           = -12912,

Could your hardware encoder be malfunctioning?

svth
  • 1,303
  • 1
  • 14
  • 23