@softure-ai/marketing-kit 0.34.0 → 0.36.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.
Files changed (102) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/NOTICE +6 -0
  3. package/README.md +49 -1
  4. package/dist/config/config.d.ts.map +1 -1
  5. package/dist/config/config.js +1 -0
  6. package/dist/config/config.js.map +1 -1
  7. package/dist/config/schema.d.ts +10 -0
  8. package/dist/config/schema.d.ts.map +1 -1
  9. package/dist/config/schema.js +9 -3
  10. package/dist/config/schema.js.map +1 -1
  11. package/dist/footage/captions.d.ts +22 -2
  12. package/dist/footage/captions.d.ts.map +1 -1
  13. package/dist/footage/captions.js +23 -4
  14. package/dist/footage/captions.js.map +1 -1
  15. package/dist/footage/compose.d.ts +11 -1
  16. package/dist/footage/compose.d.ts.map +1 -1
  17. package/dist/footage/compose.js +51 -17
  18. package/dist/footage/compose.js.map +1 -1
  19. package/dist/footage/draft-overlays.d.ts +6 -0
  20. package/dist/footage/draft-overlays.d.ts.map +1 -1
  21. package/dist/footage/draft-overlays.js +188 -4
  22. package/dist/footage/draft-overlays.js.map +1 -1
  23. package/dist/footage/draft.d.ts +14 -1
  24. package/dist/footage/draft.d.ts.map +1 -1
  25. package/dist/footage/draft.js +117 -17
  26. package/dist/footage/draft.js.map +1 -1
  27. package/dist/footage/drawn-transitions.d.ts +63 -0
  28. package/dist/footage/drawn-transitions.d.ts.map +1 -0
  29. package/dist/footage/drawn-transitions.js +177 -0
  30. package/dist/footage/drawn-transitions.js.map +1 -0
  31. package/dist/footage/edl.d.ts +42 -0
  32. package/dist/footage/edl.d.ts.map +1 -1
  33. package/dist/footage/edl.js +72 -2
  34. package/dist/footage/edl.js.map +1 -1
  35. package/dist/footage/film.d.ts +29 -5
  36. package/dist/footage/film.d.ts.map +1 -1
  37. package/dist/footage/film.js +13 -3
  38. package/dist/footage/film.js.map +1 -1
  39. package/dist/footage/hand-font.d.ts +16 -0
  40. package/dist/footage/hand-font.d.ts.map +1 -0
  41. package/dist/footage/hand-font.js +43 -0
  42. package/dist/footage/hand-font.js.map +1 -0
  43. package/dist/footage/overlay-html.d.ts +1 -0
  44. package/dist/footage/overlay-html.d.ts.map +1 -1
  45. package/dist/footage/overlay-html.js +134 -8
  46. package/dist/footage/overlay-html.js.map +1 -1
  47. package/dist/footage/overlay-motion.d.ts +35 -0
  48. package/dist/footage/overlay-motion.d.ts.map +1 -1
  49. package/dist/footage/overlay-motion.js +45 -0
  50. package/dist/footage/overlay-motion.js.map +1 -1
  51. package/dist/footage/overlay-schema.d.ts +48 -6
  52. package/dist/footage/overlay-schema.d.ts.map +1 -1
  53. package/dist/footage/overlay-schema.js +71 -18
  54. package/dist/footage/overlay-schema.js.map +1 -1
  55. package/dist/footage/overlays.d.ts +125 -1
  56. package/dist/footage/overlays.d.ts.map +1 -1
  57. package/dist/footage/overlays.js +265 -8
  58. package/dist/footage/overlays.js.map +1 -1
  59. package/dist/footage/picture.d.ts +10 -2
  60. package/dist/footage/picture.d.ts.map +1 -1
  61. package/dist/footage/picture.js +53 -13
  62. package/dist/footage/picture.js.map +1 -1
  63. package/dist/footage/pipeline.d.ts.map +1 -1
  64. package/dist/footage/pipeline.js +14 -4
  65. package/dist/footage/pipeline.js.map +1 -1
  66. package/dist/footage/split-screen.d.ts +167 -0
  67. package/dist/footage/split-screen.d.ts.map +1 -0
  68. package/dist/footage/split-screen.js +233 -0
  69. package/dist/footage/split-screen.js.map +1 -0
  70. package/dist/footage/tools.d.ts +1 -1
  71. package/dist/footage/tools.d.ts.map +1 -1
  72. package/dist/footage/tools.js +1 -1
  73. package/dist/footage/tools.js.map +1 -1
  74. package/dist/index.d.ts +8 -5
  75. package/dist/index.d.ts.map +1 -1
  76. package/dist/index.js +8 -5
  77. package/dist/index.js.map +1 -1
  78. package/fonts/Caveat-SemiBold-Latin.ttf +0 -0
  79. package/fonts/LICENSE-Caveat.txt +93 -0
  80. package/fonts/README.md +14 -0
  81. package/package.json +1 -1
  82. package/schema/edl.schema.json +167 -11
  83. package/schema/marketing.schema.json +19 -4
  84. package/src/config/config.ts +1 -0
  85. package/src/config/schema.ts +9 -3
  86. package/src/footage/captions.ts +32 -4
  87. package/src/footage/compose.ts +44 -11
  88. package/src/footage/draft-overlays.ts +217 -2
  89. package/src/footage/draft.ts +137 -17
  90. package/src/footage/drawn-transitions.ts +214 -0
  91. package/src/footage/edl.ts +67 -2
  92. package/src/footage/film.ts +23 -4
  93. package/src/footage/hand-font.ts +47 -0
  94. package/src/footage/overlay-html.ts +141 -7
  95. package/src/footage/overlay-motion.ts +49 -0
  96. package/src/footage/overlay-schema.ts +78 -19
  97. package/src/footage/overlays.ts +311 -10
  98. package/src/footage/picture.ts +58 -15
  99. package/src/footage/pipeline.ts +14 -4
  100. package/src/footage/split-screen.ts +319 -0
  101. package/src/footage/tools.ts +1 -1
  102. package/src/index.ts +62 -0
