davinci-resolve-mcp 5.1.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +6 -1
- package/README.zh-CN.md +6 -2
- package/docs/SKILL.md +15 -0
- package/docs/guides/film-cues.md +57 -0
- package/docs/guides/film-picture-changes.md +196 -0
- package/docs/guides/film-workflow.md +145 -0
- package/install.py +1 -1
- package/package.json +1 -1
- package/src/granular/common.py +1 -1
- package/src/server.py +72 -2
- package/src/utils/destructive_hook.py +11 -0
- package/src/utils/execution_lifecycle.py +37 -0
- package/src/utils/film_cues.py +85 -0
- package/src/utils/film_picture_changes.py +381 -0
- package/src/utils/film_preflight.py +162 -0
- package/src/utils/film_stem_return.py +224 -0
- package/src/utils/operation_result.py +14 -0
- package/src/utils/timeline_versioning.py +16 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
Release history for the DaVinci Resolve MCP Server. The latest release is summarized in the root README; older entries live here to keep the README focused.
|
|
4
4
|
|
|
5
|
+
## What's New in v5.2.0 — Film scoring handoff and stem return
|
|
6
|
+
|
|
7
|
+
From #358 by @veridian69. A read-mostly workflow for handing picture to a composer and checking what comes back. Guides: `docs/guides/film-workflow.md`, `docs/guides/film-cues.md`, `docs/guides/film-picture-changes.md`.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **Cue sheets.** `timeline_markers(action="export_cue_sheet")` returns read-only `film-cues/v1` cues with relative integer frames, a rational frame rate, seconds and production metadata. `compare_cue_sheets` diffs two cue documents offline.
|
|
12
|
+
- **Picture baseline.** `timeline(action="film_snapshot")` captures a read-only structural snapshot and picture fingerprint. Given before and after snapshots, `compare_cue_sheets` reports the cues that overlap changed video.
|
|
13
|
+
- **Stem return.** `timeline(action="film_stems_return")` previews by default. With `preview=false`, plus the `timeline_id` and `fingerprint` from the preview, it verifies a `film-stems/v1` package (PCM 24-bit WAV headers, sample counts, SHA-256) and imports each stem onto a new audio track, checking every placement against the timeline. A stale preview refuses. Existing tracks are never replaced and nothing is rolled back automatically.
|
|
14
|
+
- **Preflight.** `timeline(action="film_preflight")` combines picture, media, stem, tempo, calibration and loudness checks, and reports missing evidence as unknown rather than passed.
|
|
15
|
+
|
|
16
|
+
### Fixed on landing
|
|
17
|
+
|
|
18
|
+
- **Stems imported earlier went undetected on macOS.** Existing stems are now matched by resolved path, so a delivery folder under `/tmp`, `/var` or another symlink is recognised and a second import is refused.
|
|
19
|
+
- **Stem return had no risk rating.** The preview is a low-risk read and archives nothing. The apply call is rated medium risk on the timeline and archives the timeline first, like other timeline edits.
|
|
20
|
+
- **Archiving left the Archive bin current.** The archive taken before every destructive edit now puts the previous media pool bin back, so media imported by the edit that follows no longer lands in Archive.
|
|
21
|
+
|
|
22
|
+
### Not verified
|
|
23
|
+
|
|
24
|
+
- The live film validation scripts (`tests/live_film_*_validation.py`) were not run against Resolve. Everything above is covered by unit tests against fakes.
|
|
25
|
+
|
|
5
26
|
## What's New in v5.1.0 — API search reads the installed Resolve's own stub
|
|
6
27
|
|
|
7
28
|
Completes #351, from #356 by @CaptRauti. v5.0.6 put the typed stub back in the npm package; this release stops it answering for builds newer than itself.
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
English | [简体中文](README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
[](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
|
|
6
6
|
[](https://www.npmjs.com/package/davinci-resolve-mcp)
|
|
7
7
|
[](docs/reference/api-coverage.md)
|
|
8
8
|
[-blue.svg)](#server-modes)
|
|
@@ -217,6 +217,11 @@ The open-source servers are complete and fully functional on their own.
|
|
|
217
217
|
|
|
218
218
|
## What You Can Do
|
|
219
219
|
|
|
220
|
+
For scoring to picture, the [Resolve / Live film workflow](docs/guides/film-workflow.md)
|
|
221
|
+
adds picture/cue baselines, change reports, verified new-track stem return and
|
|
222
|
+
evidence-based handoff preflight. It preserves source media and reports missing
|
|
223
|
+
calibration or delivery evidence explicitly.
|
|
224
|
+
|
|
220
225
|
```text
|
|
221
226
|
"List all projects and open the one called 'My Film'"
|
|
222
227
|
"Create a timeline called 'Assembly Cut' from all clips in the current bin"
|
package/README.zh-CN.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | 简体中文
|
|
4
4
|
|
|
5
|
-
[](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
|
|
6
6
|
[](https://www.npmjs.com/package/davinci-resolve-mcp)
|
|
7
7
|
[](docs/reference/api-coverage.md)
|
|
8
8
|
[-blue.svg)](#服务器模式)
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
[](https://www.python.org/downloads/)
|
|
13
13
|
[](https://opensource.org/licenses/MIT)
|
|
14
14
|
|
|
15
|
-
> 本翻译对应 v5.
|
|
15
|
+
> 本翻译对应 v5.2.0 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
|
|
16
16
|
|
|
17
17
|
一个 Model Context Protocol (MCP) 服务器,让 AI 助手通过官方脚本 API 控制 DaVinci Resolve Studio(达芬奇)。它提供完整的 API 覆盖,外加带护栏的工作流助手,涵盖剪辑、媒体池整理、渲染设置、审阅标记、调色、Fusion、Fairlight、项目生命周期任务、扩展开发,以及不碰源媒体的媒体分析。
|
|
18
18
|
|
|
@@ -127,6 +127,10 @@ DRX 调色写入**针对 Resolve Studio 做过实机校准**:调色参数默
|
|
|
127
127
|
|
|
128
128
|
## 你可以做什么
|
|
129
129
|
|
|
130
|
+
面向影视配乐的 [Resolve / Live 工作流](docs/guides/film-workflow.md) 提供画面和
|
|
131
|
+
提示点基线、变更报告、在新音轨上导入并验证分轨,以及基于证据的交付预检。
|
|
132
|
+
这些功能不会修改源媒体;缺少校准或交付证据时会明确报告,而不会视为检查通过。
|
|
133
|
+
|
|
130
134
|
```text
|
|
131
135
|
"列出所有项目,打开叫 'My Film' 的那个"
|
|
132
136
|
"用当前 bin 里的全部片段创建一条叫 'Assembly Cut' 的时间线"
|
package/docs/SKILL.md
CHANGED
|
@@ -1887,6 +1887,21 @@ helpers:
|
|
|
1887
1887
|
|
|
1888
1888
|
**`timeline_markers`** — Markers and playhead on the current timeline.
|
|
1889
1889
|
|
|
1890
|
+
`export_cue_sheet(color?)` returns read-only `film-cues/v1` picture cues with
|
|
1891
|
+
relative integer frames, rational frame rate, seconds and production metadata.
|
|
1892
|
+
Use it for Ableton scoring handoff; never add the timeline's absolute start frame
|
|
1893
|
+
to the cue offsets. See `docs/guides/film-cues.md` for the interchange contract.
|
|
1894
|
+
|
|
1895
|
+
`compare_cue_sheets(before, after, identity_map?, before_snapshot?, after_snapshot?)` compares supplied film cue
|
|
1896
|
+
documents offline. Positional marker IDs are not stable identities; no score
|
|
1897
|
+
movement is performed. On `timeline`, `film_snapshot` captures a picture baseline,
|
|
1898
|
+
`film_stems_return` previews or verifies a new-track import from film-stems/v1,
|
|
1899
|
+
and `film_preflight` combines picture, media, stem, saved-tempo, calibration and
|
|
1900
|
+
loudness checks without treating unknowns as passes. See
|
|
1901
|
+
`docs/guides/film-workflow.md` and `docs/guides/film-picture-changes.md`.
|
|
1902
|
+
Supply both snapshots to include conservative cue impact from changed video
|
|
1903
|
+
structure, including picture edits beneath unchanged cue markers.
|
|
1904
|
+
|
|
1890
1905
|
Key actions: `add(frame|frame_id|timecode?, color?, name?, note?, duration?)`, `get_all`,
|
|
1891
1906
|
`get_current_timecode`, `set_current_timecode(timecode)`,
|
|
1892
1907
|
`get_current_video_item`, `get_thumbnail`, `get_thumbnail_image`
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Picture-to-score cue handoff
|
|
2
|
+
|
|
3
|
+
`timeline_markers(action="export_cue_sheet", params={})` returns a read-only
|
|
4
|
+
`film-cues/v1` JSON document for the current timeline. Use `{"color":"Blue"}`
|
|
5
|
+
to export only a scoring-marker colour. No project, media, or file is changed.
|
|
6
|
+
|
|
7
|
+
This fills the gap between the existing raw/review marker reports and a DAW:
|
|
8
|
+
picture-frame timing is explicit, independent of tempo and of the timeline's
|
|
9
|
+
displayed starting timecode. It is useful for becomingJim's sparse music and
|
|
10
|
+
sound-design cue spotting, and does not invent cues or make creative choices.
|
|
11
|
+
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"schema": "film-cues/v1",
|
|
15
|
+
"frame_rate": {"numerator": 24, "denominator": 1},
|
|
16
|
+
"timeline": {"name": "Ch5", "start_frame": 86400, "start_timecode": "01:00:00:00"},
|
|
17
|
+
"cues": [{
|
|
18
|
+
"id": "marker:240", "name": "Music in", "note": "Cello",
|
|
19
|
+
"color": "Blue", "custom_data": "B1-S02",
|
|
20
|
+
"start_frame": 240, "duration_frames": 48,
|
|
21
|
+
"start_seconds": 10.0, "duration_seconds": 2.0
|
|
22
|
+
}]
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Timing contract
|
|
27
|
+
|
|
28
|
+
- Cue frames are integers relative to the first picture frame; an interval is
|
|
29
|
+
`[start_frame, start_frame + duration_frames)`. A one-frame marker remains one
|
|
30
|
+
frame; it does not automatically acquire the duration to the next marker.
|
|
31
|
+
- `timeline.start_frame` is absolute Resolve metadata. **Do not add it to cue
|
|
32
|
+
positions** when placing cues against picture beginning at beat zero in Live.
|
|
33
|
+
- Seconds derive from integer frames and the exact rational frame rate. Resolve's
|
|
34
|
+
common rounded NTSC rates are normalised, e.g. `23.976` to `24000/1001`.
|
|
35
|
+
- `start_timecode` is descriptive, including any drop-frame separator. Consumers
|
|
36
|
+
need not parse timecode; this avoids confusing skipped timecode labels with
|
|
37
|
+
skipped picture frames.
|
|
38
|
+
- Cue IDs identify positions within this timeline snapshot, not immutable shot
|
|
39
|
+
identities across edits. Preserve `custom_data` for production shot/beat IDs.
|
|
40
|
+
- A DAW consumer must explicitly choose constant tempo or a tempo map and the
|
|
41
|
+
arrangement offset. Current transport BPM alone does not describe automation.
|
|
42
|
+
- Malformed timings fail the export rather than rounding frames or returning a
|
|
43
|
+
partial sheet. Unknown colours select zero cues; colours are case-insensitive.
|
|
44
|
+
|
|
45
|
+
The returned document can be passed to the companion Ableton MCP's film cue
|
|
46
|
+
planner/importer. Keep an explicit association with the picture version; this
|
|
47
|
+
format is not an automatic score reconform or a royalty cue sheet.
|
|
48
|
+
|
|
49
|
+
## Validation
|
|
50
|
+
|
|
51
|
+
```powershell
|
|
52
|
+
venv/Scripts/python.exe -m unittest tests.test_film_cues tests.test_marker_params tests.test_action_list_drift -q
|
|
53
|
+
venv/Scripts/python.exe tests/live_film_cues_validation.py
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The live smoke uses the real MCP stdio client and current Resolve timeline,
|
|
57
|
+
asserts the cue count and timing, and verifies markers and playhead are unchanged.
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# Picture-change reports
|
|
2
|
+
|
|
3
|
+
Compare two exported `film-cues/v1` documents without touching Resolve, Live,
|
|
4
|
+
source media or either input document. This is a cue-sheet comparison, not a
|
|
5
|
+
visual edit detection system or automatic musical reconform.
|
|
6
|
+
|
|
7
|
+
## Python interface
|
|
8
|
+
|
|
9
|
+
```python
|
|
10
|
+
from src.utils.film_picture_changes import compare_film_cues
|
|
11
|
+
|
|
12
|
+
report = compare_film_cues(before, after)
|
|
13
|
+
# Caller-confirmed identity: old cue ID -> new cue ID.
|
|
14
|
+
mapped_report = compare_film_cues(
|
|
15
|
+
before, after, identity_map={"marker:240": "marker:264"}
|
|
16
|
+
)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Signature:
|
|
20
|
+
`compare_film_cues(before: dict, after: dict, identity_map: dict[str, str] | None = None) -> dict`.
|
|
21
|
+
Malformed documents, duplicate IDs and invalid/conflicting mappings raise
|
|
22
|
+
`ValueError`; there is no partial comparison on invalid input. Main integrates
|
|
23
|
+
this helper with the existing `timeline_markers` action `compare_cue_sheets`.
|
|
24
|
+
This module does not register or invoke an MCP tool.
|
|
25
|
+
|
|
26
|
+
Each input requires `schema: "film-cues/v1"`, a rational `frame_rate` object with
|
|
27
|
+
positive integer `numerator` and `denominator`, a `timeline` object containing
|
|
28
|
+
string `name` and `start_timecode` plus nonnegative integer `start_frame`, and a
|
|
29
|
+
`cues` list. Each cue requires a unique nonempty string `id`, string `name`,
|
|
30
|
+
nonnegative integer `start_frame` and positive integer `duration_frames`.
|
|
31
|
+
Optional `note`, `color` and `custom_data` are strings. Other JSON metadata is
|
|
32
|
+
preserved and compared. Optional numeric seconds fields must be finite and
|
|
33
|
+
nonnegative, but timing is always derived from frames, never these approximations.
|
|
34
|
+
Booleans, floats and numeric strings are refused as frame coordinates.
|
|
35
|
+
|
|
36
|
+
Limits: 10,000 cues, 8 MiB of canonical JSON per document, nesting depth 64,
|
|
37
|
+
frame rate at most 1,000 fps, and coordinates/rational components no larger than
|
|
38
|
+
`2**53 - 1`. Cue exclusive endpoints must also fit that integer limit.
|
|
39
|
+
|
|
40
|
+
## Identity rules
|
|
41
|
+
|
|
42
|
+
- IDs outside the reserved `marker:` namespace are assumed caller-stable and
|
|
43
|
+
match exactly. The comparator cannot verify whether a producer reused an ID.
|
|
44
|
+
- Exported IDs such as `marker:240` encode position and must agree with their
|
|
45
|
+
cue's `start_frame`. They do **not** survive a move. Names, notes and proximity
|
|
46
|
+
never establish identity.
|
|
47
|
+
- Identical unmapped position-based cues at the same frame rate count only as
|
|
48
|
+
unchanged observations, listed in `position_only_unchanged`; human review stays
|
|
49
|
+
required. This does not prove that the same picture content remains there.
|
|
50
|
+
- Changed position-based cues, including metadata edits at the same frame, are
|
|
51
|
+
reported as unmatched removal/addition unless explicitly mapped. Those labels
|
|
52
|
+
describe document differences, not proof that the creative cue was deleted.
|
|
53
|
+
- `identity_map` maps existing before IDs to existing after IDs, one-to-one.
|
|
54
|
+
It takes precedence over automatic matching. A mapping that would steal the
|
|
55
|
+
destination of another implicit stable-ID match is refused. Explicitly map
|
|
56
|
+
all participants if identities have been reassigned.
|
|
57
|
+
|
|
58
|
+
For example, a 48-frame cue at frame 240 moving to 264 at 24 fps is an unmatched
|
|
59
|
+
removal/addition when exported as `marker:240` and `marker:264`. With the explicit
|
|
60
|
+
map above, it is `moved`: +24 frames, exactly `{"numerator": 1, "denominator": 1}`
|
|
61
|
+
seconds. This mapping is the caller's assertion, not measured evidence.
|
|
62
|
+
|
|
63
|
+
## Reading the report
|
|
64
|
+
|
|
65
|
+
The report schema is `film-picture-changes/v1`. `status` is `compared` or
|
|
66
|
+
`incompatible_frame_rates`. Equivalent rationals such as 24/1 and 48/2 are
|
|
67
|
+
compatible. A rate change still permits stable/mapped cue comparison in rational
|
|
68
|
+
seconds, but `delta_frames` is `null`; do not use it as an automatic frame edit.
|
|
69
|
+
`compared` means a comparison was computed, not that the picture is unchanged
|
|
70
|
+
or delivery-ready.
|
|
71
|
+
|
|
72
|
+
`changes` contains entries with `before_id`, `after_id`, `match_basis`, `kinds`
|
|
73
|
+
and `before_range`/`after_range`. A matched cue can have several kinds: `moved`,
|
|
74
|
+
`resized`, and `metadata_edited`. Matched edits also include signed
|
|
75
|
+
`delta_frames`/`delta_seconds` for start, exclusive end and duration, plus
|
|
76
|
+
`metadata_changes`. A move means elapsed start seconds changed; a resize means
|
|
77
|
+
elapsed duration changed. Incompatible rates can cause these even when raw
|
|
78
|
+
frame coordinates are identical.
|
|
79
|
+
|
|
80
|
+
Unmatched entries have `added` or `removed` kinds and include detached
|
|
81
|
+
`before_cue`/`after_cue` snapshots. The absent side is `null`. Changes are
|
|
82
|
+
deterministic: before IDs in sorted order, then unmatched after IDs in sorted
|
|
83
|
+
order. Matched unchanged cues are counted in `unchanged_count`.
|
|
84
|
+
|
|
85
|
+
Each affected range is half-open `[start_frame, end_frame)` in its own picture's
|
|
86
|
+
relative frame coordinates, with exact rational start/end seconds. Keep before
|
|
87
|
+
and after ranges separate. A `timeline.start_frame` of 86400 at 24 fps is a
|
|
88
|
+
one-hour timecode origin; it does not add an hour of silence or move relative
|
|
89
|
+
cue positions. Timeline metadata edits set `picture_metadata_changed`.
|
|
90
|
+
|
|
91
|
+
`before` and `after` contain detached timeline metadata, normalised frame rates
|
|
92
|
+
and `fingerprint_sha256`. Fingerprints bind the complete supplied documents:
|
|
93
|
+
SHA-256 of ASCII JSON with sorted keys and compact separators, including cue
|
|
94
|
+
list order and optional approximate seconds fields. They do not hash picture
|
|
95
|
+
media or prove timeline identity. `media_identity_verified` is always false.
|
|
96
|
+
|
|
97
|
+
`requires_human_review` is true for incompatible rates, timeline metadata
|
|
98
|
+
changes, unmatched cues or position-only unchanged observations. A false value
|
|
99
|
+
does not approve a musical reconform: `automatic_reconform` is always false.
|
|
100
|
+
Review the changes and make musical decisions separately.
|
|
101
|
+
|
|
102
|
+
## Verification
|
|
103
|
+
|
|
104
|
+
From the repository root on Windows:
|
|
105
|
+
|
|
106
|
+
```powershell
|
|
107
|
+
venv/Scripts/python.exe -B -m pytest tests/test_film_picture_changes.py tests/test_film_cues.py -q -p no:cacheprovider
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
The comparison tests use plain JSON-shaped fixtures and exact expected
|
|
111
|
+
fractions. They cover unchanged/empty sheets, shifts, shortening, metadata
|
|
112
|
+
changes, additions/removals, position-ID ambiguity, explicit mapping conflicts,
|
|
113
|
+
NTSC/equivalent/changed rates, one-hour origins and validation on both inputs.
|
|
114
|
+
No live application or production media is involved.
|
|
115
|
+
|
|
116
|
+
## Picture cuts beneath unchanged markers
|
|
117
|
+
|
|
118
|
+
Cue-sheet changes alone cannot detect a picture cut when the markers stay put.
|
|
119
|
+
Supply the two existing conform snapshots for structural picture impact:
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
from src.utils.film_picture_changes import compare_picture_impact
|
|
123
|
+
|
|
124
|
+
# Main obtains this through its existing _compare_timeline_snapshots helper.
|
|
125
|
+
impact = compare_picture_impact(
|
|
126
|
+
before, after, before_snapshot, after_snapshot, editorial_comparison
|
|
127
|
+
)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
`compare_picture_impact(before: dict, after: dict, before_snapshot: dict,
|
|
131
|
+
after_snapshot: dict, editorial_comparison: dict) -> dict` is a separate pure
|
|
132
|
+
function. Main may expose snapshots as optional `before_snapshot` and
|
|
133
|
+
`after_snapshot` parameters on `compare_cue_sheets`; this module neither calls
|
|
134
|
+
the server nor edits its registration. The supplied `editorial_comparison` is
|
|
135
|
+
returned as a detached copy, without modifying its conclusions or matching
|
|
136
|
+
clips anew.
|
|
137
|
+
|
|
138
|
+
Snapshots use the existing Resolve conform shape:
|
|
139
|
+
`tracks.video.tracks[].items`, with `track_index`, `item_count` and overall
|
|
140
|
+
`track_count`. Item `start` and exclusive `end` are **absolute timeline frames**;
|
|
141
|
+
`source_start`, `source_end`, `source_fps`, `file_path` and other item fields
|
|
142
|
+
describe the structural source selection. Cue-sheet and snapshot origins must
|
|
143
|
+
agree within each version, as must their names when the snapshot supplies one.
|
|
144
|
+
Duplicate track indices refuse rather than silently discarding a track.
|
|
145
|
+
|
|
146
|
+
Video items are compared conservatively by track index and array slot. This
|
|
147
|
+
does not establish correspondence, even when two slots have the same item ID.
|
|
148
|
+
Regenerated `timeline_item_id` values and enumeration-only `item_index` fields
|
|
149
|
+
are excluded from the picture signature. `media_pool_item_id` is also excluded
|
|
150
|
+
when a nonempty `file_path` is available: that path remains in the signature,
|
|
151
|
+
so different paths still count as changes. Source timing/rates and other
|
|
152
|
+
semantic properties remain compared. Full snapshot fingerprints retain these
|
|
153
|
+
IDs and can therefore change even when structural picture impact is empty.
|
|
154
|
+
Any differing item marks both the old and new spans; additions, removals,
|
|
155
|
+
unmatched tail items and removed tracks mark every available span. Inserting an
|
|
156
|
+
item near a track's start can therefore mark much of that track for review.
|
|
157
|
+
File-path/source-rate changes are considered even if the supplied editorial
|
|
158
|
+
comparison, which inspects fewer fields, says `match: true`.
|
|
159
|
+
|
|
160
|
+
Before intersecting with cues, subtract **each snapshot's own** `start_frame`
|
|
161
|
+
from its item bounds. An origin-only change does not create relative picture
|
|
162
|
+
impact. A frame-rate change marks all available video spans conservatively and
|
|
163
|
+
sets `frame_rates_compatible: false`; exact seconds are calculated separately
|
|
164
|
+
using each cue sheet's rational frame rate. Audio/subtitle changes are excluded
|
|
165
|
+
from the impact calculation. Snapshot fingerprints still cover the full supplied
|
|
166
|
+
snapshots, including audio/subtitle metadata, so they can differ without video
|
|
167
|
+
impact.
|
|
168
|
+
|
|
169
|
+
The `film-picture-impact/v1` report contains:
|
|
170
|
+
|
|
171
|
+
- `before_affected_cue_ids` and `after_affected_cue_ids`: sorted cue IDs affected
|
|
172
|
+
or potentially affected in their own version. Half-open intersections avoid
|
|
173
|
+
flagging a cue that starts exactly at a changed span's end.
|
|
174
|
+
- `changed_ranges`: each affected slot's version (`side`), track and item
|
|
175
|
+
indices, relative frame bounds, rational seconds, and `evidence_status`.
|
|
176
|
+
These ranges deliberately remain separate; they are not edit instructions.
|
|
177
|
+
- `before_snapshot_fingerprint` / `after_snapshot_fingerprint`: SHA-256 using
|
|
178
|
+
the same compact, sorted-key ASCII JSON convention as cue fingerprints.
|
|
179
|
+
- `editorial_comparison`: the existing comparison supplied by main.
|
|
180
|
+
- `unknowns`, `unlocated_impact` and `requires_human_review`: uncertainty is
|
|
181
|
+
never converted into a finding of no impact.
|
|
182
|
+
|
|
183
|
+
Unknown source coordinates/rates or media paths mark the known timeline span
|
|
184
|
+
as uncertain. An unknown timeline coordinate or incomplete video enumeration
|
|
185
|
+
can affect an unlocated region: **every cue on that side is then potentially
|
|
186
|
+
affected**, and `unlocated_impact[side]` is true. Missing video data is not treated
|
|
187
|
+
as an empty picture. Fully enumerated zero video tracks are an empty structural
|
|
188
|
+
picture. Missing/inconsistent enumeration counts are unknown; malformed JSON
|
|
189
|
+
and misbound cue/snapshot origins raise `ValueError`.
|
|
190
|
+
|
|
191
|
+
`status` is `unknown` when evidence is incomplete, otherwise
|
|
192
|
+
`incompatible_frame_rates` for differing clocks, otherwise `compared`.
|
|
193
|
+
Known changes and incompatible rates also require human review.
|
|
194
|
+
This remains **structural only**: snapshots are not rendered-picture or source
|
|
195
|
+
media hashes, grades/effects are unverified, no clip correspondence is inferred,
|
|
196
|
+
and no automatic movement or musical reconform is performed.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Resolve / Live film workflow
|
|
2
|
+
|
|
3
|
+
These helpers join existing film cue export, stem delivery and conform inspection.
|
|
4
|
+
They do not compose music, automatically reconform a score, change source media,
|
|
5
|
+
or establish that unobserved audio hardware settings are correct.
|
|
6
|
+
|
|
7
|
+
## Capture the picture baseline
|
|
8
|
+
|
|
9
|
+
Call `timeline(action="film_snapshot")`. Retain the returned `cue_sheet`,
|
|
10
|
+
`snapshot` and `picture_fingerprint` with the picture version being scored.
|
|
11
|
+
The snapshot is read-only. Its fingerprint covers exposed video structure and
|
|
12
|
+
cues, not rendered frames, grades, effects or the contents of source files.
|
|
13
|
+
Audio-track changes do not invalidate this picture baseline.
|
|
14
|
+
|
|
15
|
+
`timeline_markers(action="compare_cue_sheets", params={"before": old_sheet,
|
|
16
|
+
"after": new_sheet})` reports cue additions, removals, timing and metadata changes.
|
|
17
|
+
See [picture-change reports](film-picture-changes.md) for stable identity rules.
|
|
18
|
+
Resolve's exported `marker:<frame>` IDs are positional, not persistent identities.
|
|
19
|
+
Do not treat a name match or nearby marker as proof that a cue moved.
|
|
20
|
+
|
|
21
|
+
For picture-edit impact, also supply `before_snapshot` and `after_snapshot` from
|
|
22
|
+
the two `film_snapshot` results. The action reuses the existing conform comparison
|
|
23
|
+
and reports cues overlapping changed video spans in either version. This is a
|
|
24
|
+
conservative track/array-position comparison, not inferred clip correspondence;
|
|
25
|
+
insertions may flag later spans too. Unknown source/timeline coordinates remain
|
|
26
|
+
explicitly unknown. No grade/effect or media-content equivalence is claimed.
|
|
27
|
+
Without snapshots, picture-edit impact is unknown even if every marker matches.
|
|
28
|
+
|
|
29
|
+
## Read the saved score tempo
|
|
30
|
+
|
|
31
|
+
On the Ableton MCP call `film_tempo_read(source_set_path="absolute/file.als")`.
|
|
32
|
+
The receipt contains `tempo_map_beats` for region bouncing and `tempo_map_seconds`
|
|
33
|
+
for `film_cues_plan`. Maps start at arrangement zero; a different picture origin
|
|
34
|
+
requires an explicit rebase. Ramps, modulation and unknown tempo topology refuse.
|
|
35
|
+
The receipt binds the source file hash; it excludes unsaved Live changes.
|
|
36
|
+
|
|
37
|
+
## Calibrate before trusting captured origins
|
|
38
|
+
|
|
39
|
+
Ableton provides `generate_calibration_probe`, `measure_capture_calibration` and
|
|
40
|
+
`validate_capture_calibration`. The first creates a new probe WAV; measurement
|
|
41
|
+
needs two to five independent captures through the exact intended audio path.
|
|
42
|
+
Validation remeasures the bound files against the current declared configuration.
|
|
43
|
+
See Ableton's `docs/FILM_CALIBRATION.md` for settings and the disposable-set procedure.
|
|
44
|
+
No tool applies compensation or changes a production score automatically.
|
|
45
|
+
|
|
46
|
+
The offset is relative to the probe, not an absolute picture-origin measurement.
|
|
47
|
+
Driver/buffer/routing/plugin settings and capture provenance are caller assertions.
|
|
48
|
+
Do not subtract a measured offset twice if the recorder already compensates it.
|
|
49
|
+
|
|
50
|
+
## Prepare and return stems
|
|
51
|
+
|
|
52
|
+
Use Ableton's `film_stems_prepare` and `film_stems_audit` to produce a new
|
|
53
|
+
`film-stems/v1` package. Each capture needs a known signed `source_start_sample`.
|
|
54
|
+
Keep the delivered directory in a stable location: Resolve references its WAVs;
|
|
55
|
+
the importer does not copy them or collect project media.
|
|
56
|
+
|
|
57
|
+
Preview on Resolve:
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"action": "film_stems_return",
|
|
62
|
+
"params": {
|
|
63
|
+
"delivery_dir": "D:/exports/ch5/music-v2",
|
|
64
|
+
"preview": true
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Pass this to `timeline`. On approval, call the same action with `preview:false`,
|
|
70
|
+
`expected_timeline_id` from the preview's `timeline_id`, and
|
|
71
|
+
`expected_fingerprint` from its `fingerprint`. A stale preview refuses.
|
|
72
|
+
|
|
73
|
+
The importer independently checks PCM24 WAV headers, sample counts, hashes and
|
|
74
|
+
the target timeline rate. New tracks are named `FILM_<package-hash>_<stem-name>`.
|
|
75
|
+
Placement adds the timeline's absolute start exactly once. Source-frame lengths
|
|
76
|
+
use the imported media item's FPS, which need not equal the timeline FPS.
|
|
77
|
+
On the verified Resolve 21.0.4.5 build, audio append end frames are exclusive.
|
|
78
|
+
Every append is checked against actual timeline items, not just the API receipt.
|
|
79
|
+
Timing readback tolerance is one audio sample expressed in timeline frames.
|
|
80
|
+
|
|
81
|
+
Complete matching imports report `already_present`; wrong placement, duplicate
|
|
82
|
+
instances, name collisions or partial prior imports require manual review.
|
|
83
|
+
An interrupted/failed write reports `partial_failure` with created tracks and
|
|
84
|
+
readable media receipts. `partially_created_unknown` means the API may have
|
|
85
|
+
created additional media without usable receipts. Nothing is automatically deleted
|
|
86
|
+
and no rollback is promised. Existing tracks and clips are never replaced.
|
|
87
|
+
|
|
88
|
+
The preview is rated a low-risk read and archives nothing. The apply call is
|
|
89
|
+
rated medium risk on the timeline. Like other timeline edits, it first archives
|
|
90
|
+
a copy of the timeline to the Archive bin (once per run); the imported stems
|
|
91
|
+
still land in the bin that was current before the call.
|
|
92
|
+
Existing stems are matched by their resolved path, so a delivery folder reached
|
|
93
|
+
through a symlink (such as `/tmp` or `/var` on macOS) is still recognised.
|
|
94
|
+
|
|
95
|
+
## Preflight the handoff
|
|
96
|
+
|
|
97
|
+
Call `timeline(action="film_preflight", params={...})`. Optional evidence:
|
|
98
|
+
|
|
99
|
+
| Parameter | Meaning |
|
|
100
|
+
|---|---|
|
|
101
|
+
| `expected_picture_fingerprint` | Baseline from `film_snapshot` or prior preflight |
|
|
102
|
+
| `delivery_dir` | Existing film-stems/v1 directory |
|
|
103
|
+
| `tempo_evidence` | Full `film_tempo_read` receipt |
|
|
104
|
+
| `calibration_evidence` | Full measured film-calibration/v1 receipt |
|
|
105
|
+
| `capture_profile` | Current configuration object used by Ableton's calibration tools |
|
|
106
|
+
| `loudness_path` | Explicit final mix/stem to measure through existing ffmpeg meter |
|
|
107
|
+
| `target_lufs`, `true_peak_max` | Explicit delivery limits; no delivery standard is guessed |
|
|
108
|
+
|
|
109
|
+
Checks independently report `pass`, `warn`, `fail` or `unknown`. Missing evidence
|
|
110
|
+
never passes. Aggregate status is `failed`, `incomplete`, `warnings` or `passed`.
|
|
111
|
+
The operation envelope maps these to failed, blocked, partial and success rather
|
|
112
|
+
than presenting an incomplete check as a successful handoff. Cue extent uses the
|
|
113
|
+
video end, not audio extending beyond picture. A media-pool ID without a readable
|
|
114
|
+
source path is unknown, not proof that the media is present.
|
|
115
|
+
Endpoint quietness is measured over the final 10 ms at -60 dBFS; it cannot decide
|
|
116
|
+
whether a musically appropriate reverb tail has finished. Coverage compares the
|
|
117
|
+
package body to cue intervals; picture markers may include non-music notes.
|
|
118
|
+
Loudness uses whole-file integrated LUFS with ±0.5 LU tolerance and a true-peak
|
|
119
|
+
ceiling; this is not dialogue-gated measurement. No automatic gain changes occur.
|
|
120
|
+
|
|
121
|
+
Resolve checks calibration receipt/configuration/file integrity, not fresh DSP.
|
|
122
|
+
Use Ableton's validation tool for remeasurement. Even valid receipts remain
|
|
123
|
+
warnings for current hardware settings and absolute picture alignment.
|
|
124
|
+
|
|
125
|
+
## Verification
|
|
126
|
+
|
|
127
|
+
Unit tests: `tests/test_film_stem_return.py`, `test_film_preflight.py`,
|
|
128
|
+
`test_film_picture_changes.py` and `test_film_lifecycle.py`.
|
|
129
|
+
|
|
130
|
+
`venv/Scripts/python.exe tests/live_film_stem_return_validation.py` creates one
|
|
131
|
+
owned temporary timeline in the current project and imports synthetic media via
|
|
132
|
+
real MCP. It restores the original timeline, deletes only the successful probe
|
|
133
|
+
timeline, retains synthetic files in scratch, and never saves the project.
|
|
134
|
+
Failure retains the probe for inspection. This is a mutating synthetic test, not
|
|
135
|
+
a command to run unattended against an actively edited project.
|
|
136
|
+
|
|
137
|
+
Ableton's `tests/live_film_workflow_validation.py` checks both configured servers,
|
|
138
|
+
the current Resolve cue sheet, a supplied saved ALS, synthetic calibration,
|
|
139
|
+
cross-MCP packaging/preflight and stale configuration refusal without live edits.
|
|
140
|
+
Synthetic calibration evidence is not a measured hardware latency profile.
|
|
141
|
+
|
|
142
|
+
On Resolve Studio 21.0.4.5, the real 24 fps probe verified one-hour-origin
|
|
143
|
+
placement, exact duration and duplicate refusal. NTSC timing is unit-tested;
|
|
144
|
+
the optional `--ntsc` live probe could not set 29.97 fps in the current project.
|
|
145
|
+
No project-wide frame-rate setting was changed to force that test through.
|
package/install.py
CHANGED
|
@@ -37,7 +37,7 @@ from src.utils.update_check import (
|
|
|
37
37
|
|
|
38
38
|
# ─── Version ──────────────────────────────────────────────────────────────────
|
|
39
39
|
|
|
40
|
-
VERSION = "5.
|
|
40
|
+
VERSION = "5.2.0"
|
|
41
41
|
# Only hard floor: mcp[cli] requires Python 3.10+. There is no upper bound —
|
|
42
42
|
# Resolve's scripting bridge loads into newer interpreters on recent builds
|
|
43
43
|
# (Python 3.14 verified against Resolve Studio 20.3.2). Older Resolve builds
|
package/package.json
CHANGED
package/src/granular/common.py
CHANGED
|
@@ -93,7 +93,7 @@ if not logging.getLogger().handlers:
|
|
|
93
93
|
handlers=[logging.StreamHandler()],
|
|
94
94
|
)
|
|
95
95
|
|
|
96
|
-
VERSION = "5.
|
|
96
|
+
VERSION = "5.2.0"
|
|
97
97
|
logger = logging.getLogger("davinci-resolve-mcp")
|
|
98
98
|
logger.info(f"Starting DaVinci Resolve MCP Server v{VERSION}")
|
|
99
99
|
logger.info(f"Detected platform: {get_platform()}")
|