Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
VideoSampler
Inherits from: Object
This object lets you get image frames from selected timestamps of a video. To create a VideoSampler, call VideoService:CreateVideoSamplerAsync().
Inherits from: Object
Memory category: Instances
Tags: NotCreatable, NotReplicated
Properties
| Name | Type / Returns | Description |
|---|---|---|
| VideoSampler.TimeLength | double | The length of the VideoContent in seconds. |
| VideoSampler.VideoContent | Content | The asset loaded into the VideoSampler. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.ClassName | string | A read-only string representing the class this Object belongs to. |
| Object.className | string |
VideoSampler.TimeLength
The length of the VideoContent in seconds.
| Field | Value |
|---|---|
| type | double |
| tags | ["ReadOnly","NotReplicated"] |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Data |
| serialization | {"can_load":false,"can_save":true} |
| capabilities | ["UI"] |
VideoSampler.VideoContent
The asset loaded into the VideoSampler.
| Field | Value |
|---|---|
| type | Content |
| tags | ["ReadOnly","NotReplicated"] |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Data |
| serialization | {"can_load":false,"can_save":true} |
| capabilities | ["UI"] |
Methods
| Name | Type / Returns | Description |
|---|---|---|
| VideoSampler:GetSamplesAtTimesAsync | List | Gets image frames at the specified timestamps. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object:GetPropertyChangedSignal | RBXScriptSignal | Get an event that fires when a given property of the object changes. |
| Object:IsA | boolean | Returns true if an object's class matches or inherits from a given class. |
| Object:isA | boolean |
VideoSampler:GetSamplesAtTimesAsync
This method allows you to get a set of image frames from a video at specified timestamps as image Content objects.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| times | Array | An array of requested timestamps in seconds for which to retrieve image frames. Each timestamp should be a number between 0 and TimeLength. |
Returns
| Type | Description |
|---|---|
| List | An array of dictionary or nil values for each requested timestamp. If a requested timestamp is out of range or the VideoSampler 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): A Content with a SourceType of ContentSourceType.Opaque containing the image frame at the corresponding timestamp. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["UI"] |
Events
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.Changed | Fires immediately after a property of the object changes, with some limitations. |