@@ -15,6 +15,7 @@ import {
15
15
  type OverlayExit,
16
16
  type OverlayKind,
17
17
  type OverlayListLayout,
18
+ type OverlayNoteStyle,
18
19
  type OverlayPosition,
19
20
  type OverlaySide,
20
21
  type OverlaySize,
@@ -22,8 +23,9 @@ import {
22
23
  import { isCameraMoving, isSameCamera } from "./camera.js";
23
24
  import { getSegmentZoomEases } from "./compose.js";
24
25
  import { normalizeWord } from "./words.js";
25
- import { getListItemStarts } from "./overlay-motion.js";
26
+ import { NOTE_FIRST_WORD_LEAD, NOTE_TICK_DELAY, getListItemStarts } from "./overlay-motion.js";
26
27
  import { STYLE_PADDING_SCALES, type BrandStyle, type CornerRadius } from "./brand-style.js";
28
+ import { measureHandText } from "./hand-font.js";
27
29
 
28
30
  /**
29
31
  * An EDL's overlays resolved for the render and the draft (issue #1200): each one's film time (from its word through
@@ -50,7 +52,29 @@ export const OVERLAY_FONT_SIZES: Record<TextOverlayKind, Record<OverlaySize, num
50
52
  place_card: { s: 70, m: 92, l: 118 },
51
53
  counter: { s: 84, m: 108, l: 132 },
52
54
  date_stamp: { s: 30, m: 36, l: 44 },
55
+ note: { s: 46, m: 56, l: 68 },
56
+ end_word: { s: 120, m: 150, l: 180 },
53
57
  };
58
+ /** A note strip's type size (its capitals), in px of a 1080 px wide frame; a note card's is `OVERLAY_FONT_SIZES.note`. */
59
+ export const NOTE_STRIP_FONT_SIZES: Record<OverlaySize, number> = { s: 38, m: 46, l: 54 };
60
+ /** A note's line height, and its padding round the text, in font sizes. */
61
+ export const NOTE_LINE_HEIGHT = 1.2;
62
+ export const NOTE_PADDING_EM = { x: 0.55, y: 0.4 } as const;
63
+ /** How deep a note's torn edge cuts into the paper, in font sizes (the card's foot, the strip's top). */
64
+ export const NOTE_TEAR_EM = 0.22;
65
+ /** The points along a note's torn edge. */
66
+ export const NOTE_TEAR_POINTS = 14;
67
+ /** A note's tick: its size and its gap after the last line, in font sizes. */
68
+ export const NOTE_TICK_EM = { size: 0.9, gap: 0.3 } as const;
69
+ /** The most words a line of a note card takes, and the most lines a note takes. */
70
+ export const MAX_NOTE_LINE_WORDS = 6;
71
+ export const MAX_NOTE_LINES = 4;
72
+ /** The share of the safe zone's width a note may take: a small card beside the subject, not a banner. */
73
+ export const NOTE_WIDTH_SHARE = 0.62;
74
+ /** A note's tilt in degrees, counter-clockwise positive as ASS turns (a note on the left leans back, on the right forward). */
75
+ export const NOTE_TILT = { card: 3, strip: 2 } as const;
76
+ /** A note's paper and ink without its own colours: an off-white paper and near-black ink, a green tick. */
77
+ export const NOTE_COLORS = { paper: "#fbf8f1", ink: "#1d1f24", tick: "#2f9e4f" } as const;
54
78
  /** A second line's type size in main font sizes: the hook title's place label, the subtitle, the unit, the stamp's place. */
55
79
  export const OVERLAY_SECONDARY_SCALE = { hook_title: 0.55, place_card: 0.55, counter: 0.5, date_stamp: 0.78 } as const;
56
80
  /** A place card's subtitle size in title sizes, by its `subtitle_size` (RV-131 of an adopting app: 0.42 read tiny). */
@@ -98,6 +122,9 @@ export const OVERLAY_FONT_ROLES: Record<TextOverlayKind, OverlayFontRole> = {
98
122
  list: "interface",
99
123
  search_bar: "interface",
100
124
  date_stamp: "interface",
125
+ // A note strip types in the heading font; a note card and an end word are handwritten (the kit's own `HAND_FONT`).
126
+ note: "heading",
127
+ end_word: "heading",
101
128
  };
102
129
 
103
130
  /** A box in the film's frame, in px. */
@@ -157,6 +184,8 @@ export type ResolvedOverlay =
157
184
  underline?: boolean;
158
185
  /** Its card sits in the middle of `box`, its text centred (`style.align` center); absent: on its side. */
159
186
  isCentred?: boolean;
187
+ /** Its text on a tight box (`style.backdrop` highlight); absent: the card. */
188
+ backdrop?: "highlight";
160
189
  })
161
190
  | (Drawn & { kind: "lower_third"; text: string; fontSize: number; side: OverlaySide; box: OverlayBox })
162
191
  | (Drawn & {
@@ -173,7 +202,17 @@ export type ResolvedOverlay =
173
202
  })
174
203
  | (Drawn & { kind: "arrow"; from: OverlayPoint; to: OverlayPoint })
175
204
  | (Drawn & { kind: "highlight"; rect: OverlayBox })
176
- | (Drawn & { kind: "hook_title"; lines: string[]; place: string | null; fontSize: number; placeFontSize: number; align?: OverlayAlign; box: OverlayBox })
205
+ | (Drawn & {
206
+ kind: "hook_title";
207
+ lines: string[];
208
+ place: string | null;
209
+ fontSize: number;
210
+ placeFontSize: number;
211
+ align?: OverlayAlign;
212
+ box: OverlayBox;
213
+ /** Each line on its own tight box (`style.backdrop` highlight); absent: the card. */
214
+ backdrop?: "highlight";
215
+ })
177
216
  | (Drawn & { kind: "search_bar"; text: string; fontSize: number; box: OverlayBox })
178
217
  | (Drawn & {
179
218
  kind: "place_card";
@@ -189,7 +228,27 @@ export type ResolvedOverlay =
189
228
  subtitleDelay?: number;
190
229
  })
191
230
  | (Drawn & { kind: "counter"; value: number; from: number; decimals: number; unit: string | null; fontSize: number; unitFontSize: number; box: OverlayBox })
