Instance Property

videoOrientation

Indicates whether to rotate the video flowing through the connection to a given orientation.

Declaration

var videoOrientation: AVCaptureVideoOrientation { get set }

Discussion

This property is only applicable to connections involving video.

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.

See Also

Managing Video Configuration

var isVideoOrientationSupported: Bool

A Boolean value that indicates whether the connection supports changing the orientation of the video.

enum AVCaptureVideoOrientation

Constants indicating video orientation.

var videoFieldMode: AVVideoFieldMode

An indicator of how interlaced video flowing through the connection should be treated

var isVideoFieldModeSupported: Bool

A Boolean value that indicates whether the connection supports setting the videoFieldMode property.

var videoMinFrameDuration: CMTime

The minimum time interval between which the receiver should output consecutive video frames.

var isVideoMinFrameDurationSupported: Bool

A Boolean value that indicates whether the connection supports setting the videoMinFrameDuration property.

var videoMaxFrameDuration: CMTime

The maximum time interval between which the receiver should output consecutive video frames.

var isVideoMaxFrameDurationSupported: Bool

A Boolean value that indicates whether the connection supports setting the videoMaxFrameDuration property.

var videoScaleAndCropFactor: CGFloat

The current video scale and crop factor in use by the receiver.

var videoMaxScaleAndCropFactor: CGFloat

The maximum video scale and crop factor by the connection.