Cameras and Media Capture

Capture photos and record video and audio; configure built-in cameras and microphones or external capture devices.

Overview

The AV Foundation Camera and Media Capture subsystem provides a common high-level architecture for video, photo, and audio capture services in iOS and macOS.

To use the capture system, configure a capture session to connect one or more inputs to one or more outputs. Inputs are sources of media, including capture devices like the cameras and microphones built into an iOS device or Mac. Outputs acquire media from inputs to produce useful data, such as movie files written to disk or raw pixel buffers available for live processing.

Topics

First Steps

class AVCaptureDevice

A device that provides input (such as audio or video) for capture sessions and offers controls for hardware-specific capture features.

class AVCaptureSession

An object that manages capture activity and coordinates the flow of data from input devices to capture outputs.

Photo Capture

class AVCapturePhotoOutput

A capture output for still image, Live Photo, and other photography workflows.

class AVCapturePhoto

A container for image data collected by a photo capture output.

Beta

Video Capture

class AVCaptureMovieFileOutput

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

class AVCaptureVideoDataOutput

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

Audio Capture

class AVCaptureAudioFileOutput

A capture output that records audio and saves the recorded audio to a file.

class AVCaptureAudioDataOutput

A capture output that records audio and provides access to audio sample buffers as they are recorded.

Metadata Capture

class AVCaptureMetadataInput

A capture input for providing timed metadata to a capture session.

class AVCaptureMetadataOutput

A capture output for processing timed metadata produced by a capture session.

class AVMetadataFaceObject

Face information detected by a metadata capture output.

class AVMetadataMachineReadableCodeObject

Barcode information detected by a metadata capture output.

class AVMetadataObject

The abstract superclass for objects provided by a metadata capture output.

Depth Data Capture

class AVCaptureDepthDataOutput

A capture output that records scene depth information on compatible camera devices.

Beta
class AVDepthData

A container for per-pixel distance or disparity information captured by compatible camera devices.

Beta

Synchronized Capture

class AVCaptureDataOutputSynchronizer

An object that coordinates time-matched delivery of data from multiple capture outputs.

Beta
class AVCaptureSynchronizedDataCollection

A set of data samples from multiple capture outputs collected at the same time.

Beta
class AVCaptureSynchronizedDepthData

A container for scene depth information collected using synchronized capture.

Beta
class AVCaptureSynchronizedMetadataObjectData

A container for metadata objects collected using synchronized capture.

Beta
class AVCaptureSynchronizedSampleBufferData

A container for video or audio samples collected using synchronized capture.

Beta
class AVCaptureSynchronizedData

The abstract superclass for media samples collected using synchronized capture.

Beta

Media Capture Preview

class AVCaptureVideoPreviewLayer

A Core Animation layer that can display video as it is being captured.

class AVCaptureAudioPreviewOutput

A capture output that provides preview playback for audio being recorded in a capture session.

Mac Capture Options

class AVCaptureScreenInput

A capture input for recording from a screen in macOS.

class AVCaptureStillImageOutput

A capture output for capturing still photos in macOS.

Session Configuration

class AVCaptureInput

The abstract superclass for objects that provide input data to a capture session.

class AVCaptureOutput

The abstract superclass for objects that output the media recorded in a capture session.

class AVCaptureConnection

A connection between a specific pair of capture input and capture output objects in a capture session.

class AVCaptureDeviceInput

A capture input that provides media from a capture device to a capture session.

class AVCaptureAudioChannel

An object that monitors average and peak power levels for an audio channel in a capture connection.

File Output

class AVCaptureFileOutput

The abstract superclass for capture outputs that can record captured data to a file.

protocol AVCaptureFileOutputDelegate

Methods for monitoring or controlling the output of a media file capture.

protocol AVCaptureFileOutputRecordingDelegate

Methods for responding to events that occur while recording captured media to a file.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software