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);
Received error is:
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)}
Writing images:
-(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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With