Function: getFrameAt()
ts
function getFrameAt(url, options?): Promise<FrameResult>;Extract a single frame from a video as a JPEG or PNG image.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | Local path of the video. |
options | Partial<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 });