Class

AVCaptureVideoDataOutput

A capture output that records video and provides access to video frames for processing.

Declaration

class AVCaptureVideoDataOutput : AVCaptureOutput

Overview

You use this output to process compressed or uncompressed frames from the captured video. You can access the frames with the captureOutput(_:didOutput:from:) delegate method.

Topics

Configuring Video Capture

var videoSettings: [String : Any]!

The compression settings for the output.

Video Settings Dictionaries

Define output image and video formats by using the key and value constants.

var alwaysDiscardsLateVideoFrames: Bool

Indicates whether to drop video frames if they arrive late.

var automaticallyConfiguresOutputBufferDimensions: Bool

A Boolean value that indicates whether the output automatically configures the size of output buffers.

var deliversPreviewSizedOutputBuffers: Bool

A Boolean value that indicates whether the output is configured to deliver preview-sized buffers.

func recommendedVideoSettings(forVideoCodecType: AVVideoCodecType, assetWriterOutputFileType: AVFileType) -> [AnyHashable : Any]?

Returns a video settings dictionary appropriate for capturing video to be recorded to a file with the specified codec and type.

func recommendedVideoSettingsForAssetWriter(writingTo: AVFileType) -> [String : Any]?

Specifies the recommended settings for use with an AVAssetWriterInput.

Retrieving Supported Video Types

var availableVideoCodecTypes: [AVVideoCodecType]

Indicates the supported video codec formats that can be specified in videoSettings.

struct AVVideoCodecType

A set of constants used to describe codecs for video capture.

Receiving Captured Video Data

func setSampleBufferDelegate(AVCaptureVideoDataOutputSampleBufferDelegate?, queue: DispatchQueue?)

Sets the sample buffer delegate and the queue on which callbacks should be invoked.

var sampleBufferCallbackQueue: DispatchQueue?

The queue on which delegate callbacks should be invoked

protocol AVCaptureVideoDataOutputSampleBufferDelegate

Methods for receiving sample buffers from and monitoring the status of a video data output.

Creating Video Capture Output

init()

Creates a new video file output.

Relationships

Inherits From

Conforms To

See Also

Movie and Video Capture

Capturing Video in Alternative Formats

Change the format used for capturing movie files.

class AVCaptureMovieFileOutput

A capture output that records video and audio to a QuickTime movie file.