AVAssetWriterDelegate doesn't report last segment in iOS

I'm trying to use the sample code associated to the talk Author fragmented MPEG-4 content with AVAssetWriter which can be found here.

It works well when I run it on macOS, but after adapting it to run in iOS (basically moving the code in the main file to a view controller), it doesn't work. The problem is that the function:

assetWriter(_:didOutputSegmentData:segmentType:segmentReport:)

is never called for the last segment.

In macOS, the last segment is reported after calling the function AVAssetWriter.finishWriting(completionHandler:), but before the completionHandler parameter block is invoked. In iOS, nothing happens at that point.

Is there anything I could do from my side to fix this problem? Thanks in advance!

That sounds unexpected. Please file a bug using the feedback assistant and include your adapted project that is failing.

Any update on that feedback? can't seems to find it

AVAssetWriterDelegate doesn't report last segment in iOS
 
 
Q