Keep fragmented file after AVAssetWriter session is complete

tl;dr: Is there a way to keep the fragmented file (instead of the normal MP4 or MOV) after the AVAssetWriter session is complete?


I'm using AVAssetWriter to write a MP4 file and I'm setting movieFragmentInterval to CMTime(1,10) because I want a fragmented MP4. The thing is: the default behavior of AVAssetWriter is to convert the file to a normal MP4 after the recording is finished. I'd like to know if there's a way to keep the fragmented file instead of the default behavior.


Currently, I'm copying the file while it's being written... but this approach is too fragile. Also, is there a place with in depth documentation about how AVAssetWriter works? I'm asking this because my approach is kind of working but I always lose the last 3 seconds (the copied file plays but it is always missing around 3 seconds). It seems like the metadata wasn't written/updated, I don't know... I'd like to know if there's any place explaning in detail how AVAssetWriter is writing the file.



Thank you in advance.

Did you find a solution to this?

Keep fragmented file after AVAssetWriter session is complete
 
 
Q