<!--
{
  "documentType" : "article",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/sample-attachment-keys",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Sample Attachment Keys"
}
-->

# Sample Attachment Keys

Keys that specify attachments to individual samples in a buffer.

## Discussion

You can get and set sample-level attachments in a sample buffer using the [`CMSampleBufferGetSampleAttachmentsArray(_:createIfNecessary:)`](/documentation/CoreMedia/CMSampleBufferGetSampleAttachmentsArray(_:createIfNecessary:)) function.

## Topics

### Sample Keys

[`kCMSampleAttachmentKey_NotSync`](/documentation/CoreMedia/kCMSampleAttachmentKey_NotSync)

Indicates whether the sample is a sync sample (type `CFBoolean`, default false).

[`kCMSampleAttachmentKey_PartialSync`](/documentation/CoreMedia/kCMSampleAttachmentKey_PartialSync)

Indicates whether the sample is a partial sync sample (type `CFBoolean`, default false).

[`kCMSampleAttachmentKey_DependsOnOthers`](/documentation/CoreMedia/kCMSampleAttachmentKey_DependsOnOthers)

Indicates whether the sample depends on other samples for decoding (type `CFBoolean`).

[`kCMSampleAttachmentKey_IsDependedOnByOthers`](/documentation/CoreMedia/kCMSampleAttachmentKey_IsDependedOnByOthers)

Indicates whether other samples depend on this sample for decoding (type `CFBoolean`).

[`kCMSampleAttachmentKey_DisplayImmediately`](/documentation/CoreMedia/kCMSampleAttachmentKey_DisplayImmediately)

Indicates whether the sample should be displayed immediately (type `CFBoolean`, default false).

[`kCMSampleAttachmentKey_DoNotDisplay`](/documentation/CoreMedia/kCMSampleAttachmentKey_DoNotDisplay)

Indicates whether the sample should be decoded but not displayed (type `CFBoolean`, default false).

[`kCMSampleAttachmentKey_EarlierDisplayTimesAllowed`](/documentation/CoreMedia/kCMSampleAttachmentKey_EarlierDisplayTimesAllowed)

Indicates whether later samples may have earlier display times (type `CFBoolean`).

[`kCMSampleAttachmentKey_HasRedundantCoding`](/documentation/CoreMedia/kCMSampleAttachmentKey_HasRedundantCoding)

Indicates whether the sample has redundant coding (type `CFBoolean`).

[`kCMSampleAttachmentKey_PostDecodeProcessingMetadata`](/documentation/CoreMedia/kCMSampleAttachmentKey_PostDecodeProcessingMetadata)

### Sample Buffer Keys

[`kCMSampleBufferAttachmentKey_DisplayEmptyMediaImmediately`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_DisplayEmptyMediaImmediately)

Tells that the empty marker should be dequeued immediately regardless of its timestamp (type `CFBoolean`, default false).

[`kCMSampleBufferAttachmentKey_DrainAfterDecoding`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_DrainAfterDecoding)

Indicates whether the sample buffer should be drained after decoding type `CFBoolean`, default false).

[`kCMSampleBufferAttachmentKey_DroppedFrameReason`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_DroppedFrameReason)

Indicates the reason the current video frame was dropped (type `CFString`).

[`kCMSampleBufferDroppedFrameReason_FrameWasLate`](/documentation/CoreMedia/kCMSampleBufferDroppedFrameReason_FrameWasLate)

The frame was dropped because it was late.

[`kCMSampleBufferDroppedFrameReason_OutOfBuffers`](/documentation/CoreMedia/kCMSampleBufferDroppedFrameReason_OutOfBuffers)

The frame was dropped because the module providing frames is out of buffers.

[`kCMSampleBufferDroppedFrameReason_Discontinuity`](/documentation/CoreMedia/kCMSampleBufferDroppedFrameReason_Discontinuity)

An unknown number of frames were dropped.

[`kCMSampleBufferAttachmentKey_DroppedFrameReasonInfo`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_DroppedFrameReasonInfo)

Indicates additional information regarding the dropped video frame (type `CFString`).

