@softure-ai/marketing-kit 0.1.12 → 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 +27 -0
- package/README.md +109 -4
- 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 +21 -5
- 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 +19 -3
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +90 -2
- package/dist/config/config.js.map +1 -1
- package/dist/config/schema.d.ts +152 -70
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +140 -10
- 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 +14 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -3
- package/dist/index.js.map +1 -1
- package/dist/messages/index.d.ts +10 -22
- package/dist/messages/index.d.ts.map +1 -1
- package/dist/messages/index.js +8 -6
- package/dist/messages/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 +339 -3
- package/src/cli/footage.ts +87 -0
- package/src/cli/main.ts +20 -5
- 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 +101 -5
- package/src/config/schema.ts +146 -12
- 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 +110 -3
- package/src/messages/index.ts +16 -8
- package/src/render/render.ts +1 -1
- package/dist/messages/pl.d.ts +0 -3
- package/dist/messages/pl.d.ts.map +0 -1
- package/dist/messages/pl.js +0 -21
- package/dist/messages/pl.js.map +0 -1
- package/src/messages/pl.ts +0 -22
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { VideoFormat } from "../compose/timeline.js";
|
|
2
|
+
import type { EndCard } from "../film.js";
|
|
3
|
+
/**
|
|
4
|
+
* A footage film: filmed clips (a person talking to camera, b-roll) cut by their transcript into a captioned
|
|
5
|
+
* vertical film. Built from `marketing.json` (`footage[]`) or passed to `renderFootageFilm` as it is.
|
|
6
|
+
*/
|
|
7
|
+
/** `talk`: someone speaks, so the cut follows the words. `broll`: pictures without speech, kept whole with a slow zoom. */
|
|
8
|
+
export declare const CLIP_ROLES: readonly ["talk", "broll"];
|
|
9
|
+
export type ClipRole = (typeof CLIP_ROLES)[number];
|
|
10
|
+
/**
|
|
11
|
+
* How a clip whose aspect differs from the film's fills the frame: `crop` (scaled to cover, edges cut), `blur` (the
|
|
12
|
+
* whole picture over a blurred, enlarged copy of itself) or `auto` (crop when the aspects are within 15 %, else blur).
|
|
13
|
+
*/
|
|
14
|
+
export declare const CLIP_FITS: readonly ["auto", "crop", "blur"];
|
|
15
|
+
export type ClipFit = (typeof CLIP_FITS)[number];
|
|
16
|
+
/**
|
|
17
|
+
* How a segment of the cut starts: `cut` (hard), `fade` (a short cross-fade from the previous segment), `zoom` (a
|
|
18
|
+
* punch-in that hides a jump cut inside one talking clip) or `whoosh` (a hard cut with the whoosh sound).
|
|
19
|
+
*/
|
|
20
|
+
export declare const CUT_TRANSITIONS: readonly ["cut", "fade", "zoom", "whoosh"];
|
|
21
|
+
export type CutTransition = (typeof CUT_TRANSITIONS)[number];
|
|
22
|
+
export interface FootageClip {
|
|
23
|
+
/** Unique within the film; the EDL refers to the clip by it. */
|
|
24
|
+
id: string;
|
|
25
|
+
/** A local file (absolute path) or an `https://` URL, downloaded once into the build folder. */
|
|
26
|
+
source: string;
|
|
27
|
+
role: ClipRole;
|
|
28
|
+
fit: ClipFit;
|
|
29
|
+
/** The part of the source the film uses, in seconds; `end: null` is the source's end. */
|
|
30
|
+
trim: {
|
|
31
|
+
start: number;
|
|
32
|
+
end: number | null;
|
|
33
|
+
};
|
|
34
|
+
/** What the clip says, for `--placeholder` only: spread evenly over the clip as a free stand-in transcript. */
|
|
35
|
+
script: string | null;
|
|
36
|
+
}
|
|
37
|
+
/** Where the music under the film comes from. `prompt` and `video` are paid (ElevenLabs Music, Video to Music). */
|
|
38
|
+
export type MusicSource = {
|
|
39
|
+
kind: "none";
|
|
40
|
+
} | {
|
|
41
|
+
kind: "file";
|
|
42
|
+
path: string;
|
|
43
|
+
} | {
|
|
44
|
+
kind: "prompt";
|
|
45
|
+
prompt: string;
|
|
46
|
+
} | {
|
|
47
|
+
kind: "video";
|
|
48
|
+
description: string;
|
|
49
|
+
tags: string[];
|
|
50
|
+
};
|
|
51
|
+
export interface FootageMusic {
|
|
52
|
+
source: MusicSource;
|
|
53
|
+
/** The music's volume while nobody speaks (0-1). */
|
|
54
|
+
volume: number;
|
|
55
|
+
/** The music's volume under speech (0-1). */
|
|
56
|
+
duckedVolume: number;
|
|
57
|
+
}
|
|
58
|
+
/** How the transcript turns into the cut (`buildEdl`). */
|
|
59
|
+
export interface CutOptions {
|
|
60
|
+
/** Words cut out wherever they stand, compared without case, punctuation and repeated letters. */
|
|
61
|
+
fillers: string[];
|
|
62
|
+
/** A silence between two words longer than this is cut (seconds). */
|
|
63
|
+
pauseSeconds: number;
|
|
64
|
+
/** Seconds kept before the first and after the last word of every kept run. */
|
|
65
|
+
padSeconds: number;
|
|
66
|
+
/** The cut's longest length in seconds; later segments are shortened or dropped. Null: no limit. */
|
|
67
|
+
maxSeconds: number | null;
|
|
68
|
+
}
|
|
69
|
+
/** Default transitions by kind of cut; a segment of the EDL may name its own. */
|
|
70
|
+
export interface FootageTransitions {
|
|
71
|
+
/** A cut inside one talking clip (a removed filler or pause). */
|
|
72
|
+
jump: CutTransition;
|
|
73
|
+
/** A cut from one clip to another. */
|
|
74
|
+
clip: CutTransition;
|
|
75
|
+
}
|
|
76
|
+
export interface FootageFilm {
|
|
77
|
+
id: string;
|
|
78
|
+
title: string;
|
|
79
|
+
format: VideoFormat;
|
|
80
|
+
/** ISO 639 code the clips speak (`pl`, `en`): the transcript's language and the default fillers. */
|
|
81
|
+
language: string;
|
|
82
|
+
clips: FootageClip[];
|
|
83
|
+
/** Clean the talking clips' voice (ElevenLabs Voice Isolator, paid) before transcribing them. */
|
|
84
|
+
isolateVoice: boolean;
|
|
85
|
+
cut: CutOptions;
|
|
86
|
+
transitions: FootageTransitions;
|
|
87
|
+
music: FootageMusic;
|
|
88
|
+
/** Word-by-word captions from the transcript. */
|
|
89
|
+
captions: boolean;
|
|
90
|
+
/** The closing card after the last segment; null: the film ends with its last segment. */
|
|
91
|
+
endCard: EndCard | null;
|
|
92
|
+
}
|
|
93
|
+
/** Filler words per language, written with repeated letters collapsed (`yyy` and `yyyy` are both `y`). */
|
|
94
|
+
export declare const DEFAULT_FILLERS: Record<string, string[]>;
|
|
95
|
+
/** The default fillers of a language; none for a language without a list. */
|
|
96
|
+
export declare function getDefaultFillers(language: string): string[];
|
|
97
|
+
export declare const DEFAULT_CUT: Omit<CutOptions, "fillers">;
|
|
98
|
+
export declare const DEFAULT_TRANSITIONS: FootageTransitions;
|
|
99
|
+
export declare const DEFAULT_MUSIC_VOLUME: {
|
|
100
|
+
readonly volume: 0.35;
|
|
101
|
+
readonly duckedVolume: 0.1;
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=film.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"film.d.ts","sourceRoot":"","sources":["../../src/footage/film.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C;;;GAGG;AAEH,2HAA2H;AAC3H,eAAO,MAAM,UAAU,4BAA6B,CAAC;AAErD,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,SAAS,mCAAoC,CAAC;AAE3D,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,eAAe,4CAA6C,CAAC;AAE1E,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,MAAM,WAAW,WAAW;IAC1B,gEAAgE;IAChE,EAAE,EAAE,MAAM,CAAC;IACX,gGAAgG;IAChG,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,yFAAyF;IACzF,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAC5C,+GAA+G;IAC/G,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,mHAAmH;AACnH,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,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AAI,CAAC;CACzB;AAED,0GAA0G;AAC1G,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAGpD,CAAC;AAEF,6EAA6E;AAC7E,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAE5D;AAED,eAAO,MAAM,WAAW,EAAE,IAAI,CAAC,UAAU,EAAE,SAAS,CAA6D,CAAC;AAElH,eAAO,MAAM,mBAAmB,EAAE,kBAAmD,CAAC;AAEtF,eAAO,MAAM,oBAAoB;;;CAA+C,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A footage film: filmed clips (a person talking to camera, b-roll) cut by their transcript into a captioned
|
|
3
|
+
* vertical film. Built from `marketing.json` (`footage[]`) or passed to `renderFootageFilm` as it is.
|
|
4
|
+
*/
|
|
5
|
+
/** `talk`: someone speaks, so the cut follows the words. `broll`: pictures without speech, kept whole with a slow zoom. */
|
|
6
|
+
export const CLIP_ROLES = ["talk", "broll"];
|
|
7
|
+
/**
|
|
8
|
+
* How a clip whose aspect differs from the film's fills the frame: `crop` (scaled to cover, edges cut), `blur` (the
|
|
9
|
+
* whole picture over a blurred, enlarged copy of itself) or `auto` (crop when the aspects are within 15 %, else blur).
|
|
10
|
+
*/
|
|
11
|
+
export const CLIP_FITS = ["auto", "crop", "blur"];
|
|
12
|
+
/**
|
|
13
|
+
* How a segment of the cut starts: `cut` (hard), `fade` (a short cross-fade from the previous segment), `zoom` (a
|
|
14
|
+
* punch-in that hides a jump cut inside one talking clip) or `whoosh` (a hard cut with the whoosh sound).
|
|
15
|
+
*/
|
|
16
|
+
export const CUT_TRANSITIONS = ["cut", "fade", "zoom", "whoosh"];
|
|
17
|
+
/** Filler words per language, written with repeated letters collapsed (`yyy` and `yyyy` are both `y`). */
|
|
18
|
+
export const DEFAULT_FILLERS = {
|
|
19
|
+
pl: ["y", "e", "yhm", "yh", "ym", "em", "hm", "mhm", "eh", "uh"],
|
|
20
|
+
en: ["um", "uh", "uhm", "er", "erm", "hm", "mhm", "ah"],
|
|
21
|
+
};
|
|
22
|
+
/** The default fillers of a language; none for a language without a list. */
|
|
23
|
+
export function getDefaultFillers(language) {
|
|
24
|
+
return DEFAULT_FILLERS[language] ?? [];
|
|
25
|
+
}
|
|
26
|
+
export const DEFAULT_CUT = { pauseSeconds: 0.6, padSeconds: 0.12, maxSeconds: null };
|
|
27
|
+
export const DEFAULT_TRANSITIONS = { jump: "zoom", clip: "fade" };
|
|
28
|
+
export const DEFAULT_MUSIC_VOLUME = { volume: 0.35, duckedVolume: 0.1 };
|
|
29
|
+
//# sourceMappingURL=film.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"film.js","sourceRoot":"","sources":["../../src/footage/film.ts"],"names":[],"mappings":"AAGA;;;GAGG;AAEH,2HAA2H;AAC3H,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU,CAAC;AAIrD;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAI3D;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAU,CAAC;AAsE1E,0GAA0G;AAC1G,MAAM,CAAC,MAAM,eAAe,GAA6B;IACvD,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC;IAChE,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC;CACxD,CAAC;AAEF,6EAA6E;AAC7E,MAAM,UAAU,iBAAiB,CAAC,QAAgB;IAChD,OAAO,eAAe,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AACzC,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAgC,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;AAElH,MAAM,CAAC,MAAM,mBAAmB,GAAuB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAEtF,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAW,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { TimedWord } from "../voice/voiceover.js";
|
|
2
|
+
/**
|
|
3
|
+
* Music under the voice: loud between sentences, ducked while someone speaks. The envelope is a list of keyframes
|
|
4
|
+
* computed from the film's word times; ffmpeg applies it to the music file (`volumeExpression`), so the composition
|
|
5
|
+
* plays an already ducked track.
|
|
6
|
+
*/
|
|
7
|
+
export interface VolumeKeyframe {
|
|
8
|
+
t: number;
|
|
9
|
+
volume: number;
|
|
10
|
+
}
|
|
11
|
+
export interface DuckingOptions {
|
|
12
|
+
/** The music's volume between sentences and under speech. */
|
|
13
|
+
volume: number;
|
|
14
|
+
duckedVolume: number;
|
|
15
|
+
/** Seconds the music takes to go down before the first word, and to come back after the last. */
|
|
16
|
+
attack?: number;
|
|
17
|
+
release?: number;
|
|
18
|
+
/** Two words closer than this stay one stretch of speech. */
|
|
19
|
+
gap?: number;
|
|
20
|
+
}
|
|
21
|
+
/** Stretches of speech: the words joined when less than `gap` seconds apart. */
|
|
22
|
+
export declare function getSpeechSpans(words: TimedWord[], gap: number): {
|
|
23
|
+
start: number;
|
|
24
|
+
end: number;
|
|
25
|
+
}[];
|
|
26
|
+
/**
|
|
27
|
+
* The music's volume over time as keyframes (linear between them): `volume`, down to `duckedVolume` by the first word
|
|
28
|
+
* of each stretch of speech, back up `release` seconds after its last word. Stretches too close for the music to
|
|
29
|
+
* come back up merge.
|
|
30
|
+
*/
|
|
31
|
+
export declare function duckingKeyframes(words: TimedWord[], options: DuckingOptions): VolumeKeyframe[];
|
|
32
|
+
/**
|
|
33
|
+
* An expression for ffmpeg's `volume` filter (`eval=frame`, time `t`): the keyframes as a sum of linear pieces, each
|
|
34
|
+
* switched on by its own time window, so a long film needs no nesting.
|
|
35
|
+
*/
|
|
36
|
+
export declare function volumeExpression(keyframes: VolumeKeyframe[]): string;
|
|
37
|
+
//# sourceMappingURL=music.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"music.d.ts","sourceRoot":"","sources":["../../src/footage/music.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;GAIG;AAEH,MAAM,WAAW,cAAc;IAC7B,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,iGAAiG;IACjG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAID,gFAAgF;AAChF,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,CAQhG;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,cAAc,GAAG,cAAc,EAAE,CAsB9F;AAID;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,cAAc,EAAE,GAAG,MAAM,CAapE"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const r3 = (value) => Math.round(value * 1000) / 1000 || 0;
|
|
2
|
+
/** Stretches of speech: the words joined when less than `gap` seconds apart. */
|
|
3
|
+
export function getSpeechSpans(words, gap) {
|
|
4
|
+
const spans = [];
|
|
5
|
+
for (const word of [...words].sort((a, b) => a.start - b.start)) {
|
|
6
|
+
const last = spans.at(-1);
|
|
7
|
+
if (last !== undefined && word.start - last.end < gap)
|
|
8
|
+
last.end = Math.max(last.end, word.end);
|
|
9
|
+
else
|
|
10
|
+
spans.push({ start: word.start, end: word.end });
|
|
11
|
+
}
|
|
12
|
+
return spans;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The music's volume over time as keyframes (linear between them): `volume`, down to `duckedVolume` by the first word
|
|
16
|
+
* of each stretch of speech, back up `release` seconds after its last word. Stretches too close for the music to
|
|
17
|
+
* come back up merge.
|
|
18
|
+
*/
|
|
19
|
+
export function duckingKeyframes(words, options) {
|
|
20
|
+
const attack = options.attack ?? 0.25;
|
|
21
|
+
const release = options.release ?? 0.5;
|
|
22
|
+
const spans = getSpeechSpans(words, Math.max(options.gap ?? 0.6, attack + release));
|
|
23
|
+
const keyframes = [];
|
|
24
|
+
const push = (t, volume) => {
|
|
25
|
+
const time = r3(Math.max(0, t));
|
|
26
|
+
const last = keyframes.at(-1);
|
|
27
|
+
if (last !== undefined && time <= last.t) {
|
|
28
|
+
last.volume = volume;
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
keyframes.push({ t: time, volume });
|
|
32
|
+
};
|
|
33
|
+
if (spans.length === 0 || (spans[0]?.start ?? 0) - attack > 0)
|
|
34
|
+
push(0, options.volume);
|
|
35
|
+
for (const span of spans) {
|
|
36
|
+
push(span.start - attack, options.volume);
|
|
37
|
+
push(span.start, options.duckedVolume);
|
|
38
|
+
push(span.end, options.duckedVolume);
|
|
39
|
+
push(span.end + release, options.volume);
|
|
40
|
+
}
|
|
41
|
+
return keyframes;
|
|
42
|
+
}
|
|
43
|
+
const n = (value) => String(r3(value));
|
|
44
|
+
/**
|
|
45
|
+
* An expression for ffmpeg's `volume` filter (`eval=frame`, time `t`): the keyframes as a sum of linear pieces, each
|
|
46
|
+
* switched on by its own time window, so a long film needs no nesting.
|
|
47
|
+
*/
|
|
48
|
+
export function volumeExpression(keyframes) {
|
|
49
|
+
const first = keyframes[0];
|
|
50
|
+
const last = keyframes.at(-1);
|
|
51
|
+
if (first === undefined || last === undefined)
|
|
52
|
+
return "1";
|
|
53
|
+
const pieces = [`lt(t,${n(first.t)})*${n(first.volume)}`];
|
|
54
|
+
keyframes.slice(0, -1).forEach((from, index) => {
|
|
55
|
+
const to = keyframes[index + 1];
|
|
56
|
+
const slope = (to.volume - from.volume) / (to.t - from.t);
|
|
57
|
+
const value = slope === 0 ? n(from.volume) : `(${n(from.volume)}+${String(Math.round(slope * 1e6) / 1e6)}*(t-${n(from.t)}))`;
|
|
58
|
+
pieces.push(`gte(t,${n(from.t)})*lt(t,${n(to.t)})*${value}`);
|
|
59
|
+
});
|
|
60
|
+
pieces.push(`gte(t,${n(last.t)})*${n(last.volume)}`);
|
|
61
|
+
return pieces.join("+");
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=music.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"music.js","sourceRoot":"","sources":["../../src/footage/music.ts"],"names":[],"mappings":"AAwBA,MAAM,EAAE,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;AAE3E,gFAAgF;AAChF,MAAM,UAAU,cAAc,CAAC,KAAkB,EAAE,GAAW;IAC5D,MAAM,KAAK,GAAqC,EAAE,CAAC;IACnD,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GA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E,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QAC7C,MAAM,EAAE,GAAG,SAAS,CAAC,KAAK,GAAG,CAAC,CAAmB,CAAC;QAClD,MAAM,KAAK,GAAG,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1D,MAAM,KAAK,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QAC7H,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACrD,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ClipFit, FootageClip } from "./film.js";
|
|
2
|
+
import { type FootageProbe, type HdrKind } from "./probe.js";
|
|
3
|
+
/**
|
|
4
|
+
* One intermediate format for every clip, so the composition can cut between them freely: the film's frame at
|
|
5
|
+
* 30 fps, upright (ffmpeg applies the stored rotation while decoding), SDR BT.709 (HDR tone-mapped), filled by a crop
|
|
6
|
+
* or a blurred copy, a keyframe every half second (the renderer seeks into each segment), and 48 kHz stereo AAC
|
|
7
|
+
* (silence when the clip has no sound), so the speech track can be cut from any clip alike.
|
|
8
|
+
*/
|
|
9
|
+
export declare const FOOTAGE_FPS = 30;
|
|
10
|
+
export declare const FOOTAGE_SAMPLE_RATE = 48000;
|
|
11
|
+
export interface Frame {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
}
|
|
15
|
+
/** The fit `auto` resolves to for this picture in this frame. */
|
|
16
|
+
export declare function resolveFit(fit: ClipFit, probe: Pick<FootageProbe, "displayWidth" | "displayHeight">, frame: Frame): "crop" | "blur";
|
|
17
|
+
/**
|
|
18
|
+
* HDR to SDR BT.709 on the CPU: to linear light (zscale), Hable tone curve, back to BT.709. A Dolby Vision phone
|
|
19
|
+
* clip is read through its HLG base layer.
|
|
20
|
+
*/
|
|
21
|
+
export declare function toneMapFilter(hdr: HdrKind | null, transfer: string | null): string[];
|
|
22
|
+
/** The video filter graph from input 0's picture to `[v]`. */
|
|
23
|
+
export declare function buildVideoFilter(options: {
|
|
24
|
+
fit: "crop" | "blur";
|
|
25
|
+
frame: Frame;
|
|
26
|
+
hdr: HdrKind | null;
|
|
27
|
+
transfer: string | null;
|
|
28
|
+
}): string;
|
|
29
|
+
export interface NormalizeInput {
|
|
30
|
+
clip: FootageClip;
|
|
31
|
+
/** The local file (a URL's downloaded copy). */
|
|
32
|
+
file: string;
|
|
33
|
+
probe: FootageProbe;
|
|
34
|
+
frame: Frame;
|
|
35
|
+
output: string;
|
|
36
|
+
}
|
|
37
|
+
/** ffmpeg's arguments for one clip; pure, so the graph is tested without ffmpeg. */
|
|
38
|
+
export declare function buildNormalizeArgs(input: NormalizeInput): string[];
|
|
39
|
+
/** Runs ffmpeg for one clip; throws with the clip's id when it fails (a broken file is not an expected outcome here). */
|
|
40
|
+
export declare function normalizeFootage(input: NormalizeInput): void;
|
|
41
|
+
//# sourceMappingURL=normalize.d.ts.map
|
|
@@ -0,0 +1 @@
|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E;AAED,yHAAyH;AACzH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAM5D"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { getTrimmedDuration } from "./probe.js";
|
|
3
|
+
/**
|
|
4
|
+
* One intermediate format for every clip, so the composition can cut between them freely: the film's frame at
|
|
5
|
+
* 30 fps, upright (ffmpeg applies the stored rotation while decoding), SDR BT.709 (HDR tone-mapped), filled by a crop
|
|
6
|
+
* or a blurred copy, a keyframe every half second (the renderer seeks into each segment), and 48 kHz stereo AAC
|
|
7
|
+
* (silence when the clip has no sound), so the speech track can be cut from any clip alike.
|
|
8
|
+
*/
|
|
9
|
+
export const FOOTAGE_FPS = 30;
|
|
10
|
+
export const FOOTAGE_SAMPLE_RATE = 48_000;
|
|
11
|
+
/** Within this difference of aspect ratios `auto` crops; beyond it, it fills with a blurred copy. */
|
|
12
|
+
const CROP_ASPECT_TOLERANCE = 0.15;
|
|
13
|
+
/** The fit `auto` resolves to for this picture in this frame. */
|
|
14
|
+
export function resolveFit(fit, probe, frame) {
|
|
15
|
+
if (fit !== "auto")
|
|
16
|
+
return fit;
|
|
17
|
+
const clipAspect = probe.displayWidth / probe.displayHeight;
|
|
18
|
+
const frameAspect = frame.width / frame.height;
|
|
19
|
+
return Math.abs(clipAspect - frameAspect) / frameAspect <= CROP_ASPECT_TOLERANCE ? "crop" : "blur";
|
|
20
|
+
}
|
|
21
|
+
const TRANSFER_INPUT = { pq: "smpte2084", hlg: "arib-std-b67", "dolby-vision": "arib-std-b67" };
|
|
22
|
+
/**
|
|
23
|
+
* HDR to SDR BT.709 on the CPU: to linear light (zscale), Hable tone curve, back to BT.709. A Dolby Vision phone
|
|
24
|
+
* clip is read through its HLG base layer.
|
|
25
|
+
*/
|
|
26
|
+
export function toneMapFilter(hdr, transfer) {
|
|
27
|
+
if (hdr === null)
|
|
28
|
+
return [];
|
|
29
|
+
const input = transfer === "smpte2084" || transfer === "arib-std-b67" ? transfer : TRANSFER_INPUT[hdr];
|
|
30
|
+
return [
|
|
31
|
+
`zscale=tin=${input}:pin=bt2020:min=bt2020nc:t=linear:npl=100`,
|
|
32
|
+
"format=gbrpf32le",
|
|
33
|
+
"zscale=p=bt709",
|
|
34
|
+
"tonemap=tonemap=hable:desat=0",
|
|
35
|
+
"zscale=t=bt709:m=bt709:r=tv",
|
|
36
|
+
// Back to 8-bit before scaling: the blur fill on float frames crashed ffmpeg 6.1.
|
|
37
|
+
"format=yuv420p",
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
/** The video filter graph from input 0's picture to `[v]`. */
|
|
41
|
+
export function buildVideoFilter(options) {
|
|
42
|
+
const { width, height } = options.frame;
|
|
43
|
+
const head = [...toneMapFilter(options.hdr, options.transfer), `fps=${FOOTAGE_FPS}`].join(",");
|
|
44
|
+
const cover = `scale=${width}:${height}:force_original_aspect_ratio=increase,crop=${width}:${height}`;
|
|
45
|
+
const tail = "setsar=1,format=yuv420p";
|
|
46
|
+
if (options.fit === "crop")
|
|
47
|
+
return `[0:v]${head},${cover},${tail}[v]`;
|
|
48
|
+
return [
|
|
49
|
+
`[0:v]${head},split=2[bg][fg]`,
|
|
50
|
+
`[bg]scale=${Math.round(width / 4)}:${Math.round(height / 4)}:force_original_aspect_ratio=increase,crop=${Math.round(width / 4)}:${Math.round(height / 4)},boxblur=20:2,scale=${width}:${height},eq=brightness=-0.06[back]`,
|
|
51
|
+
`[fg]scale=${width}:${height}:force_original_aspect_ratio=decrease[front]`,
|
|
52
|
+
`[back][front]overlay=(W-w)/2:(H-h)/2,${tail}[v]`,
|
|
53
|
+
].join(";");
|
|
54
|
+
}
|
|
55
|
+
/** ffmpeg's arguments for one clip; pure, so the graph is tested without ffmpeg. */
|
|
56
|
+
export function buildNormalizeArgs(input) {
|
|
57
|
+
const { clip, file, probe, frame, output } = input;
|
|
58
|
+
const duration = getTrimmedDuration(clip, probe);
|
|
59
|
+
const fit = resolveFit(clip.fit, probe, frame);
|
|
60
|
+
const seek = clip.trim.start > 0 ? ["-ss", String(clip.trim.start)] : [];
|
|
61
|
+
const silence = probe.hasAudio ? [] : ["-f", "lavfi", "-i", `anullsrc=r=${FOOTAGE_SAMPLE_RATE}:cl=stereo`];
|
|
62
|
+
return [
|
|
63
|
+
"-v",
|
|
64
|
+
"error",
|
|
65
|
+
"-y",
|
|
66
|
+
...seek,
|
|
67
|
+
"-i",
|
|
68
|
+
file,
|
|
69
|
+
...silence,
|
|
70
|
+
"-t",
|
|
71
|
+
duration.toFixed(3),
|
|
72
|
+
"-filter_complex",
|
|
73
|
+
buildVideoFilter({ fit, frame, hdr: probe.hdr, transfer: probe.colorTransfer }),
|
|
74
|
+
"-map",
|
|
75
|
+
"[v]",
|
|
76
|
+
"-map",
|
|
77
|
+
probe.hasAudio ? "0:a:0" : "1:a",
|
|
78
|
+
"-c:v",
|
|
79
|
+
"libx264",
|
|
80
|
+
"-preset",
|
|
81
|
+
"veryfast",
|
|
82
|
+
"-crf",
|
|
83
|
+
"18",
|
|
84
|
+
"-g",
|
|
85
|
+
String(FOOTAGE_FPS / 2),
|
|
86
|
+
"-color_primaries",
|
|
87
|
+
"bt709",
|
|
88
|
+
"-color_trc",
|
|
89
|
+
"bt709",
|
|
90
|
+
"-colorspace",
|
|
91
|
+
"bt709",
|
|
92
|
+
"-c:a",
|
|
93
|
+
"aac",
|
|
94
|
+
"-b:a",
|
|
95
|
+
"192k",
|
|
96
|
+
"-ar",
|
|
97
|
+
String(FOOTAGE_SAMPLE_RATE),
|
|
98
|
+
"-ac",
|
|
99
|
+
"2",
|
|
100
|
+
"-movflags",
|
|
101
|
+
"+faststart",
|
|
102
|
+
output,
|
|
103
|
+
];
|
|
104
|
+
}
|
|
105
|
+
/** Runs ffmpeg for one clip; throws with the clip's id when it fails (a broken file is not an expected outcome here). */
|
|
106
|
+
export function normalizeFootage(input) {
|
|
107
|
+
const result = spawnSync("ffmpeg", buildNormalizeArgs(input), { stdio: ["ignore", "inherit", "inherit"] });
|
|
108
|
+
if (result.error !== undefined)
|
|
109
|
+
throw new Error(`Normalizing clip ${input.clip.id}: ffmpeg did not start (${result.error.message}).`);
|
|
110
|
+
if (result.status !== 0) {
|
|
111
|
+
throw new Error(`Normalizing clip ${input.clip.id} (${input.file}): ffmpeg ended with code ${String(result.status)} (signal ${result.signal ?? "-"}).`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=normalize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../../src/footage/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EAAE,kBAAkB,EAAmC,MAAM,YAAY,CAAC;AAEjF;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAC9B,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAC1C,qGAAqG;AACrG,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAOnC,iEAAiE;AACjE,MAAM,UAAU,UAAU,CAAC,GAAY,EAAE,KAA2D,EAAE,KAAY;IAChH,IAAI,GAAG,KAAK,MAAM;QAAE,OAAO,GAAG,CAAC;IAC/B,MAAM,UAAU,GAAG,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,aAAa,CAAC;IAC5D,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;IAC/C,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,WAAW,CAAC,GAAG,WAAW,IAAI,qBAAqB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;AACrG,CAAC;AAED,MAAM,cAAc,GAA4B,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC;AA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U;QACV,MAAM;QACN,IAAI;QACJ,IAAI;QACJ,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC;QACvB,kBAAkB;QAClB,OAAO;QACP,YAAY;QACZ,OAAO;QACP,aAAa;QACb,OAAO;QACP,MAAM;QACN,KAAK;QACL,MAAM;QACN,MAAM;QACN,KAAK;QACL,MAAM,CAAC,mBAAmB,CAAC;QAC3B,KAAK;QACL,GAAG;QACH,WAAW;QACX,YAAY;QACZ,MAAM;KACP,CAAC;AACJ,CAAC;AAED,yHAAyH;AACzH,MAAM,UAAU,gBAAgB,CAAC,KAAqB;IACpD,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE,kBAAkB,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;IAC3G,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,KAAK,CAAC,IAAI,CAAC,EAAE,2BAA2B,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;IACtI,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,oBAAoB,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,KAAK,CAAC,IAAI,6BAA6B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC;IAC1J,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { type LayoutOverride } from "../compose/timeline.js";
|
|
2
|
+
import type { BrandColors } from "../config/colors.js";
|
|
3
|
+
import type { BrandFont } from "../config/config.js";
|
|
4
|
+
import type { SfxEvent } from "../config/schema.js";
|
|
5
|
+
import { type TtsResult } from "../voice/provider.js";
|
|
6
|
+
import type { TimedWord } from "../voice/voiceover.js";
|
|
7
|
+
import { type Edl } from "./edl.js";
|
|
8
|
+
import type { FootageClip, FootageFilm } from "./film.js";
|
|
9
|
+
import { type Frame } from "./normalize.js";
|
|
10
|
+
import { type FootageProbe } from "./probe.js";
|
|
11
|
+
import { type FootageProviders, type PaidStep } from "./providers.js";
|
|
12
|
+
export interface FootageBrand {
|
|
13
|
+
name: string;
|
|
14
|
+
/** BCP 47, e.g. `en-US`. */
|
|
15
|
+
locale: string;
|
|
16
|
+
colors: BrandColors;
|
|
17
|
+
fonts: {
|
|
18
|
+
heading: BrandFont | null;
|
|
19
|
+
body: BrandFont | null;
|
|
20
|
+
};
|
|
21
|
+
logo: string | null;
|
|
22
|
+
}
|
|
23
|
+
export interface FootageRunOptions {
|
|
24
|
+
/** The film's build folder (`<buildDir>/<film id>` in the CLI). */
|
|
25
|
+
buildDir: string;
|
|
26
|
+
/** The paid cache's root; files go to `<cacheDir>/<film id>/`. */
|
|
27
|
+
cacheDir: string;
|
|
28
|
+
providers: FootageProviders;
|
|
29
|
+
/** Only `true` lets a provider spend money. */
|
|
30
|
+
isCommit: boolean;
|
|
31
|
+
isPlaceholder: boolean;
|
|
32
|
+
log: (line: string) => void;
|
|
33
|
+
/** Downloads clip URLs; injected in tests. */
|
|
34
|
+
fetch?: typeof globalThis.fetch;
|
|
35
|
+
}
|
|
36
|
+
export interface PreparedClip {
|
|
37
|
+
clip: FootageClip;
|
|
38
|
+
/** The source as read (a URL's downloaded copy). */
|
|
39
|
+
source: string;
|
|
40
|
+
probe: FootageProbe;
|
|
41
|
+
/** The normalized clip. */
|
|
42
|
+
file: string;
|
|
43
|
+
/** Seconds after the trim. */
|
|
44
|
+
duration: number;
|
|
45
|
+
}
|
|
46
|
+
export type FootageResult<T> = TtsResult<T>;
|
|
47
|
+
export type TranscribeOutcome = {
|
|
48
|
+
kind: "dry-run";
|
|
49
|
+
steps: PaidStep[];
|
|
50
|
+
} | {
|
|
51
|
+
kind: "ready";
|
|
52
|
+
/** Each clip's words, times from its trimmed start. */
|
|
53
|
+
words: Record<string, TimedWord[]>;
|
|
54
|
+
/** The audio each clip's speech is cut from (the cleaned voice when isolated). */
|
|
55
|
+
speech: Record<string, string>;
|
|
56
|
+
};
|
|
57
|
+
export declare function getFrame(film: Pick<FootageFilm, "format">): Frame;
|
|
58
|
+
export declare function getEdlPath(buildDir: string, isPlaceholder: boolean): string;
|
|
59
|
+
/** Downloads URL clips, probes every clip (all problems at once), normalizes each one that changed. */
|
|
60
|
+
export declare function prepareFootage(film: FootageFilm, options: Pick<FootageRunOptions, "buildDir" | "log" | "fetch">): Promise<FootageResult<PreparedClip[]>>;
|
|
61
|
+
/** The paid music step, when the film's music still has to be bought; null when it is cached or free. */
|
|
62
|
+
export declare function getMusicPaidStep(film: FootageFilm, options: Pick<FootageRunOptions, "cacheDir" | "providers">, seconds: number): PaidStep | null;
|
|
63
|
+
/**
|
|
64
|
+
* Each talking clip's words with times, from the cache or (with `isCommit`) from the speech-to-text provider, the
|
|
65
|
+
* voice cleaned first when the film isolates it. Without `isCommit`, a cache miss returns the dry run: every paid
|
|
66
|
+
* call the film still needs, music included, with its length.
|
|
67
|
+
*/
|
|
68
|
+
export declare function transcribeFootage(film: FootageFilm, clips: PreparedClip[], options: FootageRunOptions): Promise<FootageResult<TranscribeOutcome>>;
|
|
69
|
+
/** The cut from the transcripts, written to the EDL file (replacing what is there). */
|
|
70
|
+
export declare function cutFootage(film: FootageFilm, clips: PreparedClip[], words: Record<string, TimedWord[]>, edlPath: string): Edl;
|
|
71
|
+
/** The EDL file as written by `cutFootage` or edited by hand, checked against the clips. */
|
|
72
|
+
export declare function readEdlFile(film: FootageFilm, clips: PreparedClip[], edlPath: string): FootageResult<Edl>;
|
|
73
|
+
export interface RenderFootageOptions extends FootageRunOptions {
|
|
74
|
+
brand: FootageBrand;
|
|
75
|
+
sfx: Partial<Record<SfxEvent, string>>;
|
|
76
|
+
/** hyperframes' `--quality`: `draft`, `standard` or `high`. */
|
|
77
|
+
quality: string;
|
|
78
|
+
/** The finished MP4. */
|
|
79
|
+
output: string;
|
|
80
|
+
/** A project's override of the format's caption box (`marketing.json` `layout`). */
|
|
81
|
+
layout?: LayoutOverride;
|
|
82
|
+
}
|
|
83
|
+
export type RenderedFootage = {
|
|
84
|
+
kind: "dry-run";
|
|
85
|
+
steps: PaidStep[];
|
|
86
|
+
} | {
|
|
87
|
+
kind: "rendered";
|
|
88
|
+
output: string;
|
|
89
|
+
seconds: number;
|
|
90
|
+
edlPath: string;
|
|
91
|
+
};
|
|
92
|
+
/** Composes the cut and renders it: speech track, ducked music, end card backdrop, assets, hyperframes. */
|
|
93
|
+
export declare function renderFootage(film: FootageFilm, clips: PreparedClip[], transcript: Extract<TranscribeOutcome, {
|
|
94
|
+
kind: "ready";
|
|
95
|
+
}>, edl: Edl, options: RenderFootageOptions): Promise<FootageResult<RenderedFootage>>;
|
|
96
|
+
export interface RenderFootageFilmOptions extends RenderFootageOptions {
|
|
97
|
+
/** Build the EDL again even when the build folder holds one (by default a present EDL, maybe edited by hand, is used). */
|
|
98
|
+
isRecut?: boolean;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The whole footage film from a `FootageFilm` object, no `marketing.json` needed: prepare, transcribe (or the dry
|
|
102
|
+
* run), cut (reusing an EDL already in the build folder unless `isRecut`), render.
|
|
103
|
+
*/
|
|
104
|
+
export declare function renderFootageFilm(film: FootageFilm, options: RenderFootageFilmOptions): Promise<FootageResult<RenderedFootage>>;
|
|
105
|
+
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/footage/pipeline.ts"],"names":[],"mappings":"AAKA,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KA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