reframe-video 0.6.12 → 0.6.14
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/dist/bin.js +38 -7
- package/dist/browserEntry.js +3 -2
- package/dist/cli.js +3 -2
- package/dist/diff.js +1189 -0
- package/dist/index.js +4 -2
- package/dist/labels.js +3 -2
- package/dist/types/ir.d.ts +3 -0
- package/guides/directing-guide.md +101 -0
- package/guides/edsl-guide.md +6 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -10,13 +10,14 @@ var __export = (target, all) => {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
// ../core/src/ir.ts
|
|
13
|
-
var DEFAULT_TO_DURATION, DEFAULT_TWEEN_DURATION, DEFAULT_MOTIONPATH_DURATION;
|
|
13
|
+
var DEFAULT_TO_DURATION, DEFAULT_TWEEN_DURATION, DEFAULT_MOTIONPATH_DURATION, DEFAULT_STILL_DURATION;
|
|
14
14
|
var init_ir = __esm({
|
|
15
15
|
"../core/src/ir.ts"() {
|
|
16
16
|
"use strict";
|
|
17
17
|
DEFAULT_TO_DURATION = 0.5;
|
|
18
18
|
DEFAULT_TWEEN_DURATION = 0.5;
|
|
19
19
|
DEFAULT_MOTIONPATH_DURATION = 1;
|
|
20
|
+
DEFAULT_STILL_DURATION = 1;
|
|
20
21
|
}
|
|
21
22
|
});
|
|
22
23
|
|
|
@@ -319,14 +320,14 @@ function compileScene(ir) {
|
|
|
319
320
|
}
|
|
320
321
|
}
|
|
321
322
|
};
|
|
322
|
-
const inferredEnd = ir.timeline ? walk(ir.timeline, 0) : 0;
|
|
323
|
+
const inferredEnd = (ir.timeline ? walk(ir.timeline, 0) : 0) || 0;
|
|
323
324
|
for (const list of segments.values()) list.sort((a, b) => a.t0 - b.t0);
|
|
324
325
|
for (const list of motionPaths.values()) list.sort((a, b) => a.t0 - b.t0);
|
|
325
326
|
const hasCamera = !cameraIsNode && (ir.camera !== void 0 || motionPaths.has("camera") || [...segments.keys()].some((k) => k.startsWith("camera.")));
|
|
326
327
|
const hasPerspective = !cameraIsNode && (ir.camera?.perspective !== void 0 || segments.has("camera.perspective"));
|
|
327
328
|
return {
|
|
328
329
|
ir,
|
|
329
|
-
duration: ir.duration ?? inferredEnd,
|
|
330
|
+
duration: ir.duration ?? (inferredEnd > 0 ? inferredEnd : DEFAULT_STILL_DURATION),
|
|
330
331
|
segments,
|
|
331
332
|
motionPaths,
|
|
332
333
|
initialValues,
|
|
@@ -2706,6 +2707,7 @@ var ROOT2 = PACKAGED ? resolve6(HERE2, "..") : resolve6(HERE2, "..", "..", "..")
|
|
|
2706
2707
|
var USER_CWD = process.env.INIT_CWD ?? process.cwd();
|
|
2707
2708
|
var RENDER_CLI = PACKAGED ? join9(ROOT2, "dist", "cli.js") : join9(ROOT2, "packages", "render-cli", "src", "cli.ts");
|
|
2708
2709
|
var LABELS = PACKAGED ? join9(ROOT2, "dist", "labels.js") : join9(ROOT2, "packages", "render-cli", "src", "labels.ts");
|
|
2710
|
+
var DIFF = PACKAGED ? join9(ROOT2, "dist", "diff.js") : join9(ROOT2, "packages", "render-cli", "src", "diff.ts");
|
|
2709
2711
|
var PLAYER = PACKAGED ? join9(ROOT2, "dist", "player.js") : join9(ROOT2, "packages", "render-cli", "src", "player.ts");
|
|
2710
2712
|
var ANALYZE = PACKAGED ? join9(ROOT2, "dist", "analyze.js") : join9(ROOT2, "benchmark", "harness", "motion", "analyze.ts");
|
|
2711
2713
|
var TRACE = PACKAGED ? join9(ROOT2, "dist", "trace-cli.js") : join9(ROOT2, "benchmark", "harness", "motion", "trace-cli.ts");
|
|
@@ -2725,7 +2727,8 @@ usage:
|
|
|
2725
2727
|
${CMD} labels <scene.ts|.json> print the event clock (label \u2192 exact seconds; for sound design / timing)
|
|
2726
2728
|
${CMD} motion <mp4|framesDir> motion-profile a rendered clip
|
|
2727
2729
|
${CMD} trace <ref.mp4> [--apply scene.ts] extract a video's motion structure \u2192 MotionSketch / timeline
|
|
2728
|
-
${CMD}
|
|
2730
|
+
${CMD} diff <ref-image> [<scene.ts>] [--t S] [--mode side|blend|diff|grid] compare/measure a render against a reference image
|
|
2731
|
+
${CMD} guide [--regen|--directing] print a guide (--regen: stable-address contract; --directing: high-end workflow)
|
|
2729
2732
|
${CMD} demo run the edit-survival demo (3 mp4s into out/)
|
|
2730
2733
|
`;
|
|
2731
2734
|
var userPath = (p) => isAbsolute5(p) ? p : resolve6(USER_CWD, p);
|
|
@@ -2841,10 +2844,16 @@ ${USAGE}`);
|
|
|
2841
2844
|
}
|
|
2842
2845
|
preflightFfmpeg();
|
|
2843
2846
|
const outBase = PACKAGED ? join9(USER_CWD, "out") : join9(ROOT2, "out");
|
|
2847
|
+
const stem = `${basename(input).replace(/\.[^.]+$/, "")}.mp4`;
|
|
2844
2848
|
let outArgs = args;
|
|
2845
|
-
|
|
2849
|
+
const oIdx = args.indexOf("-o");
|
|
2850
|
+
if (oIdx === -1) {
|
|
2846
2851
|
await mkdir4(outBase, { recursive: true });
|
|
2847
|
-
outArgs = [...args, "-o", join9(outBase,
|
|
2852
|
+
outArgs = [...args, "-o", join9(outBase, stem)];
|
|
2853
|
+
} else if (args[oIdx + 1] && !args[oIdx + 1].startsWith("-") && !/\.\w{2,4}$/.test(args[oIdx + 1])) {
|
|
2854
|
+
const dir = userPath(args[oIdx + 1]);
|
|
2855
|
+
await mkdir4(dir, { recursive: true });
|
|
2856
|
+
outArgs = args.map((a, i) => i === oIdx + 1 ? join9(dir, stem) : a);
|
|
2848
2857
|
}
|
|
2849
2858
|
outArgs = outArgs.map(
|
|
2850
2859
|
(a, i) => outArgs[i - 1] === "--overlay" || outArgs[i - 1] === "-o" ? userPath(a) : a
|
|
@@ -3024,8 +3033,30 @@ ${results.length - failed} rendered (${orphaned} with orphans), ${failed} failed
|
|
|
3024
3033
|
await (PACKAGED ? run2(process.execPath, [TRACE, userPath(input), ...args]) : run2("npx", ["tsx", TRACE, userPath(input), ...args]))
|
|
3025
3034
|
);
|
|
3026
3035
|
}
|
|
3036
|
+
case "diff": {
|
|
3037
|
+
const input = rest[0];
|
|
3038
|
+
if (!input || input.startsWith("-")) {
|
|
3039
|
+
fail(`usage: ${CMD} diff <ref-image> [<scene.ts>] [--t <sec>] [--mode side|blend|diff|grid] [-o out.png]`);
|
|
3040
|
+
}
|
|
3041
|
+
let seenScene = false;
|
|
3042
|
+
const args = rest.map((a, i) => {
|
|
3043
|
+
if (i === 0) return userPath(a);
|
|
3044
|
+
if (rest[i - 1] === "-o") return userPath(a);
|
|
3045
|
+
if (!a.startsWith("-") && rest[i - 1] !== "--t" && rest[i - 1] !== "--mode" && !seenScene) {
|
|
3046
|
+
seenScene = true;
|
|
3047
|
+
return userPath(a);
|
|
3048
|
+
}
|
|
3049
|
+
return a;
|
|
3050
|
+
});
|
|
3051
|
+
process.exit(
|
|
3052
|
+
await (PACKAGED ? run2(process.execPath, [DIFF, ...args]) : run2("npx", ["tsx", DIFF, ...args]))
|
|
3053
|
+
);
|
|
3054
|
+
}
|
|
3027
3055
|
case "guide": {
|
|
3028
|
-
const
|
|
3056
|
+
const which = rest.includes("--regen") ? "regen" : rest.includes("--directing") ? "directing" : "edsl";
|
|
3057
|
+
const repoFile = { regen: join9(ROOT2, "docs", "regen-contract.md"), directing: join9(ROOT2, "benchmark", "guides", "directing-guide.md"), edsl: join9(ROOT2, "benchmark", "guides", "edsl-guide.md") };
|
|
3058
|
+
const pkgFile = { regen: join9(ROOT2, "guides", "regen-contract.md"), directing: join9(ROOT2, "guides", "directing-guide.md"), edsl: join9(ROOT2, "guides", "edsl-guide.md") };
|
|
3059
|
+
const file = (PACKAGED ? pkgFile : repoFile)[which];
|
|
3029
3060
|
const { readFile: readFile7 } = await import("node:fs/promises");
|
|
3030
3061
|
process.stdout.write(await readFile7(file, "utf8"));
|
|
3031
3062
|
return;
|
package/dist/browserEntry.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
var DEFAULT_TO_DURATION = 0.5;
|
|
5
5
|
var DEFAULT_TWEEN_DURATION = 0.5;
|
|
6
6
|
var DEFAULT_MOTIONPATH_DURATION = 1;
|
|
7
|
+
var DEFAULT_STILL_DURATION = 1;
|
|
7
8
|
|
|
8
9
|
// ../core/src/path.ts
|
|
9
10
|
function pathBBox(d) {
|
|
@@ -316,14 +317,14 @@
|
|
|
316
317
|
}
|
|
317
318
|
}
|
|
318
319
|
};
|
|
319
|
-
const inferredEnd = ir.timeline ? walk(ir.timeline, 0) : 0;
|
|
320
|
+
const inferredEnd = (ir.timeline ? walk(ir.timeline, 0) : 0) || 0;
|
|
320
321
|
for (const list of segments.values()) list.sort((a, b) => a.t0 - b.t0);
|
|
321
322
|
for (const list of motionPaths.values()) list.sort((a, b) => a.t0 - b.t0);
|
|
322
323
|
const hasCamera = !cameraIsNode && (ir.camera !== void 0 || motionPaths.has("camera") || [...segments.keys()].some((k) => k.startsWith("camera.")));
|
|
323
324
|
const hasPerspective = !cameraIsNode && (ir.camera?.perspective !== void 0 || segments.has("camera.perspective"));
|
|
324
325
|
return {
|
|
325
326
|
ir,
|
|
326
|
-
duration: ir.duration ?? inferredEnd,
|
|
327
|
+
duration: ir.duration ?? (inferredEnd > 0 ? inferredEnd : DEFAULT_STILL_DURATION),
|
|
327
328
|
segments,
|
|
328
329
|
motionPaths,
|
|
329
330
|
initialValues,
|
package/dist/cli.js
CHANGED
|
@@ -10,6 +10,7 @@ var DEFAULT_CROSSFADE = 0.5;
|
|
|
10
10
|
var DEFAULT_TO_DURATION = 0.5;
|
|
11
11
|
var DEFAULT_TWEEN_DURATION = 0.5;
|
|
12
12
|
var DEFAULT_MOTIONPATH_DURATION = 1;
|
|
13
|
+
var DEFAULT_STILL_DURATION = 1;
|
|
13
14
|
|
|
14
15
|
// ../core/src/path.ts
|
|
15
16
|
function locate(segCount, u) {
|
|
@@ -306,14 +307,14 @@ function compileScene(ir) {
|
|
|
306
307
|
}
|
|
307
308
|
}
|
|
308
309
|
};
|
|
309
|
-
const inferredEnd = ir.timeline ? walk(ir.timeline, 0) : 0;
|
|
310
|
+
const inferredEnd = (ir.timeline ? walk(ir.timeline, 0) : 0) || 0;
|
|
310
311
|
for (const list of segments.values()) list.sort((a, b) => a.t0 - b.t0);
|
|
311
312
|
for (const list of motionPaths.values()) list.sort((a, b) => a.t0 - b.t0);
|
|
312
313
|
const hasCamera = !cameraIsNode && (ir.camera !== void 0 || motionPaths.has("camera") || [...segments.keys()].some((k) => k.startsWith("camera.")));
|
|
313
314
|
const hasPerspective = !cameraIsNode && (ir.camera?.perspective !== void 0 || segments.has("camera.perspective"));
|
|
314
315
|
return {
|
|
315
316
|
ir,
|
|
316
|
-
duration: ir.duration ?? inferredEnd,
|
|
317
|
+
duration: ir.duration ?? (inferredEnd > 0 ? inferredEnd : DEFAULT_STILL_DURATION),
|
|
317
318
|
segments,
|
|
318
319
|
motionPaths,
|
|
319
320
|
initialValues,
|