<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/CMReadySampleBuffer/init(markerAt:duration:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core Media",
      "CoreMedia"
    ],
    "preciseIdentifier" : "s:9CoreMedia19CMReadySampleBufferVAAs5NeverORszrlE8markerAt8durationACyAEGSo6CMTimea_AJtcfc"
  },
  "title" : "init(markerAt:duration:)"
}
-->

# init(markerAt:duration:)

Creates a marker-only sample buffer with no payload and no format description.

```
init(markerAt markerTime: CMTime, duration: CMTime = .invalid)
```

## Parameters

`markerTime`

Timestamp at which the marker sample buffer should be considered. Pass [`invalid`](/documentation/CoreMedia/CMTime/invalid)
if the marker buffer does not carry timing information.

`duration`

Duration of the marker sample buffer.

## Discussion

Marker-only sample buffers are meant to carry attachments that communicate a state change between sample buffers.
To set attachments on the sample buffer please to access the underlying sample buffer instance as follows:

```swift
markerOnlySampleBuffer.withUnsafeSampleBuffer { sbuf in
    sbuf.attachments[.endsPreviousSampleDuration] = .shouldPropagate(true)
}
```

---

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)