2

当我想通过使用 VTCompressionSessionCreate 创建 VTCompressionSessionRef 时,这是崩溃,谁能告诉我为什么??????

 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 ;

        }
}

崩溃时状态始终为-12912。

4

1 回答 1

0

根据 VideoToolbox/VTErrors.h:

kVTVideoEncoderMalfunctionErr           = -12912,

您的硬件编码器可能出现故障吗?

于 2016-02-11T15:37:30.423 回答