---
title: captureSession
framework: createmlcomponents
role: symbol
role_heading: Instance Property
path: createmlcomponents/videoreader/cameraasyncbuffers/capturesession
---

# captureSession

The capture session.

## Declaration

```swift
var captureSession: AVCaptureSession { get }
```

## Discussion

Discussion You can use the capture session to create a preview with AVCaptureVideoPreviewLayer and to configure the input device, for example switching the input camera. let sequence = try await VideoReader.readCamera(configuration: configuration) sequence.captureSession.beginConfiguration() sequence.captureSession.removeInput(captureSession.inputs[0]) try sequence.captureSession.addInput(AVCaptureDeviceInput(device: camera)) sequence.captureSession.commitConfiguration()
