I'm using AVAssetWriter to write an AAC packaged in MP4 container. Pretty standard stuff. It is working well.
However, now I need to add an atom contained in the udta atom, so I have done this:
AVAssetWriter * writer =....
AVMutableMetadataItem * item = [AVMutableMetadataItem metadataItem];
item.keySpace = AVMetadataKeySpaceQuickTimeUserData; //udta
item.key = @"mine";
item.value = @"json data string";
writer.metadata = @[item];
[writer startWriting];
...And then in the end, the udta atom doesn't appear at all in the output file. What is going wrong here?
I should mention this is iOS 9.3 SDK with Xcode 7.3.1