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

# videoOrientation

An orientation that tells the connection how to rotate a video flowing through it.

```
var videoOrientation: AVCaptureVideoOrientation { get set }
```

## Discussion

The property only applies to a video connection.

If the value of [`isVideoOrientationSupported`](/documentation/AVFoundation/AVCaptureConnection/isVideoOrientationSupported) is <doc://com.apple.documentation/documentation/Swift/true>, you can set `videoOrientation` to rotate the video buffers consumed by the connection’s output. Setting `videoOrientation` doesn’t necessarily result in a physical rotation of video buffers. For example, a video connection to an [`AVCaptureMovieFileOutput`](/documentation/AVFoundation/AVCaptureMovieFileOutput) object handles orientation using a QuickTime track matrix. A video connection to an [`AVCaptureStillImageOutput`](/documentation/AVFoundation/AVCaptureStillImageOutput) object handles orientation using EXIF tags.

[`AVCaptureVideoDataOutput`](/documentation/AVFoundation/AVCaptureVideoDataOutput) clients may receive physically rotated pixel buffers in their [`captureOutput(_:didOutput:from:)`](/documentation/AVFoundation/AVCaptureVideoDataOutputSampleBufferDelegate/captureOutput(_:didOutput:from:)) delegate callback. The `AVCaptureVideoDataOutput` hardware accelerates the rotation operation and supports all four [`AVCaptureVideoOrientation`](/documentation/AVFoundation/AVCaptureVideoOrientation) modes. A client sets `videoOrientation` or [`isVideoMirrored`](/documentation/AVFoundation/AVCaptureConnection/isVideoMirrored) on the video data output’s video [`AVCaptureConnection`](/documentation/AVFoundation/AVCaptureConnection) to request physical buffer rotation.

> Important:
> Physically rotating buffers comes with a performance cost, so only request rotation when necessary. If you want to write rotated video to a movie file using ``doc://com.apple.avfoundation/documentation/AVFoundation/AVAssetWriter``, set the ``doc://com.apple.avfoundation/documentation/AVFoundation/AVAssetWriterInput/transform`` property on the ``doc://com.apple.avfoundation/documentation/AVFoundation/AVAssetWriterInput`` instead.

---

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)