Skip to main content

clipwright-trim

MCP tool for explicit keep/drop range selection and OTIO timeline generation. Accepts user-defined time ranges in seconds and produces a kept-range OTIO timeline that clipwright-render can use for precise, non-destructive video editing.

Overview

  • Input: Media file (video or audio), output OTIO path, optional keep/drop range specification
  • Process: Validates ranges against media duration (via ffprobe), applies padding, builds a kept-range OTIO timeline using the same structure as clipwright-silence output
  • Output: New OTIO file with KEEP intervals; input media is never modified (non-destructive, readOnly)

MCP Tool

clipwright_trim

Parameters

Name Type Default Description
media string required Input media file path (video or audio)
output string required Output OTIO timeline file path (.otio extension)
options object null TrimOptions (see below)

TrimOptions

Field Type Default Description
keep array[TrimRange] [] Ranges to retain, in enumeration order. Mutually exclusive with drop.
drop array[TrimRange] [] Ranges to remove; complement becomes the kept region. Mutually exclusive with keep.
padding_sec float 0.0 Non-negative padding (seconds) applied to each range boundary. In keep mode, expands outward; in drop mode, shrinks inward.

TrimRange

Field Type Constraints Description
start_sec float >= 0 Range start time in seconds from media start
end_sec float > start_sec Range end time in seconds from media start

Return Value

{
  "ok": true,
  "summary": "Kept 2 clip(s) totalling 45.0 s out of 120.0 s source duration (mode: keep).",
  "data": {
    "clip_count": 2,
    "kept_duration_sec": 45.0,
    "source_duration_sec": 120.0,
    "mode": "keep"
  },
  "artifacts": [
    {"role": "timeline", "path": "/path/to/output.otio", "format": "otio"}
  ],
  "warnings": []
}

Requirements

  • Python 3.11+
  • ffprobe (path resolved via CLIPWRIGHT_FFPROBE environment variable or PATH)
  • ffmpeg is not required (this tool produces OTIO only; rendering is clipwright-render's responsibility)

Usage with MCP

Register in your MCP client configuration:

{
  "mcpServers": {
    "clipwright-trim": {
      "command": "clipwright-trim",
      "env": {
        "CLIPWRIGHT_FFPROBE": "/path/to/ffprobe"
      }
    }
  }
}

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clipwright_trim-0.2.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clipwright_trim-0.2.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file clipwright_trim-0.2.0.tar.gz.

File metadata

  • Download URL: clipwright_trim-0.2.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for clipwright_trim-0.2.0.tar.gz
Algorithm Hash digest
SHA256 758f2dc33849132cdd368bf96f96a2483279b31b9a376cfb1d19f984f5dfca9d
MD5 3126a6f22311f2522557e1cb29ff3ec7
BLAKE2b-256 c702e6c485e8b85a4a3fb7aa53c09fce3a5286e4b4c6db1e05b64fc693a0535e

See more details on using hashes here.

Provenance

The following attestation bundles were made for clipwright_trim-0.2.0.tar.gz:

Publisher: publish.yml on satoh-y-0323/clipwright

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clipwright_trim-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: clipwright_trim-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for clipwright_trim-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 30cd774537b0e1d94454247624666009af0c4b0e357f97413e53b71488e16b88
MD5 1c4e94710fae19c90c96c290a9bfbbc1
BLAKE2b-256 a37cadd6e3b92b2f80f7bd7e75be76ebc3b6e69e73d375c9d7368a61a5effcac

See more details on using hashes here.

Provenance

The following attestation bundles were made for clipwright_trim-0.2.0-py3-none-any.whl:

Publisher: publish.yml on satoh-y-0323/clipwright

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page