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

# preservesDynamicHDRMetadata

Indicates whether the receiver should preserve dynamic HDR metadata as an attachment on the output sample buffer’s underlying pixel buffer.

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

## Discussion

Set this property to `true` if you wish to use [`AVCaptureVideoDataOutput`](/documentation/AVFoundation/AVCaptureVideoDataOutput) with [`AVAssetWriter`](/documentation/AVFoundation/AVAssetWriter) to record HDR movies. You must also set `kVTCompressionPropertyKey_PreserveDynamicHDRMetadata` to `true` in the compression settings you pass to your [`AVAssetWriterInput`](/documentation/AVFoundation/AVAssetWriterInput). These compression settings are represented under the [`AVVideoCompressionPropertiesKey`](/documentation/AVFoundation/AVVideoCompressionPropertiesKey) sub-dictionary of your top-level AVVideoSettings (see <doc://com.apple.documentation/documentation/AVFoundation/video-settings>). When you set this key to `true`, performance improves, as the encoder is able to skip HDR metadata calculation for every frame. The default value is `false`.

---

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)