> ## Documentation Index
> Fetch the complete documentation index at: https://autorender.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# GIF

> Convert a video segment into a lightweight GIF animation.

`f_gif` converts a video into a GIF. Combine it with the trim tokens `so_`, `eo_`, and `d_` to control which segment becomes the GIF, and with `w_` to set the output width.

> [!NOTE]
>
> `f_gif` returns a GIF image, not video. Reference the result with an `<img>` tag rather than a `<video>` element.

## How to use it?

Add `f_gif` to the URL. On its own it converts the full video; add trim tokens to capture a segment.

| Token | What it does |
| - | - |
| `f_gif` | Converts the output to GIF |
| `so_` | Optional start offset in seconds, e.g. `so_5` |
| `eo_` | Optional end offset in seconds, e.g. `eo_10` |
| `d_` | Optional duration in seconds, e.g. `d_10` |

> [tab] Full Video to GIF
>
> ```bash theme={null}
> https://assets.autorender.io/LOKVTtKVGb/f_gif,w_400/doc/skateboarding.mp4
> ```
>
> ![Video to GIF conversion](https://assets.autorender.io/LOKVTtKVGb/f_gif,w_400/doc/skateboarding.mp4)

> [tab] Trim by duration (so\_5, d\_10)
>
> ```bash theme={null}
> https://assets.autorender.io/LOKVTtKVGb/f_gif,so_5,d_10,w_400/doc/skateboarding.mp4
> ```
>
> ![Trimmed GIF by duration](https://assets.autorender.io/LOKVTtKVGb/f_gif,so_5,d_10,w_400/doc/skateboarding.mp4)

> [tab] Trim by end offset (so\_5, eo\_10)
>
> ```bash theme={null}
> https://assets.autorender.io/LOKVTtKVGb/f_gif,so_5,eo_10,w_400/doc/skateboarding.mp4
> ```
>
> ![Trimmed GIF by end offset](https://assets.autorender.io/LOKVTtKVGb/f_gif,so_5,eo_10,w_400/doc/skateboarding.mp4)

We recommend trimming with `d_` and setting a width with `w_` (e.g. `f_gif,so_5,d_10,w_400`) because GIF file size grows fast with both length and dimensions. Use GIFs for silent previews in lists and cards where full video controls are not needed.

## Next steps

> [card] [Trim](https://autorender.io/docs/video/trim.md)
>
> Pick the exact segment before converting to GIF.

> [card] [Resize & aspect ratio](https://autorender.io/docs/video/resize.md)
>
> Control GIF dimensions with width, height, and ratio.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.