[`kCMSampleBufferDroppedFrameReasonInfo_CameraModeSwitch`](/documentation/CoreMedia/kCMSampleBufferDroppedFrameReasonInfo_CameraModeSwitch)

A discontinuity was caused by a camera mode switch.

[`kCMSampleBufferAttachmentKey_EmptyMedia`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_EmptyMedia)

Marks an intentionally empty interval in the sequence of samples (type `CFBoolean`, default false).

[`kCMSampleBufferAttachmentKey_EndsPreviousSampleDuration`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_EndsPreviousSampleDuration)

Indicates that sample buffer’s decode timestamp may be used to define the previous sample buffer’s duration (type `CFBoolean`, default false).

[`kCMSampleBufferAttachmentKey_FillDiscontinuitiesWithSilence`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_FillDiscontinuitiesWithSilence)

Fill the difference between discontiguous sample buffers with silence (type `CFBoolean`, default false).

[`kCMSampleBufferAttachmentKey_ForceKeyFrame`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_ForceKeyFrame)

Indicates that the current or next video sample buffer should be forced to be encoded as a key frame.

[`kCMSampleBufferAttachmentKey_GradualDecoderRefresh`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_GradualDecoderRefresh)

Indicates the decoder refresh count (type `CFNumber`).

[`kCMSampleBufferAttachmentKey_PermanentEmptyMedia`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_PermanentEmptyMedia)

Marks the end of the sequence of samples (type `CFBoolean`, default false).

[`kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed)

If present, indicates that decode pipelines should post a notification when consuming the sample buffer(type `CFDictionary`).

[`kCMSampleBufferAttachmentKey_ResetDecoderBeforeDecoding`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_ResetDecoderBeforeDecoding)

Indicates whether the sample buffer should be reset before decoding (type `CFBoolean`, default false).

[`kCMSampleBufferAttachmentKey_ResumeOutput`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_ResumeOutput)

If present, indicates that output should be resumed following a discontinuity `CFBoolean`, default false).

[`kCMSampleBufferAttachmentKey_Reverse`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_Reverse)

Indicates that the decoded contents of the sample buffer should be reversed (type `CFBoolean`, default false).

[`kCMSampleBufferAttachmentKey_SampleReferenceByteOffset`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_SampleReferenceByteOffset)

Indicates the byte offset at which the sample data begins (type `CFNumber`).

[`kCMSampleBufferAttachmentKey_SampleReferenceURL`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_SampleReferenceURL)

Indicates the URL where the sample data is (type `CFURL`).

[`kCMSampleBufferAttachmentKey_SpeedMultiplier`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_SpeedMultiplier)

The factor by which the sample buffer’s presentation should be accelerated (type `CFNumber`, default 1.0).

[`kCMSampleBufferAttachmentKey_StillImageLensStabilizationInfo`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_StillImageLensStabilizationInfo)

Indicates information about the lens stabilization applied to the current still image buffer.

[`kCMSampleBufferLensStabilizationInfo_Active`](/documentation/CoreMedia/kCMSampleBufferLensStabilizationInfo_Active)

The lens stabilization module was active for the duration this buffer.

[`kCMSampleBufferLensStabilizationInfo_OutOfRange`](/documentation/CoreMedia/kCMSampleBufferLensStabilizationInfo_OutOfRange)

The motion of the device or duration of the capture was outside of what the stabilization mechanism could support.

[`kCMSampleBufferLensStabilizationInfo_Unavailable`](/documentation/CoreMedia/kCMSampleBufferLensStabilizationInfo_Unavailable)

The lens stabilization module was unavailable for use.

[`kCMSampleBufferLensStabilizationInfo_Off`](/documentation/CoreMedia/kCMSampleBufferLensStabilizationInfo_Off)

The lens stabilization module was not used during this capture.

[`kCMSampleBufferAttachmentKey_TransitionID`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_TransitionID)

Marks a transition from one source of buffers to another.

[`kCMSampleBufferAttachmentKey_TrimDurationAtEnd`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_TrimDurationAtEnd)

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

[`kCMSampleBufferAttachmentKey_TrimDurationAtStart`](/documentation/CoreMedia/kCMSampleBufferAttachmentKey_TrimDurationAtStart)

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



---

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)