<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCaptureTimecode/createMetadataSampleBuffer(from:associatedWithPresentationTimeStamp:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:@F@AVCaptureTimecodeCreateMetadataSampleBufferAssociatedWithPresentationTimeStamp"
  },
  "title" : "createMetadataSampleBuffer(from:associatedWithPresentationTimeStamp:)"
}
-->

# createMetadataSampleBuffer(from:associatedWithPresentationTimeStamp:)

Creates a sample buffer containing Timecode Media Description metadata for integration with a video track.

```
static func createMetadataSampleBuffer(from timecode: AVCaptureTimecode, associatedWithPresentationTimeStamp presentationTimeStamp: CMTime) -> Unmanaged<CMSampleBuffer>?
```

## Parameters

`timecode`

The [`AVCaptureTimecode`](/documentation/AVFoundation/AVCaptureTimecode) instance providing the timecode details to encode.

`presentationTimeStamp`

The presentation time stamp that determines the exact moment in the media timeline where the metadata should be applied. It is embedded in the sample timing info (`CMSampleTimingInfo`) and ensures that the packaged metadata synchronizes accurately with the corresponding video frame.

## Return Value

A `CMSampleBufferRef` with the encoded Timecode Media Description metadata for video synchronization, or `nil` if sample buffer creation fails.

---

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)