AVAssetWriter unknown error

随声附和 提交于 2019-12-03 05:56:12

I found the problem, it was putting two frames at the same frame time.

Direct from DTS

Error -12633 is a InvalidTimestamp

If you give a sampleBuffer to the AVAssetWriter, then destroy the associated AVAssetReader, future AVAssetReaders may try to reuse the sampleBuffer before AVAssetWriter is finished with it. This is in contradiction to the AVAssetWriter documentation in AVAssetWriterInput.h, and as far as I am aware there is no way to be sure AVAssetWriter is finished until you get the callback in finishWritingWithCompletionHandler, but this can result in the OSStatus error -12633.

@method appendSampleBuffer:

The receiver will retain the CMSampleBuffer until it is done with it, and then release it. Do not modify a CMSampleBuffer or its contents after you have passed it to this method.

It may also happen if pushed frames is out of order

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!