OpenMediaLib User and Development Guide

Clip Modifications

If the filter graph is constructed with a single input, the resultant duration of the filter graph is clearly the duration of the input.

However, if you wish to clip a video, you can use the 'clip' filter as follows:

<input> filter:clip in=100 out=200

This of course assumes that the input is seekable, but of course, if an input isn't seekable, it's not much use in a video editing environment :-).

Clip also allows the use of negative offsets – these are treated as relative to the length of the input, thus:

<input> filter:clip in=0 out=-1

is equivalent to the entire length of the input clip, while:

<input> filter:clip in=-25 out=-1

is equivalent to the last 25 frames of the input.

Clips can also be extracted in reverse order:

<input> filter:clip in=-1 out=0

Note that as a courtesy, audio samples are also reversed.

These are provided to allow easier 'blind' use of a clip – the duration doesn't need to be known to split or reverse video in an easy manner.