---
title: "follow(_:videoFrameDuration:delegate:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avcapturedeviceinput/follow(_:videoframeduration:delegate:)"
---

# follow(_:videoFrameDuration:delegate:)

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

## Declaration

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

## Parameters

- `externalSyncDevice`: The doc://com.apple.avfoundation/documentation/AVFoundation/AVExternalSyncDevice hardware to follow.
- `delegate`: The delegate to notify when the connection status changes, or an error occurs.

## Discussion

Discussion Call this method to direct your 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 with AVErrorFollowExternalSyncDeviceTimedOut. The ability to follow an external sync device may change depending on the device configuration. For example, follow(_:videoFrameDuration:delegate:) cannot be used when isAutoVideoFrameRateEnabled is true. To stop following an external pulse, call unfollowExternalSyncDevice(). External sync device following is also disabled when your device’s AVCaptureDevice.Format changes. Your provided delegate’s 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 changes to AVExternalSyncDeviceStatusActiveSync, your input’s  AVCaptureInput/activeExternalSyncVideoFrameDuration property reports the up-to-date frame duration. AVCaptureInput/activeExternalSyncVideoFrameDuration is also reflected in the activeVideoMinFrameDuration and 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 sessionPreset. note: When using this property, set the exposure duration with 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 isExternalSyncSupported returns false. important: The provided external sync device’s status must be AVExternalSyncDeviceStatusReady when you call this method, otherwise an NSInvalidArgumentException is thrown.

## See Also

### Synchronizing with external devices

- [isExternalSyncSupported](avfoundation/avcapturedeviceinput/isexternalsyncsupported.md)
- [unfollowExternalSyncDevice()](avfoundation/avcapturedeviceinput/unfollowexternalsyncdevice().md)
- [activeExternalSyncVideoFrameDuration](avfoundation/avcapturedeviceinput/activeexternalsyncvideoframeduration.md)
- [externalSyncDevice](avfoundation/avcapturedeviceinput/externalsyncdevice.md)
