Skip to content

Function: getFrameAt() ​

ts
function getFrameAt(url, options?): Promise<FrameResult>;

Extract a single frame from a video as a JPEG or PNG image.

Parameters ​

ParameterTypeDescription
urlstringLocal path of the video.
optionsPartial<FrameExtractionOptions>Timestamp, format and size of the frame.

Returns ​

Promise<FrameResult>

The path of the image, written to the cache directory.

Example ​

ts
const { outputPath } = await getFrameAt(videoUri, { time: 5_000, maxWidth: 640 });

Released under the MIT License.