<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCaptureDevice/RotationCoordinator/videoRotationAngleForHorizonLevelCapture",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptureDeviceRotationCoordinator(py)videoRotationAngleForHorizonLevelCapture"
  },
  "title" : "videoRotationAngleForHorizonLevelCapture"
}
-->

# videoRotationAngleForHorizonLevelCapture

An angle the coordinator provides your app to apply to photos or videos it captures with the device so that they’re level relative to gravity.

```
var videoRotationAngleForHorizonLevelCapture: CGFloat { get }
```

## Discussion

Your app can get immediate rotation angle updates from the rotation coordinator with key-value observation (KVO) of this property. The system calls key-value observation code on the main queue so that it has the same behavior as the [`videoRotationAngleForHorizonLevelPreview`](/documentation/AVFoundation/AVCaptureDevice/RotationCoordinator/videoRotationAngleForHorizonLevelPreview) property.

Apps typically apply the property’s value to an [`AVCaptureConnection`](/documentation/AVFoundation/AVCaptureConnection) instance’s [`videoRotationAngle`](/documentation/AVFoundation/AVCaptureConnection/videoRotationAngle) property, such as saving photos and videos with the correction rotation with [`AVCapturePhotoOutput`](/documentation/AVFoundation/AVCapturePhotoOutput) and [`AVCaptureMovieFileOutput`](/documentation/AVFoundation/AVCaptureMovieFileOutput), respectively.

Alternatively, if your app uses an [`AVCaptureVideoDataOutput`](/documentation/AVFoundation/AVCaptureVideoDataOutput) instance with an [`AVAssetWriter`](/documentation/AVFoundation/AVAssetWriter), such as for recording custom videos with effects, don’t rotate the video with [`AVCaptureConnection`](/documentation/AVFoundation/AVCaptureConnection). Instead, set the rotation with an [`AVAssetWriterInput`](/documentation/AVFoundation/AVAssetWriterInput) instance’s [`transform`](/documentation/AVFoundation/AVAssetWriterInput/transform) property, which alters the output file’s metadata. With this approach, video-playing apps apply the rotation during playback, which uses less energy than rotating each frame with the capture connection.

> Note:
> Your app needs to convert the ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureDevice/RotationCoordinator/videoRotationAngleForHorizonLevelCapture`` value from degrees to radians for an asset writer input’s transform, which is a <doc://com.apple.documentation/documentation/CoreGraphics/cgaffinetransform>.

---

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)