movieFragmentInterval not building sample table

When I set movieFragmentInterval to a positive CMTime on an AVAssetWriter, I see periodic writes to the file, but the file itself is not playable if the application terminates unexpectedly. When I look at the contents of the file it seems to be missing track info. It essentially only has a mdat atom but with its size set to 0. No sample table is present either.

The documentation says it is able to build up the sample table incrementally, but it appears the sample table is only written during finishWriting.

Replies

What value are you setting for movieFragmentInterval, what file type are you writing, and how long do you wait between starting writing and terminating the app?