@softure-ai/marketing-kit 0.2.0 → 0.3.1
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 +20 -0
- package/README.md +108 -3
- package/dist/cli/footage.d.ts +6 -0
- package/dist/cli/footage.d.ts.map +1 -0
- package/dist/cli/footage.js +95 -0
- package/dist/cli/footage.js.map +1 -0
- package/dist/cli/main.js +18 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/options.d.ts +18 -3
- package/dist/cli/options.d.ts.map +1 -1
- package/dist/cli/options.js +41 -2
- package/dist/cli/options.js.map +1 -1
- package/dist/compose/compose.d.ts.map +1 -1
- package/dist/compose/compose.js +1 -22
- package/dist/compose/compose.js.map +1 -1
- package/dist/compose/html.d.ts +6 -0
- package/dist/compose/html.d.ts.map +1 -0
- package/dist/compose/html.js +24 -0
- package/dist/compose/html.js.map +1 -0
- package/dist/config/actions-schema.d.ts +14 -14
- package/dist/config/config.d.ts +16 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +88 -0
- package/dist/config/config.js.map +1 -1
- package/dist/config/schema.d.ts +133 -70
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +110 -3
- package/dist/config/schema.js.map +1 -1
- package/dist/config/shot-steps.d.ts +16 -16
- package/dist/footage/cache.d.ts +23 -0
- package/dist/footage/cache.d.ts.map +1 -0
- package/dist/footage/cache.js +51 -0
- package/dist/footage/cache.js.map +1 -0
- package/dist/footage/compose.d.ts +50 -0
- package/dist/footage/compose.d.ts.map +1 -0
- package/dist/footage/compose.js +166 -0
- package/dist/footage/compose.js.map +1 -0
- package/dist/footage/edl.d.ts +83 -0
- package/dist/footage/edl.d.ts.map +1 -0
- package/dist/footage/edl.js +166 -0
- package/dist/footage/edl.js.map +1 -0
- package/dist/footage/elevenlabs.d.ts +31 -0
- package/dist/footage/elevenlabs.d.ts.map +1 -0
- package/dist/footage/elevenlabs.js +140 -0
- package/dist/footage/elevenlabs.js.map +1 -0
- package/dist/footage/fake.d.ts +38 -0
- package/dist/footage/fake.d.ts.map +1 -0
- package/dist/footage/fake.js +66 -0
- package/dist/footage/fake.js.map +1 -0
- package/dist/footage/film.d.ts +103 -0
- package/dist/footage/film.d.ts.map +1 -0
- package/dist/footage/film.js +29 -0
- package/dist/footage/film.js.map +1 -0
- package/dist/footage/music.d.ts +37 -0
- package/dist/footage/music.d.ts.map +1 -0
- package/dist/footage/music.js +63 -0
- package/dist/footage/music.js.map +1 -0
- package/dist/footage/normalize.d.ts +41 -0
- package/dist/footage/normalize.d.ts.map +1 -0
- package/dist/footage/normalize.js +114 -0
- package/dist/footage/normalize.js.map +1 -0
- package/dist/footage/pipeline.d.ts +105 -0
- package/dist/footage/pipeline.d.ts.map +1 -0
- package/dist/footage/pipeline.js +385 -0
- package/dist/footage/pipeline.js.map +1 -0
- package/dist/footage/probe.d.ts +64 -0
- package/dist/footage/probe.d.ts.map +1 -0
- package/dist/footage/probe.js +138 -0
- package/dist/footage/probe.js.map +1 -0
- package/dist/footage/providers.d.ts +61 -0
- package/dist/footage/providers.d.ts.map +1 -0
- package/dist/footage/providers.js +13 -0
- package/dist/footage/providers.js.map +1 -0
- package/dist/footage/render.d.ts +20 -0
- package/dist/footage/render.d.ts.map +1 -0
- package/dist/footage/render.js +76 -0
- package/dist/footage/render.js.map +1 -0
- package/dist/index.d.ts +13 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/dist/render/render.d.ts +6 -0
- package/dist/render/render.d.ts.map +1 -1
- package/dist/render/render.js +1 -1
- package/dist/render/render.js.map +1 -1
- package/package.json +1 -1
- package/schema/marketing.schema.json +254 -2
- package/src/cli/footage.ts +87 -0
- package/src/cli/main.ts +17 -1
- package/src/cli/options.ts +51 -4
- package/src/compose/compose.ts +1 -25
- package/src/compose/html.ts +28 -0
- package/src/config/config.ts +97 -0
- package/src/config/schema.ts +114 -4
- package/src/footage/cache.ts +66 -0
- package/src/footage/compose.ts +213 -0
- package/src/footage/edl.ts +204 -0
- package/src/footage/elevenlabs.ts +154 -0
- package/src/footage/fake.ts +92 -0
- package/src/footage/film.ts +111 -0
- package/src/footage/music.ts +86 -0
- package/src/footage/normalize.ts +133 -0
- package/src/footage/pipeline.ts +447 -0
- package/src/footage/probe.ts +172 -0
- package/src/footage/providers.ts +71 -0
- package/src/footage/render.ts +82 -0
- package/src/index.ts +109 -1
- package/src/render/render.ts +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TimedWord } from "../voice/voiceover.js";
|
|
2
|
+
/**
|
|
3
|
+
* The paid footage cache: what a provider returned, stored under a key made of the input's bytes and every setting
|
|
4
|
+
* that changes the answer, so a re-render never pays twice and a changed clip is never served a stale result. Files
|
|
5
|
+
* live in `<cacheDir>/<film id>/` (the project commits them, as it commits the voiceover).
|
|
6
|
+
*/
|
|
7
|
+
export type FootageCacheKind = "transcript" | "isolated" | "music";
|
|
8
|
+
/** SHA-256 of a file's bytes, streamed (phone clips are large). */
|
|
9
|
+
export declare function hashFile(path: string): Promise<string>;
|
|
10
|
+
/** A cache key: the first 16 hex digits of the SHA-256 of the parts as JSON. */
|
|
11
|
+
export declare function footageCacheKey(kind: FootageCacheKind, parts: Record<string, unknown>): string;
|
|
12
|
+
export declare function getFootageCachePath(cacheDir: string, filmId: string, kind: FootageCacheKind, key: string): string;
|
|
13
|
+
export declare function writeCacheFile(path: string, data: Buffer | string): void;
|
|
14
|
+
/** A cached transcript; null when there is none, an error naming a broken file. */
|
|
15
|
+
export declare function readCachedTranscript(path: string): {
|
|
16
|
+
ok: true;
|
|
17
|
+
words: TimedWord[] | null;
|
|
18
|
+
} | {
|
|
19
|
+
ok: false;
|
|
20
|
+
error: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function writeTranscript(path: string, words: TimedWord[]): void;
|
|
23
|
+
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/footage/cache.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;GAIG;AAEH,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,UAAU,GAAG,OAAO,CAAC;AAInE,mEAAmE;AACnE,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAI5D;AAED,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAK9F;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjH;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGxE;AAaD,mFAAmF;AACnF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CASzH;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,CAEtE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { createReadStream, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
const SUFFIXES = { transcript: "transcript.json", isolated: "isolated.mp3", music: "music.mp3" };
|
|
5
|
+
/** SHA-256 of a file's bytes, streamed (phone clips are large). */
|
|
6
|
+
export async function hashFile(path) {
|
|
7
|
+
const hash = createHash("sha256");
|
|
8
|
+
for await (const chunk of createReadStream(path))
|
|
9
|
+
hash.update(chunk);
|
|
10
|
+
return hash.digest("hex");
|
|
11
|
+
}
|
|
12
|
+
/** A cache key: the first 16 hex digits of the SHA-256 of the parts as JSON. */
|
|
13
|
+
export function footageCacheKey(kind, parts) {
|
|
14
|
+
return createHash("sha256")
|
|
15
|
+
.update(JSON.stringify({ kind, ...parts }))
|
|
16
|
+
.digest("hex")
|
|
17
|
+
.slice(0, 16);
|
|
18
|
+
}
|
|
19
|
+
export function getFootageCachePath(cacheDir, filmId, kind, key) {
|
|
20
|
+
return join(cacheDir, filmId, `${key}.${SUFFIXES[kind]}`);
|
|
21
|
+
}
|
|
22
|
+
export function writeCacheFile(path, data) {
|
|
23
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
24
|
+
writeFileSync(path, data);
|
|
25
|
+
}
|
|
26
|
+
function isTimedWords(value) {
|
|
27
|
+
return (Array.isArray(value) &&
|
|
28
|
+
value.every((item) => {
|
|
29
|
+
if (typeof item !== "object" || item === null)
|
|
30
|
+
return false;
|
|
31
|
+
const word = item;
|
|
32
|
+
return typeof word.text === "string" && typeof word.start === "number" && typeof word.end === "number";
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
/** A cached transcript; null when there is none, an error naming a broken file. */
|
|
36
|
+
export function readCachedTranscript(path) {
|
|
37
|
+
if (!existsSync(path))
|
|
38
|
+
return { ok: true, words: null };
|
|
39
|
+
let words;
|
|
40
|
+
try {
|
|
41
|
+
words = JSON.parse(readFileSync(path, "utf8"));
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
return { ok: false, error: `cannot read ${path}: ${String(error)}` };
|
|
45
|
+
}
|
|
46
|
+
return isTimedWords(words) ? { ok: true, words } : { ok: false, error: `${path} is not a list of timed words` };
|
|
47
|
+
}
|
|
48
|
+
export function writeTranscript(path, words) {
|
|
49
|
+
writeCacheFile(path, `${JSON.stringify(words, null, 1)}\n`);
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/footage/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAY1C,MAAM,QAAQ,GAAqC,EAAE,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AAEnI,mEAAmE;AACnE,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAAY;IACzC,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IAClC,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,gBAAgB,CAAC,IAAI,CAAC;QAAE,IAAI,CAAC,MAAM,CAAC,KAAe,CAAC,CAAC;IAC/E,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,eAAe,CAAC,IAAsB,EAAE,KAA8B;IACpF,OAAO,UAAU,CAAC,QAAQ,CAAC;SACxB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;SAC1C,MAAM,CAAC,KAAK,CAAC;SACb,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,QAAgB,EAAE,MAAc,EAAE,IAAsB,EAAE,GAAW;IACvG,OAAO,IAAI,CAA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,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,+BAA+B,EAAE,CAAC;AAClH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,KAAkB;IAC9D,cAAc,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { BrandColors } from "../config/colors.js";
|
|
2
|
+
import type { SfxEvent } from "../config/schema.js";
|
|
3
|
+
import type { ComposeFont } from "../compose/compose.js";
|
|
4
|
+
import { type CaptionLayout } from "../compose/timeline.js";
|
|
5
|
+
import type { TimedWord } from "../voice/voiceover.js";
|
|
6
|
+
import { type Edl } from "./edl.js";
|
|
7
|
+
import type { FootageFilm } from "./film.js";
|
|
8
|
+
/** A cross-fade's length; the outgoing segment plays on under the incoming one for this long. */
|
|
9
|
+
export declare const FADE_SECONDS = 0.35;
|
|
10
|
+
/** The end card's length after the cut. */
|
|
11
|
+
export declare const END_CARD_SECONDS = 3;
|
|
12
|
+
export interface FootageComposeAssets {
|
|
13
|
+
/** The normalized clips by id. */
|
|
14
|
+
clips: Record<string, string>;
|
|
15
|
+
/** The cut speech track (as long as the cut). */
|
|
16
|
+
speech: string;
|
|
17
|
+
/** The ducked music track, or null for none. */
|
|
18
|
+
music: string | null;
|
|
19
|
+
/** The cut's last frame, under the end card. */
|
|
20
|
+
lastFrame: string;
|
|
21
|
+
logo: string | null;
|
|
22
|
+
sfx: Partial<Record<SfxEvent, string>>;
|
|
23
|
+
}
|
|
24
|
+
export interface FootageComposeInput {
|
|
25
|
+
film: FootageFilm;
|
|
26
|
+
edl: Edl;
|
|
27
|
+
/** The film's words in film time (`remapWords`), for the captions. */
|
|
28
|
+
words: TimedWord[];
|
|
29
|
+
frame: {
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
};
|
|
33
|
+
caption: CaptionLayout;
|
|
34
|
+
/** The end card's headline size. */
|
|
35
|
+
headlineSize: number;
|
|
36
|
+
colors: BrandColors;
|
|
37
|
+
fonts: {
|
|
38
|
+
heading: ComposeFont | null;
|
|
39
|
+
body: ComposeFont | null;
|
|
40
|
+
};
|
|
41
|
+
assets: FootageComposeAssets;
|
|
42
|
+
brandName: string;
|
|
43
|
+
locale: string;
|
|
44
|
+
}
|
|
45
|
+
/** The film's length: the cut plus the end card. */
|
|
46
|
+
export declare function getFootageFilmSeconds(film: Pick<FootageFilm, "endCard">, edl: Edl): number;
|
|
47
|
+
/** The picture scale each segment starts at: `zoom` cuts alternate between punched in and back out. */
|
|
48
|
+
export declare function getSegmentScales(edl: Edl): number[];
|
|
49
|
+
export declare function composeFootage(input: FootageComposeInput): string;
|
|
50
|
+
//# sourceMappingURL=compose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/footage/compose.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAoC,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAU7C,iGAAiG;AACjG,eAAO,MAAM,YAAY,OAAO,CAAC;AAKjC,2CAA2C;AAC3C,eAAO,MAAM,gBAAgB,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+1,166 @@
|
|
|
1
|
+
import { escapeHtml, fontFaces, fontStack } from "../compose/html.js";
|
|
2
|
+
import { captionChunks } from "../compose/timeline.js";
|
|
3
|
+
import { getEdlDuration, getSegmentStarts } from "./edl.js";
|
|
4
|
+
/**
|
|
5
|
+
* The HyperFrames composition of a footage film (the same 0.8.85 contract as `composeFilm`): one `<video>` clip per
|
|
6
|
+
* EDL segment over the normalized clip with its media start, the transitions (`fade` cross-fades from the segment
|
|
7
|
+
* before, `zoom` punches in on alternate jump cuts, `whoosh` plays the whoosh sound), a slow zoom on b-roll, the
|
|
8
|
+
* word-by-word captions, the end card over the cut's last frame, the cut speech track and the ducked music.
|
|
9
|
+
*/
|
|
10
|
+
const COMPOSITION_ID = "film";
|
|
11
|
+
/** A cross-fade's length; the outgoing segment plays on under the incoming one for this long. */
|
|
12
|
+
export const FADE_SECONDS = 0.35;
|
|
13
|
+
/** The punch-in of a `zoom` cut. */
|
|
14
|
+
const ZOOM_SCALE = 1.12;
|
|
15
|
+
/** How far a b-roll segment zooms over its length. */
|
|
16
|
+
const KEN_BURNS_SCALE = 1.08;
|
|
17
|
+
/** The end card's length after the cut. */
|
|
18
|
+
export const END_CARD_SECONDS = 3;
|
|
19
|
+
const r3 = (value) => Math.round(value * 1000) / 1000 || 0;
|
|
20
|
+
/** The film's length: the cut plus the end card. */
|
|
21
|
+
export function getFootageFilmSeconds(film, edl) {
|
|
22
|
+
return r3(getEdlDuration(edl) + (film.endCard === null ? 0 : END_CARD_SECONDS));
|
|
23
|
+
}
|
|
24
|
+
/** The picture scale each segment starts at: `zoom` cuts alternate between punched in and back out. */
|
|
25
|
+
export function getSegmentScales(edl) {
|
|
26
|
+
const scales = [];
|
|
27
|
+
edl.segments.forEach((segment, index) => {
|
|
28
|
+
const previous = scales[index - 1] ?? 1;
|
|
29
|
+
scales.push(segment.transition === "zoom" && index > 0 ? (previous === 1 ? ZOOM_SCALE : 1) : 1);
|
|
30
|
+
});
|
|
31
|
+
return scales;
|
|
32
|
+
}
|
|
33
|
+
export function composeFootage(input) {
|
|
34
|
+
const { film, edl, words, frame, colors: c, fonts, assets, caption: captionBox } = input;
|
|
35
|
+
const starts = getSegmentStarts(edl);
|
|
36
|
+
const cutEnd = getEdlDuration(edl);
|
|
37
|
+
const end = getFootageFilmSeconds(film, edl);
|
|
38
|
+
const scales = getSegmentScales(edl);
|
|
39
|
+
const segments = edl.segments.map((segment, index) => {
|
|
40
|
+
const src = assets.clips[segment.clip];
|
|
41
|
+
if (src === undefined)
|
|
42
|
+
throw new Error(`The EDL names clip "${segment.clip}", which the film has no file for.`);
|
|
43
|
+
const next = edl.segments[index + 1];
|
|
44
|
+
const tail = next?.transition === "fade" ? FADE_SECONDS : 0;
|
|
45
|
+
const start = starts[index];
|
|
46
|
+
const duration = r3(segment.end - segment.start + tail);
|
|
47
|
+
const scale = scales[index];
|
|
48
|
+
const style = scale === 1 ? "" : ` style="transform:scale(${scale})"`;
|
|
49
|
+
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>`;
|
|
50
|
+
});
|
|
51
|
+
const tweens = [];
|
|
52
|
+
edl.segments.forEach((segment, index) => {
|
|
53
|
+
const start = starts[index];
|
|
54
|
+
if (segment.transition === "fade" && index > 0) {
|
|
55
|
+
tweens.push(`tl.fromTo("#seg${index}", { opacity: 0 }, { opacity: 1, duration: ${FADE_SECONDS}, ease: "none", immediateRender: false }, ${start});`);
|
|
56
|
+
}
|
|
57
|
+
if (segment.motion === "kenburns") {
|
|
58
|
+
const from = scales[index];
|
|
59
|
+
tweens.push(`tl.fromTo("#seg${index}", { scale: ${from} }, { scale: ${r3(from * KEN_BURNS_SCALE)}, duration: ${r3(segment.end - segment.start)}, ease: "none", immediateRender: false }, ${start});`);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
// --- Captions ---
|
|
63
|
+
const caption = input.film.captions ? captionChunks(words) : [];
|
|
64
|
+
const captionHtml = caption
|
|
65
|
+
.map((chunk, i) => {
|
|
66
|
+
const next = caption[i + 1];
|
|
67
|
+
const start = r3(chunk.start - 0.05);
|
|
68
|
+
const stop = Math.min(chunk.end + 0.35, next === undefined ? cutEnd : next.start - 0.06);
|
|
69
|
+
const spans = chunk.words.map((w, j) => `<span id="cw${i}_${j}">${escapeHtml(w.text)}</span>`).join(" ");
|
|
70
|
+
return `<div id="cap${i}" class="clip caption" data-start="${start}" data-duration="${r3(Math.max(0.1, stop - start))}"><p class="pill">${spans}</p></div>`;
|
|
71
|
+
})
|
|
72
|
+
.join("\n ");
|
|
73
|
+
// --- Sound ---
|
|
74
|
+
const sfx = [];
|
|
75
|
+
const play = (event, t, volume, dur) => {
|
|
76
|
+
const src = assets.sfx[event];
|
|
77
|
+
if (src !== undefined)
|
|
78
|
+
sfx.push({ src, t: r3(Math.max(0, t)), volume, dur });
|
|
79
|
+
};
|
|
80
|
+
edl.segments.forEach((segment, index) => {
|
|
81
|
+
if (segment.transition === "whoosh" && index > 0)
|
|
82
|
+
play("whoosh", starts[index] - 0.1, 0.45, 0.57);
|
|
83
|
+
});
|
|
84
|
+
if (film.endCard !== null) {
|
|
85
|
+
play("whoosh", cutEnd, 0.3, 0.57);
|
|
86
|
+
play("pop", r3(cutEnd + 0.9), 0.35, 0.72);
|
|
87
|
+
}
|
|
88
|
+
const audio = [
|
|
89
|
+
`<audio id="speech" src="${escapeHtml(assets.speech)}" data-start="0" data-duration="${cutEnd}" data-volume="1"></audio>`,
|
|
90
|
+
...(assets.music === null ? [] : [`<audio id="music" src="${escapeHtml(assets.music)}" data-start="0" data-duration="${end}" data-volume="1"></audio>`]),
|
|
91
|
+
...sfx.map((s, i) => `<audio id="sfx${i}" src="${escapeHtml(s.src)}" data-start="${s.t}" data-duration="${s.dur}" data-volume="${s.volume}"></audio>`),
|
|
92
|
+
].join("\n ");
|
|
93
|
+
const tail = r3(end - cutEnd);
|
|
94
|
+
const endCard = film.endCard;
|
|
95
|
+
const endCardHtml = endCard === null
|
|
96
|
+
? ""
|
|
97
|
+
: `<img id="last" class="clip shot" src="${escapeHtml(assets.lastFrame)}" data-start="${cutEnd}" data-duration="${tail}" />
|
|
98
|
+
<div class="shade" id="shade"></div>
|
|
99
|
+
<div class="endcard">
|
|
100
|
+
<div class="brand" id="ec-brand">${assets.logo === null ? "" : `<img class="logo" src="${escapeHtml(assets.logo)}" alt="" />`}<span>${escapeHtml(input.brandName)}</span></div>
|
|
101
|
+
<p class="headline" id="ec-headline">${escapeHtml(endCard.headline)}</p>
|
|
102
|
+
<p class="url" id="ec-url">${escapeHtml(endCard.url)}</p>
|
|
103
|
+
${endCard.note.length > 0 ? `<p class="note" id="ec-note">${escapeHtml(endCard.note)}</p>` : ""}
|
|
104
|
+
</div>`;
|
|
105
|
+
const endCardTweens = endCard === null
|
|
106
|
+
? []
|
|
107
|
+
: [
|
|
108
|
+
`tl.fromTo("#shade", { opacity: 0 }, { opacity: 0.82, duration: 0.45, ease: "power2.out" }, ${cutEnd});`,
|
|
109
|
+
`tl.fromTo("#ec-brand", { y: 30, opacity: 0 }, { y: 0, opacity: 1, duration: 0.5, ease: "power3.out" }, ${r3(cutEnd + 0.3)});`,
|
|
110
|
+
`tl.fromTo("#ec-headline", { y: 40, opacity: 0 }, { y: 0, opacity: 1, duration: 0.6, ease: "power3.out" }, ${r3(cutEnd + 0.45)});`,
|
|
111
|
+
`tl.fromTo("#ec-url", { y: 30, opacity: 0, scale: 0.94 }, { y: 0, opacity: 1, scale: 1, duration: 0.55, ease: "power3.out" }, ${r3(cutEnd + 0.9)});`,
|
|
112
|
+
...(endCard.note.length > 0 ? [`tl.fromTo("#ec-note", { opacity: 0 }, { opacity: 1, duration: 0.5, ease: "power2.out" }, ${r3(cutEnd + 1.3)});`] : []),
|
|
113
|
+
];
|
|
114
|
+
const bodyFont = fontStack(fonts.body, "sans-serif");
|
|
115
|
+
const headingFont = fonts.heading === null ? bodyFont : fontStack(fonts.heading, "sans-serif");
|
|
116
|
+
const faces = [...fontFaces(fonts.body), ...fontFaces(fonts.heading)];
|
|
117
|
+
return `<!doctype html>
|
|
118
|
+
<html lang="${escapeHtml(input.locale)}">
|
|
119
|
+
<head>
|
|
120
|
+
<meta charset="UTF-8" />
|
|
121
|
+
<meta name="viewport" content="width=${frame.width}, height=${frame.height}" />
|
|
122
|
+
<title>${escapeHtml(film.title)}</title>
|
|
123
|
+
<script src="assets/gsap.min.js"></script>
|
|
124
|
+
<style>
|
|
125
|
+
${faces.join("\n")}
|
|
126
|
+
*{margin:0;padding:0;box-sizing:border-box}
|
|
127
|
+
html,body{width:${frame.width}px;height:${frame.height}px;overflow:hidden;background:#000}
|
|
128
|
+
#root{position:relative;width:${frame.width}px;height:${frame.height}px;overflow:hidden;background:#000;font-family:${bodyFont};color:${c.foreground}}
|
|
129
|
+
.shot{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transform-origin:50% 42%}
|
|
130
|
+
.shade{position:absolute;inset:0;background:${c.background};opacity:0}
|
|
131
|
+
.caption{position:absolute;left:${captionBox.left}px;right:${captionBox.right}px;top:${captionBox.top}px;display:flex;justify-content:center}
|
|
132
|
+
.pill{font-weight:650;font-size:${captionBox.fontSize}px;line-height:1.18;letter-spacing:-.01em;text-align:center;padding:16px 28px;border-radius:22px;background:${c.captionBackground};box-shadow:0 14px 44px rgba(0,0,0,.5);color:${c.captionText}}
|
|
133
|
+
.pill span{display:inline-block}
|
|
134
|
+
.endcard{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:0 80px;text-align:center}
|
|
135
|
+
.brand{display:flex;justify-content:center;align-items:center;gap:18px;font-family:${headingFont};font-size:46px}
|
|
136
|
+
.logo{height:60px;width:auto}
|
|
137
|
+
.headline{font-family:${headingFont};font-weight:500;font-size:${input.headlineSize}px;letter-spacing:-.025em;line-height:1.02;margin-top:44px}
|
|
138
|
+
.url{display:inline-block;margin-top:40px;padding:20px 38px;border-radius:999px;font-size:44px;font-weight:600;color:${c.onCta};background:${c.cta}}
|
|
139
|
+
.note{margin-top:26px;font-size:30px;color:${c.muted}}
|
|
140
|
+
</style>
|
|
141
|
+
</head>
|
|
142
|
+
<body>
|
|
143
|
+
<div id="root" data-composition-id="${COMPOSITION_ID}" data-start="0" data-duration="${end}" data-width="${frame.width}" data-height="${frame.height}">
|
|
144
|
+
${segments.join("\n ")}
|
|
145
|
+
${endCardHtml}
|
|
146
|
+
${captionHtml}
|
|
147
|
+
${audio}
|
|
148
|
+
</div>
|
|
149
|
+
<script>
|
|
150
|
+
const tl = gsap.timeline({ paused: true });
|
|
151
|
+
${tweens.join("\n")}
|
|
152
|
+
const captions = ${JSON.stringify(caption.map((chunk) => chunk.words.map((w) => w.start)))};
|
|
153
|
+
captions.forEach((words, i) => {
|
|
154
|
+
tl.fromTo("#cap" + i + " .pill", { y: 14, opacity: 0 }, { y: 0, opacity: 1, duration: 0.16, ease: "power3.out" }, Math.max(0, words[0] - 0.05));
|
|
155
|
+
words.forEach((t, j) => tl.fromTo("#cw" + i + "_" + j, { color: "${c.captionText}" }, { color: "${c.captionHighlight}", duration: 0.06, immediateRender: false }, t).to("#cw" + i + "_" + j, { color: "${c.captionText}", duration: 0.2 }, t + 0.32));
|
|
156
|
+
});
|
|
157
|
+
${endCardTweens.join("\n")}
|
|
158
|
+
tl.set({}, {}, ${end});
|
|
159
|
+
window.__timelines = window.__timelines || {};
|
|
160
|
+
window.__timelines["${COMPOSITION_ID}"] = tl;
|
|
161
|
+
</script>
|
|
162
|
+
</body>
|
|
163
|
+
</html>
|
|
164
|
+
`;
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=compose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../../src/footage/compose.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAsB,MAAM,wBAAw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from "../voice/voiceover.js";
|
|
3
|
+
import { type ClipRole, type CutOptions, type CutTransition, type FootageTransitions } from "./film.js";
|
|
4
|
+
/**
|
|
5
|
+
* The edit decision list: which parts of which clips the film keeps, in order, and how each part starts. Built from
|
|
6
|
+
* the transcript (`buildEdl`), written as plain JSON next to the build so a person or an agent can check or change it
|
|
7
|
+
* before the render, and read back through `edlSchema`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const SEGMENT_MOTIONS: readonly ["none", "kenburns"];
|
|
10
|
+
export type SegmentMotion = (typeof SEGMENT_MOTIONS)[number];
|
|
11
|
+
export interface EdlSegment {
|
|
12
|
+
/** The clip's id. */
|
|
13
|
+
clip: string;
|
|
14
|
+
/** Seconds in the trimmed clip. */
|
|
15
|
+
start: number;
|
|
16
|
+
end: number;
|
|
17
|
+
transition: CutTransition;
|
|
18
|
+
/** `kenburns`: a slow zoom over a segment without speech. */
|
|
19
|
+
motion: SegmentMotion;
|
|
20
|
+
}
|
|
21
|
+
export interface Edl {
|
|
22
|
+
version: 1;
|
|
23
|
+
film: string;
|
|
24
|
+
segments: EdlSegment[];
|
|
25
|
+
}
|
|
26
|
+
export declare const edlSchema: z.ZodObject<{
|
|
27
|
+
version: z.ZodLiteral<1>;
|
|
28
|
+
film: z.ZodString;
|
|
29
|
+
segments: z.ZodArray<z.ZodObject<{
|
|
30
|
+
clip: z.ZodString;
|
|
31
|
+
start: z.ZodNumber;
|
|
32
|
+
end: z.ZodNumber;
|
|
33
|
+
transition: z.ZodEnum<{
|
|
34
|
+
fade: "fade";
|
|
35
|
+
cut: "cut";
|
|
36
|
+
zoom: "zoom";
|
|
37
|
+
whoosh: "whoosh";
|
|
38
|
+
}>;
|
|
39
|
+
motion: z.ZodEnum<{
|
|
40
|
+
none: "none";
|
|
41
|
+
kenburns: "kenburns";
|
|
42
|
+
}>;
|
|
43
|
+
}, z.core.$strict>>;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
/** A clip as the cut sees it: its role, its trimmed length and its transcript (times from the trimmed start). */
|
|
46
|
+
export interface EdlClip {
|
|
47
|
+
id: string;
|
|
48
|
+
role: ClipRole;
|
|
49
|
+
duration: number;
|
|
50
|
+
words: TimedWord[];
|
|
51
|
+
}
|
|
52
|
+
/** Shortest segment kept, in seconds: anything shorter reads as a glitch. */
|
|
53
|
+
export declare const MIN_SEGMENT_SECONDS = 0.25;
|
|
54
|
+
/** A word reduced for comparison: lower case, letters and digits only, repeated letters collapsed (`Yyyy,` → `y`). */
|
|
55
|
+
export declare function normalizeWord(text: string): string;
|
|
56
|
+
/** Whether the word is one of the fillers (compared as `normalizeWord` writes both). */
|
|
57
|
+
export declare function isFiller(text: string, fillers: readonly string[]): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* The cut from the transcripts. A talking clip keeps its runs of words: fillers are cut out, a pause longer than
|
|
60
|
+
* `pauseSeconds` is cut, `padSeconds` stays around each cut. A talking clip without words, and every b-roll clip, is
|
|
61
|
+
* kept whole (b-roll with a slow zoom). The first segment starts with a cut; later ones with `transitions.jump`
|
|
62
|
+
* inside one clip and `transitions.clip` between clips.
|
|
63
|
+
*/
|
|
64
|
+
export declare function buildEdl(filmId: string, clips: EdlClip[], options: CutOptions, transitions: FootageTransitions): Edl;
|
|
65
|
+
/** What makes an EDL (a hand-edited one above all) unusable with these clips; empty when it is fine. */
|
|
66
|
+
export declare function findEdlProblems(edl: Edl, clips: Pick<EdlClip, "id" | "duration">[], filmId: string): string[];
|
|
67
|
+
/** Reads an EDL file's JSON; an error names the first problems by path. */
|
|
68
|
+
export declare function readEdl(json: unknown): {
|
|
69
|
+
ok: true;
|
|
70
|
+
edl: Edl;
|
|
71
|
+
} | {
|
|
72
|
+
ok: false;
|
|
73
|
+
error: string;
|
|
74
|
+
};
|
|
75
|
+
export declare function getEdlDuration(edl: Edl): number;
|
|
76
|
+
/** Where each segment starts in the film, in seconds. */
|
|
77
|
+
export declare function getSegmentStarts(edl: Edl): number[];
|
|
78
|
+
/**
|
|
79
|
+
* The words the film says, in film time: each clip's words that fall in a kept segment (by their middle), shifted by
|
|
80
|
+
* where the segment lands; fillers left out. Every cut shifts every later word.
|
|
81
|
+
*/
|
|
82
|
+
export declare function remapWords(edl: Edl, words: Record<string, TimedWord[]>, fillers: readonly string[]): TimedWord[];
|
|
83
|
+
//# sourceMappingURL=edl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edl.d.ts","sourceRoot":"","sources":["../../src/footage/edl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAmB,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEzH;;;;GAIG;AAEH,eAAO,MAAM,eAAe,+BAAgC,CAAC;AAE7D,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,MAAM,WAAW,UAAU;IACzB,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,aAAa,CAAC;IAC1B,6DAA6D;IAC7D,MAAM,EAAE,aAAa,CAAC;CACvB;AAED,MAAM,WAAW,GAAG;IAClB,OAAO,EAAE,CAAC,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,UAAU,EAAE,CAAC;CACxB;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;kBAcpB,CAAC;AAEH,iHAAiH;AACjH,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,EAAE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
|
3
|
+
/**
|
|
4
|
+
* The edit decision list: which parts of which clips the film keeps, in order, and how each part starts. Built from
|
|
5
|
+
* the transcript (`buildEdl`), written as plain JSON next to the build so a person or an agent can check or change it
|
|
6
|
+
* before the render, and read back through `edlSchema`.
|
|
7
|
+
*/
|
|
8
|
+
export const SEGMENT_MOTIONS = ["none", "kenburns"];
|
|
9
|
+
export const edlSchema = z.strictObject({
|
|
10
|
+
version: z.literal(1),
|
|
11
|
+
film: z.string().min(1),
|
|
12
|
+
segments: z
|
|
13
|
+
.array(z.strictObject({
|
|
14
|
+
clip: z.string().min(1),
|
|
15
|
+
start: z.number().min(0),
|
|
16
|
+
end: z.number().positive(),
|
|
17
|
+
transition: z.enum(CUT_TRANSITIONS),
|
|
18
|
+
motion: z.enum(SEGMENT_MOTIONS),
|
|
19
|
+
}))
|
|
20
|
+
.min(1, "the cut needs at least one segment"),
|
|
21
|
+
});
|
|
22
|
+
/** Shortest segment kept, in seconds: anything shorter reads as a glitch. */
|
|
23
|
+
export const MIN_SEGMENT_SECONDS = 0.25;
|
|
24
|
+
const r3 = (value) => Math.round(value * 1000) / 1000 || 0;
|
|
25
|
+
/** A word reduced for comparison: lower case, letters and digits only, repeated letters collapsed (`Yyyy,` → `y`). */
|
|
26
|
+
export function normalizeWord(text) {
|
|
27
|
+
return text
|
|
28
|
+
.toLowerCase()
|
|
29
|
+
.replace(/[^\p{L}\p{N}]/gu, "")
|
|
30
|
+
.replace(/(.)\1+/gu, "$1");
|
|
31
|
+
}
|
|
32
|
+
/** Whether the word is one of the fillers (compared as `normalizeWord` writes both). */
|
|
33
|
+
export function isFiller(text, fillers) {
|
|
34
|
+
const word = normalizeWord(text);
|
|
35
|
+
return word.length > 0 && fillers.some((filler) => normalizeWord(filler) === word);
|
|
36
|
+
}
|
|
37
|
+
/** The kept spans of a talking clip: runs of spoken words split at fillers and long pauses, padded, never into a neighbour word. */
|
|
38
|
+
function getTalkSpans(clip, options) {
|
|
39
|
+
const runs = [];
|
|
40
|
+
let run = [];
|
|
41
|
+
const words = [...clip.words].sort((a, b) => a.start - b.start);
|
|
42
|
+
words.forEach((word, index) => {
|
|
43
|
+
const previous = words[index - 1];
|
|
44
|
+
if (isFiller(word.text, options.fillers)) {
|
|
45
|
+
if (run.length > 0)
|
|
46
|
+
runs.push(run);
|
|
47
|
+
run = [];
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (run.length > 0 && previous !== undefined && word.start - previous.end > options.pauseSeconds) {
|
|
51
|
+
runs.push(run);
|
|
52
|
+
run = [];
|
|
53
|
+
}
|
|
54
|
+
run.push(word);
|
|
55
|
+
});
|
|
56
|
+
if (run.length > 0)
|
|
57
|
+
runs.push(run);
|
|
58
|
+
const spans = [];
|
|
59
|
+
for (const kept of runs) {
|
|
60
|
+
const first = kept[0];
|
|
61
|
+
const last = kept[kept.length - 1];
|
|
62
|
+
const before = words[words.indexOf(first) - 1];
|
|
63
|
+
const after = words[words.indexOf(last) + 1];
|
|
64
|
+
const start = Math.max(0, first.start - options.padSeconds, before?.end ?? 0);
|
|
65
|
+
const end = Math.min(clip.duration, last.end + options.padSeconds, after?.start ?? clip.duration);
|
|
66
|
+
const previous = spans.at(-1);
|
|
67
|
+
if (previous !== undefined && start <= previous.end + 0.01)
|
|
68
|
+
previous.end = Math.max(previous.end, end);
|
|
69
|
+
else
|
|
70
|
+
spans.push({ start, end });
|
|
71
|
+
}
|
|
72
|
+
return spans.filter((span) => span.end - span.start >= MIN_SEGMENT_SECONDS);
|
|
73
|
+
}
|
|
74
|
+
/** Cuts the segments to `maxSeconds`: the last one that crosses it is shortened, later ones dropped. */
|
|
75
|
+
function limitLength(segments, maxSeconds) {
|
|
76
|
+
if (maxSeconds === null)
|
|
77
|
+
return segments;
|
|
78
|
+
const kept = [];
|
|
79
|
+
let total = 0;
|
|
80
|
+
for (const segment of segments) {
|
|
81
|
+
const left = maxSeconds - total;
|
|
82
|
+
if (left < MIN_SEGMENT_SECONDS)
|
|
83
|
+
break;
|
|
84
|
+
const length = segment.end - segment.start;
|
|
85
|
+
kept.push(length <= left ? segment : { ...segment, end: r3(segment.start + left) });
|
|
86
|
+
total += Math.min(length, left);
|
|
87
|
+
}
|
|
88
|
+
return kept;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The cut from the transcripts. A talking clip keeps its runs of words: fillers are cut out, a pause longer than
|
|
92
|
+
* `pauseSeconds` is cut, `padSeconds` stays around each cut. A talking clip without words, and every b-roll clip, is
|
|
93
|
+
* kept whole (b-roll with a slow zoom). The first segment starts with a cut; later ones with `transitions.jump`
|
|
94
|
+
* inside one clip and `transitions.clip` between clips.
|
|
95
|
+
*/
|
|
96
|
+
export function buildEdl(filmId, clips, options, transitions) {
|
|
97
|
+
const segments = [];
|
|
98
|
+
for (const clip of clips) {
|
|
99
|
+
const spans = clip.role === "talk" ? getTalkSpans(clip, options) : [];
|
|
100
|
+
const kept = spans.length > 0 ? spans : [{ start: 0, end: clip.duration }];
|
|
101
|
+
for (const span of kept) {
|
|
102
|
+
const previous = segments.at(-1);
|
|
103
|
+
const transition = previous === undefined ? "cut" : previous.clip === clip.id ? transitions.jump : transitions.clip;
|
|
104
|
+
segments.push({ clip: clip.id, start: r3(span.start), end: r3(span.end), transition, motion: clip.role === "broll" ? "kenburns" : "none" });
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return { version: 1, film: filmId, segments: limitLength(segments, options.maxSeconds) };
|
|
108
|
+
}
|
|
109
|
+
/** What makes an EDL (a hand-edited one above all) unusable with these clips; empty when it is fine. */
|
|
110
|
+
export function findEdlProblems(edl, clips, filmId) {
|
|
111
|
+
const problems = [];
|
|
112
|
+
if (edl.film !== filmId)
|
|
113
|
+
problems.push(`it belongs to film "${edl.film}", not "${filmId}"`);
|
|
114
|
+
const durations = new Map(clips.map((clip) => [clip.id, clip.duration]));
|
|
115
|
+
edl.segments.forEach((segment, index) => {
|
|
116
|
+
const duration = durations.get(segment.clip);
|
|
117
|
+
const at = `segments[${index}]`;
|
|
118
|
+
if (duration === undefined)
|
|
119
|
+
problems.push(`${at}.clip: no clip "${segment.clip}" in the film`);
|
|
120
|
+
else if (segment.end > duration + 0.05)
|
|
121
|
+
problems.push(`${at}.end: ${segment.end} s is past the clip's end (${duration.toFixed(2)} s)`);
|
|
122
|
+
if (segment.end - segment.start < MIN_SEGMENT_SECONDS)
|
|
123
|
+
problems.push(`${at}: shorter than ${MIN_SEGMENT_SECONDS} s (start ${segment.start}, end ${segment.end})`);
|
|
124
|
+
});
|
|
125
|
+
return problems;
|
|
126
|
+
}
|
|
127
|
+
/** Reads an EDL file's JSON; an error names the first problems by path. */
|
|
128
|
+
export function readEdl(json) {
|
|
129
|
+
const parsed = edlSchema.safeParse(json);
|
|
130
|
+
if (parsed.success)
|
|
131
|
+
return { ok: true, edl: parsed.data };
|
|
132
|
+
const issues = parsed.error.issues.slice(0, 5).map((issue) => `${issue.path.join(".") || "(root)"}: ${issue.message}`);
|
|
133
|
+
return { ok: false, error: issues.join("; ") };
|
|
134
|
+
}
|
|
135
|
+
export function getEdlDuration(edl) {
|
|
136
|
+
return r3(edl.segments.reduce((sum, segment) => sum + (segment.end - segment.start), 0));
|
|
137
|
+
}
|
|
138
|
+
/** Where each segment starts in the film, in seconds. */
|
|
139
|
+
export function getSegmentStarts(edl) {
|
|
140
|
+
const starts = [];
|
|
141
|
+
let time = 0;
|
|
142
|
+
for (const segment of edl.segments) {
|
|
143
|
+
starts.push(r3(time));
|
|
144
|
+
time += segment.end - segment.start;
|
|
145
|
+
}
|
|
146
|
+
return starts;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* The words the film says, in film time: each clip's words that fall in a kept segment (by their middle), shifted by
|
|
150
|
+
* where the segment lands; fillers left out. Every cut shifts every later word.
|
|
151
|
+
*/
|
|
152
|
+
export function remapWords(edl, words, fillers) {
|
|
153
|
+
const starts = getSegmentStarts(edl);
|
|
154
|
+
const film = [];
|
|
155
|
+
edl.segments.forEach((segment, index) => {
|
|
156
|
+
const offset = starts[index] - segment.start;
|
|
157
|
+
for (const word of words[segment.clip] ?? []) {
|
|
158
|
+
const middle = (word.start + word.end) / 2;
|
|
159
|
+
if (middle < segment.start || middle >= segment.end || isFiller(word.text, fillers))
|
|
160
|
+
continue;
|
|
161
|
+
film.push({ text: word.text, start: r3(Math.max(word.start, segment.start) + offset), end: r3(Math.min(word.end, segment.end) + offset) });
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
return film;
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=edl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edl.js","sourceRoot":"","sources":["../../src/footage/edl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,eAAe,EAA+E,MAAM,WAAW,CAAC;AAEzH;;;;GAIG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,UAAU,CAAU,CAAC;AAqB7D,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,YAAY,CAAC;IACtC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACrB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,QAAQ,EAAE,CAAC;SACR,KAAK,CACJ,CAAC,CAAC,YAAY,CAAC;QACb,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACvB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACxB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC1B,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC;QACnC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC;KAChC,CAAC,CACH;SACA,GAAG,C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.js";
|
|
3
|
+
/**
|
|
4
|
+
* ElevenLabs behind the footage providers (API reference checked 2026-10-29): Scribe speech to text
|
|
5
|
+
* (`/v1/speech-to-text`, word timestamps), Voice Isolator (`/v1/audio-isolation`), Music (`/v1/music`) and Video to
|
|
6
|
+
* Music (`/v1/music/video-to-music`). Each takes an injected `fetch`, so tests reach no network.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ELEVENLABS_STT_MODEL = "scribe_v2";
|
|
9
|
+
export declare const ELEVENLABS_MUSIC_MODEL = "music_v1";
|
|
10
|
+
export interface ElevenLabsFootageOptions {
|
|
11
|
+
/** The API key; a missing one fails the call, never the estimate. */
|
|
12
|
+
apiKey: string | undefined;
|
|
13
|
+
fetch?: typeof globalThis.fetch;
|
|
14
|
+
/** Scribe's model; `scribe_v2` by default. */
|
|
15
|
+
sttModel?: string;
|
|
16
|
+
musicModel?: string;
|
|
17
|
+
}
|
|
18
|
+
/** Scribe's response read as timed words: entries of type `word` only (no spacing, no sound events). */
|
|
19
|
+
export declare function readScribeResponse(body: unknown, language: string): TtsResult<SttTranscript>;
|
|
20
|
+
export declare function createElevenLabsSttProvider(options: ElevenLabsFootageOptions): SttProvider;
|
|
21
|
+
export declare function createElevenLabsIsolationProvider(options: ElevenLabsFootageOptions): IsolationProvider;
|
|
22
|
+
/** The length ElevenLabs Music is asked for: the film's, within the service's 3 s to 10 min. */
|
|
23
|
+
export declare function getMusicLengthMs(seconds: number): number;
|
|
24
|
+
export declare function createElevenLabsMusicProvider(options: ElevenLabsFootageOptions): MusicProvider;
|
|
25
|
+
/** The ElevenLabs footage providers with the key from the environment (read, never logged). */
|
|
26
|
+
export declare function createElevenLabsFootageProviders(env: Record<string, string | undefined>, fetch?: typeof globalThis.fetch): {
|
|
27
|
+
stt: SttProvider;
|
|
28
|
+
isolation: IsolationProvider;
|
|
29
|
+
music: MusicProvider;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=elevenlabs.d.ts.map
|
|
@@ -0,0 +1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