Contents

createMetadataSampleBuffer(from:associatedWithPresentationTimeStamp:)

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

Declaration

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

Parameters

  • timecode:

    The 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.

See Also

Timecode generation