versioncam 0.1.2 → 0.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 +196 -46
- package/README.md +486 -243
- package/bin/versioncam.js +1 -1
- package/dist/app-server.js +2 -2
- package/dist/app-server.js.map +1 -1
- package/dist/cli/commands/doctor.js +41 -4
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/init.js +26 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/preview.js +10 -1
- package/dist/cli/commands/preview.js.map +1 -1
- package/dist/cli/commands/record.js +3 -2
- package/dist/cli/commands/record.js.map +1 -1
- package/dist/cli/commands/render.d.ts +17 -0
- package/dist/cli/commands/render.js +79 -22
- package/dist/cli/commands/render.js.map +1 -1
- package/dist/cli/commands/stability.js +4 -4
- package/dist/cli/commands/stability.js.map +1 -1
- package/dist/cli/cwd.d.ts +46 -0
- package/dist/cli/cwd.js +102 -0
- package/dist/cli/cwd.js.map +1 -0
- package/dist/cli/main.js +11 -2
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/usage.d.ts +10 -5
- package/dist/cli/usage.js +42 -24
- package/dist/cli/usage.js.map +1 -1
- package/dist/config.d.ts +24 -0
- package/dist/config.js +25 -0
- package/dist/config.js.map +1 -1
- package/dist/core/camera-track.d.ts +63 -0
- package/dist/core/camera-track.js +230 -0
- package/dist/core/camera-track.js.map +1 -0
- package/dist/core/camera.d.ts +14 -1
- package/dist/core/camera.js +18 -2
- package/dist/core/camera.js.map +1 -1
- package/dist/core/follow.d.ts +129 -0
- package/dist/core/follow.js +151 -0
- package/dist/core/follow.js.map +1 -0
- package/dist/core/motion-defaults.d.ts +29 -0
- package/dist/core/motion-defaults.js +29 -0
- package/dist/core/motion-defaults.js.map +1 -1
- package/dist/core/timeline.d.ts +32 -2
- package/dist/core/timeline.js +10 -0
- package/dist/core/timeline.js.map +1 -1
- package/dist/driver/clip.d.ts +4 -1
- package/dist/driver/clip.js +9 -1
- package/dist/driver/clip.js.map +1 -1
- package/dist/driver/session.d.ts +35 -1
- package/dist/driver/session.js +81 -12
- package/dist/driver/session.js.map +1 -1
- package/dist/driver/settle.js +2 -2
- package/dist/driver/settle.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/inspect/inspect.js +1 -1
- package/dist/loader.d.ts +7 -1
- package/dist/loader.js +23 -8
- package/dist/loader.js.map +1 -1
- package/dist/page/assets/index-fZtacWyp.js +2 -0
- package/dist/page/index.html +2 -2
- package/dist/render/encode.d.ts +12 -1
- package/dist/render/encode.js +94 -35
- package/dist/render/encode.js.map +1 -1
- package/dist/render/presentation.d.ts +12 -0
- package/dist/render/presentation.js +15 -0
- package/dist/render/presentation.js.map +1 -1
- package/dist/render/render.js +19 -2
- package/dist/render/render.js.map +1 -1
- package/dist/render/sampling.d.ts +13 -0
- package/dist/render/sampling.js +48 -20
- package/dist/render/sampling.js.map +1 -1
- package/dist/render/scenes.d.ts +16 -0
- package/dist/render/scenes.js +108 -0
- package/dist/render/scenes.js.map +1 -0
- package/dist/render/sequence.d.ts +18 -0
- package/dist/render/sequence.js +67 -13
- package/dist/render/sequence.js.map +1 -1
- package/dist/review/review.js +48 -23
- package/dist/review/review.js.map +1 -1
- package/dsl.md +267 -92
- package/package.json +2 -2
- package/plugin/README.md +58 -47
- package/plugin/agents/versioncam-reviewer.md +3 -2
- package/plugin/skills/versioncam/SKILL.md +60 -14
- package/plugin/skills/versioncam/authoring.md +6 -1
- package/plugin/skills/versioncam/onboarding.md +17 -17
- package/dist/page/assets/index-DUom5amc.js +0 -1
package/dist/render/sampling.js
CHANGED
|
@@ -10,6 +10,44 @@ export function uniformFrames(durationFrames, count = SHEET_TILES) {
|
|
|
10
10
|
const tiles = Math.max(2, Math.min(count, durationFrames));
|
|
11
11
|
return Array.from({ length: tiles }, (_, i) => Math.round((i / (tiles - 1)) * (durationFrames - 1)));
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* The first frame at or after `frame` that is not inside a dissolve.
|
|
15
|
+
*
|
|
16
|
+
* The renderer dissolves between states for `crossfadeFrames` after every
|
|
17
|
+
* cut, and a tile taken inside that window is two pages at once. A reviewer
|
|
18
|
+
* shown one said so and declined to judge the beat from it, which is the
|
|
19
|
+
* right answer to a question that should not have been asked.
|
|
20
|
+
*
|
|
21
|
+
* Two settles a few frames apart overlap their dissolves, and the first frame
|
|
22
|
+
* after one can be inside the next, so the frame moves on until it is clear
|
|
23
|
+
* of all of them. Never past the last frame, which has nothing after it.
|
|
24
|
+
*/
|
|
25
|
+
function pastCrossfade(frame, durationFrames, crossfadeFrames, cuts) {
|
|
26
|
+
let clear = frame;
|
|
27
|
+
for (;;) {
|
|
28
|
+
const cut = cuts.find((c) => clear > c && clear <= c + crossfadeFrames);
|
|
29
|
+
if (cut === undefined)
|
|
30
|
+
break;
|
|
31
|
+
clear = cut + crossfadeFrames + 1;
|
|
32
|
+
}
|
|
33
|
+
return Math.min(clear, durationFrames - 1);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Evenly spaced, ends included, and none of them inside a dissolve: the
|
|
37
|
+
* frames a sheet shows when nobody chose them.
|
|
38
|
+
*
|
|
39
|
+
* An even spread knows nothing about the clip, so it lands wherever the
|
|
40
|
+
* spacing puts it, and after a settle that can be the renderer's crossfade: a
|
|
41
|
+
* plain sheet of the example app showed two tiles with one page ghosting
|
|
42
|
+
* through the next, which `--at-marks` had stopped doing for its own tiles
|
|
43
|
+
* long before. A tile inside a dissolve moves to the first frame after it.
|
|
44
|
+
* The first frame is never inside one, the last stays the last, and two
|
|
45
|
+
* tiles that land on the same frame are one.
|
|
46
|
+
*/
|
|
47
|
+
export function evenFrames(durationFrames, count = SHEET_TILES, crossfadeFrames = 0, cuts = []) {
|
|
48
|
+
const tiles = uniformFrames(durationFrames, count).map((frame) => pastCrossfade(frame, durationFrames, crossfadeFrames, cuts));
|
|
49
|
+
return [...new Set(tiles)].sort((a, b) => a - b);
|
|
50
|
+
}
|
|
13
51
|
/**
|
|
14
52
|
* Frame 0, every beat, and the last frame.
|
|
15
53
|
*
|
|
@@ -23,23 +61,13 @@ export function uniformFrames(durationFrames, count = SHEET_TILES) {
|
|
|
23
61
|
*/
|
|
24
62
|
export function markedFrames(durationFrames, marks, count = SHEET_TILES, crossfadeFrames = 0, cuts = []) {
|
|
25
63
|
const inRange = (frame) => Number.isInteger(frame) && frame >= 0 && frame < durationFrames;
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
// A mark is the worst case — it sits on the cut's first frame, where the
|
|
34
|
-
// blend has barely begun and the tile still shows what was on screen
|
|
35
|
-
// *before* the wait — but any evenly spread tile can land there too. Marks
|
|
36
|
-
// stay where they are, because `review` wants the state boundary; only the
|
|
37
|
-
// picture waits for the dissolve to finish.
|
|
38
|
-
const settled = (frame) => {
|
|
39
|
-
const cut = cuts.find((c) => frame > c && frame <= c + crossfadeFrames);
|
|
40
|
-
const clear = cut === undefined ? frame : cut + crossfadeFrames + 1;
|
|
41
|
-
return Math.min(clear, durationFrames - 1);
|
|
42
|
-
};
|
|
64
|
+
// A mark is the worst case of a tile inside a dissolve: it sits on the
|
|
65
|
+
// cut's first frame, where the blend has barely begun and the tile still
|
|
66
|
+
// shows what was on screen *before* the wait. `beatFrame` moves its tile
|
|
67
|
+
// past the dissolve that starts there; the marks themselves stay where
|
|
68
|
+
// they are, because `review` wants the state boundary. The spare tiles
|
|
69
|
+
// below come from `evenFrames`, which moves them past any dissolve they
|
|
70
|
+
// land in.
|
|
43
71
|
const wanted = [
|
|
44
72
|
0,
|
|
45
73
|
...marks.map((m) => beatFrame(m, durationFrames, crossfadeFrames)),
|
|
@@ -55,10 +83,10 @@ export function markedFrames(durationFrames, marks, count = SHEET_TILES, crossfa
|
|
|
55
83
|
// the shape of the clip around them.
|
|
56
84
|
if (unique.length < count) {
|
|
57
85
|
const filled = new Set(unique);
|
|
58
|
-
for (const frame of
|
|
86
|
+
for (const frame of evenFrames(durationFrames, count, crossfadeFrames, cuts)) {
|
|
59
87
|
if (filled.size >= count)
|
|
60
88
|
break;
|
|
61
|
-
filled.add(
|
|
89
|
+
filled.add(frame);
|
|
62
90
|
}
|
|
63
91
|
return [...filled].sort((a, b) => a - b);
|
|
64
92
|
}
|
|
@@ -98,7 +126,7 @@ timeline, wanted, crossfadeFrames = 0) {
|
|
|
98
126
|
const marks = timeline.marks ?? [];
|
|
99
127
|
if (marks.length === 0) {
|
|
100
128
|
return {
|
|
101
|
-
error: "This recording has no beats to go by
|
|
129
|
+
error: "This recording has no beats to go by: it has no labelled settle(), or it " +
|
|
102
130
|
"was made before marks existed. Ask for a frame number or --t instead.",
|
|
103
131
|
};
|
|
104
132
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sampling.js","sourceRoot":"","sources":["../../src/render/sampling.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC;AAE7B,qFAAqF;AACrF,MAAM,UAAU,aAAa,CAC3B,cAAsB,EACtB,KAAK,GAAG,WAAW;IAEnB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC;IAC3D,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAC5C,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC,CACrD,CAAC;AACJ,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"sampling.js","sourceRoot":"","sources":["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AAC,CAAC,EAAE,CAAC;iBACpC,IAAI,CAAC,IAAI,CAAC,EAAE;SAChB,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GACR,KAAK;QACL,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO;YACL,KAAK,EAAE,uBAAuB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,iBAAiB,IAAI,EAAE;SAC5E,CAAC;IACJ,CAAC;IACD,OAAO;QACL,KAAK,EAAE,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,cAAc,EAAE,eAAe,CAAC;QAChE,KAAK,EAAE,IAAI,CAAC,KAAK;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Scene } from "../scene.js";
|
|
2
|
+
/**
|
|
3
|
+
* The scenes a module defines, by id, or why there are none to read.
|
|
4
|
+
*
|
|
5
|
+
* `file` names the module in the message: its path, wherever the path is
|
|
6
|
+
* known. The message is three lines at most (what is wrong, the shape, and
|
|
7
|
+
* the one-line fix when there is an obvious one), so `doctor` can print the
|
|
8
|
+
* first as its finding and the rest beneath it.
|
|
9
|
+
*/
|
|
10
|
+
export declare function readScenes(module: Record<string, unknown>, file: string): {
|
|
11
|
+
scenes: Record<string, Scene>;
|
|
12
|
+
} | {
|
|
13
|
+
error: string;
|
|
14
|
+
};
|
|
15
|
+
/** What to say when scenes are asked for that the module does not define. */
|
|
16
|
+
export declare function missingScenes(asked: string[], defined: string[], file: string | null): string;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a scenes module has to export, checked the same way wherever one is
|
|
3
|
+
* read: in Node, where the CLI lists the ids to render and filter, and in the
|
|
4
|
+
* render page, which draws them.
|
|
5
|
+
*
|
|
6
|
+
* Both used to take `module.default` and carry on with whatever it was. A
|
|
7
|
+
* module whose record of scenes was a named export gave them nothing at all:
|
|
8
|
+
* `render` found no scenes, said nothing, and stitched a film without them.
|
|
9
|
+
* Anything that is not a record of scenes now stops the command, naming the
|
|
10
|
+
* file and the shape it should have.
|
|
11
|
+
*
|
|
12
|
+
* A record with nothing in it is still a record, and renders no scenes, which
|
|
13
|
+
* is what it says.
|
|
14
|
+
*/
|
|
15
|
+
/** The shape, as the second line of every refusal. */
|
|
16
|
+
const SHAPE = "versioncam reads scenes from a module's default export: a Record<string, Scene> " +
|
|
17
|
+
"keyed by scene id, as in `export default { [intro.id]: intro }`.";
|
|
18
|
+
/** For anything but a plain object, which is never what is being described. */
|
|
19
|
+
function describe(value) {
|
|
20
|
+
if (value === null || value === undefined)
|
|
21
|
+
return String(value);
|
|
22
|
+
if (Array.isArray(value))
|
|
23
|
+
return "an array";
|
|
24
|
+
return `a ${typeof value}`;
|
|
25
|
+
}
|
|
26
|
+
/** A value as it was written, so `"60"` does not read as the number 60. */
|
|
27
|
+
function shown(value) {
|
|
28
|
+
return typeof value === "string" ? JSON.stringify(value) : String(value);
|
|
29
|
+
}
|
|
30
|
+
function isPlainObject(value) {
|
|
31
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
32
|
+
}
|
|
33
|
+
/** What is wrong with one entry, or null when it can be drawn. */
|
|
34
|
+
function entryProblem(key, value) {
|
|
35
|
+
if (!isPlainObject(value))
|
|
36
|
+
return `"${key}" is ${describe(value)}, not a scene`;
|
|
37
|
+
const { draw, durationFrames, fps } = value;
|
|
38
|
+
if (typeof draw !== "function") {
|
|
39
|
+
return `"${key}" has no draw(ctx, frame, canvas)`;
|
|
40
|
+
}
|
|
41
|
+
if (!Number.isInteger(durationFrames) || durationFrames < 1) {
|
|
42
|
+
return `"${key}" has durationFrames ${shown(durationFrames)}, where a whole number of frames, 1 or more, belongs`;
|
|
43
|
+
}
|
|
44
|
+
if (typeof fps !== "number" || !Number.isFinite(fps) || fps <= 0) {
|
|
45
|
+
return `"${key}" has fps ${shown(fps)}, where a number above 0 belongs`;
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* What is wrong with a would-be record of scenes, as the end of a sentence
|
|
51
|
+
* that starts "default-exports", or null when nothing is.
|
|
52
|
+
*
|
|
53
|
+
* A single scene and an array are singled out because they are the two
|
|
54
|
+
* mistakes a clip file invites: a clip file default-exports one clip or an
|
|
55
|
+
* array of them, and a scenes module does neither.
|
|
56
|
+
*/
|
|
57
|
+
function recordProblem(value) {
|
|
58
|
+
if (!isPlainObject(value))
|
|
59
|
+
return describe(value);
|
|
60
|
+
if (typeof value.draw === "function") {
|
|
61
|
+
return "a single scene rather than a record of them";
|
|
62
|
+
}
|
|
63
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
64
|
+
const problem = entryProblem(key, entry);
|
|
65
|
+
if (problem)
|
|
66
|
+
return `a record in which ${problem}`;
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The scenes a module defines, by id, or why there are none to read.
|
|
72
|
+
*
|
|
73
|
+
* `file` names the module in the message: its path, wherever the path is
|
|
74
|
+
* known. The message is three lines at most (what is wrong, the shape, and
|
|
75
|
+
* the one-line fix when there is an obvious one), so `doctor` can print the
|
|
76
|
+
* first as its finding and the rest beneath it.
|
|
77
|
+
*/
|
|
78
|
+
export function readScenes(module, file) {
|
|
79
|
+
if (module.default === undefined) {
|
|
80
|
+
const named = Object.keys(module).filter((name) => name !== "default");
|
|
81
|
+
const lines = [
|
|
82
|
+
`${file} has no default export.` +
|
|
83
|
+
(named.length > 0 ? ` It exports ${named.join(", ")}.` : ""),
|
|
84
|
+
SHAPE,
|
|
85
|
+
];
|
|
86
|
+
// The failure that made this check: the record was there, under a name.
|
|
87
|
+
const records = named.filter((name) => recordProblem(module[name]) === null &&
|
|
88
|
+
Object.keys(module[name]).length > 0);
|
|
89
|
+
if (records.length === 1) {
|
|
90
|
+
lines.push(`${records[0]} is one: add \`export default ${records[0]}\`.`);
|
|
91
|
+
}
|
|
92
|
+
return { error: lines.join("\n") };
|
|
93
|
+
}
|
|
94
|
+
const problem = recordProblem(module.default);
|
|
95
|
+
if (problem) {
|
|
96
|
+
return { error: `${file} default-exports ${problem}.\n${SHAPE}` };
|
|
97
|
+
}
|
|
98
|
+
return { scenes: module.default };
|
|
99
|
+
}
|
|
100
|
+
/** What to say when scenes are asked for that the module does not define. */
|
|
101
|
+
export function missingScenes(asked, defined, file) {
|
|
102
|
+
const names = asked.map((id) => `"${id}"`).join(", ");
|
|
103
|
+
const head = `No scene${asked.length === 1 ? "" : "s"} called ${names}.`;
|
|
104
|
+
if (file === null)
|
|
105
|
+
return `${head} The config names no \`scenes\` module.`;
|
|
106
|
+
return `${head} ${file} defines ${defined.length > 0 ? defined.join(", ") : "none"}.`;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=scenes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenes.js","sourceRoot":"","sources":["../../src/render/scenes.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,sDAAsD;AACtD,MAAM,KAAK,GACT,kFAAkF;IAClF,kEAAkE,CAAC;AAErE,+EAA+E;AAC/E,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IAChE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,UAAU,CAAC;IAC5C,OAAO,KAAK,OAAO,KAAK,EAAE,CAAC;AAC7B,CAAC;AAED,2EAA2E;AAC3E,SAAS,KAAK,CAAC,KAAc;IAC3B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,C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C,CAAC;IAED,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9C,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,oBAAoB,OAAO,MAAM,KAAK,EAAE,EAAE,CAAC;IACpE,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,OAAgC,EAAE,CAAC;AAC7D,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,aAAa,CAC3B,KAAe,EACf,OAAiB,EACjB,IAAmB;IAEnB,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,MAAM,IAAI,GAAG,WAAW,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,WAAW,KAAK,GAAG,CAAC;IACzE,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,GAAG,IAAI,yCAAyC,CAAC;IAC3E,OAAO,GAAG,IAAI,IAAI,IAAI,YAAY,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC;AACxF,CAAC"}
|
|
@@ -1,15 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A rendered clip. `frameRate` is the fraction ffprobe gives, `60/1` or
|
|
3
|
+
* `30000/1001`, kept as written rather than divided out: it is the rate the
|
|
4
|
+
* filter may convert every clip to, the fastest clip included, and only the
|
|
5
|
+
* exact rate leaves that clip's frames where they were.
|
|
6
|
+
*/
|
|
1
7
|
export type SequenceInput = {
|
|
2
8
|
id: string;
|
|
3
9
|
path: string;
|
|
4
10
|
duration: number;
|
|
11
|
+
frameRate: string;
|
|
5
12
|
};
|
|
6
13
|
/** Duration of a video file, in seconds. Blocking; ffprobe is quick. */
|
|
7
14
|
export declare function probeDuration(path: string): number;
|
|
15
|
+
/** Frame rate of a video file, as the fraction ffprobe gives. Blocking too. */
|
|
16
|
+
export declare function probeFrameRate(path: string): string;
|
|
8
17
|
/**
|
|
9
18
|
* The `xfade` chain. Each transition's `offset` is measured from the start of
|
|
10
19
|
* everything accumulated so far, and every crossfade shortens the total by its
|
|
11
20
|
* own duration — which is the part that is easy to get wrong and shows up as
|
|
12
21
|
* a clip that starts before the previous one has finished.
|
|
22
|
+
*
|
|
23
|
+
* `xfade` joins streams of one frame rate and one timebase only, and clips
|
|
24
|
+
* need not share a rate: a 15 fps draft among 60 fps recordings, or a scene
|
|
25
|
+
* or a clip with an `fps` of its own. When the rates differ, every clip goes
|
|
26
|
+
* through `fps` at the highest of them first. The highest, so that no clip
|
|
27
|
+
* loses a frame: a slower clip's frames are each held as long as they were.
|
|
28
|
+
* Every clip, the fastest included, because `fps` sets the timebase as well,
|
|
29
|
+
* and a clip left alone would keep its own. When the rates agree, the filter
|
|
30
|
+
* is the one it always was.
|
|
13
31
|
*/
|
|
14
32
|
export declare function buildFilter(inputs: SequenceInput[]): {
|
|
15
33
|
filter: string;
|
package/dist/render/sequence.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
|
-
import { existsSync, statSync } from "node:fs";
|
|
2
|
+
import { existsSync, renameSync, rmSync, statSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { ffmpegPath, ffprobeSync } from "./ffmpeg.js";
|
|
5
5
|
/**
|
|
@@ -32,22 +32,62 @@ export function probeDuration(path) {
|
|
|
32
32
|
}
|
|
33
33
|
return seconds;
|
|
34
34
|
}
|
|
35
|
+
/** Frame rate of a video file, as the fraction ffprobe gives. Blocking too. */
|
|
36
|
+
export function probeFrameRate(path) {
|
|
37
|
+
const out = ffprobeSync([
|
|
38
|
+
"-v",
|
|
39
|
+
"error",
|
|
40
|
+
"-select_streams",
|
|
41
|
+
"v:0",
|
|
42
|
+
"-show_entries",
|
|
43
|
+
"stream=r_frame_rate",
|
|
44
|
+
"-of",
|
|
45
|
+
"default=nw=1:nk=1",
|
|
46
|
+
path,
|
|
47
|
+
]).trim();
|
|
48
|
+
const rate = rateOf(out);
|
|
49
|
+
if (!Number.isFinite(rate) || rate <= 0) {
|
|
50
|
+
throw new Error(`Could not read a frame rate from ${path}`);
|
|
51
|
+
}
|
|
52
|
+
return out;
|
|
53
|
+
}
|
|
54
|
+
/** A fraction as ffprobe prints one, `30000/1001`, as a number. */
|
|
55
|
+
function rateOf(fraction) {
|
|
56
|
+
const [num, den = "1"] = fraction.split("/");
|
|
57
|
+
return Number(num) / Number(den);
|
|
58
|
+
}
|
|
35
59
|
/**
|
|
36
60
|
* The `xfade` chain. Each transition's `offset` is measured from the start of
|
|
37
61
|
* everything accumulated so far, and every crossfade shortens the total by its
|
|
38
62
|
* own duration — which is the part that is easy to get wrong and shows up as
|
|
39
63
|
* a clip that starts before the previous one has finished.
|
|
64
|
+
*
|
|
65
|
+
* `xfade` joins streams of one frame rate and one timebase only, and clips
|
|
66
|
+
* need not share a rate: a 15 fps draft among 60 fps recordings, or a scene
|
|
67
|
+
* or a clip with an `fps` of its own. When the rates differ, every clip goes
|
|
68
|
+
* through `fps` at the highest of them first. The highest, so that no clip
|
|
69
|
+
* loses a frame: a slower clip's frames are each held as long as they were.
|
|
70
|
+
* Every clip, the fastest included, because `fps` sets the timebase as well,
|
|
71
|
+
* and a clip left alone would keep its own. When the rates agree, the filter
|
|
72
|
+
* is the one it always was.
|
|
40
73
|
*/
|
|
41
74
|
export function buildFilter(inputs) {
|
|
42
75
|
if (inputs.length === 1)
|
|
43
76
|
return { filter: "", label: "0:v", total: inputs[0].duration };
|
|
44
77
|
const parts = [];
|
|
45
|
-
|
|
78
|
+
const rates = inputs.map((input) => rateOf(input.frameRate));
|
|
79
|
+
const mixed = new Set(rates).size > 1;
|
|
80
|
+
if (mixed) {
|
|
81
|
+
const highest = inputs[rates.indexOf(Math.max(...rates))].frameRate;
|
|
82
|
+
inputs.forEach((_, i) => parts.push(`[${i}:v]fps=${highest}[f${i}]`));
|
|
83
|
+
}
|
|
84
|
+
const stream = (i) => (mixed ? `f${i}` : `${i}:v`);
|
|
85
|
+
let current = stream(0);
|
|
46
86
|
let accumulated = inputs[0].duration;
|
|
47
87
|
for (let i = 1; i < inputs.length; i += 1) {
|
|
48
88
|
const offset = accumulated - TRANSITION_S;
|
|
49
89
|
const label = i === inputs.length - 1 ? "out" : `x${i}`;
|
|
50
|
-
parts.push(`[${current}][${i}
|
|
90
|
+
parts.push(`[${current}][${stream(i)}]xfade=transition=fade:duration=${TRANSITION_S}:offset=${offset.toFixed(3)}[${label}]`);
|
|
51
91
|
current = label;
|
|
52
92
|
accumulated += inputs[i].duration - TRANSITION_S;
|
|
53
93
|
}
|
|
@@ -62,14 +102,25 @@ export async function buildSequence(ids, outDir) {
|
|
|
62
102
|
missing.push(id);
|
|
63
103
|
continue;
|
|
64
104
|
}
|
|
65
|
-
inputs.push({
|
|
105
|
+
inputs.push({
|
|
106
|
+
id,
|
|
107
|
+
path,
|
|
108
|
+
duration: probeDuration(path),
|
|
109
|
+
frameRate: probeFrameRate(path),
|
|
110
|
+
});
|
|
66
111
|
}
|
|
67
112
|
if (inputs.length < 2) {
|
|
68
113
|
throw new Error(`Need at least two rendered clips to build a sequence; have ${inputs.length}.`);
|
|
69
114
|
}
|
|
70
115
|
const { filter, label, total } = buildFilter(inputs);
|
|
71
116
|
const out = join(outDir, "sequence.mp4");
|
|
72
|
-
|
|
117
|
+
// Made beside the film and moved over it once ffmpeg has finished. ffmpeg
|
|
118
|
+
// opens its output before it finds out whether it can join the clips, and
|
|
119
|
+
// a sequence written straight to sequence.mp4 that failed left it empty,
|
|
120
|
+
// whatever film had been there. `.mp4` last: ffmpeg picks the muxer by it.
|
|
121
|
+
const partial = join(outDir, "sequence.partial.mp4");
|
|
122
|
+
let stderr = "";
|
|
123
|
+
const code = await new Promise((resolve) => {
|
|
73
124
|
const child = spawn(ffmpegPath(), [
|
|
74
125
|
"-y",
|
|
75
126
|
...inputs.flatMap((input) => ["-i", input.path]),
|
|
@@ -87,19 +138,22 @@ export async function buildSequence(ids, outDir) {
|
|
|
87
138
|
"yuv420p",
|
|
88
139
|
"-movflags",
|
|
89
140
|
"+faststart",
|
|
90
|
-
|
|
141
|
+
partial,
|
|
91
142
|
], { stdio: ["ignore", "ignore", "pipe"] });
|
|
92
|
-
let stderr = "";
|
|
93
143
|
child.stderr.on("data", (c) => {
|
|
94
144
|
stderr += c.toString();
|
|
95
145
|
});
|
|
96
|
-
child.on("close",
|
|
97
|
-
if (code === 0)
|
|
98
|
-
resolve();
|
|
99
|
-
else
|
|
100
|
-
reject(new Error(`sequence failed:\n${stderr.slice(-1200)}`));
|
|
101
|
-
});
|
|
146
|
+
child.on("close", resolve);
|
|
102
147
|
});
|
|
148
|
+
if (code !== 0) {
|
|
149
|
+
rmSync(partial, { force: true });
|
|
150
|
+
// The film still there is not this sequence, and could pass for it.
|
|
151
|
+
const kept = existsSync(out)
|
|
152
|
+
? `\n${out} is from an earlier run, left as it was.`
|
|
153
|
+
: "";
|
|
154
|
+
throw new Error(`sequence failed:\n${stderr.slice(-1200)}${kept}`);
|
|
155
|
+
}
|
|
156
|
+
renameSync(partial, out);
|
|
103
157
|
return { path: out, total, used: inputs.map((i) => i.id), missing };
|
|
104
158
|
}
|
|
105
159
|
//# sourceMappingURL=sequence.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequence.js","sourceRoot":"","sources":["../../src/render/sequence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"sequence.js","sourceRoot":"","sources":["../../src/render/sequence.ts"],"names":[],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AAS,EAAE,EAAE;YACpC,MAAM,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;QACf,MAAM,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACjC,oEAAoE;QACpE,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC;YAC1B,CAAC,CAAC,KAAK,GAAG,0CAA0C;YACpD,CAAC,CAAC,EAAE,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,qBAAqB,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;IACrE,CAAC;IACD,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAEzB,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;AACtE,CAAC"}
|
package/dist/review/review.js
CHANGED
|
@@ -61,7 +61,7 @@ function checkBeats(timeline, beats) {
|
|
|
61
61
|
detail: missing.length === 0
|
|
62
62
|
? `${beats.length} beats, each with a mark`
|
|
63
63
|
: `no settle labelled ${missing.map((b) => `"${b.label}"`).join(", ")}` +
|
|
64
|
-
`
|
|
64
|
+
` (the clip has ${[...labels].map((l) => `"${l}"`).join(", ") || "none"})`,
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
@@ -113,9 +113,13 @@ function checkRendered(timeline) {
|
|
|
113
113
|
const lastFrame = timeline.durationFrames - 1;
|
|
114
114
|
const late = (t) => frameAt(t, timeline.fps) > lastFrame;
|
|
115
115
|
const unseen = [];
|
|
116
|
-
for
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
// Once for the camera, at its last key. A camera that follows the cursor
|
|
117
|
+
// or blends between moves has a key a frame, and one still under way at
|
|
118
|
+
// the end left dozens past it: one line saying where the camera would have
|
|
119
|
+
// stopped says everything they do.
|
|
120
|
+
const lastKey = timeline.camera[timeline.camera.length - 1];
|
|
121
|
+
if (lastKey && late(lastKey.t)) {
|
|
122
|
+
unseen.push(`a camera key at ${seconds(lastKey.t)}`);
|
|
119
123
|
}
|
|
120
124
|
for (const highlight of timeline.highlights) {
|
|
121
125
|
if (late(highlight.t0)) {
|
|
@@ -138,7 +142,7 @@ function checkRendered(timeline) {
|
|
|
138
142
|
check: "rendered",
|
|
139
143
|
pass: false,
|
|
140
144
|
warning: true,
|
|
141
|
-
detail: `${unseen.join(", ")}
|
|
145
|
+
detail: `${unseen.join(", ")}: the clip ends at frame ${lastFrame} ` +
|
|
142
146
|
`(${seconds(timeline.durationFrames / timeline.fps)}), so nothing renders them. ` +
|
|
143
147
|
"A track write costs no time; give it a `hold` to be seen in.",
|
|
144
148
|
};
|
|
@@ -154,14 +158,21 @@ function checkRendered(timeline) {
|
|
|
154
158
|
* not `review`, which had no clause for it, and not the video, which simply
|
|
155
159
|
* lacks the ring it was supposed to end on.
|
|
156
160
|
*
|
|
161
|
+
* A click is the other thing a clip points at. The ripple is drawn where the
|
|
162
|
+
* cursor was, and a click the camera is framing something else for is a
|
|
163
|
+
* ripple drawn off the edge of the frame: the button changes, and nobody saw
|
|
164
|
+
* it pressed. A camera that follows the cursor promises this never happens,
|
|
165
|
+
* and this is where that promise is checked, for every other camera too.
|
|
166
|
+
*
|
|
157
167
|
* A warning rather than a failure: the camera can legitimately be somewhere
|
|
158
168
|
* else entirely by the time a highlight runs, and only the renderer knows for
|
|
159
|
-
* certain. But a highlight wholly outside the
|
|
160
|
-
* mistake, and it is invisible in every other way.
|
|
169
|
+
* certain. But a highlight or a click wholly outside the frame is almost
|
|
170
|
+
* always a mistake, and it is invisible in every other way.
|
|
161
171
|
*/
|
|
162
172
|
function checkOnScreen(timeline) {
|
|
163
173
|
const { width, height } = timeline.viewport;
|
|
164
174
|
const full = { x: 0, y: 0, w: width, h: height };
|
|
175
|
+
const cameraAt = (t) => timeline.camera.length > 0 ? evalCamera(timeline.camera, t) : full;
|
|
165
176
|
// Against the camera, not the viewport.
|
|
166
177
|
//
|
|
167
178
|
// The first version of this clause compared a highlight to the whole page,
|
|
@@ -175,32 +186,46 @@ function checkOnScreen(timeline) {
|
|
|
175
186
|
// Sampled at both ends of the highlight because the camera can be moving
|
|
176
187
|
// through it: a ring that starts cropped and ends visible is still a ring
|
|
177
188
|
// someone can read.
|
|
178
|
-
const visible = (h) =>
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
return rects.some((r) => h.rect.x + h.rect.w > r.x &&
|
|
183
|
-
h.rect.y + h.rect.h > r.y &&
|
|
184
|
-
h.rect.x < r.x + r.w &&
|
|
185
|
-
h.rect.y < r.y + r.h);
|
|
186
|
-
};
|
|
189
|
+
const visible = (h) => [cameraAt(h.t0), cameraAt(h.t1)].some((r) => h.rect.x + h.rect.w > r.x &&
|
|
190
|
+
h.rect.y + h.rect.h > r.y &&
|
|
191
|
+
h.rect.x < r.x + r.w &&
|
|
192
|
+
h.rect.y < r.y + r.h);
|
|
187
193
|
const offscreen = timeline.highlights.filter((h) => !visible(h));
|
|
188
|
-
|
|
194
|
+
// A click, at the moment the button goes down.
|
|
195
|
+
const presses = timeline.pointer.filter((p) => p.kind === "down");
|
|
196
|
+
const unseen = presses.filter((p) => {
|
|
197
|
+
const r = cameraAt(p.t);
|
|
198
|
+
const [x, y] = p.at;
|
|
199
|
+
return x < r.x || x > r.x + r.w || y < r.y || y > r.y + r.h;
|
|
200
|
+
});
|
|
201
|
+
if (offscreen.length === 0 && unseen.length === 0) {
|
|
189
202
|
return {
|
|
190
203
|
check: "onscreen",
|
|
191
204
|
pass: true,
|
|
192
|
-
detail: `${timeline.highlights.length} highlight(s)
|
|
205
|
+
detail: `${timeline.highlights.length} highlight(s) and ${presses.length} ` +
|
|
206
|
+
"click(s), all inside what the camera shows",
|
|
193
207
|
};
|
|
194
208
|
}
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
|
|
209
|
+
const found = [];
|
|
210
|
+
if (offscreen.length > 0) {
|
|
211
|
+
const where = offscreen
|
|
212
|
+
.map((h) => `y ${Math.round(h.rect.y)}–${Math.round(h.rect.y + h.rect.h)}`)
|
|
213
|
+
.join(", ");
|
|
214
|
+
found.push(`${offscreen.length} highlight(s) outside what the camera is showing ` +
|
|
215
|
+
`(${where}), so no frame can show them`);
|
|
216
|
+
}
|
|
217
|
+
if (unseen.length > 0) {
|
|
218
|
+
const where = unseen
|
|
219
|
+
.map((p) => `at ${seconds(p.t)} on (${Math.round(p.at[0])}, ${Math.round(p.at[1])})`)
|
|
220
|
+
.join(", ");
|
|
221
|
+
found.push(`${unseen.length} click(s) outside what the camera is showing (${where}), ` +
|
|
222
|
+
"so no frame shows the press");
|
|
223
|
+
}
|
|
198
224
|
return {
|
|
199
225
|
check: "onscreen",
|
|
200
226
|
pass: false,
|
|
201
227
|
warning: true,
|
|
202
|
-
detail:
|
|
203
|
-
`(${where}) — drawn where no frame can show them`,
|
|
228
|
+
detail: found.join("; "),
|
|
204
229
|
};
|
|
205
230
|
}
|
|
206
231
|
export function reviewRecording(input) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review.js","sourceRoot":"","sources":["../../src/review/review.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C;;;;;;;;;;;GAWG;AAEH,gFAAgF;AAChF,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC;AAkChE,MAAM,OAAO,GAAG,CAAC,KAAa,E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