---
title: preservesDynamicHDRMetadata
framework: avfoundation
role: symbol
role_heading: Instance Property
path: avfoundation/avcapturevideodataoutput/preservesdynamichdrmetadata
---

# preservesDynamicHDRMetadata

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

## Declaration

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

## Discussion

Discussion Set this property to true if you wish to use AVCaptureVideoDataOutput with AVAssetWriter to record HDR movies. You must also set kVTCompressionPropertyKey_PreserveDynamicHDRMetadata to true in the compression settings you pass to your AVAssetWriterInput. These compression settings are represented under the AVVideoCompressionPropertiesKey sub-dictionary of your top-level AVVideoSettings (see 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.

## See Also

### Configuring video capture

- [videoSettings](avfoundation/avcapturevideodataoutput/videosettings.md)
- [Video settings](avfoundation/video-settings.md)
- [alwaysDiscardsLateVideoFrames](avfoundation/avcapturevideodataoutput/alwaysdiscardslatevideoframes.md)
- [automaticallyConfiguresOutputBufferDimensions](avfoundation/avcapturevideodataoutput/automaticallyconfiguresoutputbufferdimensions.md)
- [deliversPreviewSizedOutputBuffers](avfoundation/avcapturevideodataoutput/deliverspreviewsizedoutputbuffers.md)
- [preparesCellularRadioForNetworkConnection](avfoundation/avcapturevideodataoutput/preparescellularradiofornetworkconnection.md)
- [recommendedMediaTimeScaleForAssetWriter](avfoundation/avcapturevideodataoutput/recommendedmediatimescaleforassetwriter.md)
- [recommendedMovieMetadata(forVideoCodecType:assetWriterOutputFileType:)](avfoundation/avcapturevideodataoutput/recommendedmoviemetadata(forvideocodectype:assetwriteroutputfiletype:).md)
- [recommendedVideoSettings(forVideoCodecType:assetWriterOutputFileType:)](avfoundation/avcapturevideodataoutput/recommendedvideosettings(forvideocodectype:assetwriteroutputfiletype:).md)
- [recommendedVideoSettings(forVideoCodecType:assetWriterOutputFileType:outputFileURL:)](avfoundation/avcapturevideodataoutput/recommendedvideosettings(forvideocodectype:assetwriteroutputfiletype:outputfileurl:).md)
- [recommendedVideoSettingsForAssetWriter(writingTo:)](avfoundation/avcapturevideodataoutput/recommendedvideosettingsforassetwriter(writingto:).md)
