Getting started

Integration & migration

Image & video API

DAM user guide

API overview

Account

Trim Videos

Learn how to trim videos using ImageKit.io.


You can trim a video using using so, eo and du options to specify start offset, end offset or duration.

You can also provide an arithmetic expressions like idu_div_2, bdu_mul_0.2, or bdu as a value for these parameter. Doing so will first calculate the value of the expression and then apply transformations using that value. Learn more about arithmetic expressions here.

Start offset - (so)

Specify start offset in seconds. The video before the start offset is removed from the output.

Usage - so-<value>

Possible values - Specify the time in seconds as a positive number up to 2 decimal places, e.g., 20 or 10.55, or an arithmetic expression like idu_div_2. It must be less than the duration of the input video.

End offset - (eo)

Specify end offset in seconds. The video after the end offset is removed from the output.

Usage - eo-<value>

Possible values - Specify the time in seconds as a positive number up to 2 decimal places, e.g., 20 or 10.55, or an arithmetic expression like idu_div_2. It must be less than the duration of the input video.

Duration - (du)

Specify duration in seconds. It is often used with so to control the duration of the video to keep in output starting after so seconds.

Usage - du-<value>

Possible values - Specify the time in seconds as a positive number up to 2 decimal places, e.g., 20 or 10.55, or an arithmetic expression like idu_div_2. It must be less than or equal to the duration of the input video.