192
- | (Drawn & { kind: "date_stamp"; text: string; place: string | null; fontSize: number; placeFontSize: number; side: OverlaySide; box: OverlayBox });
231
+ | (Drawn & { kind: "date_stamp"; text: string; place: string | null; fontSize: number; placeFontSize: number; side: OverlaySide; box: OverlayBox })
232
+ | (Drawn & {
233
+ kind: "note";
234
+ noteStyle: OverlayNoteStyle;
235
+ /** Its lines as drawn (a strip's in capitals). */
236
+ lines: string[];
237
+ fontSize: number;
238
+ side: OverlaySide;
239
+ /** Its paper, unturned; it is drawn turned by `tilt` degrees about its middle. */
240
+ box: OverlayBox;
241
+ tilt: number;
242
+ /** The torn edge's depth at each of `NOTE_TEAR_POINTS` points, 0 to 1 of `NOTE_TEAR_EM`. */
243
+ tear: number[];
244
+ /** The film second each word comes in at, in reading order (a card's words as they are said); null: a strip, typed. */
245
+ wordTimes: number[] | null;
246
+ /** Whether a hand tick is drawn after its last word (`style.tick`). */
247
+ tick: boolean;
248
+ /** The film second its tick starts being drawn; null without one. */
249
+ tickAt: number | null;
250
+ })
251
+ | (Drawn & { kind: "end_word"; text: string; fontSize: number; box: OverlayBox });
193
252
 
194
253
  export type ResolvedOverlaysResult = { ok: true; overlays: ResolvedOverlay[] } | { ok: false; problems: string[] };
195
254
 
@@ -264,6 +323,22 @@ export function estimateTextWidth(text: string, fontSize: number): number {
264
323
  return Math.ceil([...text].length * OVERLAY_CHAR_EM * fontSize - 1e-6);
265
324
  }
266
325
 
326
+ /** A line's width at a font size, in px. */
327
+ export type TextMeasure = (text: string, fontSize: number) => number;
328
+
329
+ /** How a note's line is measured: a card's handwriting from the hand font itself, a strip's capitals by their own wider average. */
330
+ export function getNoteMeasure(noteStyle: OverlayNoteStyle): TextMeasure {
331
+ return noteStyle === "card" ? measureHandText : measureStripText;
332
+ }
333
+
334
+ /** A strip's capitals per character, in font sizes: bold capitals run about 0.72 em, plus the strip's letter spacing. */
335
+ export const NOTE_STRIP_CHAR_EM = 0.76;
336
+
337
+ /** How wide a strip's capitals are at `fontSize`: wider than `estimateTextWidth`'s mixed-case average. */
338
+ function measureStripText(text: string, fontSize: number): number {
339
+ return Math.ceil([...text].length * NOTE_STRIP_CHAR_EM * fontSize - 1e-6);
340
+ }
341
+
267
342
  /** Text broken into lines at spaces so each fits `width` at `fontSize` by the estimate; a word longer than a line stands alone. */
