Functions Index :: E :: EditTrimRange

[<< up one level]

Module:

filters :: multiedit

Definition:

EditTrimRange(clip c, string fs, val "fe", int "op", string "extra_info")

Description:

Trims a number of ranges of frames from clip c and returns them as a single clip. Joining of ranges is performed by the EditJoin filter, supporting all of its features.

Selected ranges can have the same or different lengths, depending on the values of fs, fe and (possibly) on custom joining user-code. [1]

Arguments:

c: The clip to extract frame ranges from.

fs: An array of frame numbers indicating the start of the frame ranges to be extracted.

fe (optional): An array or a single value (a scalar) indicating the first frame past the end of ranges to be extracted.

If fe is a scalar value, it is interpreted as the number of frames to extract from each range. Thus, the ith range selected will be [fs(i)..fs(i)+fe).

If fe is not provided it defaults to a scalar value equal to 1. Thus, the ith range selected will be [fs(i)..fs(i)+1), ie only the frames contained in fs will be selected.

If fe is an array, it must have the same length as fs and then each element of fe is interpreted as the first frame past the end of the corresponding range. Thus, the ith range selected will be [fs(i)..fe(i)).

op, extra_info (optional): See the documentation of the EditJoin filter.

Examples:

clp = AviSource(...)

...

# select frames [12..21]+[345..354]+[1024..1033]+[4356..4365]

# use AllignedSplice (++) to join

fs = "12,345,1024,4356"

sel1 = clp.EditTrimRange(fs, 10, EDOP_ALGN)

...

# select just the frames 12+345+1024+4356

# use UnallignedSplice (+) to join

fs = "12,345,1024,4356"

sel2 = clp.EditTrimRange(fs)

...

# select frames [12..339]+[345..811]+[1024..3566]+[4356..6744]

# join parts using Dissolve(p1, p2, 10)

fs = "12,345,1024,4356"

fe = "340,812,3567,6745"

sel3 = clp.EditTrimRange(fs, fe, EDOP_DISS, "10")

 

[<< top]

 


[1]: For selecting single-frame ranges or constant-size ranges without any special join operation, the use of the standard Avisynth filters SelectEvery / SelectRangeEvery may be more appropriate.