我试图使用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"); } }
有人有这样的问题吗?
解决方法
我发现这个问题,它在同一帧时间放置了两帧.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。