<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateMLComponents",
  "identifier" : "/documentation/CreateMLComponents/VideoReader/CameraAsyncBuffers/captureSession",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents11VideoReaderV18CameraAsyncBuffersV14captureSessionSo09AVCaptureI0Cvp"
  },
  "title" : "captureSession"
}
-->

# captureSession

The capture session.

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

## Discussion

You can use the capture session to create a preview with
<doc://com.apple.documentation/documentation/AVFoundation/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()
```

---

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)