268
343
  export function wrapOverlayText(text: string, fontSize: number, width: number): string[] {
269
344
  const lines: string[] = [];
@@ -443,7 +518,12 @@ export function resolveEdlOverlays(input: ResolveOverlaysInput): ResolvedOverlay
443
518
  const segment = findSegmentAt(edl, start);
444
519
  const segmentStart = starts[segment] as number;
445
520
  const segmentId = edl.segments[segment]?.id ?? "";
446
- if (overlay.kind !== "hook_title") {
521
+ const split = edl.segments.findIndex((candidate, i) => candidate.split !== undefined && (starts[i] as number) < end - 0.001 && start < (starts[i] as number) + candidate.end - candidate.start - 0.001);
522
+ if (split !== -1) {
523
+ problems.push(`${at}: segment "${edl.segments[split]?.id ?? ""}" is a split screen with its own labels and arrows; keep overlays off it`);
524
+ return;
525
+ }
526
+ if (!isTitleBand(overlay.kind)) {
447
527
  const shot = findShotSpan(edl, starts, { segment, end, isPunchIn: overlay.kind === "punch_in" });
448
528
  if (end > shot.end + 0.01) {
449
529
  const inside = shot.last === segment ? `segment "${segmentId}"` : `segments "${segmentId}" to "${edl.segments[shot.last]?.id ?? ""}"`;
@@ -468,6 +548,11 @@ export function resolveEdlOverlays(input: ResolveOverlaysInput): ResolvedOverlay
468
548
  // The first point comes in with the card, so the card never stands empty (RV-144 of an adopting app).
469
549
  placed.overlay.itemStarts = getListItemStarts({ start, end, count: placed.overlay.items.length, ...(times === undefined ? {} : { words: times }) }).map((at, item) => (item === 0 ? start : at));
470
550
  }
551
+ if (placed.overlay.kind === "note") {
552
+ const timed = timeNote(placed.overlay, input.words);
553
+ placed.overlay.wordTimes = timed.wordTimes;
554
+ placed.overlay.tickAt = timed.tickAt;
555
+ }
471
556
  if (placed.overlay.kind === "punch_in") {
472
557
  if (edl.segments[segment]?.motion === "kenburns") {
473
558
  problems.push(`${at}: segment "${segmentId}" has a Ken Burns zoom, which owns the picture's scale; put the punch-in on a still segment`);
@@ -490,6 +575,11 @@ export function resolveEdlOverlays(input: ResolveOverlaysInput): ResolvedOverlay
490
575
  return problems.length > 0 ? { ok: false, problems } : { ok: true, overlays: ordered };
491
576
  }
492
577
 
578
+ /** The kinds that live in the top band (a hook title, an end word): not counted against one overlay at a time. */
579
+ export function isTitleBand(kind: OverlayKind): boolean {
580
+ return kind === "hook_title" || kind === "end_word";
581
+ }
582
+
493
583
  /** Whether two overlays are on screen at the same time. */
494
584
  function isConcurrent(a: ResolvedOverlay, b: ResolvedOverlay): boolean {
495
585
  return a.start < b.end - 0.001 && b.start < a.end - 0.001;
@@ -498,7 +588,7 @@ function isConcurrent(a: ResolvedOverlay, b: ResolvedOverlay): boolean {
498
588
  /** Two overlays on screen at once, two too close, two hook titles at once, or a drawing on a hook title while it shows. */
499
589
  function findTimingProblems(ordered: readonly ResolvedOverlay[], spacing: number): string[] {
500
590
  const problems: string[] = [];
501
- const counted = ordered.filter((overlay) => overlay.kind !== "hook_title");
591
+ const counted = ordered.filter((overlay) => !isTitleBand(overlay.kind));
502
592
  counted.forEach((overlay, place) => {
503
593
  const previous = counted[place - 1];
504
594
  if (previous === undefined) return;
@@ -508,17 +598,18 @@ function findTimingProblems(ordered: readonly ResolvedOverlay[], spacing: number
508
598
  problems.push(`overlays[${overlay.index}]: starts ${r1(overlay.start - previous.start)} s after overlays[${previous.index}]; the film keeps overlays ${spacing} s apart (overlayMinSpacing)`);
509
599
  }
510
600
  });
511
- const titles = ordered.filter((overlay) => overlay.kind === "hook_title");
601
+ const titles = ordered.filter((overlay): overlay is Extract<ResolvedOverlay, { kind: "hook_title" | "end_word" }> => isTitleBand(overlay.kind));
512
602
  titles.forEach((title, place) => {
603
+ const name = title.kind.replace("_", " ");
513
604
  const previous = titles[place - 1];
514
605
  if (previous !== undefined && isConcurrent(title, previous)) {
515
- problems.push(`overlays[${title.index}]: starts at ${title.start} s while the hook title overlays[${previous.index}] is on screen (until ${previous.end} s); one hook title at a time`);
606
+ problems.push(`overlays[${title.index}]: starts at ${title.start} s while the ${previous.kind.replace("_", " ")} overlays[${previous.index}] is on screen (until ${previous.end} s); one title at the top at a time`);
516
607
  }
517
608
  const titleBox = title.box;
518
609
  for (const other of counted) {
519
610
  const bounds = getOverlayBounds(other);
520
611
  if (bounds === null || !isConcurrent(title, other) || !isOverlapping(bounds, titleBox)) continue;
521
- problems.push(`overlays[${other.index}]: the ${other.kind.replace("_", " ")} would sit on the hook title overlays[${title.index}] (on screen until ${title.end} s); move it lower or start it after the title`);
612
+ problems.push(`overlays[${other.index}]: the ${other.kind.replace("_", " ")} would sit on the ${name} overlays[${title.index}] (on screen until ${title.end} s); move it lower or start it after the ${name}`);
522
613
  }
523
614
  });
524
615
  return problems;
@@ -580,9 +671,149 @@ function placeOverlay(overlay: EdlOverlay, base: OverlayBase, place: Placement):
580
671
  const drawn = { ...base, ...getLook(overlay), ...(place.padScale === 1 ? {} : { padScale: place.padScale }) };
581
672
  if (overlay.kind === "arrow" || overlay.kind === "highlight") return placeMark(overlay, drawn, place);
582
673
  if (overlay.kind === "keyword" || overlay.kind === "lower_third" || overlay.kind === "list") return placeSideText({ ...overlay, kind: overlay.kind }, drawn, place);
674
+ if (overlay.kind === "note") return placeNote(overlay, drawn, place);
675
+ if (overlay.kind === "end_word") return placeEndWord(overlay, drawn, place);
583
676
  return placeCard({ ...overlay, kind: overlay.kind }, drawn, place);
584
677
  }
585
678
 
679
+ /** A note's lines: broken at spaces to fit `width`, at most `MAX_NOTE_LINE_WORDS` words a line; null when a word alone is wider. */
680
+ export function wrapNoteText(text: string, fontSize: number, width: number, measure: TextMeasure = estimateTextWidth): string[] | null {
681
+ const lines: string[][] = [];
682
+ for (const word of text.split(/\s+/).filter((part) => part.length > 0)) {
683
+ if (measure(word, fontSize) > width) return null;
684
+ const last = lines[lines.length - 1];
685
+ if (last !== undefined && last.length < MAX_NOTE_LINE_WORDS && measure([...last, word].join(" "), fontSize) <= width) last.push(word);
686
+ else lines.push([word]);
687
+ }
688
+ return lines.map((line) => line.join(" "));
689
+ }
690
+
691
+ /** A number from 0 to 1 for each of `count` points, the same for the same text: a torn edge that is not a pattern. */
692
+ export function getTornEdge(text: string, count = NOTE_TEAR_POINTS): number[] {
693
+ let seed = 2166136261;
694
+ for (const char of text) seed = Math.imul(seed ^ (char.codePointAt(0) ?? 0), 16777619) >>> 0;
695
+ return Array.from({ length: count }, () => {
696
+ seed = (Math.imul(seed, 1664525) + 1013904223) >>> 0;
697
+ return r3(0.25 + 0.75 * (seed / 4294967296));
698
+ });
699
+ }
700
+
701
+ /** A note's tick size and the gap before it, in px. */
702
+ export function getNoteTickSize(fontSize: number): { size: number; gap: number } {
703
+ return { size: Math.round(fontSize * NOTE_TICK_EM.size), gap: Math.round(fontSize * NOTE_TICK_EM.gap) };
704
+ }
705
+
706
+ /** A note's padding round its text, in px. */
707
+ export function getNotePadding(fontSize: number): { x: number; y: number; tear: number } {
708
+ return { x: Math.round(fontSize * NOTE_PADDING_EM.x), y: Math.round(fontSize * NOTE_PADDING_EM.y), tear: Math.round(fontSize * NOTE_TEAR_EM) };
709
+ }
710
+
711
+ /** A note's text block inside its paper: its left edge and top, in px (the tear takes the card's foot, the strip's top). */
712
+ export function getNoteTextBox(note: Pick<Extract<ResolvedOverlay, { kind: "note" }>, "box" | "fontSize" | "noteStyle" | "lines">): OverlayBox {
713
+ const pad = getNotePadding(note.fontSize);
714
+ const top = note.box.top + pad.y + (note.noteStyle === "strip" ? pad.tear : 0);
715
+ return { left: note.box.left + pad.x, top, width: note.box.width - 2 * pad.x, height: note.lines.length * note.fontSize * NOTE_LINE_HEIGHT };
716
+ }
717
+
718
+ /**
719
+ * A note: a paper card (handwritten, its words coming in as they are said) or a strip (typed capitals), on its side
720
+ * in the top or the middle of the room above the captions, at most `NOTE_WIDTH_SHARE` of the safe width; a text that
721
+ * takes more than `MAX_NOTE_LINES` lines is refused.
722
+ */
723
+ function placeNote(overlay: EdlOverlay, drawn: Drawn, place: Placement): Placed {
724
+ const { zone, frame } = place;
725
+ const scale = frame.width / 1080;
726
+ const noteStyle = overlay.style?.note_style ?? "card";
727
+ const size = overlay.style?.size ?? "m";
728
+ const fontSize = Math.round((noteStyle === "strip" ? NOTE_STRIP_FONT_SIZES : OVERLAY_FONT_SIZES.note)[size] * scale);
729
+ const pad = getNotePadding(fontSize);
730
+ const margin = Math.round(OVERLAY_MARGIN * scale);
731
+ const room = Math.round((frame.width - zone.left - zone.right - 2 * margin) * NOTE_WIDTH_SHARE) - 2 * pad.x;
732
+ const text = noteStyle === "strip" ? (overlay.text ?? "").toUpperCase() : (overlay.text ?? "");
733
+ const measure = getNoteMeasure(noteStyle);
734
+ const lines = wrapNoteText(text, fontSize, room, measure);
735
+ if (lines === null) return { ok: false, error: "a word of the note is too wide for its card; shorten it or use a smaller size" };
736
+ if (lines.length > MAX_NOTE_LINES) return { ok: false, error: `the note takes ${lines.length} lines, more than ${MAX_NOTE_LINES}; shorten it or use a smaller size` };
737
+ const isTick = overlay.style?.tick === true;
738
+ const tick = getNoteTickSize(fontSize);
739
+ const lastWidth = measure(lines[lines.length - 1] ?? "", fontSize) + (isTick ? tick.gap + tick.size : 0);
740
+ const contentWidth = Math.max(lastWidth, ...lines.map((line) => measure(line, fontSize)));
741
+ if (contentWidth > room) return { ok: false, error: "the note's last line and its tick are too wide for its card; shorten it or leave the tick out" };
742
+ const width = Math.ceil(contentWidth + 2 * pad.x);
743
+ const height = Math.ceil(lines.length * fontSize * NOTE_LINE_HEIGHT + 2 * pad.y + pad.tear);
744
+ const region = getTextRegion(place);
745
+ const top = getPositionTop(region, overlay.style?.position ?? "top", height);
746
+ if (top < region.top || top + height > region.bottom) {
747
+ return { ok: false, error: `the note (${height} px tall) does not fit between the platform safe zone and the captions; use a smaller size or shorter text` };
748
+ }
749
+ const side = overlay.style?.side ?? "left";
750
+ const left = side === "right" ? frame.width - zone.right - margin - width : zone.left + margin;
751
+ const tilt = (side === "right" ? -1 : 1) * NOTE_TILT[noteStyle];
752
+ return {
753
+ ok: true,
754
+ overlay: { ...drawn, kind: "note", noteStyle, lines, fontSize, side, box: { left, top, width, height }, tilt, tear: getTornEdge(text), wordTimes: null, tick: isTick, tickAt: null },
755
+ };
756
+ }
757
+
758
+ /**
759
+ * A note card's word times and its tick's start: each word of the note comes in on the same word said inside its span
760
+ * (matched in order, compared like fillers are), a word not said with the one before it; when none is said, the words
761
+ * are spaced over the first part of the span. The card is there one frame before its first word, and no word comes
762
+ * later than 0.6 s before its end. A strip types its text (`getTypingTimes`), its tick after its last letter.
763
+ */
764
+ export function timeNote(note: Extract<ResolvedOverlay, { kind: "note" }>, words: readonly TimedWord[]): { wordTimes: number[] | null; tickAt: number | null } {
765
+ // The tick comes after the last word, but never in the note's last 0.4 s nor before it starts.
766
+ const tickAfter = (at: number): number | null => (note.tick ? r3(Math.max(note.start, Math.min(note.end - 0.4, at + NOTE_TICK_DELAY))) : null);
767
+ const noteWords = note.lines.join(" ").split(" ");
768
+ const first = r3(note.start + NOTE_FIRST_WORD_LEAD);
769
+ const latest = r3(Math.max(first, note.end - 0.6));
770
+ if (note.noteStyle === "strip") {
771
+ const typed = note.typing ?? DEFAULT_OVERLAY_TYPING_SPEED;
772
+ const lastLetter = note.start + 0.3 + ([...note.lines.join("")].length - 1) / typed;
773
+ return { wordTimes: null, tickAt: tickAfter(lastLetter) };
774
+ }
775
+ const said = words.filter((word) => word.start >= note.start - 0.05 && word.start < note.end);
776
+ let cursor = 0;
777
+ let previous: number | null = null;
778
+ const matched = noteWords.map((word) => {
779
+ const key = normalizeWord(word);
780
+ const found = said.findIndex((spoken, index) => index >= cursor && normalizeWord(spoken.text) === key);
781
+ if (found === -1) return previous;
782
+ cursor = found + 1;
783
+ previous = said[found]?.start ?? null;
784
+ return previous;
785
+ });
786
+ const isSaid = matched.some((time) => time !== null);
787
+ const gap = Math.min(0.35, Math.max(0.12, ((note.end - note.start) * 0.5) / noteWords.length));
788
+ const times = noteWords.map((_word, index) => {
789
+ const at = isSaid ? (matched[index] ?? first) : first + index * gap;
790
+ return r3(Math.min(latest, Math.max(first, at)));
791
+ });
792
+ // Never earlier than the word before: a later word matched before an earlier one keeps the reading order.
793
+ for (let index = 1; index < times.length; index++) times[index] = Math.max(times[index] as number, times[index - 1] as number);
794
+ return { wordTimes: times, tickAt: tickAfter(times[times.length - 1] ?? first) };
795
+ }
796
+
797
+ /** An end word: one big handwritten line at the top of the room, no card, shrunk to fit the width or refused. */
798
+ function placeEndWord(overlay: EdlOverlay, drawn: Drawn, place: Placement): Placed {
799
+ const { zone, frame } = place;
800
+ const scale = frame.width / 1080;
801
+ const margin = Math.round(OVERLAY_MARGIN * scale);
802
+ const room = frame.width - zone.left - zone.right - 2 * margin;
803
+ const text = (overlay.text ?? "").replace(/\s+/g, " ").trim();
804
+ let fontSize = Math.round(OVERLAY_FONT_SIZES.end_word[overlay.style?.size ?? "m"] * scale);
805
+ for (let shrink = 0; measureHandText(text, fontSize) > room; shrink++) {
806
+ if (shrink === MAX_TITLE_SHRINKS) return { ok: false, error: "the end word is too wide for one line even at a smaller size; shorten it or use a smaller size" };
807
+ fontSize = Math.round(fontSize * OVERLAY_TITLE_SHRINK);
808
+ }
809
+ const width = measureHandText(text, fontSize);
810
+ const height = Math.ceil(fontSize * OVERLAY_LINE_HEIGHT);
811
+ const region = getTextRegion(place);
812
+ if (region.top + height > region.bottom) return { ok: false, error: `the end word (${height} px tall) does not fit above the captions; use a smaller size` };
813
+ const left = Math.round(zone.left + margin + (room - width) / 2);
814
+ return { ok: true, overlay: { ...drawn, kind: "end_word", text, fontSize, box: { left, top: region.top, width, height } } };
815
+ }
816
+
586
817
  /** An arrow's tail and point, or a highlight's rectangle. */
587
818
  function placeMark(overlay: EdlOverlay, drawn: Drawn, place: Placement): Placed {
588
819
  const { zone, frame } = place;
@@ -643,7 +874,14 @@ function placeSideText(overlay: EdlOverlay & { kind: "keyword" | "lower_third" |
643
874
  if (overlay.kind === "lower_third") return { ok: true, overlay: { ...drawn, kind: "lower_third", ...fields } };
644
875
  return {
645
876
  ok: true,
646
- overlay: { ...drawn, kind: "keyword", ...fields, ...(overlay.style?.underline === true ? { underline: true } : {}), ...(align === "center" ? { isCentred: true } : {}) },
877
+ overlay: {
878
+ ...drawn,
879
+ kind: "keyword",
880
+ ...fields,
881
+ ...(overlay.style?.underline === true ? { underline: true } : {}),
882
+ ...(align === "center" ? { isCentred: true } : {}),
883
+ ...(overlay.style?.backdrop === "highlight" ? { backdrop: "highlight" as const } : {}),
884
+ },
647
885
  };
648
886
  }
649
887
 
@@ -821,7 +1059,7 @@ function measureTitle(overlay: EdlOverlay & { kind: "hook_title" | "place_card"
821
1059
  content: {
822
1060
  ...getTitleContentSize({ kind: overlay.kind, lines, fontSize, second, secondSize, pin: pin !== undefined }),
823
1061
  fields: isHook
824
- ? { kind: "hook_title", lines, place: second, fontSize, placeFontSize: secondSize, align }
1062
+ ? { kind: "hook_title", lines, place: second, fontSize, placeFontSize: secondSize, align, ...(overlay.style?.backdrop === "highlight" ? { backdrop: "highlight" } : {}) }
825
1063
  : { kind: "place_card", lines, subtitle: second, fontSize, subtitleFontSize: secondSize, align, ...(pin === undefined ? {} : { pin }), ...(delay === undefined ? {} : { subtitleDelay: delay }) },
826
1064
  },
827
1065
  };
@@ -918,6 +1156,9 @@ export function getOverlayTextsByRole(overlays: readonly ResolvedOverlay[], loca
918
1156
  texts.heading.push(formatOverlayNumber(overlay.value, overlay.decimals, locale), "0123456789", ...(overlay.unit === null ? [] : [overlay.unit]));
919
1157
  } else if (overlay.kind === "date_stamp") {
920
1158
  texts.interface.push(overlay.text, ...(overlay.place === null ? [] : [overlay.place]));
1159
+ } else if (overlay.kind === "note" && overlay.noteStyle === "strip") {
1160
+ // A note card and an end word are drawn in the kit's own handwriting, which covers every Latin letter.
1161
+ texts.heading.push(...overlay.lines);
921
1162
  }
922
1163
  }
923
1164
  return texts;
@@ -928,3 +1169,63 @@ export function getOverlayTexts(overlays: readonly ResolvedOverlay[], locale = "
928
1169
  const texts = getOverlayTextsByRole(overlays, locale);
929
1170
  return [...texts.heading, ...texts.interface];
930
1171
  }
1172
+
1173
+ type NoteOverlay = Extract<ResolvedOverlay, { kind: "note" }>;
1174
+
1175
+ /**
1176
+ * A note's paper as a polygon in px of the frame, before its tilt: straight sides and a torn edge (`tear`) along the
1177
+ * card's foot or the strip's top, cutting at most `NOTE_TEAR_EM` into the paper. Both paths draw this outline.
1178
+ */
1179
+ export function getNotePaperPoints(note: Pick<NoteOverlay, "box" | "fontSize" | "noteStyle" | "tear">): OverlayPoint[] {
1180
+ const { left, top, width, height } = note.box;
1181
+ const depth = getNotePadding(note.fontSize).tear;
1182
+ const last = Math.max(1, note.tear.length - 1);
1183
+ const torn = note.tear.map((share, index) => ({ x: r1(left + (width * index) / last), share }));
1184
+ if (note.noteStyle === "strip") {
1185
+ const edge = torn.map(({ x, share }) => ({ x, y: r1(top + depth * share) }));
1186
+ return [...edge, { x: left + width, y: top + height }, { x: left, y: top + height }];
1187
+ }
1188
+ const edge = torn.map(({ x, share }) => ({ x, y: r1(top + height - depth * share) })).reverse();
1189
+ return [{ x: left, y: top }, { x: left + width, y: top }, ...edge];
1190
+ }
1191
+
1192
+ /** The middle of a note's paper: the point its tilt turns it about. */
1193
+ export function getNoteCentre(note: Pick<NoteOverlay, "box">): OverlayPoint {
1194
+ return { x: r1(note.box.left + note.box.width / 2), y: r1(note.box.top + note.box.height / 2) };
1195
+ }
1196
+
1197
+ /** A note's tick as three points of a hand-drawn check (down to the left, then a long stroke up), in px before the tilt. */
1198
+ export function getNoteTickPoints(note: Pick<NoteOverlay, "box" | "fontSize" | "noteStyle" | "lines">): OverlayPoint[] {
1199
+ const text = getNoteTextBox(note);
1200
+ const tick = getNoteTickSize(note.fontSize);
1201
+ const lastTop = text.top + (note.lines.length - 1) * note.fontSize * NOTE_LINE_HEIGHT;
1202
+ const x = text.left + getNoteMeasure(note.noteStyle)(note.lines[note.lines.length - 1] ?? "", note.fontSize) + tick.gap;
1203
+ const y = lastTop + (note.fontSize * NOTE_LINE_HEIGHT - tick.size) / 2;
1204
+ return [
1205
+ { x: r1(x), y: r1(y + tick.size * 0.55) },
1206
+ { x: r1(x + tick.size * 0.35), y: r1(y + tick.size * 0.9) },
1207
+ { x: r1(x + tick.size), y: r1(y + tick.size * 0.08) },
1208
+ ];
1209
+ }
1210
+
1211
+ /** A note's words line by line, each with its film second (a card's `wordTimes`; a strip's are typed, so its start). */
1212
+ export function getNoteWordsByLine(note: Pick<NoteOverlay, "lines" | "wordTimes" | "start">): { text: string; at: number }[][] {
1213
+ let index = 0;
1214
+ return note.lines.map((line) =>
1215
+ line.split(" ").map((text) => {
1216
+ const at = note.wordTimes?.[index] ?? note.start;
1217
+ index += 1;
1218
+ return { text, at };
1219
+ }),
1220
+ );
1221
+ }
1222
+
1223
+ /** A note's paper, ink and tick colours: its own (`style.colors` card, text, accent), else paper, near-black and green. */
1224
+ export function getNoteColors(note: Pick<NoteOverlay, "colors">): { paper: string; ink: string; tick: string } {
1225
+ return { paper: note.colors.card ?? NOTE_COLORS.paper, ink: note.colors.text ?? NOTE_COLORS.ink, tick: note.colors.accent ?? NOTE_COLORS.tick };
1226
+ }
1227
+
1228
+ /** Whether the overlays draw in the kit's handwriting: a note card or an end word. */
1229
+ export function isHandFontNeeded(overlays: readonly ResolvedOverlay[]): boolean {
1230
+ return overlays.some((overlay) => overlay.kind === "end_word" || (overlay.kind === "note" && overlay.noteStyle === "card"));
1231
+ }
@@ -1,8 +1,10 @@
1
1
  import { CAMERA_ORIGIN, getCameraOrigin, type CameraAnchor } from "./camera.js";
2
- import { getSegmentFadeFrames, getSegmentScales } from "./compose.js";
2
+ import { getSegmentScales } from "./compose.js";
3
+ import { buildDrawnTransitionFilters, FRAME_TIMING, getTransitionOverlapFrames, isDrawnTransition, type DrawnTransition } from "./drawn-transitions.js";
3
4
  import { getEdlDuration, getSegmentStarts, type Edl } from "./edl.js";
4
5
  import { getFootageEdit, type FootageFilm } from "./film.js";
5
6
  import { FOOTAGE_FPS, getThreadArgs, type Frame, type NormalizeEncoder } from "./normalize.js";
7
+ import { buildSplitScreenFilters, getSplitLayerInputArgs, type EdlSplit } from "./split-screen.js";
6
8
 
7
9
  /**
8
10
  * The cut's picture in film time, which the render's composition plays as one `<video>`: one short ffmpeg per segment
@@ -12,8 +14,9 @@ import { FOOTAGE_FPS, getThreadArgs, type Frame, type NormalizeEncoder } from ".
12
14
  *
13
15
  * Every piece starts on a film frame and runs to the next segment's frame, so rounding never adds up along the cut.
14
16
  * A cross-fade is drawn into the incoming piece: the outgoing segment's tail, held at the zoom it ends on, dissolves
15
- * into the incoming clip (`xfade`), as the per-segment composition plays it. Zoom cuts and Ken Burns stay tweens on
16
- * the composition's video.
17
+ * into the incoming clip (`xfade`), as the per-segment composition plays it. A drawn transition (`whip`, `card`,
18
+ * `paper`) takes the same tail and blends it with the piece's head (`buildDrawnTransitionFilters`), as the draft does.
19
+ * Zoom cuts and Ken Burns stay tweens on the composition's video.
17
20
  */
18
21
 
19
22
  /** How far a segment marked `kenburns` zooms when the film's `kenBurnsPercent` is 0, as in the composition. */
@@ -24,8 +27,10 @@ const DEFAULT_PICTURE_PRESET = "veryfast";
24
27
  const r3 = (value: number): number => Math.round(value * 1000) / 1000 || 0;
25
28
  const r4 = (value: number): number => Math.round(value * 10000) / 10000 || 0;
26
29
 
27
- /** The outgoing segment's tail under a cross-fade. */
30
+ /** The outgoing segment's tail under a cross-fade or a drawn transition. */
28
31
  export interface PictureFadeTail {
32
+ /** How the tail meets the piece: a drawn transition of exactly `frames`; absent: a dissolve. */
33
+ kind?: DrawnTransition;
29
34
  clip: string;
30
35
  /** Seconds in the clip: where the outgoing segment ends. */
31
36
  start: number;
@@ -44,8 +49,10 @@ export interface PicturePiece {
44
49
  /** The piece's first film frame. */
45
50
  frame: number;
46
51
  frames: number;
47
- /** For a `fade` cut, the outgoing tail the piece dissolves from; null for any other cut. */
52
+ /** For a `fade` cut or a drawn transition, the outgoing tail the piece starts over; null for any other cut. */
48
53
  fade: PictureFadeTail | null;
54
+ /** The segment's split screen: the piece is its three bands under its layer (`split-screen.ts`); absent: `clip`. */
55
+ split?: EdlSplit;
49
56
  }
50
57
 
51
58
  /** The film frame a film second falls on. */
@@ -66,9 +73,13 @@ export function planFootagePicture(film: Pick<FootageFilm, "edit">, edl: Edl): P
66
73
  const nextStart = starts[index + 1];
67
74
  const frames = Math.max(1, (nextStart === undefined ? lastFrame : toFrame(nextStart)) - frame);
68
75
  const previous = edl.segments[index - 1];
69
- const fadeFrames = Math.min(frames, getSegmentFadeFrames(edl, index, edit));
76
+ const overlap = index === 0 ? 0 : getTransitionOverlapFrames(segment, edit.fadeFrames);
77
+ const kind = segment.transition === "fade" ? "fade" : isDrawnTransition(segment.transition) ? segment.transition : null;
78
+ // A dissolve fits the piece; a drawn transition has its own frames, and a piece too short for them (the EDL check
79
+ // refuses one) plays a plain cut.
80
+ const fadeFrames = kind === "fade" ? Math.min(frames, overlap) : kind !== null && overlap < frames ? overlap : 0;
70
81
  let fade: PictureFadeTail | null = null;
71
- if (previous !== undefined && fadeFrames > 0) {
82
+ if (previous !== undefined && kind !== null && fadeFrames > 0) {
72
83
  const previousScale = scales[index - 1] as number;
73
84
  // The outgoing segment's Ken Burns tween or camera move ends by its end; its tail holds the zoom it reached.
74
85
  const reached = previous.camera !== undefined ? previous.camera.to : previous.motion === "kenburns" ? r4(previousScale * kenBurnsScale) : previousScale;
@@ -76,9 +87,9 @@ export function planFootagePicture(film: Pick<FootageFilm, "edit">, edl: Edl): P
76
87
  // baked at what is left of its zoom (never below the full frame: a fade into a tighter camera is a hard cut's job).
77
88
  const isCamera = previous.camera !== undefined || segment.camera !== undefined;
78
89
  const scale = isCamera ? r4(Math.max(1, reached / (scales[index] as number))) : reached;
79
- fade = { clip: previous.clip, start: r3(previous.end), frames: fadeFrames, scale, origin: getCameraOrigin(previous.camera) };
90
+ fade = { ...(kind === "fade" ? {} : { kind }), clip: previous.clip, start: r3(previous.end), frames: fadeFrames, scale, origin: getCameraOrigin(previous.camera) };
80
91
  }
81
- return { clip: segment.clip, start: r3(segment.start), frame, frames, fade };
92
+ return { clip: segment.clip, start: r3(segment.start), frame, frames, fade, ...(segment.split === undefined ? {} : { split: segment.split }) };
82
93
  });
83
94
  }
84
95
 
@@ -125,6 +136,8 @@ export interface PicturePieceArgsInput {
125
136
  output: string;
126
137
  /** The intermediate clips' encoder (`RenderFootageOptions.normalize`): its preset and threads encode the piece too. */
127
138
  encoder?: NormalizeEncoder;
139
+ /** A split piece's layer (`renderSplitLayerPng` at `frame`'s size); needed when the piece has a `split`. */
140
+ splitLayer?: string;
128
141
  }
129
142
 
130
143
  /** One piece's ffmpeg arguments: its clip (and a fade's outgoing tail), exactly `frames` frames, H.264 without sound. */
@@ -137,19 +150,32 @@ export function buildPicturePieceArgs(input: PicturePieceArgsInput): string[] {
137
150
  };
138
151
  const threads = getThreadArgs(input.encoder?.threads, "normalize.threads");
139
152
  const seconds = (frames: number): string => String(r3(frames / FOOTAGE_FPS + 1 / FOOTAGE_FPS));
140
- const inputs = [...threads.output, "-ss", String(piece.start), "-t", seconds(piece.frames), "-i", getClip(piece.clip)];
141
- let graph = `[0:v]${fitStream(piece.frames).join(",")}[picture]`;
153
+ const inputs: string[] = [];
154
+ const prelude: string[] = [];
155
+ let source = `[0:v]${fitStream(piece.frames).join(",")}`;
156
+ if (piece.split === undefined) {
157
+ inputs.push(...threads.output, "-ss", String(piece.start), "-t", seconds(piece.frames), "-i", getClip(piece.clip));
158
+ } else {
159
+ if (input.splitLayer === undefined) throw new Error("A split piece needs its layer (splitLayer).");
160
+ for (const band of piece.split.bands) inputs.push(...threads.output, "-ss", String(r3(band.start)), "-t", seconds(piece.frames), "-i", getClip(band.clip));
161
+ inputs.push(...getSplitLayerInputArgs(input.splitLayer, Number(seconds(piece.frames)), FOOTAGE_FPS));
162
+ prelude.push(...buildSplitScreenFilters({ inputs: ["0:v", "1:v", "2:v"], layer: "3:v", split: piece.split, frame: input.frame, fit: fitStream(piece.frames), output: "split", prefix: "sp" }));
163
+ source = "[split]null";
164
+ }
165
+ const tailInput = piece.split === undefined ? 1 : 4;
166
+ let graph = `${source}[picture]`;
142
167
  if (piece.fade !== null) {
143
168
  const { fade } = piece;
144
169
  inputs.push(...threads.output, "-ss", String(fade.start), "-t", seconds(fade.frames), "-i", getClip(fade.clip));
145
170
  const tail = [...zoomFilters(fade.scale, input.frame, fade.origin ?? CAMERA_ORIGIN), ...fitStream(fade.frames)];
146
- graph = [
147
- `[0:v]${fitStream(piece.frames).join(",")}[incoming]`,
148
- `[1:v]${tail.join(",")}[outgoing]`,
171
+ graph = fade.kind === undefined ? [
172
+ `${source}[incoming]`,
173
+ `[${String(tailInput)}:v]${tail.join(",")}[outgoing]`,
149
174
  // xfade's output is the outgoing tail plus the incoming piece minus the fade: the piece's own length.
150
175
  `[outgoing][incoming]xfade=transition=fade:duration=${r3(fade.frames / FOOTAGE_FPS)}:offset=0,trim=end_frame=${piece.frames}[picture]`,
151
- ].join(";");
176
+ ].join(";") : buildDrawnPieceGraph({ kind: fade.kind, piece, tail, frame: input.frame, source, tailInput });
152
177
  }
178
+ if (prelude.length > 0) graph = [...prelude, graph].join(";");
153
179
  return [
154
180
  "-v",
155
181
  "error",
@@ -184,6 +210,23 @@ export function buildPicturePieceArgs(input: PicturePieceArgsInput): string[] {
184
210
  ];
185
211
  }
186
212
 
213
+ /**
214
+ * A piece that starts on a drawn transition: its first `frames` blended with the outgoing tail, then the rest of its
215
+ * own frames (the plan gives a drawn transition only to a piece longer than it).
216
+ */
217
+ function buildDrawnPieceGraph(input: { kind: DrawnTransition; piece: PicturePiece; tail: string[]; frame: Frame; source: string; tailInput: number }): string {
218
+ const { piece } = input;
219
+ const frames = piece.fade?.frames ?? 0;
220
+ return [
221
+ `${input.source},split[full1][full2]`,
222
+ `[full1]trim=end_frame=${frames},setpts=PTS-STARTPTS,${FRAME_TIMING}[incoming]`,
223
+ `[full2]trim=start_frame=${frames},setpts=PTS-STARTPTS,${FRAME_TIMING}[rest]`,
224
+ `[${String(input.tailInput)}:v]${input.tail.join(",")}[outgoing]`,
225
+ ...buildDrawnTransitionFilters({ kind: input.kind, outgoing: "outgoing", incoming: "incoming", output: "blend", frame: input.frame, prefix: "dt" }),
226
+ `[blend][rest]concat=n=2:v=1:a=0,settb=1/${FOOTAGE_FPS},fps=${FOOTAGE_FPS}[picture]`,
227
+ ].join(";");
228
+ }
229
+
187
230
  /** The concat demuxer's list: one `file` line per piece, quotes escaped as the demuxer reads them. */
188
231
  export function buildPictureList(files: readonly string[]): string {
189
232
  return `${files.map((file) => `file '${file.replace(/'/g, "'\\''")}'`).join("\n")}\n`;