AVAssetWriter unknown error

后端 未结 5 1752
暖寄归人
暖寄归人 2021-02-07 22:53

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



        
5条回答
  •  迷失自我
    2021-02-07 23:46

    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.

提交回复
热议问题