<!--
{
  "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/AVCaptureDeviceInput/follow(_:videoFrameDuration:delegate:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptureDeviceInput(im)followExternalSyncDevice:videoFrameDuration:delegate:"
  },
  "title" : "follow(_:videoFrameDuration:delegate:)"
}
-->

# follow(_:videoFrameDuration:delegate:)

Configures the the device input to follow an external sync device at the given frame duration.

```
func follow(_ externalSyncDevice: AVExternalSyncDevice, videoFrameDuration frameDuration: CMTime, delegate: (any AVExternalSyncDeviceDelegate)?)
```

## Parameters

`externalSyncDevice`

The [`AVExternalSyncDevice`](/documentation/AVFoundation/AVExternalSyncDevice) hardware to follow.

`delegate`

The delegate to notify when the connection status changes, or an error occurs.

## Discussion

Call this method to direct your [`AVCaptureDeviceInput`](/documentation/AVFoundation/AVCaptureDeviceInput) to follow the external sync pulse from a sync device at the given frame duration.

Your provided `videoFrameDuration` value must match the sync pulse duration of the external sync device. If it does not, the request times out, the external sync device’s status returns to `AVExternalSyncDeviceStatusReady`, and your session stops running, posting a [`runtimeErrorNotification`](/documentation/AVFoundation/AVCaptureSession/runtimeErrorNotification) with `AVErrorFollowExternalSyncDeviceTimedOut`.

The ability to follow an external sync device may change depending on the device configuration. For example, [`follow(_:videoFrameDuration:delegate:)`](/documentation/AVFoundation/AVCaptureDeviceInput/follow(_:videoFrameDuration:delegate:)) cannot be used when [`isAutoVideoFrameRateEnabled`](/documentation/AVFoundation/AVCaptureDevice/isAutoVideoFrameRateEnabled) is `true`.

To stop following an external pulse, call [`unfollowExternalSyncDevice()`](/documentation/AVFoundation/AVCaptureDeviceInput/unfollowExternalSyncDevice()). External sync device following is also disabled when your device’s [`AVCaptureDevice.Format`](/documentation/AVFoundation/AVCaptureDevice/Format) changes.

Your provided delegate’s [`externalSyncDeviceStatusDidChange(_:)`](/documentation/AVFoundation/AVExternalSyncDeviceDelegate/externalSyncDeviceStatusDidChange(_:)) method is called with a status of `AVExternalSyncDeviceStatusReady` if the external pulse signal is not close enough to the provided `videoFrameDuration` for successful calibration.

Once your [`status`](/documentation/AVFoundation/AVExternalSyncDevice/status) changes to `AVExternalSyncDeviceStatusActiveSync`, your input’s  `AVCaptureInput/activeExternalSyncVideoFrameDuration` property reports the up-to-date frame duration. `AVCaptureInput/activeExternalSyncVideoFrameDuration` is also reflected in the [`activeVideoMinFrameDuration`](/documentation/AVFoundation/AVCaptureDevice/activeVideoMinFrameDuration) and [`activeVideoMaxFrameDuration`](/documentation/AVFoundation/AVCaptureDevice/activeVideoMaxFrameDuration) of your input’s associated device.

> Note: Calling this method may cause a lengthy reconfiguration of the receiver, similar to setting a new active format or ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureSession/sessionPreset``.

> Note: When using this property, set the exposure duration with ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureDevice/setExposureModeCustom(duration:iso:completionHandler:)`` to one half the frame duration (or less) to maintain full dynamic range.

> Important: Calling this method throws an `NSInvalidArgumentException` if ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureDeviceInput/isExternalSyncSupported`` returns `false`.

> Important: The provided external sync device’s ``status`` must be ``AVExternalSyncDeviceStatusReady`` when you call this method, otherwise an `NSInvalidArgumentException` is thrown.

---

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)