
Use LosslessCut's segment-selection expression when you need existing cuts that satisfy more than one condition, such as a specific label and a maximum duration. An expression selects entries; it does not decide whether their content is editorially useful. Inspect the selected set before exporting it.
Key Takeaways
- Expressions can combine segment properties in one selection rule.
- Existing selections need deliberate handling.
- A matching label is metadata, not proof of the clip's contents.
Define the selection rule in plain language
Write the intended set before entering code. For a hypothetical film review, the request might be “all entries labeled Interview that are shorter than the agreed review limit.”
Check that the labels are consistently assigned. A selection rule cannot recognize a mislabeled interview from its picture or sound. Keep the original project so any metadata cleanup remains reversible.
Decide whether markers belong in the result. An entry without a meaningful interval may not serve the same delivery as a timed segment.
Use the documented expression context
The LosslessCut expressions guide describes a per-segment variable and boolean selection expressions. Its recipe cookbook demonstrates combining a label test with a duration test.
A proposed expression, with a hypothetical limit of five seconds, is:
segment.label === 'Interview' && segment.duration < 5
Replace the label and threshold with the actual requirement. The number here is an example, not a recommended maximum film-shot length.
Review the selected and excluded entries
Clear or otherwise account for the existing selection before building the intended set. The cookbook notes that selection operations can add to a current selection.
After applying the rule, inspect the count and several entries on both sides of the threshold. Check labels with punctuation or different capitalization rather than assuming they compare identically.
Do not export immediately because the application accepted the expression. A valid boolean rule can describe the wrong set.
Export according to the delivery shape
Choose whether the selected cuts should become separate files or a merged result. Those are different outputs, even when the same entries are selected.
Retain enough naming and source-time information for the recipient to identify the exported material. Check the actual cut boundaries; keyframe limitations still apply independently of selection logic.
For a structured planning list, the chapter and marker distinction is useful background, but the expression here acts on LosslessCut's existing segment objects.
Accept the selection when both its membership and its export form match the stated request.
Related tasks
- Why Does a Lossless Video Trim Start Before My Chosen Frame?
- HandBrake Chapters: Preserve, Rename, or Create New Markers?
Sources and scope
- LosslessCut expressions: segment selection expression label duration
Based on the official LosslessCut project documentation, retrieved October 23, 2026. Master-branch instructions can change; the workflows and clearly marked expression examples are documentation-based and were not executed in the application.
Prepared by Imagild Editorial, the company editorial team responsible for these guides. AI assisted research and drafting. This is documentation-based guidance with proposed examples, not a claim of hands-on testing or an independent product review. Report a correction.
Cover: William Liu / Pexels, Pexels License. This is an illustrative source photograph, not an application screenshot or a generated test result.