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
I was getting the same error when the image in my pixel buffer was not of the same width/height dimensions that the input pixel buffer adapter expects based on what you set the sourcePixelBufferAttributes to for(kCVPixelBufferWidthKey, kCVPixelBufferHeightKey). Make sure the pixel buffer has those same dimensions. In my case, my application was sometimes drawing a 1x1 image because I intended to draw a solid color image but I neglected to upscale that single-color pixel to the full size.