---
title: "init(markerAt:duration:)"
framework: coremedia
role: symbol
role_heading: Initializer
path: "coremedia/cmreadysamplebuffer/init(markerat:duration:)"
---

# init(markerAt:duration:)

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

## Declaration

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

## Parameters

- `markerTime`: Timestamp at which the marker sample buffer should be considered. Pass doc://com.apple.coremedia/documentation/CoreMedia/CMTime/invalid if the marker buffer does not carry timing information.
- `duration`: Duration of the marker sample buffer.

## Discussion

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: markerOnlySampleBuffer.withUnsafeSampleBuffer { sbuf in     sbuf.attachments[.endsPreviousSampleDuration] = .shouldPropagate(true) }
