我正在尝试使用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");
}
}
有人有这样的问题吗?