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


class AVCaptureVideoDataOutput : AVCaptureOutput


You can use a video data output to process uncompressed frames from the video being captured or to access compressed frames.

An instance of AVCaptureVideoDataOutput produces video frames you can process using other media APIs. You can access the frames with the captureOutput(_:didOutput:from:) delegate method.


Configuring Video Capture

var videoSettings: [String : Any]!

The compression settings for the output.

Video Settings Dictionaries

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

var alwaysDiscardsLateVideoFrames: Bool

Indicates whether video frames are dropped if they arrive late.

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


Creates a new video file output.


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.