@softure-ai/marketing-kit 0.33.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/README.md +13 -0
- package/dist/footage/camera.d.ts +67 -0
- package/dist/footage/camera.d.ts.map +1 -0
- package/dist/footage/camera.js +89 -0
- package/dist/footage/camera.js.map +1 -0
- package/dist/footage/compose.d.ts +6 -1
- package/dist/footage/compose.d.ts.map +1 -1
- package/dist/footage/compose.js +31 -9
- package/dist/footage/compose.js.map +1 -1
- package/dist/footage/draft-overlays.d.ts.map +1 -1
- package/dist/footage/draft-overlays.js +6 -5
- package/dist/footage/draft-overlays.js.map +1 -1
- package/dist/footage/draft.d.ts +10 -2
- package/dist/footage/draft.d.ts.map +1 -1
- package/dist/footage/draft.js +25 -28
- package/dist/footage/draft.js.map +1 -1
- package/dist/footage/edl.d.ts +23 -0
- package/dist/footage/edl.d.ts.map +1 -1
- package/dist/footage/edl.js +24 -0
- package/dist/footage/edl.js.map +1 -1
- package/dist/footage/overlay-html.d.ts.map +1 -1
- package/dist/footage/overlay-html.js +4 -1
- package/dist/footage/overlay-html.js.map +1 -1
- package/dist/footage/overlay-schema.d.ts +9 -2
- package/dist/footage/overlay-schema.d.ts.map +1 -1
- package/dist/footage/overlay-schema.js +16 -3
- package/dist/footage/overlay-schema.js.map +1 -1
- package/dist/footage/overlays.d.ts +2 -0
- package/dist/footage/overlays.d.ts.map +1 -1
- package/dist/footage/overlays.js +18 -5
- package/dist/footage/overlays.js.map +1 -1
- package/dist/footage/picture.d.ts +3 -0
- package/dist/footage/picture.d.ts.map +1 -1
- package/dist/footage/picture.js +15 -11
- package/dist/footage/picture.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/schema/edl.schema.json +70 -2
- package/src/footage/camera.ts +129 -0
- package/src/footage/compose.ts +30 -10
- package/src/footage/draft-overlays.ts +6 -5
- package/src/footage/draft.ts +29 -29
- package/src/footage/edl.ts +24 -0
- package/src/footage/overlay-html.ts +4 -1
- package/src/footage/overlay-schema.ts +22 -4
- package/src/footage/overlays.ts +27 -6
- package/src/footage/picture.ts +17 -11
- package/src/index.ts +24 -0
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,oGAAoG;AACpG,uGAAuG;AACvG,wGAAwG;AACxG,wHAAwH;AACxH,wEAAwE;AACxE,qEAAqE;AACrE,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,SAAS,EACT,UAAU,EACV,sBAAsB,EACtB,eAAe,GAKhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,aAAa,EACb,eAAe,GAOhB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,SAAS,EAET,mBAAmB,GAUpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,GAMrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gCAAgC,EAChC,4BAA4B,EAC5B,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,2BAA2B,GAK5B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,6BAA6B,EAC7B,0BAA0B,EAC1B,4BAA4B,EAC5B,8BAA8B,EAC9B,wBAAwB,EACxB,8BAA8B,EAC9B,yBAAyB,EACzB,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,yBAAyB,EACzB,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,0BAA0B,EAC1B,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,oGAAoG;AACpG,uGAAuG;AACvG,wGAAwG;AACxG,wHAAwH;AACxH,wEAAwE;AACxE,qEAAqE;AACrE,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,SAAS,EACT,UAAU,EACV,sBAAsB,EACtB,eAAe,GAKhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,aAAa,EACb,eAAe,GAOhB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,SAAS,EAET,mBAAmB,GAUpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,GAMrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gCAAgC,EAChC,4BAA4B,EAC5B,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,2BAA2B,GAK5B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,6BAA6B,EAC7B,0BAA0B,EAC1B,4BAA4B,EAC5B,8BAA8B,EAC9B,wBAAwB,EACxB,8BAA8B,EAC9B,yBAAyB,EACzB,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAw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AC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,YAAY,EAAE,gBAAgB,EAAwB,MAAM,mBAAmB,CAAC;AACrI,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAA4B,MAAM,oBAAoB,CAAC;AAC5K,OAAO,EACL,SAAS,EACT,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,GAelB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAmE,MAAM,sBAAsB,CAAC;AAC7J,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,iBAAiB,GAGlB,MAAM,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softure-ai/marketing-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"description": "SOFTURE AI marketing kit: a CLI that turns a project's real app into a vertical film (cached voiceover, frame-by-frame recording, HTML composition, hyperframes render) plus per-platform post copy and OG images.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/schema/edl.schema.json
CHANGED
|
@@ -56,6 +56,73 @@
|
|
|
56
56
|
],
|
|
57
57
|
"description": "kenburns: a slow zoom over the segment; none: still."
|
|
58
58
|
},
|
|
59
|
+
"camera": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"properties": {
|
|
62
|
+
"from": {
|
|
63
|
+
"type": "number",
|
|
64
|
+
"minimum": 1,
|
|
65
|
+
"maximum": 1.6,
|
|
66
|
+
"description": "The scale the segment starts at: 1 is the full frame, up to 1.6."
|
|
67
|
+
},
|
|
68
|
+
"to": {
|
|
69
|
+
"type": "number",
|
|
70
|
+
"minimum": 1,
|
|
71
|
+
"maximum": 1.6,
|
|
72
|
+
"description": "The scale it ends at; equal to from: a still framing."
|
|
73
|
+
},
|
|
74
|
+
"ease": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"enum": [
|
|
77
|
+
"linear",
|
|
78
|
+
"out"
|
|
79
|
+
],
|
|
80
|
+
"description": "linear: one steady speed; out: slows down to its end."
|
|
81
|
+
},
|
|
82
|
+
"seconds": {
|
|
83
|
+
"description": "How long the move takes from the segment's start, then the picture holds; absent: the whole segment.",
|
|
84
|
+
"type": "number",
|
|
85
|
+
"exclusiveMinimum": 0,
|
|
86
|
+
"maximum": 120
|
|
87
|
+
},
|
|
88
|
+
"anchor": {
|
|
89
|
+
"description": "The point the zoom keeps still, such as the face's centre; absent: 50 % across, 42 % down.",
|
|
90
|
+
"type": "object",
|
|
91
|
+
"properties": {
|
|
92
|
+
"x": {
|
|
93
|
+
"type": "number",
|
|
94
|
+
"minimum": 0,
|
|
95
|
+
"maximum": 1,
|
|
96
|
+
"description": "Across the frame, 0 (left) to 1 (right)."
|
|
97
|
+
},
|
|
98
|
+
"y": {
|
|
99
|
+
"type": "number",
|
|
100
|
+
"minimum": 0,
|
|
101
|
+
"maximum": 1,
|
|
102
|
+
"description": "Down the frame, 0 (top) to 1 (bottom)."
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"required": [
|
|
106
|
+
"x",
|
|
107
|
+
"y"
|
|
108
|
+
],
|
|
109
|
+
"additionalProperties": false
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"required": [
|
|
113
|
+
"from",
|
|
114
|
+
"to",
|
|
115
|
+
"ease"
|
|
116
|
+
],
|
|
117
|
+
"additionalProperties": false,
|
|
118
|
+
"description": "The segment's framing and a slow move over it (a push-in, a pull-out, a settle); drawn alike by the draft and the render."
|
|
119
|
+
},
|
|
120
|
+
"fadeFrames": {
|
|
121
|
+
"description": "A fade cut's own length in frames at 30 fps (1-30); absent: the film's fadeFrames. Only on a fade.",
|
|
122
|
+
"type": "integer",
|
|
123
|
+
"minimum": 1,
|
|
124
|
+
"maximum": 30
|
|
125
|
+
},
|
|
59
126
|
"audio": {
|
|
60
127
|
"description": "Sound from another clip or span: a J- or L-cut, or b-roll over speech. Without it, the segment plays its own sound.",
|
|
61
128
|
"type": "object",
|
|
@@ -391,11 +458,12 @@
|
|
|
391
458
|
]
|
|
392
459
|
},
|
|
393
460
|
"align": {
|
|
394
|
-
"description": "center (the default) or left: how a hook_title's or a place_card's lines sit in their card.",
|
|
461
|
+
"description": "center (the default) or left: how a hook_title's or a place_card's lines sit in their card; left, center or right: where a keyword's card sits across its room (in place of side).",
|
|
395
462
|
"type": "string",
|
|
396
463
|
"enum": [
|
|
464
|
+
"left",
|
|
397
465
|
"center",
|
|
398
|
-
"
|
|
466
|
+
"right"
|
|
399
467
|
]
|
|
400
468
|
},
|
|
401
469
|
"subtitle_size": {
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
import { FOOTAGE_FPS } from "./normalize.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A segment's camera: the framing it is shown at and a slow move over it, drawn alike by the draft (ffmpeg `zoompan`
|
|
7
|
+
* about the anchor) and the render (a GSAP scale tween with the anchor as `transform-origin`). Captions and overlays
|
|
8
|
+
* are drawn over the moved picture, so a move never moves them.
|
|
9
|
+
*
|
|
10
|
+
* - A still framing: `from` equal to `to` (1 is the full frame, 1.5 a tight crop).
|
|
11
|
+
* - A push-in: `from` below `to`; a pull-out or a settle: `from` above `to`.
|
|
12
|
+
* - `ease`: `linear` keeps one speed (a slow drift); `out` slows down to its end (`power1.out`, `1 - (1 - t)^2`).
|
|
13
|
+
* - `seconds`: how long the move takes from the segment's start, then the picture holds; absent: the whole segment.
|
|
14
|
+
* - `anchor`: the point of the frame the zoom keeps still (fractions of the frame; a face's centre keeps the face in
|
|
15
|
+
* the picture); absent: the kit's zoom origin (`CAMERA_ORIGIN`). The crop never leaves the source frame.
|
|
16
|
+
*/
|
|
17
|
+
export interface EdlCamera {
|
|
18
|
+
from: number;
|
|
19
|
+
to: number;
|
|
20
|
+
ease: CameraEase;
|
|
21
|
+
seconds?: number;
|
|
22
|
+
anchor?: CameraAnchor;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const CAMERA_EASES = ["linear", "out"] as const;
|
|
26
|
+
|
|
27
|
+
export type CameraEase = (typeof CAMERA_EASES)[number];
|
|
28
|
+
|
|
29
|
+
export interface CameraAnchor {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** The point a zoom keeps still when it names none: the composition's `transform-origin: 50% 42%`. */
|
|
35
|
+
export const CAMERA_ORIGIN: CameraAnchor = { x: 0.5, y: 0.42 };
|
|
36
|
+
|
|
37
|
+
/** The tightest framing a camera may take: past it a 1080x1920 source shows its pixels. */
|
|
38
|
+
export const MAX_CAMERA_SCALE = 1.6;
|
|
39
|
+
|
|
40
|
+
const scaleSchema = z.number().min(1).max(MAX_CAMERA_SCALE);
|
|
41
|
+
|
|
42
|
+
export const cameraSchema = z
|
|
43
|
+
.strictObject({
|
|
44
|
+
from: scaleSchema.describe(`The scale the segment starts at: 1 is the full frame, up to ${String(MAX_CAMERA_SCALE)}.`),
|
|
45
|
+
to: scaleSchema.describe("The scale it ends at; equal to from: a still framing."),
|
|
46
|
+
ease: z.enum(CAMERA_EASES).describe("linear: one steady speed; out: slows down to its end."),
|
|
47
|
+
seconds: z.number().positive().max(120).optional().describe("How long the move takes from the segment's start, then the picture holds; absent: the whole segment."),
|
|
48
|
+
anchor: z
|
|
49
|
+
.strictObject({
|
|
50
|
+
x: z.number().min(0).max(1).describe("Across the frame, 0 (left) to 1 (right)."),
|
|
51
|
+
y: z.number().min(0).max(1).describe("Down the frame, 0 (top) to 1 (bottom)."),
|
|
52
|
+
})
|
|
53
|
+
.optional()
|
|
54
|
+
.describe("The point the zoom keeps still, such as the face's centre; absent: 50 % across, 42 % down."),
|
|
55
|
+
})
|
|
56
|
+
.describe("The segment's framing and a slow move over it (a push-in, a pull-out, a settle); drawn alike by the draft and the render.");
|
|
57
|
+
|
|
58
|
+
const r4 = (value: number): number => Math.round(value * 10000) / 10000 || 0;
|
|
59
|
+
|
|
60
|
+
/** The point a camera keeps still. */
|
|
61
|
+
export function getCameraOrigin(camera: Pick<EdlCamera, "anchor"> | undefined): CameraAnchor {
|
|
62
|
+
return camera?.anchor ?? CAMERA_ORIGIN;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Whether a camera changes its scale over the segment (a still framing does not). */
|
|
66
|
+
export function isCameraMoving(camera: EdlCamera | undefined): boolean {
|
|
67
|
+
return camera !== undefined && camera.from !== camera.to;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** The frames a camera's move takes: its `seconds` (or the segment's length), at most the segment's frames, at least one. */
|
|
71
|
+
export function getCameraMoveFrames(camera: EdlCamera, segmentSeconds: number): number {
|
|
72
|
+
const segmentFrames = Math.max(1, Math.round(segmentSeconds * FOOTAGE_FPS));
|
|
73
|
+
return Math.max(1, Math.min(segmentFrames, Math.round((camera.seconds ?? segmentSeconds) * FOOTAGE_FPS)));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** The camera's move in seconds, as the render's tween plays it (`getCameraMoveFrames` in film frames). */
|
|
77
|
+
export function getCameraMoveSeconds(camera: EdlCamera, segmentSeconds: number): number {
|
|
78
|
+
return Math.round((getCameraMoveFrames(camera, segmentSeconds) / FOOTAGE_FPS) * 1000) / 1000;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** The GSAP ease of a camera's move: `none` for `linear`, `power1.out` (`1 - (1 - t)^2`) for `out`. */
|
|
82
|
+
export function getCameraGsapEase(ease: CameraEase): string {
|
|
83
|
+
return ease === "linear" ? "none" : "power1.out";
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** The camera's scale as an ffmpeg expression of the segment's frame number `variable`, as the render's tween eases it. */
|
|
87
|
+
export function getCameraScaleExpression(camera: EdlCamera, frames: number, variable = "on"): string {
|
|
88
|
+
if (!isCameraMoving(camera)) return String(camera.from);
|
|
89
|
+
const progress = `min(${variable}/${String(frames)},1)`;
|
|
90
|
+
const eased = camera.ease === "linear" ? progress : `(1-pow(1-${progress},2))`;
|
|
91
|
+
return `${String(camera.from)}+(${String(r4(camera.to - camera.from))})*${eased}`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** The camera's scale `frame` frames into its segment, as the draft's expression and the render's tween give it. */
|
|
95
|
+
export function getCameraScaleAt(camera: EdlCamera, frames: number, frame: number): number {
|
|
96
|
+
const t = Math.min(Math.max(frame / frames, 0), 1);
|
|
97
|
+
const eased = camera.ease === "linear" ? t : 1 - (1 - t) ** 2;
|
|
98
|
+
return r4(camera.from + (camera.to - camera.from) * eased);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** The anchor as a CSS `transform-origin`. */
|
|
102
|
+
export function toTransformOrigin(anchor: CameraAnchor): string {
|
|
103
|
+
return `${String(r4(anchor.x * 100))}% ${String(r4(anchor.y * 100))}%`;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Whether a camera shows the full frame, still: drawn as no camera at all. */
|
|
107
|
+
function isFullFrame(camera: EdlCamera | undefined): boolean {
|
|
108
|
+
return camera === undefined || (camera.from === 1 && camera.to === 1);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Whether two cameras show the same framing: both the full frame, still (absent, or `from` and `to` 1), or the same
|
|
113
|
+
* scales, ease, length and anchor.
|
|
114
|
+
*/
|
|
115
|
+
export function isSameCamera(a: EdlCamera | undefined, b: EdlCamera | undefined): boolean {
|
|
116
|
+
if (isFullFrame(a) && isFullFrame(b)) return true;
|
|
117
|
+
if (a === undefined || b === undefined) return false;
|
|
118
|
+
const [pa, pb] = [getCameraOrigin(a), getCameraOrigin(b)];
|
|
119
|
+
return a.from === b.from && a.to === b.to && a.ease === b.ease && a.seconds === b.seconds && pa.x === pb.x && pa.y === pb.y;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** A camera in a few words, for `diffEdl` ("push 1 → 1.15 linear"). */
|
|
123
|
+
export function describeCamera(camera: EdlCamera | undefined): string {
|
|
124
|
+
if (camera === undefined) return "none";
|
|
125
|
+
const kind = camera.from === camera.to ? "framing" : camera.from < camera.to ? "push" : "pull";
|
|
126
|
+
const scales = camera.from === camera.to ? String(camera.from) : `${String(camera.from)} → ${String(camera.to)} ${camera.ease}`;
|
|
127
|
+
const anchor = camera.anchor === undefined ? "" : ` at ${String(r4(camera.anchor.x))},${String(r4(camera.anchor.y))}`;
|
|
128
|
+
return `${kind} ${scales}${camera.seconds === undefined ? "" : ` over ${String(camera.seconds)} s`}${anchor}`;
|
|
129
|
+
}
|
package/src/footage/compose.ts
CHANGED
|
@@ -6,7 +6,8 @@ import { CAPTION_LINE_HEIGHT, getCaptionPillCss, getCaptionPositionCss, type Cap
|
|
|
6
6
|
import type { TimedWord } from "../voice/voiceover.js";
|
|
7
7
|
import { CAPTION_HIGHLIGHT_BOX_PADDING_EM, CAPTION_HIGHLIGHT_BOX_RADIUS, CAPTION_HIGHLIGHT_SECONDS, CAPTION_UNDERLINE_EM, getCaptionEntranceTween, getCaptionHighlight } from "./caption-highlight.js";
|
|
8
8
|
import { CAPTION_SAFE_ZONES, getCaptionChunkLayouts, getCaptionSpans, getFootageCaptionChunks, isSameCaptionPlace, type CaptionSpan } from "./captions.js";
|
|
9
|
-
import {
|
|
9
|
+
import { getCameraGsapEase, getCameraMoveSeconds, getCameraOrigin, isCameraMoving, toTransformOrigin } from "./camera.js";
|
|
10
|
+
import { getEdlDuration, getSegmentStarts, type Edl, type EdlSegment } from "./edl.js";
|
|
10
11
|
import {
|
|
11
12
|
CAPTION_MIN_FONT_SCALE,
|
|
12
13
|
DEFAULT_EDIT,
|
|
@@ -93,16 +94,27 @@ export function getFootageFilmSeconds(film: Pick<FootageFilm, "endCard">, edl: E
|
|
|
93
94
|
return r3(getEdlDuration(edl) + getEndCardSeconds(film.endCard));
|
|
94
95
|
}
|
|
95
96
|
|
|
96
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* The picture scale each segment starts at: `zoom` cuts alternate between punched in (`zoomPercent`) and back out; a
|
|
99
|
+
* segment with a `camera` starts at its camera's `from`.
|
|
100
|
+
*/
|
|
97
101
|
export function getSegmentScales(edl: Edl, zoomPercent = DEFAULT_EDIT.zoomPercent): number[] {
|
|
98
102
|
const scales: number[] = [];
|
|
99
103
|
edl.segments.forEach((segment, index) => {
|
|
100
104
|
const previous = scales[index - 1] ?? 1;
|
|
101
|
-
|
|
105
|
+
if (segment.camera !== undefined) scales.push(segment.camera.from);
|
|
106
|
+
else scales.push(segment.transition === "zoom" && index > 0 ? (previous === 1 ? zoomPercent / 100 : 1) : 1);
|
|
102
107
|
});
|
|
103
108
|
return scales;
|
|
104
109
|
}
|
|
105
110
|
|
|
111
|
+
/** The frames a segment's cut cross-fades over: its own `fadeFrames` or the film's on a `fade` after the first segment, else 0. */
|
|
112
|
+
export function getSegmentFadeFrames(edl: Pick<Edl, "segments">, index: number, edit: Pick<FootageEdit, "fadeFrames">): number {
|
|
113
|
+
const segment: EdlSegment | undefined = edl.segments[index];
|
|
114
|
+
if (segment === undefined || index === 0 || segment.transition !== "fade") return 0;
|
|
115
|
+
return segment.fadeFrames ?? edit.fadeFrames;
|
|
116
|
+
}
|
|
117
|
+
|
|
106
118
|
/**
|
|
107
119
|
* The frames each segment's zoom eases over (`zoomEaseFrames`, at most the segment's own frames): a `zoom` cut after
|
|
108
120
|
* the first segment that changes the scale and is not `kenburns` (its slow zoom owns the scale); 0 for every other.
|
|
@@ -110,7 +122,7 @@ export function getSegmentScales(edl: Edl, zoomPercent = DEFAULT_EDIT.zoomPercen
|
|
|
110
122
|
export function getSegmentZoomEases(edl: Edl, edit: Pick<FootageEdit, "zoomPercent" | "zoomEaseFrames">): number[] {
|
|
111
123
|
const scales = getSegmentScales(edl, edit.zoomPercent);
|
|
112
124
|
return edl.segments.map((segment, index) => {
|
|
113
|
-
const isEased = edit.zoomEaseFrames > 0 && index > 0 && segment.transition === "zoom" && segment.motion !== "kenburns" && scales[index - 1] !== scales[index];
|
|
125
|
+
const isEased = edit.zoomEaseFrames > 0 && index > 0 && segment.transition === "zoom" && segment.motion !== "kenburns" && segment.camera === undefined && scales[index - 1] !== scales[index];
|
|
114
126
|
return isEased ? Math.max(1, Math.min(edit.zoomEaseFrames, Math.floor((segment.end - segment.start) * FOOTAGE_FPS))) : 0;
|
|
115
127
|
});
|
|
116
128
|
}
|
|
@@ -156,7 +168,10 @@ export function composeFootage(input: FootageComposeInput): string {
|
|
|
156
168
|
const edit = getFootageEdit(film);
|
|
157
169
|
const scales = getSegmentScales(edl, edit.zoomPercent);
|
|
158
170
|
const eases = getSegmentZoomEases(edl, edit);
|
|
159
|
-
const
|
|
171
|
+
const fadeSecondsAt = (index: number): number => r3(getSegmentFadeFrames(edl, index, edit) / FOOTAGE_FPS);
|
|
172
|
+
// A film with a camera anchors its zooms per segment; one without keeps the stylesheet's origin (and its markup).
|
|
173
|
+
const hasCamera = edl.segments.some((segment) => segment.camera !== undefined);
|
|
174
|
+
const originOf = (segment: EdlSegment): string => toTransformOrigin(getCameraOrigin(segment.camera));
|
|
160
175
|
const kenBurnsScale = 1 + (edit.kenBurnsPercent > 0 ? edit.kenBurnsPercent : HAND_KEN_BURNS_PERCENT) / 100;
|
|
161
176
|
|
|
162
177
|
const picture = assets.picture;
|
|
@@ -165,12 +180,12 @@ export function composeFootage(input: FootageComposeInput): string {
|
|
|
165
180
|
? edl.segments.map((segment, index) => {
|
|
166
181
|
const src = assets.clips[segment.clip];
|
|
167
182
|
if (src === undefined) throw new Error(`The EDL names clip "${segment.clip}", which the film has no file for.`);
|
|
168
|
-
const
|
|
169
|
-
const tail = next?.transition === "fade" ? fadeSeconds : 0;
|
|
183
|
+
const tail = fadeSecondsAt(index + 1);
|
|
170
184
|
const start = starts[index] as number;
|
|
171
185
|
const duration = r3(segment.end - segment.start + tail);
|
|
172
186
|
const scale = scales[index] as number;
|
|
173
|
-
const
|
|
187
|
+
const origin = segment.camera === undefined ? "" : `;transform-origin:${originOf(segment)}`;
|
|
188
|
+
const style = scale === 1 && origin === "" ? "" : ` style="transform:scale(${scale})${origin}"`;
|
|
174
189
|
return `<video id="seg${index}" class="clip shot" src="${escapeHtml(src)}" data-start="${start}" data-media-start="${segment.start}" data-duration="${duration}"${style} muted playsinline></video>`;
|
|
175
190
|
})
|
|
176
191
|
: [`<video id="picture" class="clip shot" src="${escapeHtml(picture)}" data-start="0" data-media-start="0" data-duration="${cutEnd}" muted playsinline></video>`];
|
|
@@ -181,9 +196,14 @@ export function composeFootage(input: FootageComposeInput): string {
|
|
|
181
196
|
const scale = scales[index] as number;
|
|
182
197
|
const target = picture === undefined ? `#seg${index}` : "#picture";
|
|
183
198
|
// One video carries every segment: each one sets the zoom it starts at (a fade is already in the picture).
|
|
184
|
-
if (picture !== undefined) tweens.push(`tl.set("#picture", { scale: ${scale} }, ${start});`);
|
|
199
|
+
if (picture !== undefined) tweens.push(hasCamera ? `tl.set("#picture", { scale: ${scale}, transformOrigin: "${originOf(segment)}" }, ${start});` : `tl.set("#picture", { scale: ${scale} }, ${start});`);
|
|
185
200
|
if (picture === undefined && segment.transition === "fade" && index > 0) {
|
|
186
|
-
tweens.push(`tl.fromTo("${target}", { opacity: 0 }, { opacity: 1, duration: ${
|
|
201
|
+
tweens.push(`tl.fromTo("${target}", { opacity: 0 }, { opacity: 1, duration: ${fadeSecondsAt(index)}, ease: "none", immediateRender: false }, ${start});`);
|
|
202
|
+
}
|
|
203
|
+
const { camera } = segment;
|
|
204
|
+
if (camera !== undefined && isCameraMoving(camera)) {
|
|
205
|
+
const seconds = getCameraMoveSeconds(camera, segment.end - segment.start);
|
|
206
|
+
tweens.push(`tl.fromTo("${target}", { scale: ${camera.from} }, { scale: ${camera.to}, duration: ${seconds}, ease: "${getCameraGsapEase(camera.ease)}", immediateRender: false }, ${start});`);
|
|
187
207
|
}
|
|
188
208
|
const ease = eases[index] as number;
|
|
189
209
|
if (ease > 0) {
|
|
@@ -403,19 +403,20 @@ function getSideTextEvents(overlay: Extract<ResolvedOverlay, { kind: "keyword" |
|
|
|
403
403
|
// A side text always has a card: only a punch_in has none.
|
|
404
404
|
const card = getDrawnOverlayCard(overlay) as OverlayBox;
|
|
405
405
|
const { x: padX, y: padY } = getOverlayPadding(overlay);
|
|
406
|
-
const
|
|
407
|
-
const
|
|
406
|
+
const isCentred = overlay.kind === "keyword" && overlay.isCentred === true;
|
|
407
|
+
const isRight = !isCentred && side === "right";
|
|
408
|
+
const x = isCentred ? card.left + card.width / 2 : isRight ? card.left + card.width - padX : card.left + padX;
|
|
408
409
|
const isFoot = overlay.kind === "lower_third";
|
|
409
410
|
const y = isFoot ? card.top + card.height - padY : card.top + padY;
|
|
410
|
-
// \an: 7 top left, 9 top right, 1 bottom left, 3 bottom right.
|
|
411
|
-
const align = isFoot ? (isRight ? 3 : 1) : isRight ? 9 : 7;
|
|
411
|
+
// \an: 7 top left, 8 top centre, 9 top right, 1 bottom left, 3 bottom right.
|
|
412
|
+
const align = isFoot ? (isRight ? 3 : 1) : isCentred ? 8 : isRight ? 9 : 7;
|
|
412
413
|
const motion = getDraftMotion(overlay, overlay.entrance === null || overlay.entrance === "type" ? "fade" : overlay.entrance, card, context);
|
|
413
414
|
const span = { start: overlay.start, end: overlay.end };
|
|
414
415
|
const tags = `\\an${align}\\fs${fontSize}${getTextTags(overlay, colors, context, OVERLAY_FONT_ROLES[overlay.kind])}`;
|
|
415
416
|
const text = (pos: OverlayPoint, steps: TextStep[], own = motion) => getTextEvents({ layer: 4, style: "OverlayPlain", pos, tags, steps, motion: own });
|
|
416
417
|
const shape = getCardShapeEvents(overlay, card, fontSize, colors, motion, context);
|
|
417
418
|
// A keyword or a lower third types in only when its entrance says so.
|
|
418
|
-
const steps = overlay.entrance === null ? [{ from: span.start, to: span.end, text: toAssText(overlay.text) }] : getTypedSteps(overlay.text, span, overlay.typing);
|
|
419
|
+
const steps = overlay.entrance === null ? [{ from: span.start, to: span.end, text: toAssText(overlay.text) }] : getTypedSteps(overlay.text, span, overlay.typing, isCentred);
|
|
419
420
|
return [...shape, ...text({ x, y }, steps), ...(overlay.kind === "keyword" ? getUnderlineEvent(overlay, card, colors.accent, motion) : [])];
|
|
420
421
|
}
|
|
421
422
|
|
package/src/footage/draft.ts
CHANGED
|
@@ -8,7 +8,8 @@ import { err, ok } from "./failure.js";
|
|
|
8
8
|
import type { TimedWord } from "../voice/voiceover.js";
|
|
9
9
|
import { CAPTION_HIGHLIGHT_BOX_PADDING_EM, CAPTION_HIGHLIGHT_SECONDS, CAPTION_UNDERLINE_EM, getCaptionHighlight, type CaptionHighlightLook } from "./caption-highlight.js";
|
|
10
10
|
import { getCaptionChunkLayouts, getCaptionSpans, getFootageCaptionChunks, getFootageCaptionLayout, isSameCaptionPlace, type CaptionWordsFilm } from "./captions.js";
|
|
11
|
-
import {
|
|
11
|
+
import { getCameraMoveFrames, getCameraOrigin, getCameraScaleExpression, type CameraAnchor, type EdlCamera } from "./camera.js";
|
|
12
|
+
import { getSegmentFadeFrames, getSegmentScales, getSegmentZoomEases } from "./compose.js";
|
|
12
13
|
import { toAssColor } from "./draft-color.js";
|
|
13
14
|
import { buildDraftOverlayEvents, getDraftOverlayStyles, getRoundedRectDrawing } from "./draft-overlays.js";
|
|
14
15
|
import { getCaptionCornerRadius, getCornerRadiusPx, getStylePadding, type BrandStyle } from "./brand-style.js";
|
|
@@ -66,8 +67,6 @@ export const FOOTAGE_DRAFT_FONT = {
|
|
|
66
67
|
|
|
67
68
|
/** How far a segment marked `kenburns` zooms when the film's `kenBurnsPercent` is 0, as in the render. */
|
|
68
69
|
const HAND_KEN_BURNS_PERCENT = 4;
|
|
69
|
-
/** The point a zoom keeps still, as the render's `transform-origin: 50% 42%`. */
|
|
70
|
-
const ZOOM_ORIGIN = { x: 0.5, y: 0.42 } as const;
|
|
71
70
|
const DRAFT_CRF = 28;
|
|
72
71
|
const DRAFT_AUDIO_BITRATE = "128k";
|
|
73
72
|
|
|
@@ -481,6 +480,10 @@ export interface DraftSegmentPlan {
|
|
|
481
480
|
startScale: number;
|
|
482
481
|
/** The frames the zoom eases over (`getSegmentZoomEases`); 0: the segment starts at `scale`. */
|
|
483
482
|
easeFrames: number;
|
|
483
|
+
/** The segment's camera (`EdlCamera`) and the frames its move takes; null: the film's own zoom (`scale`, `endScale`). */
|
|
484
|
+
camera: { camera: EdlCamera; frames: number } | null;
|
|
485
|
+
/** The point the segment's zooms keep still: its camera's anchor, else the render's `transform-origin: 50% 42%`. */
|
|
486
|
+
origin: CameraAnchor;
|
|
484
487
|
/**
|
|
485
488
|
* The EDL's `punch_in` overlays in this segment, in frames from its start: each multiplies the zoom by up to `scale`,
|
|
486
489
|
* rising over `ease` frames from `from` and falling over the last `ease` of its `frames` (linear, the render eases).
|
|
@@ -489,17 +492,16 @@ export interface DraftSegmentPlan {
|
|
|
489
492
|
}
|
|
490
493
|
|
|
491
494
|
/**
|
|
492
|
-
* How each segment plays in the draft. A `fade` cut lasts the film's
|
|
493
|
-
* the cross-fade never outlasts it) and the outgoing segment runs on under it, as in the render.
|
|
495
|
+
* How each segment plays in the draft. A `fade` cut lasts its own `fadeFrames` or the film's (clamped to the incoming
|
|
496
|
+
* segment, so the cross-fade never outlasts it) and the outgoing segment runs on under it, as in the render.
|
|
494
497
|
*/
|
|
495
498
|
export function planFootageDraft(film: Pick<FootageFilm, "edit">, edl: Edl, overlays: readonly ResolvedOverlay[] = []): DraftSegmentPlan[] {
|
|
496
499
|
const edit = getFootageEdit(film);
|
|
497
|
-
const fadeSeconds = r3(edit.fadeFrames / FOOTAGE_FPS);
|
|
498
500
|
const kenBurnsScale = 1 + (edit.kenBurnsPercent > 0 ? edit.kenBurnsPercent : HAND_KEN_BURNS_PERCENT) / 100;
|
|
499
501
|
const scales = getSegmentScales(edl, edit.zoomPercent);
|
|
500
502
|
const eases = getSegmentZoomEases(edl, edit);
|
|
501
503
|
const starts = getSegmentStarts(edl);
|
|
502
|
-
const fades = edl.segments.map((segment, index) => (
|
|
504
|
+
const fades = edl.segments.map((segment, index) => r3(Math.min(getSegmentFadeFrames(edl, index, edit) / FOOTAGE_FPS, segment.end - segment.start)));
|
|
503
505
|
return edl.segments.map((segment, index) => {
|
|
504
506
|
const scale = scales[index] as number;
|
|
505
507
|
return {
|
|
@@ -508,9 +510,11 @@ export function planFootageDraft(film: Pick<FootageFilm, "edit">, edl: Edl, over
|
|
|
508
510
|
start: starts[index] as number,
|
|
509
511
|
fade: fades[index] as number,
|
|
510
512
|
scale,
|
|
511
|
-
endScale: segment.motion === "kenburns" ? r4(scale * kenBurnsScale) : scale,
|
|
513
|
+
endScale: segment.camera !== undefined ? segment.camera.to : segment.motion === "kenburns" ? r4(scale * kenBurnsScale) : scale,
|
|
512
514
|
startScale: (eases[index] as number) > 0 ? (scales[index - 1] as number) : scale,
|
|
513
515
|
easeFrames: eases[index] as number,
|
|
516
|
+
camera: segment.camera === undefined ? null : { camera: segment.camera, frames: getCameraMoveFrames(segment.camera, segment.end - segment.start) },
|
|
517
|
+
origin: getCameraOrigin(segment.camera),
|
|
514
518
|
punches: overlays.flatMap((overlay) =>
|
|
515
519
|
overlay.kind === "punch_in" && overlay.segment === index
|
|
516
520
|
? [
|
|
@@ -528,36 +532,32 @@ export function planFootageDraft(film: Pick<FootageFilm, "edit">, edl: Edl, over
|
|
|
528
532
|
}
|
|
529
533
|
|
|
530
534
|
/**
|
|
531
|
-
* The filters that zoom a segment's picture and scale it to the draft: a crop for a still zoom, `zoompan` for Ken Burns
|
|
532
|
-
* and
|
|
535
|
+
* The filters that zoom a segment's picture and scale it to the draft: a crop for a still zoom, `zoompan` for Ken Burns,
|
|
536
|
+
* a camera's move and an eased zoom cut (the render's `power1.out`: `1 - (1 - t)^2`), each about the segment's origin.
|
|
533
537
|
*/
|
|
534
538
|
function buildPictureFilters(plan: DraftSegmentPlan, draft: Frame): string[] {
|
|
535
539
|
const size = `${draft.width}:${draft.height}`;
|
|
540
|
+
const { origin } = plan;
|
|
536
541
|
const zoompan = (zoom: string): string =>
|
|
537
|
-
`zoompan=z='${zoom}':x='(iw-iw/zoom)*${
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
plan.
|
|
543
|
-
|
|
542
|
+
`zoompan=z='${zoom}':x='(iw-iw/zoom)*${origin.x}':y='(ih-ih/zoom)*${origin.y}':d=1:s=${draft.width}x${draft.height}:fps=${FOOTAGE_FPS}`;
|
|
543
|
+
// The zoom runs over the segment's own length, as the render's tween does, and holds through a fade's tail.
|
|
544
|
+
const frames = Math.max(1, Math.round(plan.length * FOOTAGE_FPS));
|
|
545
|
+
const own =
|
|
546
|
+
plan.easeFrames > 0
|
|
547
|
+
? `${plan.startScale}+(${r4(plan.scale - plan.startScale)})*(1-pow(1-min(on/${plan.easeFrames},1),2))`
|
|
548
|
+
: plan.camera !== null && plan.endScale !== plan.scale
|
|
549
|
+
? getCameraScaleExpression(plan.camera.camera, plan.camera.frames)
|
|
544
550
|
: plan.endScale !== plan.scale
|
|
545
551
|
? `${plan.scale}+${r4(plan.endScale - plan.scale)}*min(on/${frames},1)`
|
|
546
|
-
:
|
|
552
|
+
: null;
|
|
553
|
+
if (plan.punches.length > 0) {
|
|
554
|
+
// The segment's own zoom (an eased cut, a camera, Ken Burns or still) times each punch-in's rise, hold and fall.
|
|
547
555
|
const lifts = plan.punches.map((punch) => `${r4(punch.scale - 1)}*max(0,min(min(1,(on-${punch.from})/${punch.ease}),(${punch.from + punch.frames}-on)/${punch.ease}))`);
|
|
548
|
-
return [zoompan(`(${own})*(1+${lifts.join("+")})`)];
|
|
549
|
-
}
|
|
550
|
-
if (plan.easeFrames > 0) {
|
|
551
|
-
return [zoompan(`${plan.startScale}+(${r4(plan.scale - plan.startScale)})*(1-pow(1-min(on/${plan.easeFrames},1),2))`)];
|
|
552
|
-
}
|
|
553
|
-
if (plan.endScale !== plan.scale) {
|
|
554
|
-
// The zoom runs over the segment's own length, as the render's tween does, and holds through a fade's tail.
|
|
555
|
-
const frames = Math.max(1, Math.round(plan.length * FOOTAGE_FPS));
|
|
556
|
-
const zoom = `${plan.scale}+${r4(plan.endScale - plan.scale)}*min(on/${frames},1)`;
|
|
557
|
-
return [zoompan(zoom)];
|
|
556
|
+
return [zoompan(`(${own ?? String(plan.scale)})*(1+${lifts.join("+")})`)];
|
|
558
557
|
}
|
|
558
|
+
if (own !== null) return [zoompan(own)];
|
|
559
559
|
if (plan.scale !== 1) {
|
|
560
|
-
return [`crop=iw/${plan.scale}:ih/${plan.scale}:(iw-iw/${plan.scale})*${
|
|
560
|
+
return [`crop=iw/${plan.scale}:ih/${plan.scale}:(iw-iw/${plan.scale})*${origin.x}:(ih-ih/${plan.scale})*${origin.y}`, `scale=${size}`];
|
|
561
561
|
}
|
|
562
562
|
return [`scale=${size}`];
|
|
563
563
|
}
|
package/src/footage/edl.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
import type { TimedWord } from "../voice/voiceover.js";
|
|
4
|
+
import { cameraSchema, describeCamera, isSameCamera, type EdlCamera } from "./camera.js";
|
|
4
5
|
import { overlaySchema, type EdlOverlay } from "./overlay-schema.js";
|
|
5
6
|
import { CUT_TRANSITIONS, type ClipRole, type CutOptions, type CutTransition, type FootageTransitions } from "./film.js";
|
|
6
7
|
import { splitFilmSentences, type Sentence } from "./sentences.js";
|
|
@@ -59,6 +60,10 @@ export interface EdlSegment {
|
|
|
59
60
|
transition: CutTransition;
|
|
60
61
|
/** `kenburns`: a slow zoom over a segment without speech. */
|
|
61
62
|
motion: SegmentMotion;
|
|
63
|
+
/** The segment's framing and a slow move over it (`camera.ts`); absent: the film's own zoom (cuts, Ken Burns). */
|
|
64
|
+
camera?: EdlCamera;
|
|
65
|
+
/** A `fade` cut's own length in frames at 30 fps (1-30); absent: the film's `fadeFrames`. */
|
|
66
|
+
fadeFrames?: number;
|
|
62
67
|
audio?: EdlAudio;
|
|
63
68
|
/** Moves the caption box for the captions that start in this segment; absent: the film's box. */
|
|
64
69
|
caption?: EdlCaption;
|
|
@@ -77,6 +82,10 @@ export interface Edl {
|
|
|
77
82
|
captionRanges?: EdlCaptionRange[];
|
|
78
83
|
}
|
|
79
84
|
|
|
85
|
+
/** The shortest and the longest a segment's own `fadeFrames` may be. */
|
|
86
|
+
export const MIN_FADE_FRAMES = 1;
|
|
87
|
+
export const MAX_FADE_FRAMES = 30;
|
|
88
|
+
|
|
80
89
|
const SEGMENT_ID_PATTERN = /^[A-Za-z0-9._-]+$/;
|
|
81
90
|
|
|
82
91
|
const segmentFields = {
|
|
@@ -96,6 +105,8 @@ export const edlSchema = z
|
|
|
96
105
|
z.strictObject({
|
|
97
106
|
id: z.string().regex(SEGMENT_ID_PATTERN, "letters, digits, dot, dash or underscore").describe("The segment's id, unique in the cut: s<n> for a sentence, r<n> for b-roll."),
|
|
98
107
|
...segmentFields,
|
|
108
|
+
camera: cameraSchema.optional(),
|
|
109
|
+
fadeFrames: z.number().int().min(MIN_FADE_FRAMES).max(MAX_FADE_FRAMES).optional().describe("A fade cut's own length in frames at 30 fps (1-30); absent: the film's fadeFrames. Only on a fade."),
|
|
99
110
|
audio: z
|
|
100
111
|
.strictObject({
|
|
101
112
|
clip: z.string().min(1).describe("The clip the sound comes from."),
|
|
@@ -305,6 +316,7 @@ export function validateEdl(edl: Edl, clips: Pick<EdlClip, "id" | "duration">[],
|
|
|
305
316
|
checkSpan(at, segment);
|
|
306
317
|
if (segment.end - segment.start < MIN_SEGMENT_SECONDS) problems.push(`${at}: shorter than ${MIN_SEGMENT_SECONDS} s (start ${segment.start}, end ${segment.end})`);
|
|
307
318
|
if (captionBounds !== undefined) problems.push(...findCaptionProblems(`${at}.caption`, segment.caption, captionBounds));
|
|
319
|
+
problems.push(...findCameraProblems(at, segment));
|
|
308
320
|
const { audio } = segment;
|
|
309
321
|
if (audio === undefined) return;
|
|
310
322
|
checkSpan(`${at}.audio`, audio);
|
|
@@ -316,6 +328,16 @@ export function validateEdl(edl: Edl, clips: Pick<EdlClip, "id" | "duration">[],
|
|
|
316
328
|
return problems;
|
|
317
329
|
}
|
|
318
330
|
|
|
331
|
+
/** A camera beside the film's own zoom (a Ken Burns zoom, a zoom cut), which owns the scale too, and a fade length on another cut. */
|
|
332
|
+
function findCameraProblems(at: string, segment: EdlSegment): string[] {
|
|
333
|
+
const problems: string[] = [];
|
|
334
|
+
if (segment.fadeFrames !== undefined && segment.transition !== "fade") problems.push(`${at}.fadeFrames: only a fade cut has a length; this segment starts on a ${segment.transition}`);
|
|
335
|
+
if (segment.camera === undefined) return problems;
|
|
336
|
+
if (segment.motion === "kenburns") problems.push(`${at}.camera: the segment has a Ken Burns zoom, which owns the picture's scale; set motion to none or drop the camera`);
|
|
337
|
+
if (segment.transition === "zoom") problems.push(`${at}.camera: the segment starts on a zoom cut, which owns the picture's scale; start it on a cut or a fade`);
|
|
338
|
+
return problems;
|
|
339
|
+
}
|
|
340
|
+
|
|
319
341
|
/** Caption ranges that are empty, run past the cut, overlap one another or (with `captionBounds`) leave the frame. */
|
|
320
342
|
function findCaptionRangeProblems(edl: Edl, captionBounds: EdlCaptionBounds | undefined): string[] {
|
|
321
343
|
const problems: string[] = [];
|
|
@@ -419,6 +441,8 @@ export function diffEdl(before: Edl, after: Edl): string[] {
|
|
|
419
441
|
if (a.clip !== b.clip || a.start !== b.start || a.end !== b.end) lines.push(`${id}: ${a.clip} ${formatSpan(a)} → ${b.clip} ${formatSpan(b)}`);
|
|
420
442
|
if (a.transition !== b.transition) lines.push(`${id}: ${a.transition} → ${b.transition}`);
|
|
421
443
|
if (a.motion !== b.motion) lines.push(`${id}: motion ${a.motion} → ${b.motion}`);
|
|
444
|
+
if (!isSameCamera(a.camera, b.camera)) lines.push(`${id}: camera ${describeCamera(a.camera)} → ${describeCamera(b.camera)}`);
|
|
445
|
+
if (a.fadeFrames !== b.fadeFrames) lines.push(`${id}: fade ${a.fadeFrames === undefined ? "default" : `${String(a.fadeFrames)} frames`} → ${b.fadeFrames === undefined ? "default" : `${String(b.fadeFrames)} frames`}`);
|
|
422
446
|
}
|
|
423
447
|
for (const segment of after.segments) {
|
|
424
448
|
const previous = old.get(segment.id);
|
|
@@ -99,6 +99,8 @@ function getOverlayCss(colors: OverlayColors, fonts: { heading: string; interfac
|
|
|
99
99
|
`.ov-list .ov-card.cen{align-items:center;text-align:center}`,
|
|
100
100
|
`.ov-list li{white-space:nowrap}`,
|
|
101
101
|
`.ov.center .ov-card{transform-origin:50% 100%}`,
|
|
102
|
+
// A centred keyword (style.align center) centres a line that wraps too.
|
|
103
|
+
`.ov-keyword.center .ov-card{justify-content:center;text-align:center}`,
|
|
102
104
|
`.ov-list .ov-chip{position:absolute;box-sizing:border-box;flex-direction:row;align-items:center;justify-content:center;white-space:nowrap;line-height:${OVERLAY_LINE_HEIGHT};transform-origin:50% 100%}`,
|
|
103
105
|
`.ov-svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}`,
|
|
104
106
|
`.ov-search,.ov-counter .ov-card,.ov-date .ov-card,.ov-place,.ov-sub,.ov-line{white-space:nowrap}`,
|
|
@@ -265,6 +267,7 @@ interface MarkupContext {
|
|
|
265
267
|
/** A keyword or a lower third, entering as the soft pill (or by its own entrance). */
|
|
266
268
|
function addSideText(overlay: Extract<ResolvedOverlay, { kind: "keyword" | "lower_third" }>, id: string, context: MarkupContext, out: OverlayMarkup): void {
|
|
267
269
|
const { box, fontSize, side } = overlay;
|
|
270
|
+
const isCentred = overlay.kind === "keyword" && overlay.isCentred === true;
|
|
268
271
|
const colors = getOverlayColors(overlay, context.colors);
|
|
269
272
|
const cardStyle = getCardStyle(overlay, colors, context.scale);
|
|
270
273
|
const dotStyle = overlay.colors.accent === undefined ? "" : ` style="background:${colors.accent}"`;
|
|
@@ -274,7 +277,7 @@ function addSideText(overlay: Extract<ResolvedOverlay, { kind: "keyword" | "lowe
|
|
|
274
277
|
const wipe = overlay.entrance === "wipe" ? `<i class="ov-wipe" id="${id}w"></i>` : "";
|
|
275
278
|
const underline = overlay.kind === "keyword" && overlay.underline === true ? `<i class="ov-ul" id="${id}u" style="${getUnderlineStyle(overlay)}"></i>` : "";
|
|
276
279
|
const body = `<div class="ov-card"${cardStyle}>${wipe}${overlay.kind === "lower_third" ? `<i class="ov-dot" id="${id}d"${dotStyle}></i>` : ""}<span id="${id}t">${text}</span>${underline}</div>`;
|
|
277
|
-
out.html.push(clipDiv(overlay, id, `ov ov-${overlay.kind.replace("_", "-")}${side === "right" ? " right" : ""}${isTyped ? " ty" : ""}${underline === "" ? "" : " ul"}`, style, body));
|
|
280
|
+
out.html.push(clipDiv(overlay, id, `ov ov-${overlay.kind.replace("_", "-")}${isCentred ? " center" : side === "right" ? " right" : ""}${isTyped ? " ty" : ""}${underline === "" ? "" : " ul"}`, style, body));
|
|
278
281
|
if (overlay.entrance !== null) {
|
|
279
282
|
out.tweens.push(...getMotionTweens(`#${id} .ov-card`, getEntranceMotion(overlay.entrance, overlay.easing ?? "smooth", context.frame), overlay.start));
|
|
280
283
|
out.tweens.push(...getTypingTweens(id, overlay, [...overlay.text].length));
|