<!--
{
  "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/AVCaptureConnection/videoRotationAngle",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptureConnection(py)videoRotationAngle"
  },
  "title" : "videoRotationAngle"
}
-->

# videoRotationAngle

A rotation angle the connection applies to a video flowing through it.

```
var videoRotationAngle: CGFloat { get set }
```

## Discussion

Your app can set a video rotation angle that it gets from an [`AVCaptureDevice.RotationCoordinator`](/documentation/AVFoundation/AVCaptureDevice/RotationCoordinator) instance’s [`videoRotationAngleForHorizonLevelCapture`](/documentation/AVFoundation/AVCaptureDevice/RotationCoordinator/videoRotationAngleForHorizonLevelCapture) or [`videoRotationAngleForHorizonLevelPreview`](/documentation/AVFoundation/AVCaptureDevice/RotationCoordinator/videoRotationAngleForHorizonLevelPreview) property. The rotation angle only applies to video or depth connections, similar to [`isVideoMirrored`](/documentation/AVFoundation/AVCaptureConnection/isVideoMirrored), and can be any angle that [`isVideoRotationAngleSupported(_:)`](/documentation/AVFoundation/AVCaptureConnection/isVideoRotationAngleSupported(_:)) returns <doc://com.apple.documentation/documentation/Swift/true> for.

Not all capture connections rotate each frame. For example, a video connection to an [`AVCaptureMovieFileOutput`](/documentation/AVFoundation/AVCaptureMovieFileOutput) or [`AVCapturePhotoOutput`](/documentation/AVFoundation/AVCapturePhotoOutput) instance applies a rotation with a QuickTime track matrix or with EXIF tags, respectively.

Capture connections to [`AVCaptureVideoDataOutput`](/documentation/AVFoundation/AVCaptureVideoDataOutput) and [`AVCaptureDepthDataOutput`](/documentation/AVFoundation/AVCaptureDepthDataOutput) instances rotate video frames they provide to their [`captureOutput(_:didOutput:from:)`](/documentation/AVFoundation/AVCaptureVideoDataOutputSampleBufferDelegate/captureOutput(_:didOutput:from:)) and [`depthDataOutput(_:didOutput:timestamp:connection:)`](/documentation/AVFoundation/AVCaptureDepthDataOutputDelegate/depthDataOutput(_:didOutput:timestamp:connection:)) delegate methods, respectively. Each [`AVCaptureVideoDataOutput`](/documentation/AVFoundation/AVCaptureVideoDataOutput) instance uses hardware acceleration to rotate every frame.

> Tip:
> Avoid potential performance issues by only rotating video with a capture connection when necessary.

You can rotate the video of a movie file you record with an [`AVAssetWriter`](/documentation/AVFoundation/AVAssetWriter) instance by applying the rotation to an [`AVAssetWriterInput`](/documentation/AVFoundation/AVAssetWriterInput) instance’s [`transform`](/documentation/AVFoundation/AVAssetWriterInput/transform) property. This approach avoids the performance costs that come with rotating each video frame.

> Note:
> Your app needs to convert the ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureDevice/RotationCoordinator/videoRotationAngleForHorizonLevelCapture`` or ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureDevice/RotationCoordinator/videoRotationAngleForHorizonLevelPreview`` value from degrees to radians for transform properties.

---

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)