gpt4 book ai didi

ios - AVAssetWriter 未知错误

转载 作者:技术小花猫 更新时间:2023-10-29 10:30:22 27 4
gpt4 key购买 nike

我正在尝试使用 AVAssetWriter 从图像创建视频。实现的代码大部分时间都可以正常工作,但在随机时刻,编写器会出现问题

AVAssetWriter *videoWriter;
...
[videoWriter finishWriting];
NSLog(@"videoWriter error %@",videoWriter.error);

收到的错误是:

Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" 
UserInfo=0x1f839cd0 {NSLocalizedDescription=The operation could not be completed,
NSUnderlyingError=0x1e59efb0 "The operation couldn’t be completed. (OSStatus error -12633.)",
NSLocalizedFailureReason=An unknown error occurred (-12633)}

写入图像:

-(void)writeFrame:(WriteableFrame*)wF
{
if([writerInput isReadyForMoreMediaData])
{
CMTime presentTime = CMTimeMake(wF.frameTime, 1000);
CGImageRef tmpImgRef = [wF.currentImage CGImage];
buffer = [self pixelBufferFromCGImage:tmpImgRef];
if(buffer)
{
[adaptor appendPixelBuffer:buffer withPresentationTime:presentTime];
CVPixelBufferRelease(buffer);
}
}
else
{
NSLog(@"error");
}
}

有人遇到这样的问题吗?

最佳答案

我发现了问题,它在同一帧时间放置了两个帧。

关于ios - AVAssetWriter 未知错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15071387/

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