Skip to main content

MCP tool for shot boundary (scene) detection and OTIO marker generation.

Project description

clipwright-scene

MCP tool for shot boundary detection.

Detects scene cuts in video files using FFmpeg's scdet filter (built-in, no extra install) or PySceneDetect (optional, more accurate). Boundaries are written as zero-duration OTIO markers on the V1 track of an output timeline.

MCP Tool

clipwright_detect_scenes

Parameter Type Required Description
media string yes Input video file path.
output string yes Output OTIO timeline file path (must end in .otio).
options DetectScenesOptions no Detection options (see Options section).
timeline string no Existing OTIO timeline path to augment. When provided, markers are appended to the V1 track instead of creating a new timeline.

Return value: Standard ToolResult envelope — { ok, summary, data, artifacts, warnings }.

  • data.scene_count: Number of scene boundaries detected.
  • data.backend: Backend used ("ffmpeg" or "pyscenedetect").
  • data.total_duration_sec: Total duration of the media in seconds.
  • artifacts[0]: The output .otio file path (role: "timeline", format: "otio").

Options

DetectScenesOptions fields:

Field Type Default Description
threshold float (0.0–1.0) 0.3 Scene change sensitivity. Lower = more sensitive. AI agents should use ~0.5 for major cuts only, ~0.1 for subtle transitions.
min_scene_duration float (≥ 0.0) 1.0 Minimum seconds between boundaries. Closer boundaries are merged (highest confidence kept). Set 0.0 to disable merging.
backend "ffmpeg" | "pyscenedetect" "ffmpeg" Detection backend. "ffmpeg" uses the built-in scdet filter. "pyscenedetect" uses the scenedetect CLI (requires install).

Prerequisites

FFmpeg (required)

FFmpeg must be available on PATH or specified via the CLIPWRIGHT_FFMPEG environment variable:

export CLIPWRIGHT_FFMPEG=/path/to/ffmpeg

On Windows with winget:

winget install Gyan.FFmpeg

PySceneDetect (optional)

Required only when options.backend = "pyscenedetect". Install via pip:

pip install scenedetect

Or install the optional extra:

pip install "clipwright-scene[pyscenedetect]"

Note: PySceneDetect performs a full video decode and is significantly slower than the FFmpeg backend. It may produce more accurate results for content-based detection.

Output

The output is an OTIO timeline file containing zero-duration Marker objects on the V1 track. Each marker represents a detected shot boundary (an instantaneous point event, not an interval).

Marker metadata

Each marker's metadata["clipwright"] contains:

Key Type Description
kind string Always "scene_boundary".
scene_index int 0-based sequential index.
confidence float 0.0–1.0. FFmpeg: normalized scdet score. PySceneDetect: always 1.0.
backend string Backend that produced this boundary ("ffmpeg" or "pyscenedetect").
tool string Always "clipwright-scene".
version string Package version.

Augment mode

Provide an existing .otio file via the timeline parameter to append scene markers to a previously created timeline (e.g., one produced by clipwright-transcribe or clipwright-silence). No clips are added or removed; only markers are appended.

Project details


Download files

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

Source Distribution

clipwright_scene-0.1.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

clipwright_scene-0.1.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file clipwright_scene-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for clipwright_scene-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4f14b2ad960470100f7a33c05963f58d548c778c6eb85ecf77711761a1ef51a8
MD5 7ca8b07dfcfa2e001ce767246ad0efe5
BLAKE2b-256 94d8b8ae9c0e9fe390ca533647412b1d8a255a26361c104d8be92923dfdcad4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for clipwright_scene-0.1.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_scene-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for clipwright_scene-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7de57e89254647b43d9e6143731d63cea5b2482aaffa3a82ee916cf9ddf8c45c
MD5 13918e227b2cb4b74bbc8edb588d83dd
BLAKE2b-256 fb678c083f7d916110a4139917a13e29ebfc1a80447d3cc0658e0cc7b811c6a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for clipwright_scene-0.1.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