---
title: maxRecordedDuration
framework: avfoundation
role: symbol
role_heading: Instance Property
path: avfoundation/avcapturefileoutput/maxrecordedduration
---

# maxRecordedDuration

The longest duration allowed for the recording.

## Declaration

```swift
var maxRecordedDuration: CMTime { get set }
```

## Discussion

Discussion This property specifies a hard limit on the duration of recorded files. Recording is stopped when the limit is reached and the fileOutput(_:didFinishRecordingTo:from:error:) delegate method is invoked with an appropriate error. The default value of this property is invalid, which indicates no limit.

## See Also

### Setting file output properties

- [delegate](avfoundation/avcapturefileoutput/delegate.md)
- [maxRecordedFileSize](avfoundation/avcapturefileoutput/maxrecordedfilesize.md)
- [minFreeDiskSpaceLimit](avfoundation/avcapturefileoutput/minfreediskspacelimit.md)
- [outputFileURL](avfoundation/avcapturefileoutput/outputfileurl.md)
- [recordedDuration](avfoundation/avcapturefileoutput/recordedduration.md)
- [recordedFileSize](avfoundation/avcapturefileoutput/recordedfilesize.md)
- [isRecording](avfoundation/avcapturefileoutput/isrecording.md)
- [isRecordingPaused](avfoundation/avcapturefileoutput/isrecordingpaused.md)
