首先,最好把他们放在线程里去执行,而写顺序应该是
[self.writerInput markAsFinished];
[self.videoWriter finishWriting];
其次,如果每次想在重新写一个视频的时候,那么你就要重新init一下AVAssetWriter,AVAssetWriterInput,否则就会报错Cannot call method when status is 2
参考文章:AVAssetWriter multiple sessions and the status property