Function: toGif()
ts
function toGif(url, options?): Promise<GifResult>;Convert a segment of a video to an animated GIF.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | Local path of the video. |
options | Partial<GifOptions> | Segment, frame rate and width of the GIF. |
Returns
Promise<GifResult>
The path of the GIF, written to the cache directory.
Example
ts
const { outputPath } = await toGif(videoUri, { startTime: 2_000, endTime: 7_000, fps: 15, width: 320 });