<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:@S@AVCaptureTimecode"
  },
  "title" : "AVCaptureTimecode"
}
-->

# AVCaptureTimecode

This structure represents a timecode, adhering to SMPTE standards, which define precise time information and associated timestamps for video or audio synchronization.

```
struct AVCaptureTimecode
```

## Overview

This structure corresponds to the SMPTE 12M-1 Linear Timecode (LTC) format, widely used for professional video and audio synchronization.

## Topics

### Accessing timecode components

[`frameDuration`](/documentation/AVFoundation/AVCaptureTimecode/frameDuration)

Frame duration of the timecode. If unknown, the value is `kCMTimeInvalid`.

[`frames`](/documentation/AVFoundation/AVCaptureTimecode/frames)

Frame component of the timecode, indicating the frame count within the second.

[`hours`](/documentation/AVFoundation/AVCaptureTimecode/hours)

Time component representing the current timecode in hours.

[`minutes`](/documentation/AVFoundation/AVCaptureTimecode/minutes)

Time component representing the current timecode in minutes.

[`seconds`](/documentation/AVFoundation/AVCaptureTimecode/seconds)

Time component representing the current timecode in seconds.

[`userBits`](/documentation/AVFoundation/AVCaptureTimecode/userBits)

A 32-bit field carrying SMPTE user bits, which are not strictly standardized. User bits are often used for additional metadata such as scene-take information, reel numbers, or dates, but their exact usage is application-dependent.

### Working with sources

[`sourceType`](/documentation/AVFoundation/AVCaptureTimecode/sourceType-swift.property)

Source type of the timecode, indicating the emitter, carriage, or transport mechanism.

[`AVCaptureTimecode.SourceType`](/documentation/AVFoundation/AVCaptureTimecode/SourceType-swift.enum)

Defines possible sources for generating timecode in using a timecode generator.

[`AVCaptureTimecode.Source`](/documentation/AVFoundation/AVCaptureTimecode/Source)

Describes a timecode source that a timecode generator can synchronize to.

### Manipulating timecodes

[`advanced(_:by:)`](/documentation/AVFoundation/AVCaptureTimecode/advanced(_:by:))

Generates a new timecode by adding a specified number of frames to the given timecode, handling overflow for seconds, minutes, and hours.

### Creating metadata sample buffers

[`createMetadataSampleBuffer(from:associatedWithPresentationTimeStamp:)`](/documentation/AVFoundation/AVCaptureTimecode/createMetadataSampleBuffer(from:associatedWithPresentationTimeStamp:))

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

[`createMetadataSampleBuffer(from:forDuration:)`](/documentation/AVFoundation/AVCaptureTimecode/createMetadataSampleBuffer(from:forDuration:))

Creates a sample buffer containing Timecode Media Description metadata for a specified duration.

### Initializers

[`init()`](/documentation/AVFoundation/AVCaptureTimecode/init())

[`init(hours:minutes:seconds:frames:userBits:frameDuration:sourceType:)`](/documentation/AVFoundation/AVCaptureTimecode/init(hours:minutes:seconds:frames:userBits:frameDuration:sourceType:))



---

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)