ios – AVAssetWriter未知错误

前端之家收集整理的这篇文章主要介绍了ios – AVAssetWriter未知错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图使用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相关文章