Class
VideoSampler
NotCreatableNotReplicated
An object for sampling frames from video content.
This object lets you get image frames from selected timestamps of a video. To
create a VideoSampler, call
VideoService:CreateVideoSamplerAsync().
Properties 2#
TimeLengthdouble | The length of the VideoContent in
seconds.ReadSafeReadOnlyNotReplicated |
VideoContentContent | The asset loaded into the VideoSampler.ReadSafeReadOnlyNotReplicated |
TimeLength: double#
ReadOnlyNotReplicatedReadSafe
The length of the VideoContent in
seconds.
VideoContent: Content#
ReadOnlyNotReplicatedReadSafe
The asset loaded into the VideoSampler.
Methods 1#
| GetSamplesAtTimesAsync | Gets image frames at the specified timestamps.Yields |
GetSamplesAtTimesAsync(times: Array): List<VideoSample>#
Yields
This method allows you to get a set of image frames from a video at
specified timestamps as image Content objects.
| 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
List<VideoSample>—An array of dictionary or nil values for each requested timestamp. If a requested timestamp is out of range or the
VideoSamplerwas 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): AContentwith aSourceTypeofContentSourceType.Opaquecontaining the image frame at the corresponding timestamp.