metadataItem(frameTimeRange:)
Builds a metadata item containing the presentation commands active at the start of the specified frame’s time range.
Declaration
func metadataItem(frameTimeRange: CMTimeRange) throws -> AVMetadataItem?Parameters
- frameTimeRange:
The frame’s presentation time range. Its
startis used to resolve which commands are active; the returned item is stamped with the full range.
Return Value
An AVMetadataItem whose value encodes the active presentation commands for that frame, or nil if none are active.
Discussion
This is intended to be called once per video frame. The returned item’s time and duration are set directly from frameTimeRange, so the caller can write it into a per-frame metadata track without further clipping or stamping. Returns nil if no presentation commands are active at frameTimeRange.start.