<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVAssetWriter/add(_:)-3san4",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAssetWriter(im)addInputGroup:"
  },
  "title" : "add(_:)"
}
-->

# add(_:)

Adds an input group to an asset writer.

```
func add(_ inputGroup: AVAssetWriterInputGroup)
```

## Parameters

`inputGroup`

A compatible asset writer input group to add.

## Discussion

An asset writer marks tracks associated with grouped inputs as mutually exclusive to each other for playback or other processing, if the output container format supports mutually exclusive relationships among tracks.

When you add an input group to an asset writer, the system sets the value of the default input’s [`marksOutputTrackAsEnabled`](/documentation/AVFoundation/AVAssetWriterInput/marksOutputTrackAsEnabled) property to <doc://com.apple.documentation/documentation/Swift/true> and sets the values of the group’s other inputs to <doc://com.apple.documentation/documentation/Swift/false>.

You can’t add input groups after writing starts.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)