---
title: "replaceFormatDescription(_:with:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avmutablemovietrack/replaceformatdescription(_:with:)"
---

# replaceFormatDescription(_:with:)

Replaces the track’s format description with a new format description.

## Declaration

```swift
func replaceFormatDescription(_ formatDescription: CMFormatDescription, with newFormatDescription: CMFormatDescription)
```

## Parameters

- `formatDescription`: The doc://com.apple.documentation/documentation/CoreMedia/CMFormatDescription object to be replaced.
- `newFormatDescription`: The doc://com.apple.documentation/documentation/CoreMedia/CMFormatDescription object to replacing the specified format description.

## Discussion

Discussion Use this method to change a track’s format descriptions, such as adding format description extensions to a format description or changing the audio channel layout of an audio track. Format description can have extensions of type kCMFormatDescriptionExtension_VerbatimSampleDescription and kCMFormatDescriptionExtension_VerbatimISOSampleEntry. If you modify a copy of a format description, delete those extensions from the copy or your changes might be ignored.

## See Also

### Changing format descriptions

- [formatDescriptions](avfoundation/avmutablemovietrack/formatdescriptions.md)
