---
title: duration
framework: avfoundation
role: symbol
role_heading: Instance Property
path: avfoundation/avmetadataobject/duration
---

# duration

The duration of the media associated with this metadata object.

## Declaration

```swift
var duration: CMTime { get }
```

## Discussion

Discussion For metadata originating from a sample buffer (CMSampleBuffer), the duration reflects the duration of the sample buffer. If there is no valid duration value associated with the metadata, this property should contain invalid.

## See Also

### Inspecting the metadata

- [bounds](avfoundation/avmetadataobject/bounds.md)
- [time](avfoundation/avmetadataobject/time.md)
- [type](avfoundation/avmetadataobject/type.md)
- [AVMetadataObject.ObjectType](avfoundation/avmetadataobject/objecttype.md)
- [isFixedFocus](avfoundation/avmetadataobject/isfixedfocus.md)
- [cinematicVideoFocusMode](avfoundation/avmetadataobject/cinematicvideofocusmode.md)
- [groupID](avfoundation/avmetadataobject/groupid.md)
- [objectID](avfoundation/avmetadataobject/objectid.md)
