docs/expressions.md
LosslessCut has support for JavaScript expressions in certain dialogs. This is a base JavaScript environment with core JavaScript functionality available for you to use.
You will be given a global variable called segment (type Segment) and you can create an expression that returns true or false based on custom logic. For example to select all segments with a duration of less than 5 seconds use this expression:
segment.duration < 5
LosslessCut has support for normal JavaScript expressions. You will be given a variable segment (type Segment) for each selected segment and can return a new segment with modified properties.
See more examples in-app.
You can also use JavaScript expressions when referring to variables inside ${} in output file name templates, e.g. ${FILENAME.toLowerCase()}.
See also Export file name template.
For available variables, open the Tracks dialog, then for the respective track, open Track info and you will see all available variables which you can use in your filter.