<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCaptureVideoDataOutput",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptureVideoDataOutput"
  },
  "title" : "AVCaptureVideoDataOutput"
}
-->

# AVCaptureVideoDataOutput

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

```
class AVCaptureVideoDataOutput
```

## Overview

Use this output to process compressed or uncompressed frames from the captured video. You can access the frames with the [`captureOutput(_:didOutput:from:)`](/documentation/AVFoundation/AVCaptureVideoDataOutputSampleBufferDelegate/captureOutput(_:didOutput:from:)) delegate method.

This object supports compressed video data output for macOS only. It can output pixel buffers in several pixel formats. Consider the usability and performance characteristics of these formats and choose the best format for your app.

> Important:
> Avoid defaulting to a BGRA format, because BGRA formats aren’t native and require conversion. Additionally, BGRA formats requires significantly more memory than many of the native formats. For more information, see <doc://com.apple.documentation/documentation/Technotes/tn3121-selecting-a-pixel-format-for-an-avcapturevideodataoutput>.

## Topics

### Configuring video capture

[`var videoSettings: [String : Any]!`](/documentation/AVFoundation/AVCaptureVideoDataOutput/videoSettings)

A dictionary that contains the compression settings for the output.

[Video settings](/documentation/AVFoundation/video-settings)

Configure video processing settings using standard key and value constants.

[`var alwaysDiscardsLateVideoFrames: Bool`](/documentation/AVFoundation/AVCaptureVideoDataOutput/alwaysDiscardsLateVideoFrames)

Indicates whether to drop video frames if they arrive late.

[`var automaticallyConfiguresOutputBufferDimensions: Bool`](/documentation/AVFoundation/AVCaptureVideoDataOutput/automaticallyConfiguresOutputBufferDimensions)

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

[`var deliversPreviewSizedOutputBuffers: Bool`](/documentation/AVFoundation/AVCaptureVideoDataOutput/deliversPreviewSizedOutputBuffers)

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

[`@property (nonatomic) CMTime minFrameDuration;`](/documentation/AVFoundation/AVCaptureVideoDataOutput/minFrameDuration)

The minimum frame duration.

[`var preparesCellularRadioForNetworkConnection: Bool`](/documentation/AVFoundation/AVCaptureVideoDataOutput/preparesCellularRadioForNetworkConnection)

Indicates whether the receiver should prepare the cellular radio for imminent network activity.

[`var preservesDynamicHDRMetadata: Bool`](/documentation/AVFoundation/AVCaptureVideoDataOutput/preservesDynamicHDRMetadata)

Indicates whether the receiver should preserve dynamic HDR metadata as an attachment on the output sample buffer’s underlying pixel buffer.

[`var recommendedMediaTimeScaleForAssetWriter: CMTimeScale`](/documentation/AVFoundation/AVCaptureVideoDataOutput/recommendedMediaTimeScaleForAssetWriter)

Indicates the recommended media timescale for the video track.

[`func recommendedMovieMetadata(forVideoCodecType: AVVideoCodecType, assetWriterOutputFileType: AVFileType) -> [AVMetadataItem]?`](/documentation/AVFoundation/AVCaptureVideoDataOutput/recommendedMovieMetadata(forVideoCodecType:assetWriterOutputFileType:))

Recommends movie-level metadata for a particular video codec type and output file type, to be used with an asset writer input.

[`func recommendedVideoSettings(forVideoCodecType: AVVideoCodecType, assetWriterOutputFileType: AVFileType) -> [String : Any]?`](/documentation/AVFoundation/AVCaptureVideoDataOutput/recommendedVideoSettings(forVideoCodecType:assetWriterOutputFileType:))

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

[`func recommendedVideoSettings(forVideoCodecType: AVVideoCodecType, assetWriterOutputFileType: AVFileType, outputFileURL: URL?) -> [String : Any]?`](/documentation/AVFoundation/AVCaptureVideoDataOutput/recommendedVideoSettings(forVideoCodecType:assetWriterOutputFileType:outputFileURL:))

Returns a dictionary of recommended output settings for writing the specified code, file type, and output URL.

[`func recommendedVideoSettingsForAssetWriter(writingTo: AVFileType) -> [String : Any]?`](/documentation/AVFoundation/AVCaptureVideoDataOutput/recommendedVideoSettingsForAssetWriter(writingTo:))

Specifies the recommended settings for use with an AVAssetWriterInput.

### Retrieving supported video types

[`var availableVideoPixelFormatTypes: [OSType]`](/documentation/AVFoundation/AVCaptureVideoDataOutput/availableVideoPixelFormatTypes)

The video pixel formats the output supports.

[`@property (nonatomic, readonly) NSArray<NSNumber *> * availableVideoCVPixelFormatTypes;`](/documentation/AVFoundation/AVCaptureVideoDataOutput/availableVideoCVPixelFormatTypes)

The video pixel formats the output supports.

[`var availableVideoCodecTypes: [AVVideoCodecType]`](/documentation/AVFoundation/AVCaptureVideoDataOutput/availableVideoCodecTypes)

The video codecs that the output supports.

[`func availableVideoCodecTypesForAssetWriter(writingTo: AVFileType) -> [AVVideoCodecType]`](/documentation/AVFoundation/AVCaptureVideoDataOutput/availableVideoCodecTypesForAssetWriter(writingTo:))

The video codecs that the output supports for writing video to the output file.

[`struct AVVideoCodecType`](/documentation/AVFoundation/AVVideoCodecType)

A set of constants that describe the codecs the system supports for video capture.

### Receiving captured video data

[`func setSampleBufferDelegate((any AVCaptureVideoDataOutputSampleBufferDelegate)?, queue: dispatch_queue_t?)`](/documentation/AVFoundation/AVCaptureVideoDataOutput/setSampleBufferDelegate(_:queue:))

Sets the sample buffer delegate and the queue for invoking callbacks.

[`var sampleBufferDelegate: (any AVCaptureVideoDataOutputSampleBufferDelegate)?`](/documentation/AVFoundation/AVCaptureVideoDataOutput/sampleBufferDelegate)

The capture object’s delegate.

[`var sampleBufferCallbackQueue: dispatch_queue_t?`](/documentation/AVFoundation/AVCaptureVideoDataOutput/sampleBufferCallbackQueue)

The queue on which the system invokes delegate callbacks.

[`protocol AVCaptureVideoDataOutputSampleBufferDelegate`](/documentation/AVFoundation/AVCaptureVideoDataOutputSampleBufferDelegate)

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

### Creating video capture output

[`init()`](/documentation/AVFoundation/AVCaptureVideoDataOutput/init())

Creates a new video file output.

[`+ (instancetype) new;`](/documentation/AVFoundation/AVCaptureVideoDataOutput/new)

Creates a new video file output.

## Relationships

### Inherits From

[`AVCaptureOutput`](/documentation/AVFoundation/AVCaptureOutput)

### Conforms To

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

---

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)