Metadata in Video stripped by Share Sheet / Airdrop

I have an application which records video along with some custom metadata and a chapter track. The resultant video is stored in the Camera Roll.

When sharing the video via the Share Sheet or AirDrop, the metadata track is stripped entirely (the chapter markers are preserved)

Sharing via AirDrop with the "All Photos Data" option does include the metadata track, as does copying from the device with Image Capture but this is a bad user experience as the user must remember to explicitly select this option, and the filename is lost when sending this way.

I have also tried various other approaches (such as encoding my metadata in a subtitle track, which I didn't expect to be stripped as it's an accessibility concern) but it's also removed.

Essentially I am looking for a definitive list of things that are not stripped or if there's a way to encode a track in some way to indicate it should be preserved.

The metadata is added via AVTimedMetadataGroup containing one AVMutableMetadataItem which has its value as a JSON string.

I took a different approach with the Chapter Marker track (mainly because I did it first in a completely different way and didn't rework it when I added the other track). I post-process these after the video is recorded, and add them with addMutableTrack and then addTrackAssociation(to: chapterTrack, type: .chapterList) but I don't think that's the reason the chapter track persists where the custom metadata does not as other tests with video files from other sources containing subtitles etc also had their subtitle data stripped.


tl;dr I record videos with metadata that I want to be able to share via Share Sheet and AirDrop, what am I doing wrong?

Metadata in Video stripped by Share Sheet / Airdrop
 
 
Q