@aicopycoders/exodus 2026.11.1200-beta.24 → 2026.11.1200-beta.25
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/assets/skills/exodus-video/SKILL.md +8 -4
- package/assets/skills/exodus-video/scripts/first-cut.d.mts +40 -0
- package/assets/skills/exodus-video/scripts/first-cut.mjs +470 -52
- package/dist/commands/video-customer.d.ts +4 -0
- package/dist/commands/video-customer.js +1 -1
- package/package.json +1 -1
|
@@ -1032,10 +1032,14 @@ say yes. If the price changed by then, the start refuses and says the new
|
|
|
1032
1032
|
price: show that and ask again. An older CLI is told to update first. An
|
|
1033
1033
|
admin's start begins at once, as before.
|
|
1034
1034
|
|
|
1035
|
-
**A video that
|
|
1036
|
-
the estimate it showed before the start.
|
|
1037
|
-
|
|
1038
|
-
|
|
1035
|
+
**A video that needs the member's OK to spend more.** A regular video (not
|
|
1036
|
+
One-take) keeps the estimate it showed before the start. A scene's first take
|
|
1037
|
+
does not stop to ask, even past it; when any other take would take the video's cost
|
|
1038
|
+
past it, the video stops before ordering that take and waits for the member,
|
|
1039
|
+
often while its cost so far is still under the estimate. At the storyboard,
|
|
1040
|
+
`exodus video status` says the storyboard's own estimate when it differs from
|
|
1041
|
+
the one the member started with. When the video waits, `exodus video status`
|
|
1042
|
+
prints a line that starts "Waiting for you:", with what
|
|
1039
1043
|
the video has cost so far, its estimate, what it wants to film next and
|
|
1040
1044
|
about what that costs, and under it two commands: `exodus video keep-going
|
|
1041
1045
|
<runId>` and `exodus video stop-here <runId>`. That choice is the member's,
|
|
@@ -337,6 +337,18 @@ export interface CutPace {
|
|
|
337
337
|
loudness?: { lufs: number; truePeak: number; passes: 1 | 2; limited?: true; limitedAgain?: number; limit?: number };
|
|
338
338
|
/** Present only with cutChecks. */
|
|
339
339
|
checks?: CutChecks;
|
|
340
|
+
/**
|
|
341
|
+
* #4805, written by the worker (scout cut-additions.ts): the sheet's additions the film was made again without,
|
|
342
|
+
* because its last check found a fault at one of them.
|
|
343
|
+
*/
|
|
344
|
+
remadeWithout?: Array<"addedCuts" | "pauseTrim" | "roomSound">;
|
|
345
|
+
/**
|
|
346
|
+
* #4805, written by the worker: a fault at one of the sheet's additions that making the film again without them did
|
|
347
|
+
* not fix; the film waits for its member, and `sentence` says why.
|
|
348
|
+
*/
|
|
349
|
+
finishHold?: { sentence: string; additions: Array<"addedCuts" | "pauseTrim" | "roomSound"> };
|
|
350
|
+
/** #4805, written by the worker: the sentence the member reads of either (convex customerRunView.ts cutCheckNotes). */
|
|
351
|
+
additionsNote?: string;
|
|
340
352
|
/** COP-300: present when a sped-up cut burned its captions: the caption file is on the finished cut's clock. */
|
|
341
353
|
captionClock?: "final";
|
|
342
354
|
/**
|
|
@@ -371,6 +383,20 @@ export interface CutSync {
|
|
|
371
383
|
heard: Array<{ text: string; start: number; end: number; lagMs: number; match: number }>;
|
|
372
384
|
}
|
|
373
385
|
|
|
386
|
+
/** COP-357, fps30: the frame rate a film with the phone look is delivered at, by repeated frames. */
|
|
387
|
+
export const DELIVERY_FPS: number;
|
|
388
|
+
|
|
389
|
+
/** The bars checkVerdict holds a finished cut to. */
|
|
390
|
+
export const CHECK_BARS: {
|
|
391
|
+
voiceOverBedDb: number;
|
|
392
|
+
minBrollSec: number;
|
|
393
|
+
truePeak: number;
|
|
394
|
+
lufs: number;
|
|
395
|
+
blipSec: number;
|
|
396
|
+
freezeSec: number;
|
|
397
|
+
freezeYavg: number;
|
|
398
|
+
};
|
|
399
|
+
|
|
374
400
|
/** What cutChecks measured on the finished cut, and what fails its bars. */
|
|
375
401
|
export interface CutChecks {
|
|
376
402
|
/** Caption screens holding words of two script lines, in the cut's time before any speed-up; null when no captions were burned. */
|
|
@@ -511,6 +537,12 @@ export interface FirstCut {
|
|
|
511
537
|
pace?: CutPace;
|
|
512
538
|
/** COP-300: present only with captionCheck. */
|
|
513
539
|
sync?: CutSync;
|
|
540
|
+
/**
|
|
541
|
+
* COP-357, fix A: present only when a picture pass of the phone look was laid and the takes were read before it: their
|
|
542
|
+
* frozen runs (freezedetect at -60 dB from 0.2 s), on the finished film's clock, less what a cutaway or the end card
|
|
543
|
+
* covers. The worker joins them at the cut's framing changes, drops those under 2 s, and adds them to the film's own.
|
|
544
|
+
*/
|
|
545
|
+
lookFreeze?: Array<{ start: number; end: number; duration: number }>;
|
|
514
546
|
/** The cut's words on the finished film's clock, as written beside it. */
|
|
515
547
|
rows?: Array<{ text: string; start: number; end: number; scene?: number }>;
|
|
516
548
|
/** Present only when the manifest names sounds, beds, a ducked music bed or a music-only master. */
|
|
@@ -522,6 +554,11 @@ export interface FirstCut {
|
|
|
522
554
|
* present only with the cuts row on. The worker's last guard joins a freeze that one splits (auto-cut.ts withFramingJoins).
|
|
523
555
|
*/
|
|
524
556
|
framingChangesSec?: number[];
|
|
557
|
+
/**
|
|
558
|
+
* #4805, pauseTrim: where a pause cut at one of Luke's levels joins a take to itself, in seconds on the delivered
|
|
559
|
+
* film's clock; present only with a pause level picked.
|
|
560
|
+
*/
|
|
561
|
+
pauseJoinsSec?: number[];
|
|
525
562
|
/** Present only when the manifest asked for the measured map.
|
|
526
563
|
* Authored picture time is reserved once per take; only its final split piece
|
|
527
564
|
* may extend, so earlier pieces never replay the resumed piece's source audio.
|
|
@@ -629,5 +666,8 @@ export function sentenceGapCuts(
|
|
|
629
666
|
/** jumpCut: a pause over maxGap between two heard words keeps keepAfter after the earlier word and keepBefore before the later. */
|
|
630
667
|
export interface JumpCut { maxGap: number; keepAfter: number; keepBefore: number }
|
|
631
668
|
export const JUMP_CUT: JumpCut;
|
|
669
|
+
|
|
670
|
+
/** COP-357, fix A: how the cut reads the takes before the phone look (freezedetect's noise and length) and its side files. */
|
|
671
|
+
export const LOOK_PROBE: { readonly noise: string; readonly minSec: number; readonly freeze: string; readonly motion: string };
|
|
632
672
|
/** jumpCut on one pause: the span it takes out, or null when it keeps the pause whole. */
|
|
633
673
|
export function jumpCutSpan(endSec: number, startSec: number, jump?: JumpCut): { s: number; e: number } | null;
|
|
@@ -288,6 +288,205 @@ function wholeLinesOf(raw) {
|
|
|
288
288
|
return ids.length > 0 ? { wholeLines: ids } : {};
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
+
/**
|
|
292
|
+
* COP-357, the phone look: a run's saved sheet ("Ultra realism"), written by the worker as three settings, each read only when
|
|
293
|
+
* true, on a cut of its own clock (not a template launch's, not one laid on its measured map).
|
|
294
|
+
* - fps30: the finished file runs at DELIVERY_FPS. The last step of the picture, after the words are burned in, repeats
|
|
295
|
+
* one frame in four (the fps filter), so the cut's own clock (FPS), its edges, its speed step, its captions and its
|
|
296
|
+
* sound stay as they are.
|
|
297
|
+
* - lensSmudge: LENS_SMUDGE, a soft haze of the picture itself laid back over it near one top corner, the brighter
|
|
298
|
+
* one about 1.0 s into the joined takes (brighterSide).
|
|
299
|
+
* - phonePass: PHONE_PASS, grain that changes every frame, softer colour, a light halo and a slow drift of the
|
|
300
|
+
* exposure. No shake.
|
|
301
|
+
* Both picture passes run on the joined takes, before any cutaway, picture, end card or burned word is laid over them,
|
|
302
|
+
* so those stay sharp. The numbers are Luke's, from his free realism test at its light strength and his locked smudge
|
|
303
|
+
* at half strength: tuned at 720x1280, the smudge's places and sizes are scaled here to WIDTH x HEIGHT; his own 1080 run
|
|
304
|
+
* of the phone pass kept its numbers. A pass whose filters this ffmpeg lacks is left out, with a note.
|
|
305
|
+
* With either picture pass the takes are also read before the look, in the same render (LOOK_PROBE); a 30 fps film's
|
|
306
|
+
* motion is read back on FPS, and its caption check reads each caption on the frame the delivered file shows it on.
|
|
307
|
+
*/
|
|
308
|
+
export const DELIVERY_FPS = 30;
|
|
309
|
+
export const LENS_SMUDGE = {
|
|
310
|
+
/** Where the side is read: this far into the cut. */
|
|
311
|
+
readAtSec: 1,
|
|
312
|
+
/** The mask: its peak of 255 (half of full), its reach in pixels, how it stretches across and down, its falloff. */
|
|
313
|
+
strength: 117, radius: 900, stretch: [1.1, 0.9], power: 1.25,
|
|
314
|
+
/** The mask's centre on each side, in pixels of WIDTH x HEIGHT. */
|
|
315
|
+
centre: { left: [165, 570], right: [900, 450] },
|
|
316
|
+
/** The haze: the picture made this small, blurred round (sigma) and along a line (angle, radius), averaged, scaled up. */
|
|
317
|
+
haze: { width: 180, height: 320, sigma: 6.5, angle: 32, radius: 17 },
|
|
318
|
+
/** The haze softened before it is merged in. */
|
|
319
|
+
tone: { contrast: 0.8, brightness: 0.05, saturation: 0.9 },
|
|
320
|
+
};
|
|
321
|
+
export const PHONE_PASS = {
|
|
322
|
+
grain: { luma: 4, chroma: 2 },
|
|
323
|
+
chromaBlur: 0.8,
|
|
324
|
+
halo: { size: 5, amount: 0.35 },
|
|
325
|
+
/** The exposure's drift, as eq expressions of the time. */
|
|
326
|
+
brightness: "0.008*sin(2*PI*t*0.23+1)+0.004*sin(2*PI*t*0.71+2.4)",
|
|
327
|
+
gamma: "1+0.016*sin(2*PI*t*0.17)",
|
|
328
|
+
};
|
|
329
|
+
/** The filters each picture pass needs that a build of ffmpeg may leave out. */
|
|
330
|
+
export const LOOK_FILTERS = {
|
|
331
|
+
lensSmudge: ["gblur", "dblur", "blend", "eq", "geq", "maskedmerge"],
|
|
332
|
+
phonePass: ["gblur", "eq", "unsharp", "noise"],
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* COP-357, fix A: the look's exposure drift hides a frozen picture from both freeze checks (its grain from the worker's
|
|
337
|
+
* too): the worker's freezedetect compares each frame with the first of the freeze, the cut's motion read each frame with
|
|
338
|
+
* the one before, and the drift steps the picture a whole level at a time. So with either
|
|
339
|
+
* picture pass the joined takes are split before the look, in the same render, and a probe branch reads them as the
|
|
340
|
+
* two checks read a film: freezedetect at the worker's -60 dB (scout media-probe.ts FREEZE_NOISE) from 0.2 s, as the
|
|
341
|
+
* guard reads a film whose framing the cut changed (scout auto-cut.ts FRAMING_FREEZE_MIN_SEC: an added cut halves a
|
|
342
|
+
* held pause into pieces under 2 s), and the cut's motion rows, each into a side file in the folder (read, then taken
|
|
343
|
+
* away). The worker joins the runs that meet at a framing change and drops those under 2 s, as it does the film's own.
|
|
344
|
+
* Its times are the takes' clock, before the speed step.
|
|
345
|
+
*/
|
|
346
|
+
export const LOOK_PROBE = { noise: "-60dB", minSec: 0.2, freeze: "edit.lookfreeze.txt", motion: "edit.lookmotion.txt" };
|
|
347
|
+
/** The motion read of a picture: each frame's change from the one before, on a 90 px wide copy (motionArgs, LOOK_PROBE). */
|
|
348
|
+
const MOTION_READ = "scale=90:-2,tblend=all_mode=difference,signalstats,metadata=print:key=lavfi.signalstats.YAVG";
|
|
349
|
+
|
|
350
|
+
/** The probe branch's filters, from the takes' split to its sink. */
|
|
351
|
+
export function lookProbeFilter() {
|
|
352
|
+
return `freezedetect=n=${LOOK_PROBE.noise}:d=${LOOK_PROBE.minSec},metadata=print:file=${LOOK_PROBE.freeze},` +
|
|
353
|
+
`${MOTION_READ}:file=${LOOK_PROBE.motion},nullsink`;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/** freezedetect's hits in the probe's side file as runs, in its order; one still open at the end runs to `endSec`. */
|
|
357
|
+
export function lookFreezeRunsOf(text, endSec) {
|
|
358
|
+
const runs = [];
|
|
359
|
+
let open = null;
|
|
360
|
+
for (const line of String(text ?? "").split("\n")) {
|
|
361
|
+
// ffmpeg prints a time with %g ("4.16667e-05" for frame 0): the exponent and a sign are part of the number (COP-361).
|
|
362
|
+
const hit = line.match(/^lavfi\.freezedetect\.freeze_(start|end)=([-+]?[\d.]+(?:e[-+]?\d+)?)/i);
|
|
363
|
+
if (!hit) continue;
|
|
364
|
+
if (hit[1] === "start") open = Number(hit[2]);
|
|
365
|
+
else if (open !== null) {
|
|
366
|
+
runs.push([open, Number(hit[2])]);
|
|
367
|
+
open = null;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
if (open !== null && endSec > open) runs.push([open, endSec]);
|
|
371
|
+
return runs;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/** The span from `from` to `to` less each covered [a, b]: the pieces left. */
|
|
375
|
+
function uncovered(from, to, covered) {
|
|
376
|
+
let pieces = [[from, to]];
|
|
377
|
+
for (const [a, b] of covered) {
|
|
378
|
+
pieces = pieces.flatMap(([s, e]) => (b <= s || a >= e ? [[s, e]] : [[s, Math.min(e, a)], [Math.max(s, b), e]].filter(([x, y]) => y - x > 1e-9)));
|
|
379
|
+
}
|
|
380
|
+
return pieces;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* What the probe leaves out, on the takes' clock: what covers the whole frame, so the takes are not seen there (a
|
|
385
|
+
* cutaway, the end card). A product picture sits in its box with the takes around it, so it covers nothing.
|
|
386
|
+
*/
|
|
387
|
+
export function lookCovered({ cutaways = [], pictures: _pictures = [], endCard = null }) {
|
|
388
|
+
return [...cutaways.map((c) => [c.startSec, c.startSec + c.seconds]), ...(endCard ? [[endCard.in, endCard.out]] : [])];
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* The probe's two side files, read on the film's clock (divided by the speed), with what covers the whole frame left
|
|
393
|
+
* out (lookCovered): the freeze runs for the worker's guard, and the motion rows for the cut's freeze check (a covered
|
|
394
|
+
* row never counts as still), and how many frame changes it read of the takes' (`rowsRead` of `changes`). Null when
|
|
395
|
+
* either file cannot be read. Both files are taken away.
|
|
396
|
+
*/
|
|
397
|
+
function readLookProbe(here, { pictureSec, speed, covered }) {
|
|
398
|
+
let freezeText;
|
|
399
|
+
let motionText;
|
|
400
|
+
try {
|
|
401
|
+
freezeText = readFileSync(here(LOOK_PROBE.freeze), "utf8");
|
|
402
|
+
motionText = readFileSync(here(LOOK_PROBE.motion), "utf8");
|
|
403
|
+
} catch {
|
|
404
|
+
return null;
|
|
405
|
+
} finally {
|
|
406
|
+
rmSync(here(LOOK_PROBE.freeze), { force: true });
|
|
407
|
+
rmSync(here(LOOK_PROBE.motion), { force: true });
|
|
408
|
+
}
|
|
409
|
+
const freezes = lookFreezeRunsOf(freezeText, pictureSec)
|
|
410
|
+
.flatMap(([from, to]) => uncovered(from, to, covered))
|
|
411
|
+
.map(([from, to]) => ({ start: roundMs(from / speed), end: roundMs(to / speed), duration: roundMs(to / speed - from / speed) }));
|
|
412
|
+
const read = readMotion(motionText);
|
|
413
|
+
const rows = read.map((r) => ({ t: r.t / speed, y: covered.some(([a, b]) => r.t >= a && r.t < b) ? Infinity : r.y }));
|
|
414
|
+
return { freezes, rows, rowsRead: read.length, changes: Math.max(0, Math.round(pictureSec * FPS) - 1) };
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/** Two freeze runs of one hold, read on two clocks, can miss each other by less than a frame: one run within this. */
|
|
418
|
+
const FREEZE_JOIN_SEC = 1 / FPS;
|
|
419
|
+
|
|
420
|
+
/** Freeze runs ({ at, sec }) merged where they overlap or come within FREEZE_JOIN_SEC, in time order. */
|
|
421
|
+
export function mergedFreezes(runs) {
|
|
422
|
+
const out = [];
|
|
423
|
+
for (const run of [...runs].sort((a, b) => a.at - b.at)) {
|
|
424
|
+
const last = out.at(-1);
|
|
425
|
+
if (last && run.at <= last.at + last.sec + FREEZE_JOIN_SEC + 1e-9) last.sec = roundMs(Math.max(last.at + last.sec, run.at + run.sec) - last.at);
|
|
426
|
+
else out.push({ ...run });
|
|
427
|
+
}
|
|
428
|
+
return out;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* COP-357: when the cut's 24 fps frame that starts at `sec` is first seen in its file repeated to `fps` frames a second.
|
|
433
|
+
* The fps filter shows frame n first at frame floor(n x fps / 24 + 0.5) (rounding to nearest, its default).
|
|
434
|
+
*/
|
|
435
|
+
export function deliveredSeenSec(sec, fps) {
|
|
436
|
+
const n = Math.round(sec * FPS);
|
|
437
|
+
return Math.floor((n * fps) / FPS + 0.5) / fps;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/** lensSmudge's filters, from the picture labelled `input` to `output`, its mask centred on the `side` top corner. */
|
|
441
|
+
export function lensSmudgeFilters(input, side, output) {
|
|
442
|
+
const s = LENS_SMUDGE;
|
|
443
|
+
const [x, y] = s.centre[side];
|
|
444
|
+
const h = s.haze;
|
|
445
|
+
const t = s.tone;
|
|
446
|
+
return [
|
|
447
|
+
`[${input}]format=gbrp,split=3[lkpic][lkbase][lksmall]`,
|
|
448
|
+
`[lksmall]scale=${h.width}:${h.height},split[lksmall1][lksmall2]`,
|
|
449
|
+
`[lksmall1]gblur=sigma=${h.sigma}[lkround]`,
|
|
450
|
+
`[lksmall2]dblur=angle=${h.angle}:radius=${h.radius}[lkline]`,
|
|
451
|
+
`[lkround][lkline]blend=all_mode=average,scale=${WIDTH}:${HEIGHT}:flags=bilinear[lkhaze]`,
|
|
452
|
+
`[lkpic][lkhaze]blend=all_mode=screen:all_opacity=1,eq=contrast=${t.contrast}:brightness=${t.brightness}:saturation=${t.saturation},format=gbrp[lkhazed]`,
|
|
453
|
+
// One frame of mask, made once: maskedmerge holds an input's last frame to the end of the others (ffmpeg's framesync).
|
|
454
|
+
`nullsrc=s=${WIDTH}x${HEIGHT}:r=${FPS},format=gray,` +
|
|
455
|
+
`geq=lum=${s.strength}*pow(clip(1-hypot((X-${x})/${s.stretch[0]}\\,(Y-${y})/${s.stretch[1]})/${s.radius}\\,0\\,1)\\,${s.power}),` +
|
|
456
|
+
"trim=end_frame=1,format=gbrp[lkmask]",
|
|
457
|
+
`[lkbase][lkhazed][lkmask]maskedmerge,format=yuv420p[${output}]`,
|
|
458
|
+
];
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/** phonePass's filter chain. */
|
|
462
|
+
export function phonePassFilter() {
|
|
463
|
+
const p = PHONE_PASS;
|
|
464
|
+
const { size, amount } = p.halo;
|
|
465
|
+
return `gblur=sigma=${p.chromaBlur}:planes=6,unsharp=${size}:${size}:${amount}:${size}:${size}:0,` +
|
|
466
|
+
`noise=c0s=${p.grain.luma}:c0f=t+u:c1s=${p.grain.chroma}:c1f=t+u:c2s=${p.grain.chroma}:c2f=t+u,` +
|
|
467
|
+
`eq=brightness=${p.brightness}:gamma=${p.gamma}:eval=frame`;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* lensSmudge's side: the top corner that is brighter, "left" or "right", in one frame of `file` at `atSec`, made 2 by 3
|
|
472
|
+
* pixels of grey (each top pixel is one half of the frame's top third); null when the frame cannot be read.
|
|
473
|
+
*/
|
|
474
|
+
export function brighterSide(file, atSec) {
|
|
475
|
+
const res = spawnSync("ffmpeg", [
|
|
476
|
+
"-v", "error", "-ss", sec(atSec), "-i", file, "-frames:v", "1", "-vf", "scale=2:3:flags=area,format=gray", "-f", "rawvideo", "-",
|
|
477
|
+
], { maxBuffer: 1 << 16 });
|
|
478
|
+
const px = res.status === 0 && res.stdout?.length >= 2 ? res.stdout : null;
|
|
479
|
+
return px ? (px[0] > px[1] ? "left" : "right") : null;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/** The take and its time that the cut shows about `atSec` in (a still shows its picture from its start). */
|
|
483
|
+
function spineFrameAt(spine, atSec) {
|
|
484
|
+
const seg = spine.find((s) => s.startSec + s.seconds > atSec) ?? spine.at(-1);
|
|
485
|
+
if (!seg) return null;
|
|
486
|
+
const into = Math.max(0, Math.min(atSec - seg.startSec, seg.seconds));
|
|
487
|
+
return { file: seg.file, atSec: seg.source === "clip" ? (seg.inSec ?? 0) + into : 0 };
|
|
488
|
+
}
|
|
489
|
+
|
|
291
490
|
/** Plan 14's on/off cut checks, each read only with cutChecks; paceCheck also carries its numbers. */
|
|
292
491
|
const PLAN_14_CHECKS = ["floorCheck", "flashCheck", "levelStepCheck", "voFitCheck", "dashGapCheck", "nameCheck"];
|
|
293
492
|
const isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
@@ -343,6 +542,9 @@ export function finishingOf(manifest) {
|
|
|
343
542
|
// COP-355: a saved sheet's pause level and cuts added, each by its name; the lines no added cut falls inside with it.
|
|
344
543
|
...(nameIn(PAUSE_TRIMS, f.pauseTrim) ? { pauseTrim: f.pauseTrim } : {}),
|
|
345
544
|
...(nameIn(ADDED_CUTS, f.addedCuts) ? { addedCuts: f.addedCuts, ...wholeLinesOf(f.wholeLines) } : {}),
|
|
545
|
+
...(f.fps30 === true ? { fps30: true } : {}),
|
|
546
|
+
...(f.lensSmudge === true ? { lensSmudge: true } : {}),
|
|
547
|
+
...(f.phonePass === true ? { phonePass: true } : {}),
|
|
346
548
|
// COP-356: the card as a headline at the top (headlineCards), a name only the worker writes from a run's sheet.
|
|
347
549
|
...(on.cards && f.cardPlace === "top" ? { cardPlace: "top" } : {}),
|
|
348
550
|
};
|
|
@@ -1075,6 +1277,13 @@ const SETTLED_WINDOWS = 10;
|
|
|
1075
1277
|
* silence goes while a soft breath and room tone stay (scout trim.ts).
|
|
1076
1278
|
*/
|
|
1077
1279
|
const SOUND_OVER_FLOOR_DB = 25;
|
|
1280
|
+
/**
|
|
1281
|
+
* #4803 (a number of ours, for Daniel): reading a word's sound out past its listed edge at a pause level, a dip under
|
|
1282
|
+
* SOUND_DB this long or shorter is still the word (the hush before a "t", as in "eight").
|
|
1283
|
+
*/
|
|
1284
|
+
const PAUSE_EDGE_BRIDGE_SEC = 0.1;
|
|
1285
|
+
/** #4803 (a number of ours, for Daniel): a run past such a dip is the word's when it comes within this of the word's loudest. */
|
|
1286
|
+
const PAUSE_EDGE_WORD_DB = 12;
|
|
1078
1287
|
const FAINT_SOUND_DB = -45;
|
|
1079
1288
|
/** The directions that ask for a pause (scout clip-qc.ts PAUSE_DIRECTION, NO_PAUSE_DIRECTION, lineWrittenPause). */
|
|
1080
1289
|
const PAUSE_DIRECTION =
|
|
@@ -1139,28 +1348,24 @@ export function sentenceGapCuts(words, lines, levels = null, lineGap = null, jum
|
|
|
1139
1348
|
});
|
|
1140
1349
|
const aligned = alignScript(words ?? [], written);
|
|
1141
1350
|
if (!aligned) return [];
|
|
1142
|
-
const { expected, heardTokenOf, heardWordOf, spokenWords: spoken } = aligned;
|
|
1351
|
+
const { expected, heard: heardTokens, heardTokenOf, heardWordOf, spokenWords: spoken } = aligned;
|
|
1352
|
+
// COP-355 (#4803): at one of Luke's pause levels, a pause's cut reads where the words' sound really ends and starts.
|
|
1353
|
+
const level = PAUSE_LEVELS.has(jump) && levels ? jump : null;
|
|
1143
1354
|
const cuts = [];
|
|
1144
|
-
|
|
1145
|
-
if (heardTokenOf[t + 1] !== heardTokenOf[t] + 1) continue;
|
|
1146
|
-
const to = heardWordOf[t + 1];
|
|
1147
|
-
if (heardWordOf[t] === to) continue;
|
|
1148
|
-
// A joined script token keeps its first word's line and lead-in.
|
|
1149
|
-
const [a, b] = [pieces[expected.sourceIndex[t]], pieces[expected.sourceIndex[t + 1]]];
|
|
1150
|
-
const newLine = a.li !== b.li;
|
|
1151
|
-
// A name heard split in two (#2300) ends on its last heard word.
|
|
1152
|
-
const [earlier, later] = [words[spoken.findLast((w) => w < to)], words[to]];
|
|
1153
|
-
const sentenceBreak = newLine || SENTENCE_END.test(b.before) || heardSentenceEnd(earlier.w);
|
|
1355
|
+
const cutPause = (earlier, later, { sentenceBreak, newLine, nextLine }) => {
|
|
1154
1356
|
// Inside a sentence only jumpCut acts, and only on a pause over its longest.
|
|
1155
|
-
if (!sentenceBreak && !(jump && jumpCutSpan(earlier.e, later.s, jump)))
|
|
1156
|
-
if (WRITTEN_PAUSE.test(b.before) || lines[a.li].asksPause || lines[b.li].asksPause) continue;
|
|
1157
|
-
if (newLine && lines[a.li].cuesBeat) continue;
|
|
1357
|
+
if (!sentenceBreak && !(jump && jumpCutSpan(earlier.e, later.s, jump))) return;
|
|
1158
1358
|
const gap = later.s - earlier.e;
|
|
1159
1359
|
const heard = levels && soundBetween(levels, earlier.e, later.s);
|
|
1160
1360
|
// A sound's frame edges widen the cut, so none of it is left in.
|
|
1161
1361
|
const sound = heard && { s: Math.max(floorFrame(heard.s), ceilFrame(earlier.e)), e: ceilFrame(heard.e) };
|
|
1162
1362
|
const removed = sound ? sound.e - sound.s : 0;
|
|
1163
1363
|
const spans = sound ? [sound] : [];
|
|
1364
|
+
// #4803: a word list can time a word late or far too short ("eight" listed from 4.50 s when it is heard from
|
|
1365
|
+
// 4.24 s), so at a level the air each side is kept from where the words' sound really ends and starts (heardEdge).
|
|
1366
|
+
// Which pauses are cut still goes by the listed gap.
|
|
1367
|
+
const wordEnd = level ? heardEdge(levels, earlier.e, 1, sound ? sound.s : later.s, peakDbOf(levels, earlier)) : earlier.e;
|
|
1368
|
+
const wordStart = level ? heardEdge(levels, later.s, -1, sound ? sound.e : wordEnd, peakDbOf(levels, later)) : later.s;
|
|
1164
1369
|
const [breakMax, gapKeep] =
|
|
1165
1370
|
lineGap && newLine ? [lineGap.max, lineGap.keep] : [gapMax, SENTENCE_GAP_KEEP_SEC];
|
|
1166
1371
|
// jumpCut: a pause over its longest keeps its two edges, with a sound in it taken out whole.
|
|
@@ -1172,11 +1377,11 @@ export function sentenceGapCuts(words, lines, levels = null, lineGap = null, jum
|
|
|
1172
1377
|
// between the kept length and the longest allowed.
|
|
1173
1378
|
const back = (t) => (sound && t > sound.s ? t + removed : t);
|
|
1174
1379
|
const [keepAfter, keepBefore] = jumped ? [jump.keepAfter, jump.keepBefore] : [gapKeep / 2, gapKeep / 2];
|
|
1175
|
-
const after = ceilFrame(
|
|
1380
|
+
const after = ceilFrame(wordEnd + keepAfter);
|
|
1176
1381
|
// COP-355: at one of Luke's pause levels, a sound that starts inside the air kept after the word takes that air
|
|
1177
1382
|
// with it: the silence's cut starts with the sound's, so no piece of the pause of a frame or two is left between them.
|
|
1178
1383
|
const s = jumped && PAUSE_LEVELS.has(jump) && sound && sound.s < after - 1e-6 ? sound.s : back(after);
|
|
1179
|
-
const e = back(floorFrame(
|
|
1384
|
+
const e = back(floorFrame(wordStart - removed - keepBefore));
|
|
1180
1385
|
if (e > s) spans.push({ s, e });
|
|
1181
1386
|
}
|
|
1182
1387
|
const merged = [];
|
|
@@ -1186,11 +1391,36 @@ export function sentenceGapCuts(words, lines, levels = null, lineGap = null, jum
|
|
|
1186
1391
|
else merged.push({ ...span });
|
|
1187
1392
|
}
|
|
1188
1393
|
const kept = gap - merged.reduce((sum, c) => sum + c.e - c.s, 0);
|
|
1189
|
-
const split = lineGap && newLine && paused ?
|
|
1394
|
+
const split = lineGap && newLine && paused ? nextLine : null;
|
|
1190
1395
|
merged.forEach(({ s, e }, m) => {
|
|
1191
1396
|
const cut = { s, e, after: earlier.w, gap, kept, sound: Boolean(sound) };
|
|
1192
1397
|
cuts.push(split !== null && m === merged.length - 1 ? { ...cut, atLine: split } : cut);
|
|
1193
1398
|
});
|
|
1399
|
+
};
|
|
1400
|
+
for (let t = 0; t + 1 < heardWordOf.length; t++) {
|
|
1401
|
+
const to = heardWordOf[t + 1];
|
|
1402
|
+
if (heardWordOf[t] === to) continue;
|
|
1403
|
+
// A joined script token keeps its first word's line and lead-in.
|
|
1404
|
+
const [a, b] = [pieces[expected.sourceIndex[t]], pieces[expected.sourceIndex[t + 1]]];
|
|
1405
|
+
const newLine = a.li !== b.li;
|
|
1406
|
+
const keptWhole = WRITTEN_PAUSE.test(b.before) || lines[a.li].asksPause || lines[b.li].asksPause || (newLine && lines[a.li].cuesBeat);
|
|
1407
|
+
if (heardTokenOf[t + 1] !== heardTokenOf[t] + 1) {
|
|
1408
|
+
// #4806: at one of Luke's pause levels, a word heard between two script words that the script does not have (an
|
|
1409
|
+
// "um") is a heard word like any other: each pause from the earlier script word through it to the later one is
|
|
1410
|
+
// cut at the level. Neither word is touched, and the pauses a script word's place keeps whole stay whole.
|
|
1411
|
+
if (!PAUSE_LEVELS.has(jump) || keptWhole) continue;
|
|
1412
|
+
const from = heardTokens.lastSourceIndex[heardTokenOf[t]];
|
|
1413
|
+
const chain = [from, ...spoken.filter((w) => w > from && w < to), to];
|
|
1414
|
+
for (let k = 0; k + 1 < chain.length; k++) {
|
|
1415
|
+
cutPause(words[chain[k]], words[chain[k + 1]], { sentenceBreak: false, newLine: false, nextLine: null });
|
|
1416
|
+
}
|
|
1417
|
+
continue;
|
|
1418
|
+
}
|
|
1419
|
+
// A name heard split in two (#2300) ends on its last heard word.
|
|
1420
|
+
const [earlier, later] = [words[spoken.findLast((w) => w < to)], words[to]];
|
|
1421
|
+
const sentenceBreak = newLine || SENTENCE_END.test(b.before) || heardSentenceEnd(earlier.w);
|
|
1422
|
+
if (keptWhole) continue;
|
|
1423
|
+
cutPause(earlier, later, { sentenceBreak, newLine, nextLine: b.li });
|
|
1194
1424
|
}
|
|
1195
1425
|
return cuts;
|
|
1196
1426
|
}
|
|
@@ -1224,6 +1454,43 @@ function soundBetween(levels, fromSec, toSec) {
|
|
|
1224
1454
|
return resumed < 0 ? null : { s: quiet * windowSec, e: resumed * windowSec };
|
|
1225
1455
|
}
|
|
1226
1456
|
|
|
1457
|
+
/**
|
|
1458
|
+
* #4803: at one of Luke's pause levels, where a word's sound really ends (`dir` 1, from its listed end `from`) or starts
|
|
1459
|
+
* (`dir` -1, from its listed start) on the pause's side, never past `bound`. A run of windows at SOUND_DB or over, from
|
|
1460
|
+
* the listed edge or past a dip of PAUSE_EDGE_BRIDGE_SEC or less, is the word's when it comes within PAUSE_EDGE_WORD_DB
|
|
1461
|
+
* of the word's own loudest window (`wordPeakDb`): the rest of a word its list timed too short ("eight" listed from
|
|
1462
|
+
* 4.50 s and heard from 4.24 s, its "t" after a hush), where a breath, a click or a room's steady noise is quieter. The
|
|
1463
|
+
* edge only ever moves out into the pause.
|
|
1464
|
+
*/
|
|
1465
|
+
export function heardEdge(levels, from, dir, bound, wordPeakDb) {
|
|
1466
|
+
const { db, windowSec } = levels;
|
|
1467
|
+
const bridge = Math.round(PAUSE_EDGE_BRIDGE_SEC / windowSec);
|
|
1468
|
+
const step = dir > 0 ? 1 : -1;
|
|
1469
|
+
const inPause = (i) => i >= 0 && i < db.length && (dir > 0 ? i * windowSec < bound - 1e-9 : (i + 1) * windowSec > bound + 1e-9);
|
|
1470
|
+
const edgeOf = (i) => (dir > 0 ? Math.min(bound, (i + 1) * windowSec) : Math.max(bound, i * windowSec));
|
|
1471
|
+
let i = dir > 0 ? Math.ceil(from / windowSec - 1e-9) : Math.floor(from / windowSec + 1e-9) - 1;
|
|
1472
|
+
let edge = from;
|
|
1473
|
+
for (;;) {
|
|
1474
|
+
let dip = 0;
|
|
1475
|
+
while (inPause(i) && db[i] < SOUND_DB && dip <= bridge) { i += step; dip++; }
|
|
1476
|
+
if (!inPause(i) || dip > bridge) break;
|
|
1477
|
+
let loudest = -Infinity;
|
|
1478
|
+
let far = i;
|
|
1479
|
+
for (; inPause(i) && db[i] >= SOUND_DB; i += step) { loudest = Math.max(loudest, db[i]); far = i; }
|
|
1480
|
+
if (loudest < wordPeakDb - PAUSE_EDGE_WORD_DB) break;
|
|
1481
|
+
edge = edgeOf(far);
|
|
1482
|
+
}
|
|
1483
|
+
return dir > 0 ? Math.max(from, edge) : Math.min(from, edge);
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
/** The loudest window of a word's listed span, in dB; -Infinity for none. */
|
|
1487
|
+
function peakDbOf(levels, word) {
|
|
1488
|
+
const { db, windowSec } = levels;
|
|
1489
|
+
let peak = -Infinity;
|
|
1490
|
+
for (let i = Math.floor(word.s / windowSec + 1e-9); i < db.length && i * windowSec < word.e - 1e-9; i++) peak = Math.max(peak, db[i]);
|
|
1491
|
+
return peak;
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1227
1494
|
/** Scanning forward from `from`, the first window of the first run of SETTLED_WINDOWS quiet windows, or -1. */
|
|
1228
1495
|
function settledQuiet(db, from) {
|
|
1229
1496
|
let run = 0;
|
|
@@ -1837,9 +2104,9 @@ const HEARD_COMMA = /,["'”’)\]]*$/;
|
|
|
1837
2104
|
* addedCuts (COP-355): Luke's locked rule for one take, on its own clock before the speed-up. `realCuts` are the
|
|
1838
2105
|
* cuts the take holds already; its two edges count as cuts too. `whole` holds the
|
|
1839
2106
|
* [start, end] spans of the lines no cut may fall inside. A place is the middle of the silence after a heard word that
|
|
1840
|
-
* ends a sentence or has a comma, when it is not inside a whole line. While the longest stretch between two cuts runs
|
|
1841
|
-
* over `everySec
|
|
1842
|
-
* a comma, then the place nearest its middle.
|
|
2107
|
+
* ends a sentence or has a comma, when it is not inside a whole line. While the longest stretch between two cuts that runs
|
|
2108
|
+
* over `everySec` has a place at least ADDED_CUT.clearSec from both its ends, a cut goes at one: a sentence's end
|
|
2109
|
+
* before a comma, then the place nearest its middle. A stretch with no such place is left as it is (#4804). Returns the times
|
|
1843
2110
|
* of the cuts added, in order, and the longest stretch left with no cut.
|
|
1844
2111
|
*/
|
|
1845
2112
|
export function addedCutPlan({ words, seconds, realCuts = [], joins = [], everySec, whole = [] }) {
|
|
@@ -1855,24 +2122,27 @@ export function addedCutPlan({ words, seconds, realCuts = [], joins = [], everyS
|
|
|
1855
2122
|
places.push({ t, rank });
|
|
1856
2123
|
}
|
|
1857
2124
|
const added = [];
|
|
1858
|
-
const
|
|
2125
|
+
const stretches = () => {
|
|
1859
2126
|
const marks = [...new Set([0, ...realCuts, ...added, seconds])].sort((a, b) => a - b);
|
|
1860
|
-
return marks.slice(1).
|
|
1861
|
-
(best, to, k) => (to - marks[k] > best.length + 1e-9 ? { length: to - marks[k], from: marks[k], to } : best),
|
|
1862
|
-
{ length: 0, from: 0, to: 0 },
|
|
1863
|
-
);
|
|
2127
|
+
return marks.slice(1).map((to, k) => ({ length: to - marks[k], from: marks[k], to }));
|
|
1864
2128
|
};
|
|
1865
|
-
|
|
2129
|
+
const placesIn = (gap) => places.filter((p) =>
|
|
2130
|
+
p.t >= gap.from + ADDED_CUT.clearSec - 1e-9 && p.t <= gap.to - ADDED_CUT.clearSec + 1e-9 &&
|
|
2131
|
+
added.every((t) => Math.abs(p.t - t) > 0.01));
|
|
2132
|
+
// #4804: a stretch with no place (a line no cut falls inside) is passed over, and the next longest one over
|
|
2133
|
+
// `everySec` is cut, until none over it has a place.
|
|
2134
|
+
for (;;) {
|
|
2135
|
+
const gap = stretches()
|
|
2136
|
+
.filter((g) => g.length > everySec + 1e-9 && placesIn(g).length > 0)
|
|
2137
|
+
.reduce((best, g) => (!best || g.length > best.length + 1e-9 ? g : best), null);
|
|
2138
|
+
if (!gap) break;
|
|
1866
2139
|
const mid = (gap.from + gap.to) / 2;
|
|
1867
|
-
const
|
|
1868
|
-
p.t >= gap.from + ADDED_CUT.clearSec - 1e-9 && p.t <= gap.to - ADDED_CUT.clearSec + 1e-9 &&
|
|
1869
|
-
added.every((t) => Math.abs(p.t - t) > 0.01));
|
|
1870
|
-
if (inside.length === 0) break;
|
|
1871
|
-
const best = inside.reduce((a, b) =>
|
|
2140
|
+
const best = placesIn(gap).reduce((a, b) =>
|
|
1872
2141
|
b.rank < a.rank || (b.rank === a.rank && Math.abs(b.t - mid) < Math.abs(a.t - mid) - 1e-9) ? b : a);
|
|
1873
2142
|
added.push(best.t);
|
|
1874
2143
|
}
|
|
1875
|
-
|
|
2144
|
+
const longest = stretches().reduce((most, g) => Math.max(most, g.length), 0);
|
|
2145
|
+
return { added: added.map(r6).sort((a, b) => a - b), longest: r6(longest) };
|
|
1876
2146
|
}
|
|
1877
2147
|
|
|
1878
2148
|
/**
|
|
@@ -1895,18 +2165,36 @@ function breaksOf(seg) {
|
|
|
1895
2165
|
|
|
1896
2166
|
/**
|
|
1897
2167
|
* addedCuts: the frames where a take's framing changes, from the times of its cuts: on whole frames, in order, none
|
|
1898
|
-
* within FRAMING_MIN_FRAMES of the one before it or of the take's two edges (`frames` long).
|
|
2168
|
+
* within FRAMING_MIN_FRAMES of the one before it or of the take's two edges (`frames` long). #4805: nor within
|
|
2169
|
+
* FRAMING_MIN_FRAMES of a jump the picture makes inside the take (`jumps`, frames), which is a cut already.
|
|
1899
2170
|
*/
|
|
1900
|
-
export function framingFrames(times, frames) {
|
|
2171
|
+
export function framingFrames(times, frames, jumps = []) {
|
|
1901
2172
|
const kept = [];
|
|
1902
2173
|
for (const f of [...new Set(times.map((t) => Math.round(t * FPS)))].sort((a, b) => a - b)) {
|
|
1903
2174
|
if (f < FRAMING_MIN_FRAMES || f > frames - FRAMING_MIN_FRAMES) continue;
|
|
1904
2175
|
if (kept.length > 0 && f - kept.at(-1) < FRAMING_MIN_FRAMES) continue;
|
|
2176
|
+
if (jumps.some((j) => Math.abs(f - j) < FRAMING_MIN_FRAMES)) continue;
|
|
1905
2177
|
kept.push(f);
|
|
1906
2178
|
}
|
|
1907
2179
|
return kept;
|
|
1908
2180
|
}
|
|
1909
2181
|
|
|
2182
|
+
/**
|
|
2183
|
+
* #4805: where a take's own picture jumps (`fileJumps`, seconds on its file's clock) on the segment's clock: past the
|
|
2184
|
+
* pauses cut out of it before (seg.cuts, on the file's clock) and its trimmed lead-in. A jump inside a part cut out,
|
|
2185
|
+
* or outside the segment, is not on it.
|
|
2186
|
+
*/
|
|
2187
|
+
export function takeJumpTimes(seg, fileJumps) {
|
|
2188
|
+
const cuts = [...(seg.cuts ?? [])].sort((a, b) => a.s - b.s);
|
|
2189
|
+
const out = [];
|
|
2190
|
+
for (const r of fileJumps) {
|
|
2191
|
+
if (cuts.some((c) => r >= c.s - 1e-6 && r < c.e - 1e-6)) continue;
|
|
2192
|
+
const t = r - cuts.reduce((sum, c) => sum + (c.e <= r + 1e-6 ? c.e - c.s : 0), 0) - (seg.inSec ?? 0);
|
|
2193
|
+
if (t > 1e-6 && t < seg.seconds - 1e-6) out.push(r6(t));
|
|
2194
|
+
}
|
|
2195
|
+
return out;
|
|
2196
|
+
}
|
|
2197
|
+
|
|
1910
2198
|
/** addedCuts: where each script line of a talking segment is heard, [start, end] on the segment's clock, by line id. */
|
|
1911
2199
|
function lineSpans(seg, scriptLines) {
|
|
1912
2200
|
const lines = seg.lineIds.map((id) => scriptWords(scriptLines.get(id)?.text));
|
|
@@ -1956,8 +2244,9 @@ function lineSpans(seg, scriptLines) {
|
|
|
1956
2244
|
* framing changes: at every cut it counts, those it held and those added. A line marked whole that its words do not
|
|
1957
2245
|
* show is taken to run through the whole take, so nothing is added there. Answers the cut's note.
|
|
1958
2246
|
*/
|
|
1959
|
-
function placeAddedCuts(spine, scriptLines, everySec, wholeLines) {
|
|
2247
|
+
function placeAddedCuts(spine, scriptLines, everySec, wholeLines, readJumps = () => []) {
|
|
1960
2248
|
const whole = new Set(wholeLines);
|
|
2249
|
+
const jumpsOf = new Map();
|
|
1961
2250
|
let count = 0;
|
|
1962
2251
|
let longest = 0;
|
|
1963
2252
|
for (const seg of spine) {
|
|
@@ -1966,11 +2255,18 @@ function placeAddedCuts(spine, scriptLines, everySec, wholeLines) {
|
|
|
1966
2255
|
const held = (seg.lineIds ?? []).filter((id) => whole.has(id)).map((id) => spans.get(id) ?? [0, seg.seconds]);
|
|
1967
2256
|
const breaks = breaksOf(seg);
|
|
1968
2257
|
const realCuts = breaks.filter((b) => b.counts).map((b) => b.t);
|
|
1969
|
-
|
|
2258
|
+
// #4805: a jump the video service made inside the take is a cut the viewer sees: no stretch runs across it, and no
|
|
2259
|
+
// framing change lands within FRAMING_MIN_FRAMES of it.
|
|
2260
|
+
if (!jumpsOf.has(seg.file)) jumpsOf.set(seg.file, readJumps(seg.file) ?? []);
|
|
2261
|
+
const jumps = takeJumpTimes(seg, jumpsOf.get(seg.file));
|
|
2262
|
+
const plan = addedCutPlan({
|
|
2263
|
+
words: seg.words, seconds: seg.seconds, realCuts: [...realCuts, ...jumps], joins: breaks.map((b) => b.t), everySec, whole: held,
|
|
2264
|
+
});
|
|
1970
2265
|
const frames = Math.round(seg.seconds * FPS);
|
|
1971
|
-
const
|
|
2266
|
+
const jumpFrames = jumps.map((t) => Math.round(t * FPS));
|
|
2267
|
+
const framing = framingFrames([...realCuts, ...plan.added], frames, jumpFrames);
|
|
1972
2268
|
const added = plan.added.filter((t) => framing.includes(Math.round(t * FPS)));
|
|
1973
|
-
const edges = [0, ...framing, frames];
|
|
2269
|
+
const edges = [...new Set([0, ...framing, ...jumpFrames, frames])].sort((a, b) => a - b);
|
|
1974
2270
|
longest = Math.max(longest, ...edges.slice(1).map((f, k) => (f - edges[k]) / FPS));
|
|
1975
2271
|
// Set on every take the row reaches, even with no change, so its join with the take before it is seen to (framingAtJoins).
|
|
1976
2272
|
seg.framing = framing;
|
|
@@ -2030,6 +2326,19 @@ export function framingChangeTimes(spine, speed = 1, cutaways = []) {
|
|
|
2030
2326
|
.filter((t) => !covered.some(([from, to]) => t >= from && t <= to));
|
|
2031
2327
|
}
|
|
2032
2328
|
|
|
2329
|
+
/**
|
|
2330
|
+
* #4805, pauseTrim: where a pause cut at one of Luke's levels joins a take to itself, in seconds on the delivered film's
|
|
2331
|
+
* clock (as framingChangeTimes), so the worker can tell a fault the trim made.
|
|
2332
|
+
*/
|
|
2333
|
+
export function pauseJoinTimes(spine, speed = 1) {
|
|
2334
|
+
const onFilm = (sec) => Math.round((sec / speed) * FPS) / FPS;
|
|
2335
|
+
return spine.flatMap((seg, k) => [
|
|
2336
|
+
// cutPace: a take split at a pause it cut (splitAtPauses) joins its two pieces at the second one's start.
|
|
2337
|
+
...(k > 0 && seg.cuts?.length && samePiece(spine[k - 1], seg) ? [onFilm(seg.startSec)] : []),
|
|
2338
|
+
...(seg.cuts?.length && seg.words ? breaksOf(seg).map((b) => onFilm(seg.startSec + b.t)) : []),
|
|
2339
|
+
]);
|
|
2340
|
+
}
|
|
2341
|
+
|
|
2033
2342
|
/**
|
|
2034
2343
|
* addedCuts: a segment's picture, `head` being its chain up to its own framing, split at `seg.framing` into pieces cut by
|
|
2035
2344
|
* frame number, back to back, every other one in its other framing, and joined again with no sound: every frame is
|
|
@@ -3354,7 +3663,7 @@ export function buildTimeline(args) {
|
|
|
3354
3663
|
|
|
3355
3664
|
function assembleTimeline({
|
|
3356
3665
|
manifest, storyboard, skip, probe, exists, readWords, readLevels = () => null, stillFill = false, finish = null,
|
|
3357
|
-
wholeVoice = null, sourceAd = null, measure = null,
|
|
3666
|
+
wholeVoice = null, sourceAd = null, measure = null, readJumps = () => [],
|
|
3358
3667
|
}) {
|
|
3359
3668
|
if (measure) {
|
|
3360
3669
|
// The measured map: a word's last phoneme end rides with the word through every shift.
|
|
@@ -3725,7 +4034,7 @@ function assembleTimeline({
|
|
|
3725
4034
|
? "addedCuts: a cut on a template's clock or a measured map keeps its framing, so no cut was added"
|
|
3726
4035
|
: !finish.wholeLines?.length
|
|
3727
4036
|
? "addedCuts: no line of the script is marked whole, so no cut was added"
|
|
3728
|
-
: placeAddedCuts(spine, scriptLines, ADDED_CUTS[finish.addedCuts], finish.wholeLines));
|
|
4037
|
+
: placeAddedCuts(spine, scriptLines, ADDED_CUTS[finish.addedCuts], finish.wholeLines, readJumps));
|
|
3729
4038
|
}
|
|
3730
4039
|
// A copied shot no voice runs in lasts its shot's length, its clip trimmed or its last frame held.
|
|
3731
4040
|
const shotOf = (n) => plans.get(n)?.sourceShot ?? null;
|
|
@@ -4346,6 +4655,10 @@ function mappedPiece(seg, i, { addInput, filters, tails, level, resolve }) {
|
|
|
4346
4655
|
* chain and the duck under it, and `meters` (cutChecks) names the two files
|
|
4347
4656
|
* the voice and everything under it are also written to. `pcmMix` keeps the
|
|
4348
4657
|
* render's sound uncompressed, for a mix the loudness pass then encodes once.
|
|
4658
|
+
* COP-357: `look` lays the lens smudge (`smudge`, its side) and the phone pass
|
|
4659
|
+
* on the joined takes before anything else touches the picture, with `probe`
|
|
4660
|
+
* splitting them off first to LOOK_PROBE's side files, and `deliverFps`
|
|
4661
|
+
* repeats the finished picture's frames to that rate, last.
|
|
4349
4662
|
*/
|
|
4350
4663
|
export function buildFfmpegArgs(timeline, { resolve, music, out, finish = null, sound = null, voiceOnly = false }) {
|
|
4351
4664
|
const level = finish && finish.levelSegments === false ? "anull" : LOUDNORM;
|
|
@@ -4498,6 +4811,20 @@ export function buildFfmpegArgs(timeline, { resolve, music, out, finish = null,
|
|
|
4498
4811
|
}
|
|
4499
4812
|
|
|
4500
4813
|
let videoLabel = "vcat";
|
|
4814
|
+
// COP-357, the phone look: on the joined takes, before any cutaway, picture, end card or burned word is laid over them.
|
|
4815
|
+
// Fix A: with a picture pass, the takes are first split off to the probe, which reads them before the look.
|
|
4816
|
+
if (finish?.look?.probe) {
|
|
4817
|
+
filters.push(`[${videoLabel}]split=2[lookin][lookprobe]`, `[lookprobe]${lookProbeFilter()}`);
|
|
4818
|
+
videoLabel = "lookin";
|
|
4819
|
+
}
|
|
4820
|
+
if (finish?.look?.smudge) {
|
|
4821
|
+
filters.push(...lensSmudgeFilters(videoLabel, finish.look.smudge, "smudged"));
|
|
4822
|
+
videoLabel = "smudged";
|
|
4823
|
+
}
|
|
4824
|
+
if (finish?.look?.phonePass) {
|
|
4825
|
+
filters.push(`[${videoLabel}]${phonePassFilter()}[phoned]`);
|
|
4826
|
+
videoLabel = "phoned";
|
|
4827
|
+
}
|
|
4501
4828
|
timeline.cutaways.forEach((c, j) => {
|
|
4502
4829
|
const i =
|
|
4503
4830
|
c.source === "clip"
|
|
@@ -4577,6 +4904,11 @@ export function buildFfmpegArgs(timeline, { resolve, music, out, finish = null,
|
|
|
4577
4904
|
filters.push(`[${videoLabel}]subtitles=filename=${finish.ass}[burned]`);
|
|
4578
4905
|
videoLabel = "burned";
|
|
4579
4906
|
}
|
|
4907
|
+
// COP-357, fps30: the finished picture, words and all, at the delivered rate by repeated frames; the clock above is FPS.
|
|
4908
|
+
if (finish?.deliverFps) {
|
|
4909
|
+
filters.push(`[${videoLabel}]fps=${finish.deliverFps}[delivered]`);
|
|
4910
|
+
videoLabel = "delivered";
|
|
4911
|
+
}
|
|
4580
4912
|
|
|
4581
4913
|
const beds = [];
|
|
4582
4914
|
if (sound?.beds?.length) {
|
|
@@ -4694,7 +5026,7 @@ export function buildFfmpegArgs(timeline, { resolve, music, out, finish = null,
|
|
|
4694
5026
|
...inputs,
|
|
4695
5027
|
"-filter_complex", filters.join(";"),
|
|
4696
5028
|
"-map", `[${videoLabel}]`, "-map", `[${audioLabel}]`,
|
|
4697
|
-
"-c:v", "libx264", "-preset", "medium", "-crf", "20", "-r", String(FPS),
|
|
5029
|
+
"-c:v", "libx264", "-preset", "medium", "-crf", "20", "-r", String(finish?.deliverFps ?? FPS),
|
|
4698
5030
|
// COP-300: a mix the loudness pass finishes keeps its sound uncompressed, so the finished cut's sound is AAC-encoded once.
|
|
4699
5031
|
...(finish?.pcmMix ? ["-c:a", "pcm_s16le"] : ["-c:a", "aac", "-b:a", "192k"]),
|
|
4700
5032
|
"-movflags", "+faststart",
|
|
@@ -5830,12 +6162,13 @@ export function checkVerdict(c, bars = CHECK_BARS) {
|
|
|
5830
6162
|
}
|
|
5831
6163
|
|
|
5832
6164
|
/** Frame-to-frame change of a file's picture, on a 90 px wide copy, printed per frame. `from`/`seconds` read a stretch. */
|
|
5833
|
-
export function motionArgs(file, from = null, seconds = null) {
|
|
6165
|
+
export function motionArgs(file, from = null, seconds = null, readFps = null) {
|
|
5834
6166
|
return [
|
|
5835
6167
|
"-hide_banner", "-nostats",
|
|
5836
6168
|
...(from !== null ? ["-ss", sec(from)] : []), ...(seconds !== null ? ["-t", sec(seconds)] : []),
|
|
5837
6169
|
"-i", file, "-an",
|
|
5838
|
-
|
|
6170
|
+
// COP-357: a film repeated to 30 frames a second is read back on `readFps` (FPS), its own frames, before the change.
|
|
6171
|
+
"-vf", `${readFps ? `fps=${readFps},` : ""}${MOTION_READ}:file=-`,
|
|
5839
6172
|
"-f", "null", "-",
|
|
5840
6173
|
];
|
|
5841
6174
|
}
|
|
@@ -5968,6 +6301,27 @@ export function takesOf(timeline, plans, speed = 1) {
|
|
|
5968
6301
|
return takes.map(({ lastSeg, start, ...t }) => ({ ...t, at: start / speed, sec: t.takeSec / speed }));
|
|
5969
6302
|
}
|
|
5970
6303
|
|
|
6304
|
+
/**
|
|
6305
|
+
* #4805: the frames where a picture jumps, as the flash check reads a cut: a change of a cut's size (FLASH_BARS'
|
|
6306
|
+
* spikeYavg, and spikeOverMedian times the median change), from readMotion's rows. Each is the time of the first frame
|
|
6307
|
+
* of the new picture.
|
|
6308
|
+
*/
|
|
6309
|
+
export function pictureJumps(motion, bars = FLASH_BARS) {
|
|
6310
|
+
const values = motion.map((m) => m.y).sort((a, b) => a - b);
|
|
6311
|
+
const median = values.length ? values[Math.floor(values.length / 2)] : 0;
|
|
6312
|
+
return motion.filter((r) => r.y >= bars.spikeYavg && r.y >= median * bars.spikeOverMedian).map((r) => r.t);
|
|
6313
|
+
}
|
|
6314
|
+
|
|
6315
|
+
/**
|
|
6316
|
+
* #4805: where a clip's own picture jumps (pictureJumps), on its own clock; none when its picture cannot be read. Read
|
|
6317
|
+
* on the cut's own frame grid (FPS), as the flash check reads a film repeated to 30 frames a second (COP-357), so a
|
|
6318
|
+
* frame shown twice is never a change of its own.
|
|
6319
|
+
*/
|
|
6320
|
+
function clipJumps(file) {
|
|
6321
|
+
const read = spawnSync("ffmpeg", motionArgs(file, null, null, FPS), { encoding: "utf8", maxBuffer: 1 << 28 });
|
|
6322
|
+
return read.status === 0 ? pictureJumps(readMotion(read.stdout)) : [];
|
|
6323
|
+
}
|
|
6324
|
+
|
|
5971
6325
|
/**
|
|
5972
6326
|
* flashCheck (P-7, Plan 13's 0.12 s piece and one-frame leaks): every shot on
|
|
5973
6327
|
* screen under maxSec (a one-frame piece included), and every single frame of
|
|
@@ -5993,6 +6347,16 @@ export function flashes(shots, motion, bars = FLASH_BARS) {
|
|
|
5993
6347
|
return out.sort((a, b) => a.at - b.at);
|
|
5994
6348
|
}
|
|
5995
6349
|
|
|
6350
|
+
/**
|
|
6351
|
+
* freezeCheck's runs: the finished film's, and (COP-357, fix A) the takes' read before the look, merged; the end card,
|
|
6352
|
+
* which the check leaves out, is left out of both.
|
|
6353
|
+
*/
|
|
6354
|
+
function cutFreezes(motion, lookRows, endCard, speed) {
|
|
6355
|
+
const found = freezes(motion);
|
|
6356
|
+
if (!lookRows) return found;
|
|
6357
|
+
return mergedFreezes([...found, ...freezes(endCard ? lookRows.filter((r) => r.t < endCard.in / speed) : lookRows)]);
|
|
6358
|
+
}
|
|
6359
|
+
|
|
5996
6360
|
/** The power mean of some loudness windows, in dB. */
|
|
5997
6361
|
const meanDb = (db) => 10 * Math.log10(db.reduce((sum, d) => sum + 10 ** (d / 10), 0) / db.length);
|
|
5998
6362
|
|
|
@@ -6242,11 +6606,11 @@ const roleOf = (seg) => (seg.reaction || seg.audio === "clip" ? "a-roll" : seg.a
|
|
|
6242
6606
|
* slow push-in is still picture by design, so freezeCheck reads only the
|
|
6243
6607
|
* picture before it.
|
|
6244
6608
|
*/
|
|
6245
|
-
function checkCut({ timeline, storyboard, screens, rows, scenes, out, loudness, levels, finish = null, sourceAd = null, shotOf = () => null, cards = [], speed = 1, endCard = null }) {
|
|
6609
|
+
function checkCut({ timeline, storyboard, screens, rows, scenes, out, loudness, levels, finish = null, sourceAd = null, shotOf = () => null, cards = [], speed = 1, endCard = null, lookRows = null, readFps = null }) {
|
|
6246
6610
|
const roles = new Map(timeline.spine.map((seg) => [seg.sceneIndex, roleOf(seg)]));
|
|
6247
6611
|
for (const c of timeline.cutaways) roles.set(c.sceneIndex, "b-roll");
|
|
6248
6612
|
const shots = scenes.map((p) => ({ n: p.scene, role: roles.get(p.scene) ?? "b-roll", start: p.startSec, end: roundMs(p.startSec + p.seconds) }));
|
|
6249
|
-
const read = spawnSync("ffmpeg", motionArgs(out), { encoding: "utf8", maxBuffer: 1 << 28 });
|
|
6613
|
+
const read = spawnSync("ffmpeg", motionArgs(out, null, null, readFps), { encoding: "utf8", maxBuffer: 1 << 28 });
|
|
6250
6614
|
const motion = read.status === 0 ? readMotion(read.stdout) : [];
|
|
6251
6615
|
const finished = loudness ? { i: loudness.lufs, tp: loudness.truePeak } : measureLoudness(out);
|
|
6252
6616
|
const checks = {
|
|
@@ -6260,7 +6624,7 @@ function checkCut({ timeline, storyboard, screens, rows, scenes, out, loudness,
|
|
|
6260
6624
|
// null: ffmpeg could not read the motion, so no shot was checked.
|
|
6261
6625
|
slowShots: motion.length ? slowShots(motionByShot(motion, shots)) : null,
|
|
6262
6626
|
...(finish?.blipCheck ? { blips: blips(shots.map((s) => ({ ...s, srcSec: sourceShotSec(sourceAd, shotOf(s.n)) }))) } : {}),
|
|
6263
|
-
...(finish?.freezeCheck ? { freezes:
|
|
6627
|
+
...(finish?.freezeCheck ? { freezes: cutFreezes(endCard ? motion.filter((r) => r.t < endCard.in / speed) : motion, lookRows, endCard, speed) } : {}),
|
|
6264
6628
|
...plan14Checks({ timeline, storyboard, rows, shots, motion, out, finish, cards, speed }),
|
|
6265
6629
|
lufs: finished ? round2(finished.i) : null,
|
|
6266
6630
|
truePeak: finished ? round2(finished.tp) : null,
|
|
@@ -7637,6 +8001,7 @@ export function firstCut({ dir, out: outOpt, skip = new Set(), music: musicOn =
|
|
|
7637
8001
|
return Array.isArray(rows) && rows.length > 0 ? rows : null;
|
|
7638
8002
|
},
|
|
7639
8003
|
readLevels: (file) => clipLevels(here(file)),
|
|
8004
|
+
readJumps: (file) => clipJumps(here(file)),
|
|
7640
8005
|
...(readClocks ? { measure: readClocks } : {}),
|
|
7641
8006
|
...(finish ? { finish } : {}),
|
|
7642
8007
|
...(wholeVoice ? { wholeVoice } : {}),
|
|
@@ -7673,6 +8038,8 @@ export function firstCut({ dir, out: outOpt, skip = new Set(), music: musicOn =
|
|
|
7673
8038
|
if (finish?.cutPace && (template || protectedMotion)) notes.push("template/action/listening/ending clocks remain real time; cutPace does not accelerate the cut");
|
|
7674
8039
|
// addedCuts (COP-355): the framing changes made, on the delivered film's clock, for the worker's last guard.
|
|
7675
8040
|
const framingChangesSec = finish?.addedCuts ? framingChangeTimes(timeline.spine, speed, timeline.cutaways) : null;
|
|
8041
|
+
// #4805: the joins a pause level made, on the same clock, so the worker can make the film again without them.
|
|
8042
|
+
const pauseJoinsSec = finish?.pauseTrim && !finish.keepPauses ? pauseJoinTimes(timeline.spine, speed) : null;
|
|
7676
8043
|
if (timeline.sourceMap) {
|
|
7677
8044
|
// The exact bytes every measured clock was read from, for whoever binds an approval to them.
|
|
7678
8045
|
timeline.sourceMap.sources = readClocks.files().filter(exists).map((file) => {
|
|
@@ -7810,6 +8177,40 @@ export function firstCut({ dir, out: outOpt, skip = new Set(), music: musicOn =
|
|
|
7810
8177
|
clean = { voice: VOICE_CLEAN, under: UNDER_VOICE };
|
|
7811
8178
|
}
|
|
7812
8179
|
}
|
|
8180
|
+
// COP-357, the phone look, on a cut of its own clock only.
|
|
8181
|
+
let look = null;
|
|
8182
|
+
let deliverFps = null;
|
|
8183
|
+
const lookAsked = ["fps30", "lensSmudge", "phonePass"].filter((key) => finish?.[key]);
|
|
8184
|
+
if (lookAsked.length && (template || timeline.mapped)) {
|
|
8185
|
+
notes.push(`${lookAsked.join(", ")} ${lookAsked.length === 1 ? "is" : "are"} not applied to a template launch's cut or one laid on its measured map`);
|
|
8186
|
+
} else if (lookAsked.length) {
|
|
8187
|
+
if (finish.lensSmudge) {
|
|
8188
|
+
const missing = missingFilters(LOOK_FILTERS.lensSmudge);
|
|
8189
|
+
if (missing.length) notes.push(`this ffmpeg has no ${missing.join(", ")} filter, so the lens smudge was not added`);
|
|
8190
|
+
else {
|
|
8191
|
+
const frame = spineFrameAt(timeline.spine, LENS_SMUDGE.readAtSec);
|
|
8192
|
+
const side = frame ? brighterSide(here(frame.file), frame.atSec) : null;
|
|
8193
|
+
look = { smudge: side ?? "right" };
|
|
8194
|
+
notes.push(side
|
|
8195
|
+
? `lensSmudge: a light smudge on the top ${side}, the brighter corner ${LENS_SMUDGE.readAtSec.toFixed(1)} s into the takes`
|
|
8196
|
+
: `lensSmudge: a light smudge on the top right; the picture ${LENS_SMUDGE.readAtSec.toFixed(1)} s into the takes could not be read for its brighter corner`);
|
|
8197
|
+
}
|
|
8198
|
+
}
|
|
8199
|
+
if (finish.phonePass) {
|
|
8200
|
+
const missing = missingFilters(LOOK_FILTERS.phonePass);
|
|
8201
|
+
if (missing.length) notes.push(`this ffmpeg has no ${missing.join(", ")} filter, so the phone pass was not added`);
|
|
8202
|
+
else {
|
|
8203
|
+
look = { ...look, phonePass: true };
|
|
8204
|
+
notes.push("phonePass: grain and a light phone pass on the takes' picture, no shake");
|
|
8205
|
+
}
|
|
8206
|
+
}
|
|
8207
|
+
// Fix A: a picture pass laid, so the takes are read before it too.
|
|
8208
|
+
if (look) look = { ...look, probe: true };
|
|
8209
|
+
if (finish.fps30) {
|
|
8210
|
+
deliverFps = DELIVERY_FPS;
|
|
8211
|
+
notes.push(`fps30: the film is delivered at ${DELIVERY_FPS} frames a second, one frame in four shown twice; the cut's clock stays at ${FPS}`);
|
|
8212
|
+
}
|
|
8213
|
+
}
|
|
7813
8214
|
let peakLimit = null;
|
|
7814
8215
|
if (finish?.limitPeaks) {
|
|
7815
8216
|
if (hasFilter("alimiter")) peakLimit = PEAK_LIMIT;
|
|
@@ -7821,8 +8222,9 @@ export function firstCut({ dir, out: outOpt, skip = new Set(), music: musicOn =
|
|
|
7821
8222
|
voice: paths.voice, bed: paths.bed,
|
|
7822
8223
|
...(manifest.templateMotion?.enabled === true || manifest.roomTone === false || finish.roomSound === "none" ? { allowAbsentBed: true } : {}),
|
|
7823
8224
|
} : null;
|
|
7824
|
-
// The burn reads its file from the folder ffmpeg runs in, so every path is absolute then
|
|
7825
|
-
|
|
8225
|
+
// The burn reads its file from the folder ffmpeg runs in, so every path is absolute then; so does the look's probe,
|
|
8226
|
+
// which writes its side files there.
|
|
8227
|
+
const at = ass || look ? (file) => path.resolve(dir, file) : here;
|
|
7826
8228
|
|
|
7827
8229
|
const templateCut = manifest.templateMotion?.enabled === true || manifest.videoChoice?.videoModel === "template-video";
|
|
7828
8230
|
const songMaster = templateCut && timeline.wholeVoice?.songOnly === true;
|
|
@@ -7969,6 +8371,7 @@ export function firstCut({ dir, out: outOpt, skip = new Set(), music: musicOn =
|
|
|
7969
8371
|
...(room ? { room } : {}),
|
|
7970
8372
|
...(pictures.length ? { pictures } : {}), ...(clean ? { clean } : {}), ...(meters ? { meters } : {}),
|
|
7971
8373
|
...(endLayers ? { endCard: endLayers } : {}),
|
|
8374
|
+
...(look ? { look } : {}), ...(deliverFps ? { deliverFps } : {}),
|
|
7972
8375
|
},
|
|
7973
8376
|
}
|
|
7974
8377
|
: {}),
|
|
@@ -7978,12 +8381,21 @@ export function firstCut({ dir, out: outOpt, skip = new Set(), music: musicOn =
|
|
|
7978
8381
|
rmSync(meters.voice, { force: true });
|
|
7979
8382
|
rmSync(meters.bed, { force: true });
|
|
7980
8383
|
}
|
|
7981
|
-
|
|
8384
|
+
if (look) for (const file of [LOOK_PROBE.freeze, LOOK_PROBE.motion]) rmSync(here(file), { force: true });
|
|
8385
|
+
const res = spawnSync("ffmpeg", ffmpegArgs, { stdio: "inherit", ...(ass || look ? { cwd: path.resolve(dir) } : {}) });
|
|
7982
8386
|
if (room?.file) rmSync(room.file, { force: true });
|
|
7983
8387
|
if (res.status !== 0) {
|
|
7984
8388
|
const quoted = ffmpegArgs.map((a) => (/[\s\[\];]/.test(a) ? `'${a}'` : a)).join(" ");
|
|
7985
8389
|
throw new FirstCutError(1, `ffmpeg failed. The command it ran:\n ffmpeg ${quoted}`);
|
|
7986
8390
|
}
|
|
8391
|
+
// COP-357, fix A: the takes as read before the look, on the film's clock, less what is laid over them.
|
|
8392
|
+
const lookProbe = look ? readLookProbe(here, {
|
|
8393
|
+
pictureSec, speed, covered: lookCovered({ cutaways: timeline.cutaways, pictures, endCard: endLayers }),
|
|
8394
|
+
}) : null;
|
|
8395
|
+
if (look && !lookProbe) notes.push("the takes before the look could not be read for a frozen picture, so only the finished film was checked");
|
|
8396
|
+
if (lookProbe && lookProbe.rowsRead < lookProbe.changes) {
|
|
8397
|
+
notes.push(`the takes before the look were read for ${lookProbe.rowsRead} of their ${lookProbe.changes} frame changes, so a frozen picture in them may have been missed`);
|
|
8398
|
+
}
|
|
7987
8399
|
let meterLevels = null;
|
|
7988
8400
|
if (meters) {
|
|
7989
8401
|
meterLevels = { voiceLufs: measureLufs(meters.voice), bedLufs: meters.allowAbsentBed && !existsSync(meters.bed) ? null : measureLufs(meters.bed) };
|
|
@@ -8037,7 +8449,7 @@ export function firstCut({ dir, out: outOpt, skip = new Set(), music: musicOn =
|
|
|
8037
8449
|
}
|
|
8038
8450
|
writeFileSync(sidecars.scenes, `${JSON.stringify(scenes, null, 2)}\n`);
|
|
8039
8451
|
const sync = finish?.captionCheck
|
|
8040
|
-
? cutSync({ out, speed, scenes, rows, screens: ass && burned ? burned : [], manifest, here, readJson })
|
|
8452
|
+
? cutSync({ out, speed, scenes, rows, screens: ass && burned ? burned : [], manifest, here, readJson, ...(deliverFps ? { deliverFps } : {}) })
|
|
8041
8453
|
: null;
|
|
8042
8454
|
if (sync) writeFileSync(paths.sync, `${JSON.stringify(sync, null, 2)}\n`);
|
|
8043
8455
|
|
|
@@ -8129,6 +8541,7 @@ export function firstCut({ dir, out: outOpt, skip = new Set(), music: musicOn =
|
|
|
8129
8541
|
? checkCut({
|
|
8130
8542
|
timeline, storyboard, screens: burned, rows, scenes, out, loudness, levels: meterLevels,
|
|
8131
8543
|
finish, sourceAd, shotOf: (n) => plans?.get(n)?.sourceShot ?? null, cards: burnedCards, speed, endCard: endLayers,
|
|
8544
|
+
...(lookProbe ? { lookRows: lookProbe.rows } : {}), ...(deliverFps ? { readFps: FPS } : {}),
|
|
8132
8545
|
})
|
|
8133
8546
|
: null;
|
|
8134
8547
|
// The pace record: the cut's own numbers, the settings it was cut with (so
|
|
@@ -8159,6 +8572,9 @@ export function firstCut({ dir, out: outOpt, skip = new Set(), music: musicOn =
|
|
|
8159
8572
|
return withSound({
|
|
8160
8573
|
out, durationSec, manifest, timeline, music, rows, sidecars, pace, ...(sync ? { sync } : {}),
|
|
8161
8574
|
...(framingChangesSec ? { framingChangesSec } : {}),
|
|
8575
|
+
...(pauseJoinsSec ? { pauseJoinsSec } : {}),
|
|
8576
|
+
// COP-357, fix A: for the worker's guard, the takes' frozen runs read before the look, on the film's clock.
|
|
8577
|
+
...(lookProbe ? { lookFreeze: lookProbe.freezes } : {}),
|
|
8162
8578
|
});
|
|
8163
8579
|
}
|
|
8164
8580
|
|
|
@@ -8169,14 +8585,16 @@ export function firstCut({ dir, out: outOpt, skip = new Set(), music: musicOn =
|
|
|
8169
8585
|
* The sections are the cut's takes. The captions, sections and heard words come back with the verdicts, so the
|
|
8170
8586
|
* worker can judge Check B again on a listen of its own, and cut again from the heard words.
|
|
8171
8587
|
*/
|
|
8172
|
-
function cutSync({ out, speed, scenes, rows, screens, manifest, here, readJson }) {
|
|
8588
|
+
function cutSync({ out, speed, scenes, rows, screens, manifest, here, readJson, deliverFps = null }) {
|
|
8173
8589
|
const sections = [];
|
|
8174
8590
|
for (const p of scenes) {
|
|
8175
8591
|
const last = sections.at(-1);
|
|
8176
8592
|
if (last && last.id === p.scene) last.endSec = roundMs(p.startSec + p.seconds);
|
|
8177
8593
|
else sections.push({ id: p.scene, startSec: p.startSec, endSec: roundMs(p.startSec + p.seconds) });
|
|
8178
8594
|
}
|
|
8179
|
-
|
|
8595
|
+
// COP-357: a film repeated to deliverFps shows each caption on the delivered frame that first holds its 24 fps frame.
|
|
8596
|
+
const seenOn = (t) => (deliverFps ? deliveredSeenSec(t, deliverFps) : t);
|
|
8597
|
+
const captions = screens.map((c) => ({ text: c.text, seenSec: roundMs(seenOn(captionSeenSec(captionStartCs(c.s / speed)))) }));
|
|
8180
8598
|
const takes = (manifest.scenes ?? []).flatMap((scene) => {
|
|
8181
8599
|
const file = scene.wordsFrom === "voice" ? scene.voice : scene.clip;
|
|
8182
8600
|
const words = readJson(scene.words);
|
|
@@ -283,7 +283,7 @@ export function customerStatusLines(run, dashboardUrl) {
|
|
|
283
283
|
run.mode === "guided" ? "Storyboard first" : "In one go",
|
|
284
284
|
"",
|
|
285
285
|
...customerStageLines(run, page),
|
|
286
|
-
...(run.spend ? [run.spend.line] : []),
|
|
286
|
+
...(run.spend ? [run.spend.line, ...(run.spend.storyboardEstimate ? [run.spend.storyboardEstimate.sentence] : [])] : []),
|
|
287
287
|
...spendAskLines(run, run.runId),
|
|
288
288
|
...(run.scenes ?? []).flatMap(scene => scene.clip?.speech
|
|
289
289
|
? [`Scene ${scene.sceneIndex} speech:`, ...speechSummaryLines(scene.clip.speech).map(line => ` ${line}`)] : []),
|