---
title: "init(duration:)"
framework: avfoundation
role: symbol
role_heading: Initializer
path: "avfoundation/avplannedsegmentconfiguration/init(duration:)"
---

# init(duration:)

## Declaration

```swift
init(duration: CMTime)
```

## Parameters

- `duration`: The total duration of this planned segment. If an empty edit is included, this duration may be larger than the sum of the durations of the samples in this planned segment.

## Return Value

Return Value An instance of AVPlannedSegmentConfiguration, or nil if initialization fails.

## Discussion

Discussion Creates an instance of AVPlannedSegmentConfiguration specifying the duration of the planned segment. The duration parameter must be numeric and greater than 0. Otherwise, the initializer throws NSInvalidArgumentException.
