<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVAssetWriterInput/performsMultiPassEncodingIfSupported",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAssetWriterInput(py)performsMultiPassEncodingIfSupported"
  },
  "title" : "performsMultiPassEncodingIfSupported"
}
-->

# performsMultiPassEncodingIfSupported

A Boolean value that indicates whether the input attempts to encode the source media data using multiple passes.

```
var performsMultiPassEncodingIfSupported: Bool { get set }
```

## Discussion

An asset writer input may be able to achieve higher quality and lower data rate by performing multiple passes over the source media. It does this by analyzing the media data it appends and reencodes certain segments with different parameters. To perform the reencoding, you must append the media data for the segments again. See the [`currentPassDescription`](/documentation/AVFoundation/AVAssetWriterInput/currentPassDescription) property and [`markCurrentPassAsFinished()`](/documentation/AVFoundation/AVAssetWriterInput/markCurrentPassAsFinished()) method for the means by which the input nominates segments to reappend.

When the value of this property is <doc://com.apple.documentation/documentation/Swift/true>, the value of [`isReadyForMoreMediaData`](/documentation/AVFoundation/AVAssetWriterInput/isReadyForMoreMediaData) for other inputs attached to the same asset writer may be <doc://com.apple.documentation/documentation/Swift/false> more often and for longer periods of time. In particular, the value of [`isReadyForMoreMediaData`](/documentation/AVFoundation/AVAssetWriterInput/isReadyForMoreMediaData) for inputs that don’t perform multiple passes may start as <doc://com.apple.documentation/documentation/Swift/false> after calling the method asset writer’s [`startWriting()`](/documentation/AVFoundation/AVAssetWriter/startWriting()) method, and may not change to <doc://com.apple.documentation/documentation/Swift/true> until after all multipass inputs complete their final pass.

When the value of this property is <doc://com.apple.documentation/documentation/Swift/true>, the input may store data in one or more temporary files before writing compressed samples to the output file. Use the asset writer’s [`directoryForTemporaryFiles`](/documentation/AVFoundation/AVAssetWriter/directoryForTemporaryFiles) property if you need to specify the location of temporary file writing.

The default value is <doc://com.apple.documentation/documentation/Swift/false>, which means that no additional analysis occurs and it doesn’t reencode segments. Not all asset writer input configurations benefit from performing multiple passes over the source media. To determine whether the selected encoder can perform multiple passes, query the value of [`canPerformMultiplePasses`](/documentation/AVFoundation/AVAssetWriterInput/canPerformMultiplePasses) after calling [`startWriting()`](/documentation/AVFoundation/AVAssetWriter/startWriting()).

> Important:
> It’s an error to set this property value to <doc://com.apple.documentation/documentation/Swift/true> when the value for ``doc://com.apple.avfoundation/documentation/AVFoundation/AVAssetWriterInput/expectsMediaDataInRealTime`` is <doc://com.apple.documentation/documentation/Swift/true>. It’s also an error for an asset writer to contain inputs with this property set to <doc://com.apple.documentation/documentation/Swift/true> when any of its other inputs have a value of <doc://com.apple.documentation/documentation/Swift/true> for ``doc://com.apple.avfoundation/documentation/AVFoundation/AVAssetWriterInput/expectsMediaDataInRealTime``.

---

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)