<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/kCMSampleBufferAttachmentKey_TrimDurationAtStart",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "Core Media"
    ],
    "preciseIdentifier" : "c:@kCMSampleBufferAttachmentKey_TrimDurationAtStart"
  },
  "title" : "kCMSampleBufferAttachmentKey_TrimDurationAtStart"
}
-->

# kCMSampleBufferAttachmentKey_TrimDurationAtStart

The duration that should be removed at the beginning of the sample buffer, after decoding.

```
let kCMSampleBufferAttachmentKey_TrimDurationAtStart: CFString
```

## Discussion

If this attachment is not present, the trim duration is zero (nothing removed).        This is a [`CMTime`](/documentation/CoreMedia/CMTime) in Core Foundation dictionary format as made by [`CMTimeCopyAsDictionary(_:allocator:)`](/documentation/CoreMedia/CMTimeCopyAsDictionary(_:allocator:));         use [`CMTimeMakeFromDictionary(_:)`](/documentation/CoreMedia/CMTimeMakeFromDictionary(_:)) to convert to [`CMTime`](/documentation/CoreMedia/CMTime).        In cases where all the output after decoding the sample buffer is to be discarded         (for example, the samples are only being decoded to prime the decoder) the usual convention        is to set [`kCMSampleBufferAttachmentKey_TrimDurationAtStart`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_TrimDurationAtStart) to the whole duration         and not to set a [`kCMSampleBufferAttachmentKey_TrimDurationAtEnd`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_TrimDurationAtEnd) attachment.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)