gpt4 book ai didi

video-toolbox - VTCompressionSessionCreate 总是崩溃

转载 作者:行者123 更新时间:2023-12-05 07:51:52 27 4
gpt4 key购买 nike

当我想使用 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。

最佳答案

根据 VideoToolbox/VTErrors.h:

kVTVideoEncoderMalfunctionErr           = -12912,

您的硬件编码器是否出现故障?

关于video-toolbox - VTCompressionSessionCreate 总是崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34505931/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com