# VideoSampler

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Object](https://rapi.sleaze.dev/classes/Object.md)
- Tags: Not creatable, Not replicated
- Memory category: Instances
- HTML page: https://rapi.sleaze.dev/classes/VideoSampler/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/VideoSampler

An object for sampling frames from video content.

## Properties

### TimeLength

```luau
VideoSampler.TimeLength: number
```

- Tags: Read only, Capabilities: UI, Save only

The length of the [`VideoContent`](https://rapi.sleaze.dev/classes/VideoSampler.md) in seconds.

### VideoContent

```luau
VideoSampler.VideoContent: Content
```

- Tags: Read only, Capabilities: UI, Save only

The asset loaded into the [`VideoSampler`](https://rapi.sleaze.dev/classes/VideoSampler.md).

## Methods

### GetSamplesAtTimesAsync

```luau
VideoSampler:GetSamplesAtTimesAsync(times: { any }): { any }
```

- Tags: Yields, Capabilities: UI

Gets image frames at the specified timestamps.

Parameters:

- `times`: An array of requested timestamps in seconds for which to retrieve image frames. Each timestamp should be a number between `0` and [`TimeLength`](https://rapi.sleaze.dev/classes/VideoSampler.md).

Returns: An array of dictionary or nil values for each requested timestamp. If a requested timestamp is out of range or the [`VideoSampler`](https://rapi.sleaze.dev/classes/VideoSampler.md) was unable to produce a sample, the corresponding entry in the returned array will be nil. Each dictionary contains the following keys:

- `Time` (number): The timestamp of the returned image frame in seconds. This value may differ slightly from the requested timestamp.
- `Image` ([`Content`](https://rapi.sleaze.dev/index/types/Content.md)): A [`Content`](https://rapi.sleaze.dev/index/types/Content.md) with a `SourceType` of `ContentSourceType.Opaque` containing the image frame at the corresponding timestamp.

## Inherited members

- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
