Skip to main content
Glama

Detect scene changes in a file

detect_scene_changes_in_file
Read-onlyIdempotent

Detect abrupt scene cuts in a video file and return each cut's time and ffmpeg scene score, so you can split a flattened export into shots or place markers at edits.

Instructions

Find the cuts in a video file: the times where the picture changes abruptly (ffmpeg scene score). Returns cuts as {time, score}: time in file time (seconds from the start of the file) of the first frame of the new shot, score 0-1. Use it to split a flattened export back into shots (razor_at_times (for a clip at 100 % speed: sequence time = clip start + file time - clip in point)) or to place markers at every cut (add_markers). Dissolves and fades are usually not detected. detect_scene_edits does the same inside Premiere on timeline clips. Works on the file on disk with ffmpeg, not on the timeline; Premiere Pro is not needed. ffmpeg and ffprobe must be installed (see check_ffmpeg), else FFMPEG_NOT_FOUND.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "detect_scene_changes_in_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNoAnalyse up to this file time, in seconds; clamped to the file's length. Must be greater than start. Default: the end of the file.
pathYesAbsolute path of the media file on this computer.
startNoAnalyse from this file time (seconds from the start of the file). Default 0.
thresholdNoScene score (0-1) a frame must exceed to count as a cut. Default 0.3. Lower finds more cuts (0.1-0.2 for subtle ones), higher fewer.
max_resultsNoMaximum cuts to return. When there are more, the result has truncated=true and the total count. Default 1000.
min_spacingNoIgnore a cut closer than this many seconds to the previous one (flashes, strobes). Default 0.25.
timeout_secondsNoStop ffmpeg and fail with TIMEOUT after this many seconds. Default 600.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=false, so the safety profile needs no restating. The description still adds real behavioral context the annotations don't carry: it operates on the file on disk via ffmpeg rather than the timeline, Premiere is not required, ffmpeg/ffprobe must be installed, and failure surfaces as FFMPEG_NOT_FOUND. It says little about cost/duration behavior beyond what the timeout parameter implies, so it is solid but not exceptional for a read tool whose annotations already do heavy lifting.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core definition and return shape before routing advice, with no filler sentences. The razor_at_times parenthetical formula is dense and interrupts the flow slightly, but it carries real mapping information rather than repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers everything an agent needs for a 7-parameter, no-output-schema tool: return structure ({time, score}), time semantics, known detection limits, environment prerequisites, a named error code, and sibling routing. Nothing material is left to inference.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description still adds meaning by defining the time base ("time in file time, seconds from the start of the file, of the first frame of the new shot") and the score range, and by showing how file time maps to sequence time when combined with razor_at_times. It does not explain threshold, min_spacing, or max_results beyond what the schema already states, which caps it at 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource ("Find the cuts in a video file") and immediately disambiguates from the sibling that does the same on timeline clips: "detect_scene_edits does the same inside Premiere on timeline clips." An agent can select between them without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete downstream uses ("split a flattened export back into shots (razor_at_times ...)" and "place markers at every cut (add_markers)"), names the prerequisite tool (check_ffmpeg), and states a limitation ("Dissolves and fades are usually not detected"). When-to-use, alternatives, and exclusions are all explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools