本文介绍了AVAssetWriter未知错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试使用 AVAssetWriter
从图像创建视频。已实现的代码大部分时间都可以正常工作,但是在随机时刻,编写器存在问题
Am trying to create video from images using AVAssetWriter
. Implemented code works fine most of time, but in random moments there is problem with writer
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");
}
}
是否有人有这样的问题?
Is there someone with problem like this?
推荐答案
我发现了问题,它在相同的帧时间放置了两个帧。
I found the problem, it was putting two frames at the same frame time.
这篇关于AVAssetWriter未知错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!