@softure-ai/marketing-kit 0.5.0 → 0.7.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 +98 -0
- package/README.md +130 -17
- package/dist/cli/footage.d.ts.map +1 -1
- package/dist/cli/footage.js +5 -2
- package/dist/cli/footage.js.map +1 -1
- package/dist/compose/compose.d.ts.map +1 -1
- package/dist/compose/compose.js +3 -3
- package/dist/compose/compose.js.map +1 -1
- package/dist/compose/timeline.d.ts +16 -0
- package/dist/compose/timeline.d.ts.map +1 -1
- package/dist/compose/timeline.js +17 -1
- package/dist/compose/timeline.js.map +1 -1
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +25 -2
- package/dist/config/config.js.map +1 -1
- package/dist/config/schema.d.ts +17 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +61 -3
- package/dist/config/schema.js.map +1 -1
- package/dist/footage/audio.d.ts +6 -2
- package/dist/footage/audio.d.ts.map +1 -1
- package/dist/footage/audio.js +15 -3
- package/dist/footage/audio.js.map +1 -1
- package/dist/footage/captions.d.ts +26 -3
- package/dist/footage/captions.d.ts.map +1 -1
- package/dist/footage/captions.js +35 -2
- package/dist/footage/captions.js.map +1 -1
- package/dist/footage/compose.d.ts +13 -2
- package/dist/footage/compose.d.ts.map +1 -1
- package/dist/footage/compose.js +79 -28
- package/dist/footage/compose.js.map +1 -1
- package/dist/footage/cuts.d.ts +44 -0
- package/dist/footage/cuts.d.ts.map +1 -0
- package/dist/footage/cuts.js +83 -0
- package/dist/footage/cuts.js.map +1 -0
- package/dist/footage/disk.d.ts +25 -0
- package/dist/footage/disk.d.ts.map +1 -0
- package/dist/footage/disk.js +72 -0
- package/dist/footage/disk.js.map +1 -0
- package/dist/footage/draft.d.ts +119 -0
- package/dist/footage/draft.d.ts.map +1 -0
- package/dist/footage/draft.js +296 -0
- package/dist/footage/draft.js.map +1 -0
- package/dist/footage/edl.d.ts +2 -1
- package/dist/footage/edl.d.ts.map +1 -1
- package/dist/footage/edl.js +5 -2
- package/dist/footage/edl.js.map +1 -1
- package/dist/footage/elevenlabs.d.ts.map +1 -1
- package/dist/footage/elevenlabs.js +2 -0
- package/dist/footage/elevenlabs.js.map +1 -1
- package/dist/footage/film.d.ts +54 -3
- package/dist/footage/film.d.ts.map +1 -1
- package/dist/footage/film.js +7 -1
- package/dist/footage/film.js.map +1 -1
- package/dist/footage/keyterms.d.ts +26 -0
- package/dist/footage/keyterms.d.ts.map +1 -0
- package/dist/footage/keyterms.js +36 -0
- package/dist/footage/keyterms.js.map +1 -0
- package/dist/footage/loudness.d.ts +20 -3
- package/dist/footage/loudness.d.ts.map +1 -1
- package/dist/footage/loudness.js +36 -18
- package/dist/footage/loudness.js.map +1 -1
- package/dist/footage/music.d.ts +3 -0
- package/dist/footage/music.d.ts.map +1 -1
- package/dist/footage/music.js +5 -0
- package/dist/footage/music.js.map +1 -1
- package/dist/footage/normalize.d.ts +30 -2
- package/dist/footage/normalize.d.ts.map +1 -1
- package/dist/footage/normalize.js +39 -11
- package/dist/footage/normalize.js.map +1 -1
- package/dist/footage/paid.d.ts +2 -1
- package/dist/footage/paid.d.ts.map +1 -1
- package/dist/footage/paid.js +13 -3
- package/dist/footage/paid.js.map +1 -1
- package/dist/footage/picture.d.ts +42 -0
- package/dist/footage/picture.d.ts.map +1 -0
- package/dist/footage/picture.js +141 -0
- package/dist/footage/picture.js.map +1 -0
- package/dist/footage/pipeline.d.ts +66 -4
- package/dist/footage/pipeline.d.ts.map +1 -1
- package/dist/footage/pipeline.js +172 -34
- package/dist/footage/pipeline.js.map +1 -1
- package/dist/footage/process.d.ts +2 -0
- package/dist/footage/process.d.ts.map +1 -1
- package/dist/footage/process.js +1 -0
- package/dist/footage/process.js.map +1 -1
- package/dist/footage/providers.d.ts +12 -3
- package/dist/footage/providers.d.ts.map +1 -1
- package/dist/footage/providers.js.map +1 -1
- package/dist/footage/publish.d.ts +4 -2
- package/dist/footage/publish.d.ts.map +1 -1
- package/dist/footage/publish.js +8 -5
- package/dist/footage/publish.js.map +1 -1
- package/dist/footage/render.d.ts +18 -3
- package/dist/footage/render.d.ts.map +1 -1
- package/dist/footage/render.js +67 -16
- package/dist/footage/render.js.map +1 -1
- package/dist/footage/tools.d.ts +15 -3
- package/dist/footage/tools.d.ts.map +1 -1
- package/dist/footage/tools.js +15 -2
- package/dist/footage/tools.js.map +1 -1
- package/dist/index.d.ts +14 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -9
- package/dist/index.js.map +1 -1
- package/docker/footage-worker.Dockerfile +7 -0
- package/fonts/DejaVuSans-Bold-Latin.ttf +0 -0
- package/fonts/LICENSE-DejaVu.txt +46 -0
- package/fonts/README.md +12 -0
- package/package.json +2 -1
- package/schema/marketing.schema.json +112 -4
- package/src/cli/footage.ts +4 -2
- package/src/compose/compose.ts +13 -3
- package/src/compose/timeline.ts +27 -1
- package/src/config/config.ts +26 -2
- package/src/config/schema.ts +63 -3
- package/src/footage/audio.ts +16 -3
- package/src/footage/captions.ts +45 -4
- package/src/footage/compose.ts +90 -28
- package/src/footage/cuts.ts +104 -0
- package/src/footage/disk.ts +75 -0
- package/src/footage/draft.ts +395 -0
- package/src/footage/edl.ts +5 -2
- package/src/footage/elevenlabs.ts +1 -0
- package/src/footage/film.ts +63 -5
- package/src/footage/keyterms.ts +38 -0
- package/src/footage/loudness.ts +38 -16
- package/src/footage/music.ts +7 -0
- package/src/footage/normalize.ts +51 -10
- package/src/footage/paid.ts +12 -3
- package/src/footage/picture.ts +179 -0
- package/src/footage/pipeline.ts +219 -37
- package/src/footage/process.ts +3 -0
- package/src/footage/providers.ts +10 -3
- package/src/footage/publish.ts +8 -5
- package/src/footage/render.ts +77 -16
- package/src/footage/tools.ts +23 -3
- package/src/index.ts +70 -4
package/src/footage/render.ts
CHANGED
|
@@ -1,21 +1,42 @@
|
|
|
1
1
|
import { getSoundSpan, type Edl } from "./edl.js";
|
|
2
|
+
import { DEFAULT_EDIT, type FootageEdit } from "./film.js";
|
|
2
3
|
import { FOOTAGE_SAMPLE_RATE } from "./normalize.js";
|
|
3
4
|
import { volumeExpression, type VolumeKeyframe } from "./music.js";
|
|
4
5
|
|
|
5
6
|
/** ffmpeg steps of the footage render: pure argument builders, tested without ffmpeg (`runFfmpeg` in `process.ts` runs them). */
|
|
6
7
|
|
|
7
|
-
/** A short fade at every cut of the speech track, so a cut never clicks. */
|
|
8
|
-
const CUT_FADE_SECONDS = 0.02;
|
|
9
8
|
const MUSIC_FADE_IN = 1;
|
|
10
9
|
const MUSIC_FADE_OUT = 1.5;
|
|
11
10
|
|
|
12
11
|
const r3 = (value: number): number => Math.round(value * 1000) / 1000 || 0;
|
|
12
|
+
const r4 = (value: number): number => Math.round(value * 10000) / 10000 || 0;
|
|
13
|
+
|
|
14
|
+
/** How the speech track is joined at the cuts. */
|
|
15
|
+
export interface SpeechCutOptions {
|
|
16
|
+
/** The fade at every cut, in seconds; default 0.02 (`DEFAULT_EDIT.cutAudioFadeMs`), so a cut never clicks. */
|
|
17
|
+
fadeSeconds?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Cross-fade the two sides of every cut over `fadeSeconds`, centred on the cut: each side runs on into its source
|
|
20
|
+
* for half the fade (silence where the source ends). By default each side fades out and in (a short dip).
|
|
21
|
+
*/
|
|
22
|
+
isCrossfade?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** The film's cut sound settings (`edit.cutAudioFadeMs`, `edit.isCutAudioCrossfade`) as `buildSpeechArgs` takes them. */
|
|
26
|
+
export function getSpeechCutOptions(edit: Pick<FootageEdit, "cutAudioFadeMs" | "isCutAudioCrossfade">): Required<SpeechCutOptions> {
|
|
27
|
+
return { fadeSeconds: r4(edit.cutAudioFadeMs / 1000), isCrossfade: edit.isCutAudioCrossfade };
|
|
28
|
+
}
|
|
13
29
|
|
|
14
30
|
/**
|
|
15
31
|
* The speech track: every segment's sound cut from its sound span (its own clip's, or `audio`'s: a J/L-cut or b-roll
|
|
16
|
-
* over speech) and joined in order; `audio.ownVolume` keeps the picture clip's own sound under it.
|
|
32
|
+
* over speech) and joined in order; `audio.ownVolume` keeps the picture clip's own sound under it. Each cut fades over
|
|
33
|
+
* `fadeSeconds`: a short dip, or with `isCrossfade` a cross-fade centred on the cut. Either way the track is exactly
|
|
34
|
+
* the cut's length and every word stays under its picture.
|
|
17
35
|
*/
|
|
18
|
-
export function buildSpeechArgs(edl: Edl, sources: Record<string, string>, output: string): string[] {
|
|
36
|
+
export function buildSpeechArgs(edl: Edl, sources: Record<string, string>, output: string, options: SpeechCutOptions = {}): string[] {
|
|
37
|
+
const fadeSeconds = options.fadeSeconds ?? r4(DEFAULT_EDIT.cutAudioFadeMs / 1000);
|
|
38
|
+
if (!(fadeSeconds > 0)) throw new Error(`The speech track's cut fade must be above 0 seconds, got ${String(fadeSeconds)}.`);
|
|
39
|
+
const isCrossfade = options.isCrossfade === true && edl.segments.length > 1;
|
|
19
40
|
const inputs: string[] = [];
|
|
20
41
|
const parts: string[] = [];
|
|
21
42
|
const getSource = (clip: string): string => {
|
|
@@ -23,30 +44,68 @@ export function buildSpeechArgs(edl: Edl, sources: Record<string, string>, outpu
|
|
|
23
44
|
if (source === undefined) throw new Error(`No audio for clip "${clip}" of the EDL.`);
|
|
24
45
|
return source;
|
|
25
46
|
};
|
|
47
|
+
const addInput = (clip: string): number => {
|
|
48
|
+
const input = inputs.length / 2;
|
|
49
|
+
inputs.push("-i", getSource(clip));
|
|
50
|
+
return input;
|
|
51
|
+
};
|
|
52
|
+
const format = `asetpts=PTS-STARTPTS,aformat=sample_rates=${FOOTAGE_SAMPLE_RATE}:channel_layouts=stereo`;
|
|
26
53
|
const cut = (input: number, span: { start: number; end: number }, duration: number): string =>
|
|
27
|
-
`[${input}:a]atrim=start=${span.start}:end=${span.end}
|
|
54
|
+
`[${input}:a]atrim=start=${span.start}:end=${span.end},${format},apad=whole_dur=${duration}`;
|
|
55
|
+
const last = edl.segments.length - 1;
|
|
56
|
+
const half = r4(fadeSeconds / 2);
|
|
28
57
|
edl.segments.forEach((segment, index) => {
|
|
29
58
|
const sound = getSoundSpan(segment);
|
|
30
59
|
const duration = r3(segment.end - segment.start);
|
|
31
|
-
const fades = `afade=t=in:d=${CUT_FADE_SECONDS},afade=t=out:st=${r3(Math.max(0, duration - CUT_FADE_SECONDS))}:d=${CUT_FADE_SECONDS}`;
|
|
32
|
-
const input = inputs.length / 2;
|
|
33
|
-
inputs.push("-i", getSource(sound.clip));
|
|
34
60
|
const own = segment.audio?.ownVolume ?? 0;
|
|
61
|
+
if (isCrossfade) {
|
|
62
|
+
// Half the fade on each side of the cut, read on into the source; where the source starts too late, silence.
|
|
63
|
+
const head = index === 0 ? 0 : half;
|
|
64
|
+
const tail = index === last ? 0 : half;
|
|
65
|
+
const length = r4(duration + head + tail);
|
|
66
|
+
const extend = (input: number, span: { start: number; end: number }): string => {
|
|
67
|
+
const lead = Math.min(head, span.start);
|
|
68
|
+
const silence = Math.round((head - lead) * 1000);
|
|
69
|
+
const delay = silence > 0 ? `,adelay=${silence}:all=1` : "";
|
|
70
|
+
return `[${input}:a]atrim=start=${r4(span.start - lead)}:end=${r4(span.start + duration + tail)},${format}${delay},apad=whole_dur=${length},atrim=end=${length}`;
|
|
71
|
+
};
|
|
72
|
+
const input = addInput(sound.clip);
|
|
73
|
+
if (own <= 0) {
|
|
74
|
+
parts.push(`${extend(input, sound)}[a${index}]`);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const ownInput = addInput(segment.clip);
|
|
78
|
+
parts.push(`${extend(input, sound)}[s${index}]`);
|
|
79
|
+
parts.push(`${extend(ownInput, segment)},volume=${own}[o${index}]`);
|
|
80
|
+
parts.push(`[s${index}][o${index}]amix=inputs=2:duration=first:normalize=0[a${index}]`);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const fades = `afade=t=in:d=${fadeSeconds},afade=t=out:st=${r3(Math.max(0, duration - fadeSeconds))}:d=${fadeSeconds}`;
|
|
84
|
+
const input = addInput(sound.clip);
|
|
35
85
|
// A borrowed span may be a few milliseconds longer than the picture: it is cut to the picture's length.
|
|
36
86
|
const fit = segment.audio === undefined ? "" : `,atrim=end=${duration}`;
|
|
37
87
|
if (own <= 0) {
|
|
38
88
|
parts.push(`${cut(input, sound, duration)}${fit},${fades}[a${index}]`);
|
|
39
89
|
return;
|
|
40
90
|
}
|
|
41
|
-
const ownInput =
|
|
42
|
-
inputs.push("-i", getSource(segment.clip));
|
|
91
|
+
const ownInput = addInput(segment.clip);
|
|
43
92
|
parts.push(`${cut(input, sound, duration)},atrim=end=${duration}[s${index}]`);
|
|
44
93
|
parts.push(`${cut(ownInput, segment, duration)},atrim=end=${duration},volume=${own}[o${index}]`);
|
|
45
94
|
parts.push(`[s${index}][o${index}]amix=inputs=2:duration=first:normalize=0,${fades}[a${index}]`);
|
|
46
95
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
96
|
+
if (isCrossfade) {
|
|
97
|
+
let joined = "a0";
|
|
98
|
+
for (let index = 1; index <= last; index++) {
|
|
99
|
+
parts.push(`[${joined}][a${index}]acrossfade=d=${fadeSeconds}:c1=tri:c2=tri[x${index}]`);
|
|
100
|
+
joined = `x${index}`;
|
|
101
|
+
}
|
|
102
|
+
const total = r3(edl.segments.reduce((sum, segment) => sum + r3(segment.end - segment.start), 0));
|
|
103
|
+
parts.push(`[${joined}]afade=t=in:d=${fadeSeconds},afade=t=out:st=${r3(Math.max(0, total - fadeSeconds))}:d=${fadeSeconds}[speech]`);
|
|
104
|
+
} else {
|
|
105
|
+
const joined = edl.segments.map((_, index) => `[a${index}]`).join("");
|
|
106
|
+
parts.push(`${joined}concat=n=${edl.segments.length}:v=0:a=1[speech]`);
|
|
107
|
+
}
|
|
108
|
+
return ["-v", "error", "-y", ...inputs, "-filter_complex", parts.join(";"), "-map", "[speech]", "-c:a", "libmp3lame", "-q:a", "2", output];
|
|
50
109
|
}
|
|
51
110
|
|
|
52
111
|
/** The music track: looped to the film's length, ducked by the keyframes, faded in and out. */
|
|
@@ -61,15 +120,17 @@ export function buildMusicArgs(options: { input: string; seconds: number; keyfra
|
|
|
61
120
|
return ["-v", "error", "-y", "-stream_loop", "-1", "-i", options.input, "-t", String(seconds), "-af", filters.join(","), "-c:a", "libmp3lame", "-q:a", "2", options.output];
|
|
62
121
|
}
|
|
63
122
|
|
|
64
|
-
/** A small silent copy of the cut, what Video to Music scores. */
|
|
123
|
+
/** A small silent copy of the cut, what Video to Music scores: each segment read from its own seek into its clip. */
|
|
65
124
|
export function buildCutPreviewArgs(edl: Edl, clips: Record<string, string>, output: string): string[] {
|
|
66
125
|
const inputs: string[] = [];
|
|
67
126
|
const parts: string[] = [];
|
|
68
127
|
edl.segments.forEach((segment, index) => {
|
|
69
128
|
const clip = clips[segment.clip];
|
|
70
129
|
if (clip === undefined) throw new Error(`No file for clip "${segment.clip}" of the EDL.`);
|
|
71
|
-
|
|
72
|
-
|
|
130
|
+
// Seeking the input (accurate while transcoding; normalized clips have a keyframe every half second) instead of
|
|
131
|
+
// trim, which decodes the clip from its start for every segment.
|
|
132
|
+
inputs.push("-ss", String(r3(segment.start)), "-t", String(r3(segment.end - segment.start)), "-i", clip);
|
|
133
|
+
parts.push(`[${index}:v]setpts=PTS-STARTPTS,scale=540:-2,setsar=1[v${index}]`);
|
|
73
134
|
});
|
|
74
135
|
const joined = edl.segments.map((_, index) => `[v${index}]`).join("");
|
|
75
136
|
const graph = `${parts.join(";")};${joined}concat=n=${edl.segments.length}:v=1:a=0[cut]`;
|
package/src/footage/tools.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { homedir } from "node:os";
|
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
|
|
5
5
|
import { getHyperframesBin, getHyperframesEnv, HYPERFRAMES_VERSION } from "../render/hyperframes.js";
|
|
6
|
+
import { findLowDiskProblems, getFreeBytes, getRenderTempDir, type FreeBytesReader } from "./disk.js";
|
|
6
7
|
import { runProcess } from "./process.js";
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -18,15 +19,26 @@ export interface FootageToolsOptions {
|
|
|
18
19
|
* worker image ships the browser, so the default is false.
|
|
19
20
|
*/
|
|
20
21
|
isBrowserDownloadAllowed?: boolean;
|
|
21
|
-
/**
|
|
22
|
+
/** Check the filters the fast draft draws with (`renderFootageDraft`): `ass` (libass and libfreetype), `xfade`, `zoompan`. */
|
|
23
|
+
needsDraft?: boolean;
|
|
24
|
+
/** The environment the run sees (`HYPERFRAMES_BROWSER_PATH`, `PRODUCER_HEADLESS_SHELL_PATH`, `HOME`, `TMPDIR`). */
|
|
22
25
|
env?: NodeJS.ProcessEnv;
|
|
26
|
+
/** The render's temp folder, as passed to `renderFootage`; by default `TMPDIR` of `env`, else `os.tmpdir()`. */
|
|
27
|
+
tempDir?: string;
|
|
28
|
+
/** The film's build folder, where hyperframes writes its render; checked for free space when given. */
|
|
29
|
+
buildDir?: string;
|
|
23
30
|
signal?: AbortSignal;
|
|
31
|
+
/** Reads a folder's free bytes; injected in tests. */
|
|
32
|
+
readFreeBytes?: FreeBytesReader;
|
|
24
33
|
}
|
|
25
34
|
|
|
26
35
|
/** What the footage blocks need from ffmpeg: decoders and filters, by the name ffmpeg lists them under. */
|
|
27
36
|
export const REQUIRED_DECODERS = ["hevc", "h264"] as const;
|
|
28
37
|
export const REQUIRED_FILTERS = ["zscale", "tonemap"] as const;
|
|
38
|
+
/** What the fast draft needs on top: libass (with libfreetype) for the captions, `xfade` for fades, `zoompan` for Ken Burns. */
|
|
39
|
+
export const DRAFT_FILTERS = ["ass", "xfade", "zoompan"] as const;
|
|
29
40
|
|
|
41
|
+
const DRAFT_INSTALL_HINT = "install an ffmpeg built with libass and libfreetype (macOS: brew install ffmpeg, Debian/Ubuntu: apt install ffmpeg)";
|
|
30
42
|
const INSTALL_HINT = "install an ffmpeg built with libzimg (macOS: brew install ffmpeg, Debian/Ubuntu: apt install ffmpeg)";
|
|
31
43
|
|
|
32
44
|
/** The names in `ffmpeg -decoders` or `-filters` output: the second column of each listing line. */
|
|
@@ -83,8 +95,9 @@ export function findBrowserProblem(env: NodeJS.ProcessEnv): string | null {
|
|
|
83
95
|
|
|
84
96
|
/**
|
|
85
97
|
* Checks the machine for a footage run: ffmpeg and ffprobe run, ffmpeg decodes HEVC and H.264 and has `zscale` and
|
|
86
|
-
* `tonemap` (HDR clips),
|
|
87
|
-
*
|
|
98
|
+
* `tonemap` (HDR clips), for a draft (`needsDraft`) `ass`, `xfade` and `zoompan`, and, for a render, hyperframes runs
|
|
99
|
+
* and has its browser, and its temp folder (and the build folder, when given) has the 1 GiB free hyperframes requires.
|
|
100
|
+
* Returns every problem found; an empty list means the machine is ready.
|
|
88
101
|
*/
|
|
89
102
|
export async function checkFootageTools(options: FootageToolsOptions = {}): Promise<string[]> {
|
|
90
103
|
const { signal } = options;
|
|
@@ -100,6 +113,11 @@ export async function checkFootageTools(options: FootageToolsOptions = {}): Prom
|
|
|
100
113
|
for (const filter of REQUIRED_FILTERS) {
|
|
101
114
|
if (filters?.has(filter) !== true) problems.push(`ffmpeg has no ${filter} filter (HDR clips need it): ${INSTALL_HINT}.`);
|
|
102
115
|
}
|
|
116
|
+
if (options.needsDraft === true) {
|
|
117
|
+
for (const filter of DRAFT_FILTERS) {
|
|
118
|
+
if (filters?.has(filter) !== true) problems.push(`ffmpeg has no ${filter} filter (the draft needs it): ${DRAFT_INSTALL_HINT}.`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
103
121
|
}
|
|
104
122
|
if (!(await isRunnable("ffprobe", ["-version"], aborting))) problems.push(`no ffprobe in PATH: it comes with ffmpeg; ${INSTALL_HINT}.`);
|
|
105
123
|
if (options.needsRender === false) return problems;
|
|
@@ -115,5 +133,7 @@ export async function checkFootageTools(options: FootageToolsOptions = {}): Prom
|
|
|
115
133
|
const browser = findBrowserProblem(env);
|
|
116
134
|
if (browser !== null) problems.push(browser);
|
|
117
135
|
}
|
|
136
|
+
const temp = getRenderTempDir(env, options.tempDir);
|
|
137
|
+
problems.push(...findLowDiskProblems(options.buildDir === undefined ? { temp } : { temp, build: options.buildDir }, options.readFreeBytes ?? getFreeBytes));
|
|
118
138
|
return problems;
|
|
119
139
|
}
|
package/src/index.ts
CHANGED
|
@@ -94,6 +94,8 @@ export { describeVoiceoverBatch, produceVoiceovers, type VoiceoverBatchItem, typ
|
|
|
94
94
|
export { getPlaceholderKey, isPlaceholderKey, makePlaceholderWords, writePlaceholderVoiceover, type PlaceholderPace, type WritePlaceholderOptions } from "./voice/placeholder.js";
|
|
95
95
|
export {
|
|
96
96
|
BROWSER_BAR_HEIGHT,
|
|
97
|
+
CAPTION_LINE_HEIGHT,
|
|
98
|
+
CAPTION_PILL_PADDING,
|
|
97
99
|
DEVICE_KINDS,
|
|
98
100
|
LAYOUTS,
|
|
99
101
|
LAYOUT_NAMES,
|
|
@@ -105,6 +107,7 @@ export {
|
|
|
105
107
|
crossfadeArgs,
|
|
106
108
|
fitScale,
|
|
107
109
|
fitsFrame,
|
|
110
|
+
getCaptionPositionCss,
|
|
108
111
|
getGeometry,
|
|
109
112
|
getLayoutName,
|
|
110
113
|
getTransitionSeconds,
|
|
@@ -177,10 +180,13 @@ export {
|
|
|
177
180
|
CLIP_FITS,
|
|
178
181
|
CLIP_ROLES,
|
|
179
182
|
CUT_TRANSITIONS,
|
|
183
|
+
DEFAULT_AUTO_THRESHOLD,
|
|
184
|
+
JUMP_TRANSITIONS,
|
|
180
185
|
DEFAULT_CUT,
|
|
181
186
|
DEFAULT_FILLERS,
|
|
182
187
|
DEFAULT_MUSIC_VOLUME,
|
|
183
188
|
DEFAULT_TRANSITIONS,
|
|
189
|
+
CAPTION_MIN_FONT_SCALE,
|
|
184
190
|
CAPTION_PRESETS,
|
|
185
191
|
CAPTION_STYLES,
|
|
186
192
|
DEFAULT_EDIT,
|
|
@@ -193,6 +199,7 @@ export {
|
|
|
193
199
|
type ClipRole,
|
|
194
200
|
type CutOptions,
|
|
195
201
|
type CutTransition,
|
|
202
|
+
type JumpTransition,
|
|
196
203
|
type FootageClip,
|
|
197
204
|
type FootageFilm,
|
|
198
205
|
type FootageMusic,
|
|
@@ -225,7 +232,20 @@ export {
|
|
|
225
232
|
type AudioProbeResult,
|
|
226
233
|
type MusicFileTypeCheck,
|
|
227
234
|
} from "./footage/audio.js";
|
|
228
|
-
export {
|
|
235
|
+
export {
|
|
236
|
+
FOOTAGE_FPS,
|
|
237
|
+
FOOTAGE_SAMPLE_RATE,
|
|
238
|
+
X264_PRESETS,
|
|
239
|
+
buildNormalizeArgs,
|
|
240
|
+
buildVideoFilter,
|
|
241
|
+
normalizeFootage,
|
|
242
|
+
resolveFit,
|
|
243
|
+
toneMapFilter,
|
|
244
|
+
type Frame,
|
|
245
|
+
type NormalizeEncoder,
|
|
246
|
+
type NormalizeInput,
|
|
247
|
+
type X264Preset,
|
|
248
|
+
} from "./footage/normalize.js";
|
|
229
249
|
export {
|
|
230
250
|
describePaidSteps,
|
|
231
251
|
toPaidAudio,
|
|
@@ -265,6 +285,7 @@ export {
|
|
|
265
285
|
type FakeSttOptions,
|
|
266
286
|
type FakeSttProvider,
|
|
267
287
|
} from "./footage/fake.js";
|
|
288
|
+
export { SCRIBE_KEYTERM_LIMITS, getFilmKeyTerms, normalizeKeyTerms, type KeyTermsResult } from "./footage/keyterms.js";
|
|
268
289
|
export { footageCacheKey, getFootageCachePath, hashFile, readCachedTranscript, type FootageCacheKind } from "./footage/cache.js";
|
|
269
290
|
export {
|
|
270
291
|
MIN_SEGMENT_SECONDS,
|
|
@@ -294,22 +315,62 @@ export {
|
|
|
294
315
|
CAPTION_SAFE_ZONES,
|
|
295
316
|
findMissingCaptionGlyphs,
|
|
296
317
|
getCaptionPresetLayout,
|
|
318
|
+
getCaptionSpans,
|
|
319
|
+
getFootageCaptionLayout,
|
|
297
320
|
phraseChunks,
|
|
321
|
+
type CaptionSpan,
|
|
298
322
|
type MissingCaptionGlyphs,
|
|
299
323
|
type PhraseChunk,
|
|
300
324
|
type SafeZone,
|
|
301
325
|
} from "./footage/captions.js";
|
|
326
|
+
export {
|
|
327
|
+
CUT_THUMBNAIL,
|
|
328
|
+
buildCutFrameArgs,
|
|
329
|
+
chooseCutTransition,
|
|
330
|
+
chooseCutTransitions,
|
|
331
|
+
findAutoCuts,
|
|
332
|
+
measureFrameDifference,
|
|
333
|
+
type ChooseCutTransitionsOptions,
|
|
334
|
+
type CutMeasure,
|
|
335
|
+
} from "./footage/cuts.js";
|
|
302
336
|
export { MAX_FRAMES, buildFrameArgs, extractFrames, getFrameTimes, type ExtractFramesOptions, type ExtractedFrame, type FrameSpacing } from "./footage/frames.js";
|
|
303
|
-
export { duckingKeyframes, getSpeechSpans, volumeExpression, type DuckingOptions, type VolumeKeyframe } from "./footage/music.js";
|
|
337
|
+
export { duckingKeyframes, getDuckingOptions, getSpeechSpans, volumeExpression, type DuckingOptions, type VolumeKeyframe } from "./footage/music.js";
|
|
304
338
|
export { END_CARD_SECONDS, FADE_SECONDS, composeFootage, getFootageFilmSeconds, getSegmentScales, type FootageComposeAssets, type FootageComposeInput } from "./footage/compose.js";
|
|
305
|
-
export { buildCutPreviewArgs, buildLastFrameArgs, buildMusicArgs, buildSpeechArgs } from "./footage/render.js";
|
|
339
|
+
export { buildCutPreviewArgs, buildLastFrameArgs, buildMusicArgs, buildSpeechArgs, getSpeechCutOptions, type SpeechCutOptions } from "./footage/render.js";
|
|
340
|
+
export {
|
|
341
|
+
FOOTAGE_DRAFT_FONT,
|
|
342
|
+
FOOTAGE_DRAFT_WIDTH,
|
|
343
|
+
buildFootageDraftArgs,
|
|
344
|
+
buildFootageDraftCaptions,
|
|
345
|
+
getFootageDraftFrame,
|
|
346
|
+
planFootageDraft,
|
|
347
|
+
renderFootageDraft,
|
|
348
|
+
type DraftSegmentPlan,
|
|
349
|
+
type FootageDraft,
|
|
350
|
+
type FootageDraftArgsInput,
|
|
351
|
+
type FootageDraftCaptionsInput,
|
|
352
|
+
type RenderFootageDraftOptions,
|
|
353
|
+
} from "./footage/draft.js";
|
|
354
|
+
export {
|
|
355
|
+
buildPictureConcatArgs,
|
|
356
|
+
buildPictureList,
|
|
357
|
+
buildPicturePieceArgs,
|
|
358
|
+
getPictureFrames,
|
|
359
|
+
planFootagePicture,
|
|
360
|
+
type PictureFadeTail,
|
|
361
|
+
type PicturePiece,
|
|
362
|
+
type PicturePieceArgsInput,
|
|
363
|
+
} from "./footage/picture.js";
|
|
306
364
|
export {
|
|
307
365
|
DEFAULT_LOUDNESS,
|
|
308
366
|
buildLoudnessArgs,
|
|
309
367
|
buildLoudnessMeasureArgs,
|
|
368
|
+
getLoudnessFilter,
|
|
310
369
|
isSilent,
|
|
370
|
+
measureLoudness,
|
|
311
371
|
normalizeLoudness,
|
|
312
372
|
readLoudnessMeasurement,
|
|
373
|
+
type LoudnessMeasureOutcome,
|
|
313
374
|
type LoudnessMeasurement,
|
|
314
375
|
type LoudnessOutcome,
|
|
315
376
|
type LoudnessTarget,
|
|
@@ -339,9 +400,13 @@ export {
|
|
|
339
400
|
type FootageEstimate,
|
|
340
401
|
type FootageEstimateItem,
|
|
341
402
|
} from "./footage/paid.js";
|
|
342
|
-
export {
|
|
403
|
+
export { RENDER_MIN_FREE_BYTES, findLowDiskProblems, getFreeBytes, getRenderTempDir, type FreeBytesReader } from "./footage/disk.js";
|
|
404
|
+
export { DRAFT_FILTERS, REQUIRED_DECODERS, REQUIRED_FILTERS, checkFootageTools, findBrowserProblem, readFfmpegListing, type FootageToolsOptions } from "./footage/tools.js";
|
|
343
405
|
export {
|
|
406
|
+
CUTS_FILE,
|
|
344
407
|
cutFootage,
|
|
408
|
+
cutFootageFilm,
|
|
409
|
+
describeCutMeasures,
|
|
345
410
|
getEdlPath,
|
|
346
411
|
getFrame,
|
|
347
412
|
prepareFootage,
|
|
@@ -356,6 +421,7 @@ export {
|
|
|
356
421
|
type FootageResult,
|
|
357
422
|
type FootageRunOptions,
|
|
358
423
|
type PreparedClip,
|
|
424
|
+
type CutFootageFilmOptions,
|
|
359
425
|
type RenderFootageFilmOptions,
|
|
360
426
|
type RenderFootageOptions,
|
|
361
427
|
type RenderedFootage,
|