<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateMLComponents",
  "identifier" : "/documentation/CreateMLComponents/VideoReader",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents11VideoReaderV"
  },
  "title" : "VideoReader"
}
-->

# VideoReader

A video file reader.

```
struct VideoReader
```

## Topics

### Creating the reader

[`init()`](/documentation/CreateMLComponents/VideoReader/init())

Creates a video reader.

### Reading

[`static read(_:)`](/documentation/CreateMLComponents/VideoReader/read(_:))

Reads a sequence of annotated files as an array of annotated async sequences of video frames.

[`static func readCamera(configuration: VideoReader.CameraConfiguration) async throws -> VideoReader.CameraAsyncBuffers`](/documentation/CreateMLComponents/VideoReader/readCamera(configuration:))

Reads an async sequence of video frames captured with a video camera.

[`static func read(contentsOf: URL) async throws -> VideoReader.AsyncFrames`](/documentation/CreateMLComponents/VideoReader/read(contentsOf:))

Reads a video file as an async sequence of video frames.

[`struct AsyncFrames`](/documentation/CreateMLComponents/VideoReader/AsyncFrames)

An async sequence of video frames.

[`struct CameraAsyncBuffers`](/documentation/CreateMLComponents/VideoReader/CameraAsyncBuffers)

An async sequence of video frames.

[`struct CameraConfiguration`](/documentation/CreateMLComponents/VideoReader/CameraConfiguration)

The configuration of the camera to pass to the `readCamera` method.

### Applying

[`func applied(to: URL, eventHandler: EventHandler?) async throws -> VideoReader.AsyncFrames`](/documentation/CreateMLComponents/VideoReader/applied(to:eventHandler:))

Reads a video file as an async sequence of video frames.

## Relationships

### Conforms To

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

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

[`Transformer`](/documentation/CreateMLComponents/Transformer)

---

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)