2 min read

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

NameType / ReturnsDescription
VideoSampler.TimeLengthdoubleThe length of the VideoContent in seconds.
VideoSampler.VideoContentContentThe asset loaded into the VideoSampler.

Inherited from Object

NameType / ReturnsDescription
Object.ClassNamestringA read-only string representing the class this Object belongs to.
Object.classNamestring

VideoSampler.TimeLength

The length of the VideoContent in seconds.

FieldValue
typedouble
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":true}
capabilities["UI"]

VideoSampler.VideoContent

The asset loaded into the VideoSampler.

FieldValue
typeContent
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":true}
capabilities["UI"]

Methods

NameType / ReturnsDescription
VideoSampler:GetSamplesAtTimesAsyncListGets image frames at the specified timestamps.

Inherited from Object

NameType / ReturnsDescription
Object:GetPropertyChangedSignalRBXScriptSignalGet an event that fires when a given property of the object changes.
Object:IsAbooleanReturns true if an object's class matches or inherits from a given class.
Object:isAboolean

VideoSampler:GetSamplesAtTimesAsync

This method allows you to get a set of image frames from a video at specified timestamps as image Content objects.

Parameters

NameTypeDefaultDescription
timesArrayAn array of requested timestamps in seconds for which to retrieve image frames. Each timestamp should be a number between 0 and TimeLength.

Returns

TypeDescription
ListAn 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.
FieldValue
tags["Yields"]
securityNone
thread safetyUnsafe
capabilities["UI"]

Events

Inherited from Object

NameType / ReturnsDescription
Object.ChangedFires immediately after a property of the object changes, with some limitations.