---
title: preferredMediaChunkDuration
framework: avfoundation
role: symbol
role_heading: Instance Property
path: avfoundation/avmutablemovietrack/preferredmediachunkduration
---

# preferredMediaChunkDuration

The maximum duration to use for each chunk of sample data written to the file for file types that support media chunk duration.

## Declaration

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

## Discussion

Discussion The total duration of the samples in a chunk can be no greater than the preferred chunk duration, or the duration of a single sample if the single sample’s duration is greater than the preferred chunk duration. The default media chunk duration is 1.0 second. Setting a negative or non-numeric value for the chunk duration will cause an error.

## See Also

### Accessing media chunks

- [preferredMediaChunkAlignment](avfoundation/avmutablemovietrack/preferredmediachunkalignment.md)
- [preferredMediaChunkSize](avfoundation/avmutablemovietrack/preferredmediachunksize.md)
