> ## 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.

# Trim

> Clip a video segment by start and end offset, or by start and duration.

Trim a video to a shorter clip by setting the start offset (`so_`) and either an end offset (`eo_`) or a duration (`d_`). Offsets are accurate to the second.

> [!NOTE]
>
> Trimming runs first in the pipeline, so any later transform processes only the trimmed segment.

## How to trim a clip?

Set the start offset to **5 s** (`so_5`), then define the end with either `eo_` (an absolute point on the timeline) or `d_` (a length from the start).

| Token | Name | Example | What it does |
| - | - | - | - |
| `so_` | Start offset | `so_5` | Start the clip at **5 s** |
| `eo_` | End offset | `eo_15` | End the clip at **15 s** on the timeline |
| `d_` | Duration | `d_10` | Keep **10 s** from the start offset |

`eo_` and `d_` are two ways to define the same clip end: `so_5,eo_15` and `so_5,d_10` both produce the segment from **5 s** to **15 s**.

> [tab] Original
>
> <video src="https://assets.autorender.io/LOKVTtKVGb/w_400/doc/skateboarding.mp4" controls />

> [tab] 5s to 15s Clip
>
> ```bash theme={null}
> https://assets.autorender.io/LOKVTtKVGb/so_5,eo_15,w_400/doc/skateboarding.mp4
> ```
>
> <video src="https://assets.autorender.io/LOKVTtKVGb/so_5,eo_15,w_400/doc/skateboarding.mp4" controls />

> [tab] First 5 Seconds
>
> ```bash theme={null}
> https://assets.autorender.io/LOKVTtKVGb/so_0,eo_5,w_400/doc/skateboarding.mp4
> ```
>
> <video src="https://assets.autorender.io/LOKVTtKVGb/so_0,eo_5,w_400/doc/skateboarding.mp4" controls />

We recommend trimming before converting to GIF (e.g. `so_5,d_10,f_gif`) because a shorter segment keeps the GIF file size down. See [Convert to GIF](https://autorender.io/docs/video/gif.md).

## Next steps

> [card] [Convert to GIF](https://autorender.io/docs/video/gif.md)
>
> Turn a trimmed segment into a lightweight GIF.

> [card] [Resize & aspect ratio](https://autorender.io/docs/video/resize.md)
>
> Set dimensions or a ratio on the trimmed clip.


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