---
title: videoOrientation
framework: avfoundation
role: symbol
role_heading: Instance Property
path: avfoundation/avcaptureconnection/videoorientation
---

# videoOrientation

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

## Declaration

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

## Mentioned in

Setting up a capture session

## Discussion

Discussion The property only applies to a video connection. If the value of isVideoOrientationSupported is 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 object handles orientation using a QuickTime track matrix. A video connection to an AVCaptureStillImageOutput object handles orientation using EXIF tags. AVCaptureVideoDataOutput clients may receive physically rotated pixel buffers in their captureOutput(_:didOutput:from:) delegate callback. The AVCaptureVideoDataOutput hardware accelerates the rotation operation and supports all four AVCaptureVideoOrientation modes. A client sets videoOrientation or isVideoMirrored on the video data output’s video 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 AVAssetWriter, set the transform property on the AVAssetWriterInput instead.

## See Also

### Deprecated

- [isVideoStabilizationEnabled](avfoundation/avcaptureconnection/isvideostabilizationenabled.md)
- [enablesVideoStabilizationWhenAvailable](avfoundation/avcaptureconnection/enablesvideostabilizationwhenavailable.md)
- [isVideoOrientationSupported](avfoundation/avcaptureconnection/isvideoorientationsupported.md)
- [AVCaptureVideoOrientation](avfoundation/avcapturevideoorientation.md)
