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

<Info>
  Trimming runs first in the pipeline, so any later transform processes only the trimmed segment.
</Info>

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

<Tabs>
  <Tab title="Original">
    <div className="flex object-contain justify-center mt-4">
      <video src="https://assets.autorender.io/LOKVTtKVGb/w_400/doc/skateboarding.mp4" controls className="max-w-full" />
    </div>
  </Tab>

  <Tab title="5s to 15s Clip">
    ```bash theme={null}
    https://assets.autorender.io/LOKVTtKVGb/so_5,eo_15,w_400/doc/skateboarding.mp4
    ```

    <div className="flex object-contain justify-center mt-4">
      <video src="https://assets.autorender.io/LOKVTtKVGb/so_5,eo_15,w_400/doc/skateboarding.mp4" controls className="max-w-full" />
    </div>
  </Tab>

  <Tab title="First 5 Seconds">
    ```bash theme={null}
    https://assets.autorender.io/LOKVTtKVGb/so_0,eo_5,w_400/doc/skateboarding.mp4
    ```

    <div className="flex object-contain justify-center mt-4">
      <video src="https://assets.autorender.io/LOKVTtKVGb/so_0,eo_5,w_400/doc/skateboarding.mp4" controls className="max-w-full" />
    </div>
  </Tab>
</Tabs>

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](/docs/video/gif).

## Next steps

<CardGroup cols={2}>
  <Card title="Convert to GIF" icon="film" iconType="solid" href="/docs/video/gif">
    Turn a trimmed segment into a lightweight GIF.
  </Card>

  <Card title="Resize & aspect ratio" icon="crop-simple" iconType="solid" href="/docs/video/resize">
    Set dimensions or a ratio on the trimmed clip.
  </Card>
</CardGroup>
