I got the same error and finally fixed it.
The detail of error is:
[00:02:09.377] MovieHeaderMakerCopyMovieHeaderAsBlockBuffer signalled err=-16345 (kMovieHeaderMakerError_InvalidFileExtension) (file format and file extension of destination URL doesn't match) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/EmbeddedCoreMedia/EmbeddedCoreMedia-2479.1.3/Prototypes/FormatHandlers/Movie/MovieHeaderMaker.c:1463
PS. I found the error info from Console.app with iOS 13 beta device log.
So the solution is obvious:
* Check AVFileType, which was set to AVAssetWriter, make sure it matches destinationURL extension. e.g. AVFileType.mp4 should match the file extension ".mp4".
I tried AVFileType.mov with ".mp4" file extension on iOS 12, it worked fine. But it failed on iOS 13.
Hope this help
Thank you, worked! You just saved my day