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

# init(numberOfFrames:duration:)

## Declaration

```swift
init(numberOfFrames frameCount: Int, duration: CMTime)
```

## Parameters

- `frameCount`: The number of frames in this planned video segment.
- `duration`: The duration of this planned video segment.

## Return Value

Return Value An instance of AVPlannedVideoSegmentConfiguration.

## Discussion

Discussion Creates an instance of AVPlannedVideoSegmentConfiguration specifying the number of frames in and total duration of the segment. For best results, frameCount and duration should be greater or equal to the minimumFrameCount and minimumDuration of AVPlannedVideoSegmentBoundaryGuidelines respectively. This initializer throws NSInvalidArgumentException if frameCount is less than or equal to 0, or duration is not numeric, or duration is less than or equal to 0.
