---
title: kCMSampleBufferAttachmentKey_ForceKeyFrame
framework: coremedia
role: symbol
role_heading: Global Variable
path: coremedia/kcmsamplebufferattachmentkey_forcekeyframe
---

# kCMSampleBufferAttachmentKey_ForceKeyFrame

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

## Declaration

```swift
let kCMSampleBufferAttachmentKey_ForceKeyFrame: CFString
```

## Discussion

Discussion If this attachment is present and kCFBooleanTrue on a sample buffer with a video frame, that video frame will be forced to become a key frame.  If the sample buffer for which this is present and kCFBooleanTrue does not have a valid video frame, the next sample buffer processed that contains a valid video frame will be encoded as a key frame.

## See Also

### Sample Buffer Keys

- [kCMSampleBufferAttachmentKey_DisplayEmptyMediaImmediately](coremedia/kcmsamplebufferattachmentkey_displayemptymediaimmediately.md)
- [kCMSampleBufferAttachmentKey_DrainAfterDecoding](coremedia/kcmsamplebufferattachmentkey_drainafterdecoding.md)
- [kCMSampleBufferAttachmentKey_DroppedFrameReason](coremedia/kcmsamplebufferattachmentkey_droppedframereason.md)
- [kCMSampleBufferDroppedFrameReason_FrameWasLate](coremedia/kcmsamplebufferdroppedframereason_framewaslate.md)
- [kCMSampleBufferDroppedFrameReason_OutOfBuffers](coremedia/kcmsamplebufferdroppedframereason_outofbuffers.md)
- [kCMSampleBufferDroppedFrameReason_Discontinuity](coremedia/kcmsamplebufferdroppedframereason_discontinuity.md)
- [kCMSampleBufferAttachmentKey_DroppedFrameReasonInfo](coremedia/kcmsamplebufferattachmentkey_droppedframereasoninfo.md)
- [kCMSampleBufferDroppedFrameReasonInfo_CameraModeSwitch](coremedia/kcmsamplebufferdroppedframereasoninfo_cameramodeswitch.md)
- [kCMSampleBufferAttachmentKey_EmptyMedia](coremedia/kcmsamplebufferattachmentkey_emptymedia.md)
- [kCMSampleBufferAttachmentKey_EndsPreviousSampleDuration](coremedia/kcmsamplebufferattachmentkey_endsprevioussampleduration.md)
- [kCMSampleBufferAttachmentKey_FillDiscontinuitiesWithSilence](coremedia/kcmsamplebufferattachmentkey_filldiscontinuitieswithsilence.md)
- [kCMSampleBufferAttachmentKey_GradualDecoderRefresh](coremedia/kcmsamplebufferattachmentkey_gradualdecoderrefresh.md)
- [kCMSampleBufferAttachmentKey_PermanentEmptyMedia](coremedia/kcmsamplebufferattachmentkey_permanentemptymedia.md)
- [kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed](coremedia/kcmsamplebufferattachmentkey_postnotificationwhenconsumed.md)
- [kCMSampleBufferAttachmentKey_ResetDecoderBeforeDecoding](coremedia/kcmsamplebufferattachmentkey_resetdecoderbeforedecoding.md)
