How to read 3GPP chapter markers from MOV on macOS?

The method described in Apple‘s docu https://developer.apple.com/documentation/avfoundation/avasset/presenting_chapter_markers does not seem to work for 3GPP timed chapter markers in a MOV file on macOS Mojave (e.g. a movie with a chapter track exported by Final Cut Pro). The markers itself (i.e. the AVTimedMetadataGroups) are correctly loaded for the stored language locale and show the correct times, but the values for chapterTypes title and artwork are both empty. It doesn‘t seem to be a timing issue during the load either.

Is the method described in Apple‘s docu valid for 3GPP chapter tracks on macOS MP4 files? Or do we need to extract the chapter titles from the chapter track by other means?

Accepted Reply

After stepping back and creating a small playground project I saw that the procedure described in Apple’s docu (see link above) actually does work, if you load the movie into an AVURLAsset or AVMovie object. It does not work, if you load the movie into an AVMutableMovie object - in this case the attribute value of the chapter group’s AVMetadataItems are empty (the other attributes chapterType, time, and duration are correctly loaded). I couldn’t find a statement in the docu that would confirm this finding, so it could be an error of the movie API. For now I will use AVMovie to read the movie’s metadata and chapterlist.

Replies

After stepping back and creating a small playground project I saw that the procedure described in Apple’s docu (see link above) actually does work, if you load the movie into an AVURLAsset or AVMovie object. It does not work, if you load the movie into an AVMutableMovie object - in this case the attribute value of the chapter group’s AVMetadataItems are empty (the other attributes chapterType, time, and duration are correctly loaded). I couldn’t find a statement in the docu that would confirm this finding, so it could be an error of the movie API. For now I will use AVMovie to read the movie’s metadata and chapterlist.