@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/dist/footage/paid.js
CHANGED
|
@@ -5,6 +5,7 @@ import { err, ok } from "../voice/provider.js";
|
|
|
5
5
|
import { footageCacheKey, getFootageCachePath, hashFile } from "./cache.js";
|
|
6
6
|
import { END_CARD_SECONDS, getFootageFilmSeconds } from "./compose.js";
|
|
7
7
|
import { readEdl } from "./edl.js";
|
|
8
|
+
import { getFilmKeyTerms } from "./keyterms.js";
|
|
8
9
|
import { getTrimmedDuration, probeFootage } from "./probe.js";
|
|
9
10
|
export const isUrl = (source) => /^https?:\/\//i.test(source);
|
|
10
11
|
export function getEdlPath(buildDir, isPlaceholder) {
|
|
@@ -38,7 +39,10 @@ export function getIsolatedCache(film, clipKey, options) {
|
|
|
38
39
|
}
|
|
39
40
|
export function getTranscriptCache(film, clipKey, options) {
|
|
40
41
|
const { stt } = options.providers;
|
|
41
|
-
const
|
|
42
|
+
const keyTerms = getFilmKeyTerms(film);
|
|
43
|
+
// Key terms join the key only when there are any, so a transcript bought without them keeps its key.
|
|
44
|
+
const withKeyTerms = keyTerms.ok && keyTerms.terms.length > 0 ? { keyTerms: keyTerms.terms } : {};
|
|
45
|
+
const key = footageCacheKey("transcript", { clip: clipKey, isolated: film.isolateVoice, provider: stt.id, model: stt.model, language: film.language, ...withKeyTerms });
|
|
42
46
|
return { key, path: getFootageCachePath(options.cacheDir, film.id, "transcript", key) };
|
|
43
47
|
}
|
|
44
48
|
/** Music generated from the film's prompt: keyed by the prompt, so a re-cut never pays again. */
|
|
@@ -128,11 +132,17 @@ const round = (value, digits) => {
|
|
|
128
132
|
* What a footage film will cost in the caller's credits, before anything runs: every clip probed (a URL clip not yet
|
|
129
133
|
* downloaded is probed at its URL), nothing normalized, no provider called. Talking clips need speech to text (and
|
|
130
134
|
* isolation when the film cleans the voice); generated music lasts the cut's length when the cut is known, else the
|
|
131
|
-
* clips' length plus the end card. A cached step costs 0.
|
|
135
|
+
* clips' length plus the end card. A cached step costs 0. With key terms, transcription costs `rates.transcribe` plus
|
|
136
|
+
* the keyterm surcharge `rates.keyTerms`; invalid key terms fail the estimate.
|
|
132
137
|
*/
|
|
133
138
|
export async function estimateFootageFilm(film, options) {
|
|
134
139
|
if (film.clips.length === 0)
|
|
135
140
|
return err(`footage film ${film.id} has no clips.`);
|
|
141
|
+
const keyTerms = getFilmKeyTerms(film);
|
|
142
|
+
if (!keyTerms.ok)
|
|
143
|
+
return err(`footage film ${film.id}: ${keyTerms.errors.join(" ")}`);
|
|
144
|
+
const surcharge = keyTerms.terms.length === 0 ? 0 : (options.rates.keyTerms ?? 0);
|
|
145
|
+
const rates = { ...options.rates, transcribe: options.rates.transcribe + surcharge };
|
|
136
146
|
const files = {};
|
|
137
147
|
for (const clip of film.clips) {
|
|
138
148
|
const local = findLocalSource(clip, options.buildDir);
|
|
@@ -145,7 +155,7 @@ export async function estimateFootageFilm(film, options) {
|
|
|
145
155
|
return err(probed.errors.join("\n"));
|
|
146
156
|
const items = [];
|
|
147
157
|
const add = (step, item, provider, units, cached) => {
|
|
148
|
-
items.push({ step, item, provider, units: round(units, 3), unit: "seconds", credits: cached ? 0 : round(units *
|
|
158
|
+
items.push({ step, item, provider, units: round(units, 3), unit: "seconds", credits: cached ? 0 : round(units * rates[step], 2), cached });
|
|
149
159
|
};
|
|
150
160
|
let clipSeconds = 0;
|
|
151
161
|
for (const { clip, probe } of probed.clips) {
|
package/dist/footage/paid.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paid.js","sourceRoot":"","sources":["../../src/footage/paid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,GAAG,EAAE,EAAE,EAAkB,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC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AG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAChC,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QACtD,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QAC7B,MAAM,OAAO,GAAG,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,GAAG,CAAC,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAC/H,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAChG,CAAC;IACD,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AACnG,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type Edl } from "./edl.js";
|
|
2
|
+
import { type FootageFilm } from "./film.js";
|
|
3
|
+
import { type NormalizeEncoder } from "./normalize.js";
|
|
4
|
+
/** The outgoing segment's tail under a cross-fade. */
|
|
5
|
+
export interface PictureFadeTail {
|
|
6
|
+
clip: string;
|
|
7
|
+
/** Seconds in the clip: where the outgoing segment ends. */
|
|
8
|
+
start: number;
|
|
9
|
+
frames: number;
|
|
10
|
+
/** The zoom the outgoing segment ends on, held through the fade. */
|
|
11
|
+
scale: number;
|
|
12
|
+
}
|
|
13
|
+
/** One segment's piece of the picture. */
|
|
14
|
+
export interface PicturePiece {
|
|
15
|
+
clip: string;
|
|
16
|
+
/** Seconds in the clip where the piece starts. */
|
|
17
|
+
start: number;
|
|
18
|
+
/** The piece's first film frame. */
|
|
19
|
+
frame: number;
|
|
20
|
+
frames: number;
|
|
21
|
+
/** For a `fade` cut, the outgoing tail the piece dissolves from; null for any other cut. */
|
|
22
|
+
fade: PictureFadeTail | null;
|
|
23
|
+
}
|
|
24
|
+
/** The picture's pieces, one per segment, covering the cut's frames without a gap. Throws on an EDL without segments. */
|
|
25
|
+
export declare function planFootagePicture(film: Pick<FootageFilm, "edit">, edl: Edl): PicturePiece[];
|
|
26
|
+
/** The number of frames the picture has: the cut's length in film frames. */
|
|
27
|
+
export declare function getPictureFrames(pieces: readonly PicturePiece[]): number;
|
|
28
|
+
export interface PicturePieceArgsInput {
|
|
29
|
+
piece: PicturePiece;
|
|
30
|
+
/** The normalized clips by id. */
|
|
31
|
+
clips: Record<string, string>;
|
|
32
|
+
output: string;
|
|
33
|
+
/** The intermediate clips' encoder (`RenderFootageOptions.normalize`): its preset and threads encode the piece too. */
|
|
34
|
+
encoder?: NormalizeEncoder;
|
|
35
|
+
}
|
|
36
|
+
/** One piece's ffmpeg arguments: its clip (and a fade's outgoing tail), exactly `frames` frames, H.264 without sound. */
|
|
37
|
+
export declare function buildPicturePieceArgs(input: PicturePieceArgsInput): string[];
|
|
38
|
+
/** The concat demuxer's list: one `file` line per piece, quotes escaped as the demuxer reads them. */
|
|
39
|
+
export declare function buildPictureList(files: readonly string[]): string;
|
|
40
|
+
/** Joins the pieces by stream copy (they share one encoder's settings) into the picture, fast start. */
|
|
41
|
+
export declare function buildPictureConcatArgs(list: string, output: string): string[];
|
|
42
|
+
//# sourceMappingURL=picture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picture.d.ts","sourceRoot":"","sources":["../../src/footage/picture.ts"],"names":[],"mappings":"AACA,OAAO,EAAoC,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AACt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C,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAE7E"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { getSegmentScales } from "./compose.js";
|
|
2
|
+
import { getEdlDuration, getSegmentStarts } from "./edl.js";
|
|
3
|
+
import { getFootageEdit } from "./film.js";
|
|
4
|
+
import { FOOTAGE_FPS, getThreadArgs } from "./normalize.js";
|
|
5
|
+
/**
|
|
6
|
+
* The cut's picture in film time, which the render's composition plays as one `<video>`: one short ffmpeg per segment
|
|
7
|
+
* (run one after the other, so one decoder at a time) and a stream-copy join. hyperframes then extracts the whole
|
|
8
|
+
* film's frames with one ffmpeg, and its Chrome holds one video instead of one per segment (issue #1030: the
|
|
9
|
+
* extraction peak falls from about 1 GB to 0.2 GB, the capture's from 1.7 GB to 1.1 GB on a 45 s 1080x1920 film).
|
|
10
|
+
*
|
|
11
|
+
* Every piece starts on a film frame and runs to the next segment's frame, so rounding never adds up along the cut.
|
|
12
|
+
* A cross-fade is drawn into the incoming piece: the outgoing segment's tail, held at the zoom it ends on, dissolves
|
|
13
|
+
* into the incoming clip (`xfade`), as the per-segment composition plays it. Zoom cuts and Ken Burns stay tweens on
|
|
14
|
+
* the composition's video.
|
|
15
|
+
*/
|
|
16
|
+
/** The point a zoom keeps still, as the composition's `transform-origin: 50% 42%`. */
|
|
17
|
+
const ZOOM_ORIGIN = { x: 0.5, y: 0.42 };
|
|
18
|
+
/** How far a segment marked `kenburns` zooms when the film's `kenBurnsPercent` is 0, as in the composition. */
|
|
19
|
+
const HAND_KEN_BURNS_PERCENT = 4;
|
|
20
|
+
const PICTURE_CRF = 18;
|
|
21
|
+
const DEFAULT_PICTURE_PRESET = "veryfast";
|
|
22
|
+
const r3 = (value) => Math.round(value * 1000) / 1000 || 0;
|
|
23
|
+
/** The film frame a film second falls on. */
|
|
24
|
+
function toFrame(seconds) {
|
|
25
|
+
return Math.round(seconds * FOOTAGE_FPS);
|
|
26
|
+
}
|
|
27
|
+
/** The picture's pieces, one per segment, covering the cut's frames without a gap. Throws on an EDL without segments. */
|
|
28
|
+
export function planFootagePicture(film, edl) {
|
|
29
|
+
if (edl.segments.length === 0)
|
|
30
|
+
throw new Error("The EDL has no segments.");
|
|
31
|
+
const edit = getFootageEdit(film);
|
|
32
|
+
const kenBurnsScale = 1 + (edit.kenBurnsPercent > 0 ? edit.kenBurnsPercent : HAND_KEN_BURNS_PERCENT) / 100;
|
|
33
|
+
const scales = getSegmentScales(edl, edit.zoomPercent);
|
|
34
|
+
const starts = getSegmentStarts(edl);
|
|
35
|
+
const lastFrame = toFrame(getEdlDuration(edl));
|
|
36
|
+
return edl.segments.map((segment, index) => {
|
|
37
|
+
const frame = toFrame(starts[index]);
|
|
38
|
+
const nextStart = starts[index + 1];
|
|
39
|
+
const frames = Math.max(1, (nextStart === undefined ? lastFrame : toFrame(nextStart)) - frame);
|
|
40
|
+
const previous = edl.segments[index - 1];
|
|
41
|
+
const fadeFrames = segment.transition === "fade" ? Math.min(frames, edit.fadeFrames) : 0;
|
|
42
|
+
let fade = null;
|
|
43
|
+
if (previous !== undefined && fadeFrames > 0) {
|
|
44
|
+
const previousScale = scales[index - 1];
|
|
45
|
+
// The outgoing segment's Ken Burns tween ends at its end; its tail holds the zoom it reached.
|
|
46
|
+
const scale = previous.motion === "kenburns" ? Math.round(previousScale * kenBurnsScale * 10000) / 10000 : previousScale;
|
|
47
|
+
fade = { clip: previous.clip, start: r3(previous.end), frames: fadeFrames, scale };
|
|
48
|
+
}
|
|
49
|
+
return { clip: segment.clip, start: r3(segment.start), frame, frames, fade };
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/** The number of frames the picture has: the cut's length in film frames. */
|
|
53
|
+
export function getPictureFrames(pieces) {
|
|
54
|
+
return pieces.reduce((sum, piece) => sum + piece.frames, 0);
|
|
55
|
+
}
|
|
56
|
+
/** Filters that bring a stream to the film's rate and pixel format and exactly `frames` long (a short clip holds its last frame). */
|
|
57
|
+
function fitStream(frames) {
|
|
58
|
+
const seconds = r3(frames / FOOTAGE_FPS);
|
|
59
|
+
return [
|
|
60
|
+
"setpts=PTS-STARTPTS",
|
|
61
|
+
`fps=${FOOTAGE_FPS}`,
|
|
62
|
+
"format=yuv420p",
|
|
63
|
+
"setsar=1",
|
|
64
|
+
`tpad=stop_mode=clone:stop_duration=${seconds}`,
|
|
65
|
+
`trim=end_frame=${frames}`,
|
|
66
|
+
"setpts=PTS-STARTPTS",
|
|
67
|
+
`settb=1/${FOOTAGE_FPS}`,
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
/** A crop to `scale` about the zoom origin and back to the clip's size; nothing at scale 1. */
|
|
71
|
+
function zoomFilters(scale) {
|
|
72
|
+
if (scale === 1)
|
|
73
|
+
return [];
|
|
74
|
+
return [`crop=iw/${scale}:ih/${scale}:(iw-iw/${scale})*${ZOOM_ORIGIN.x}:(ih-ih/${scale})*${ZOOM_ORIGIN.y}`, `scale=iw*${scale}:ih*${scale}`];
|
|
75
|
+
}
|
|
76
|
+
/** One piece's ffmpeg arguments: its clip (and a fade's outgoing tail), exactly `frames` frames, H.264 without sound. */
|
|
77
|
+
export function buildPicturePieceArgs(input) {
|
|
78
|
+
const { piece, clips } = input;
|
|
79
|
+
const getClip = (id) => {
|
|
80
|
+
const file = clips[id];
|
|
81
|
+
if (file === undefined)
|
|
82
|
+
throw new Error(`No file for clip "${id}" of the EDL.`);
|
|
83
|
+
return file;
|
|
84
|
+
};
|
|
85
|
+
const threads = getThreadArgs(input.encoder?.threads, "normalize.threads");
|
|
86
|
+
const seconds = (frames) => String(r3(frames / FOOTAGE_FPS + 1 / FOOTAGE_FPS));
|
|
87
|
+
const inputs = [...threads.output, "-ss", String(piece.start), "-t", seconds(piece.frames), "-i", getClip(piece.clip)];
|
|
88
|
+
let graph = `[0:v]${fitStream(piece.frames).join(",")}[picture]`;
|
|
89
|
+
if (piece.fade !== null) {
|
|
90
|
+
const { fade } = piece;
|
|
91
|
+
inputs.push(...threads.output, "-ss", String(fade.start), "-t", seconds(fade.frames), "-i", getClip(fade.clip));
|
|
92
|
+
const tail = [...zoomFilters(fade.scale), ...fitStream(fade.frames)];
|
|
93
|
+
graph = [
|
|
94
|
+
`[0:v]${fitStream(piece.frames).join(",")}[incoming]`,
|
|
95
|
+
`[1:v]${tail.join(",")}[outgoing]`,
|
|
96
|
+
// xfade's output is the outgoing tail plus the incoming piece minus the fade: the piece's own length.
|
|
97
|
+
`[outgoing][incoming]xfade=transition=fade:duration=${r3(fade.frames / FOOTAGE_FPS)}:offset=0,trim=end_frame=${piece.frames}[picture]`,
|
|
98
|
+
].join(";");
|
|
99
|
+
}
|
|
100
|
+
return [
|
|
101
|
+
"-v",
|
|
102
|
+
"error",
|
|
103
|
+
"-y",
|
|
104
|
+
...threads.global,
|
|
105
|
+
...inputs,
|
|
106
|
+
"-filter_complex",
|
|
107
|
+
graph,
|
|
108
|
+
"-map",
|
|
109
|
+
"[picture]",
|
|
110
|
+
"-an",
|
|
111
|
+
"-frames:v",
|
|
112
|
+
String(piece.frames),
|
|
113
|
+
"-c:v",
|
|
114
|
+
"libx264",
|
|
115
|
+
"-preset",
|
|
116
|
+
input.encoder?.preset ?? DEFAULT_PICTURE_PRESET,
|
|
117
|
+
"-crf",
|
|
118
|
+
String(PICTURE_CRF),
|
|
119
|
+
"-g",
|
|
120
|
+
String(FOOTAGE_FPS / 2),
|
|
121
|
+
"-pix_fmt",
|
|
122
|
+
"yuv420p",
|
|
123
|
+
"-color_primaries",
|
|
124
|
+
"bt709",
|
|
125
|
+
"-color_trc",
|
|
126
|
+
"bt709",
|
|
127
|
+
"-colorspace",
|
|
128
|
+
"bt709",
|
|
129
|
+
...threads.output,
|
|
130
|
+
input.output,
|
|
131
|
+
];
|
|
132
|
+
}
|
|
133
|
+
/** The concat demuxer's list: one `file` line per piece, quotes escaped as the demuxer reads them. */
|
|
134
|
+
export function buildPictureList(files) {
|
|
135
|
+
return `${files.map((file) => `file '${file.replace(/'/g, "'\\''")}'`).join("\n")}\n`;
|
|
136
|
+
}
|
|
137
|
+
/** Joins the pieces by stream copy (they share one encoder's settings) into the picture, fast start. */
|
|
138
|
+
export function buildPictureConcatArgs(list, output) {
|
|
139
|
+
return ["-v", "error", "-y", "-f", "concat", "-safe", "0", "-i", list, "-c", "copy", "-movflags", "+faststart", output];
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=picture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picture.js","sourceRoot":"","sources":["../../src/footage/picture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAY,MAAM,UAAU,CAAC;AACtE,OAAO,EAAE,cAAc,EAAoB,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAyB,MAAM,gBAAgB,CAAC;AAEnF;;;;;;;;;;GAUG;AAEH,sFAAsF;AACtF,MAAM,WAAW,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAW,CAAC;AACjD,+GAA+G;AAC/G,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACjC,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,MAAM,sBAAsB,GAAG,UAAU,CAAC;AAE1C,MAAM,EAAE,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;AAwB3E,6CAA6C;AAC7C,SAAS,OAAO,CAAC,OAAe;IAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,WAAW,CAAC,CAAC;AAC3C,CAAC;AAED,yHAAyH;AACzH,MAAM,UAAU,kBAAkB,CAAC,IAA+B,EAAE,GAAQ;IAC1E,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE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AAwB;IACvD,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACxF,CAAC;AAED,wGAAwG;AACxG,MAAM,UAAU,sBAAsB,CAAC,IAAY,EAAE,MAAc;IACjE,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;AAC1H,CAAC"}
|
|
@@ -4,9 +4,11 @@ import type { BrandFont } from "../config/config.js";
|
|
|
4
4
|
import type { SfxEvent } from "../config/schema.js";
|
|
5
5
|
import { type TtsResult } from "../voice/provider.js";
|
|
6
6
|
import type { TimedWord } from "../voice/voiceover.js";
|
|
7
|
+
import { type FreeBytesReader } from "./disk.js";
|
|
7
8
|
import { type Edl } from "./edl.js";
|
|
9
|
+
import { type CutMeasure } from "./cuts.js";
|
|
8
10
|
import { type FootageClip, type FootageFilm } from "./film.js";
|
|
9
|
-
import { type Frame } from "./normalize.js";
|
|
11
|
+
import { type Frame, type NormalizeEncoder } from "./normalize.js";
|
|
10
12
|
import { type FootageProbe } from "./probe.js";
|
|
11
13
|
import { type Sentence } from "./sentences.js";
|
|
12
14
|
import { type FootageCharge, type FootageProgress, type FootageProviders, type PaidStep } from "./providers.js";
|
|
@@ -39,6 +41,11 @@ export interface FootageRunOptions {
|
|
|
39
41
|
onProgress?: (progress: FootageProgress) => void;
|
|
40
42
|
/** Called after each paid call, for the app's own spend ledger. */
|
|
41
43
|
onCharge?: (charge: FootageCharge) => void;
|
|
44
|
+
/**
|
|
45
|
+
* How the normalized clips are encoded (`preset`, `threads`): a small worker trades file size for speed. Not part of
|
|
46
|
+
* the normalize stamp, so changing it does not normalize clips already made again.
|
|
47
|
+
*/
|
|
48
|
+
normalize?: NormalizeEncoder;
|
|
42
49
|
}
|
|
43
50
|
export interface PreparedClip {
|
|
44
51
|
clip: FootageClip;
|
|
@@ -63,7 +70,7 @@ export type TranscribeOutcome = {
|
|
|
63
70
|
};
|
|
64
71
|
export declare function getFrame(film: Pick<FootageFilm, "format">): Frame;
|
|
65
72
|
/** Downloads URL clips, probes every clip (all problems at once) and a local music file, normalizes each clip that changed. */
|
|
66
|
-
export declare function prepareFootage(film: FootageFilm, options: Pick<FootageRunOptions, "buildDir" | "log" | "fetch" | "signal" | "onProgress">): Promise<FootageResult<PreparedClip[]>>;
|
|
73
|
+
export declare function prepareFootage(film: FootageFilm, options: Pick<FootageRunOptions, "buildDir" | "log" | "fetch" | "signal" | "onProgress" | "normalize">): Promise<FootageResult<PreparedClip[]>>;
|
|
67
74
|
/** The paid music step, when the film's music still has to be bought; null when it is cached or free. */
|
|
68
75
|
export declare function getMusicPaidStep(film: FootageFilm, options: Pick<FootageRunOptions, "cacheDir" | "providers">, seconds: number): PaidStep | null;
|
|
69
76
|
/**
|
|
@@ -74,10 +81,32 @@ export declare function getMusicPaidStep(film: FootageFilm, options: Pick<Footag
|
|
|
74
81
|
export declare function transcribeFootage(film: FootageFilm, clips: PreparedClip[], options: FootageRunOptions): Promise<FootageResult<TranscribeOutcome>>;
|
|
75
82
|
/** The talking clips' sentences with their ids (`s1`…), as `buildEdl` names them, for choosing what to keep. */
|
|
76
83
|
export declare function getFootageSentences(clips: PreparedClip[], words: Record<string, TimedWord[]>): Sentence[];
|
|
77
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* The cut from the transcripts, written to the EDL file (replacing what is there); `keepSentences` keeps only those
|
|
86
|
+
* sentences. Sync, so it never looks at the frames: with `transitions.jump: "auto"` the jump cuts stay plain cuts, and
|
|
87
|
+
* `cutFootageFilm` is the step that chooses them.
|
|
88
|
+
*/
|
|
78
89
|
export declare function cutFootage(film: FootageFilm, clips: PreparedClip[], words: Record<string, TimedWord[]>, edlPath: string, options?: {
|
|
79
90
|
keepSentences?: readonly string[];
|
|
80
91
|
}): Edl;
|
|
92
|
+
export interface CutFootageFilmOptions {
|
|
93
|
+
/** The sentence ids to keep; absent keeps all. */
|
|
94
|
+
keepSentences?: readonly string[];
|
|
95
|
+
signal?: AbortSignal;
|
|
96
|
+
}
|
|
97
|
+
/** The file next to the EDL that records what the auto transitions measured. */
|
|
98
|
+
export declare const CUTS_FILE = "cuts.json";
|
|
99
|
+
/**
|
|
100
|
+
* The cut as `cutFootage` builds it, with `transitions.jump: "auto"` resolved from the frames of the normalized clips
|
|
101
|
+
* (`chooseCutTransitions`): each jump cut gets `zoom` or `fade`, and what it measured is answered and written to
|
|
102
|
+
* `cuts.json` next to the EDL, so an app or an agent sees why. Otherwise the same as `cutFootage`, and `cuts` is empty.
|
|
103
|
+
*/
|
|
104
|
+
export declare function cutFootageFilm(film: FootageFilm, clips: PreparedClip[], words: Record<string, TimedWord[]>, edlPath: string, options?: CutFootageFilmOptions): Promise<{
|
|
105
|
+
edl: Edl;
|
|
106
|
+
cuts: CutMeasure[];
|
|
107
|
+
}>;
|
|
108
|
+
/** One line per auto-chosen cut, for a log: `s4: zoom (difference 0.031)`. */
|
|
109
|
+
export declare function describeCutMeasures(cuts: CutMeasure[]): string[];
|
|
81
110
|
/** The EDL file as written by `cutFootage` or edited by hand, checked against the clips. */
|
|
82
111
|
export declare function readEdlFile(film: FootageFilm, clips: PreparedClip[], edlPath: string): FootageResult<Edl>;
|
|
83
112
|
export interface RenderFootageOptions extends FootageRunOptions {
|
|
@@ -89,6 +118,23 @@ export interface RenderFootageOptions extends FootageRunOptions {
|
|
|
89
118
|
output: string;
|
|
90
119
|
/** A project's override of the format's caption box (`marketing.json` `layout`). */
|
|
91
120
|
layout?: LayoutOverride;
|
|
121
|
+
/**
|
|
122
|
+
* hyperframes' temp folder, passed to it as `TMPDIR` (created when missing): the clips' frames are extracted there,
|
|
123
|
+
* so it needs room (a data volume, not a small tmpfs). By default the `TMPDIR` the process already has.
|
|
124
|
+
*/
|
|
125
|
+
tempDir?: string;
|
|
126
|
+
/** Reads a folder's free bytes for the disk check; injected in tests. */
|
|
127
|
+
readFreeBytes?: FreeBytesReader;
|
|
128
|
+
/**
|
|
129
|
+
* hyperframes' capture workers (`--workers`), each a Chrome of its own; by default hyperframes' choice (one in its
|
|
130
|
+
* low-memory profile). A positive whole number.
|
|
131
|
+
*/
|
|
132
|
+
workers?: number;
|
|
133
|
+
/**
|
|
134
|
+
* hyperframes' low-memory profile (`--low-memory-mode`: one worker, screenshot capture): true forces it on, false
|
|
135
|
+
* off; by default hyperframes turns it on by itself on a machine (or cgroup) of 8 GB or less.
|
|
136
|
+
*/
|
|
137
|
+
lowMemory?: boolean;
|
|
92
138
|
}
|
|
93
139
|
export type RenderedFootage = {
|
|
94
140
|
kind: "dry-run";
|
|
@@ -99,7 +145,11 @@ export type RenderedFootage = {
|
|
|
99
145
|
seconds: number;
|
|
100
146
|
edlPath: string;
|
|
101
147
|
} & FinishedFootage);
|
|
102
|
-
/**
|
|
148
|
+
/**
|
|
149
|
+
* Composes the cut and renders it: speech track (loudness-normalized), ducked music, end card backdrop, assets,
|
|
150
|
+
* hyperframes, final pass, cover. First of all it checks that hyperframes' temp folder and the build folder have the
|
|
151
|
+
* 1 GiB free hyperframes requires, so a full disk ends the run with a sentence before anything is bought or built.
|
|
152
|
+
*/
|
|
103
153
|
export declare function renderFootage(film: FootageFilm, clips: PreparedClip[], transcript: Extract<TranscribeOutcome, {
|
|
104
154
|
kind: "ready";
|
|
105
155
|
}>, edl: Edl, options: RenderFootageOptions): Promise<FootageResult<RenderedFootage>>;
|
|
@@ -113,8 +163,20 @@ export interface FinishedFootage {
|
|
|
113
163
|
/** The cover JPG, or null when the film has none. */
|
|
114
164
|
cover: string | null;
|
|
115
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* The final pass over hyperframes' render: the mix normalized to `film.mixLoudness` (measured on the render, one
|
|
168
|
+
* linear gain; the picture still copied), publishable codecs and fast start (stream copy where the render already
|
|
169
|
+
* matches), checked with ffprobe, then the cover and the file's facts. Exported for tests only.
|
|
170
|
+
*/
|
|
171
|
+
export declare function finishFootage(film: Pick<FootageFilm, "mixLoudness" | "cover">, input: {
|
|
172
|
+
renderFile: string;
|
|
173
|
+
seconds: number;
|
|
174
|
+
coverAt: number;
|
|
175
|
+
}, options: Pick<RenderFootageOptions, "log" | "signal" | "output" | "onProgress">): Promise<FootageResult<FinishedFootage>>;
|
|
116
176
|
/** hyperframes' progress lines carry a percentage (`… 42%`); the last one on a line counts. */
|
|
117
177
|
export declare function readRenderPercent(line: string): number | null;
|
|
178
|
+
/** hyperframes' render arguments: the quality, the output and the memory settings the caller set. Throws on invalid `workers`. */
|
|
179
|
+
export declare function getHyperframesRenderArgs(options: Pick<RenderFootageOptions, "quality" | "workers" | "lowMemory">, output: string): string[];
|
|
118
180
|
export interface RenderFootageFilmOptions extends RenderFootageOptions {
|
|
119
181
|
/** Build the EDL again even when the build folder holds one (by default a present EDL, maybe edited by hand, is used). */
|
|
120
182
|
isRecut?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/footage/pipeline.ts"],"names":[],"mappings":"AAIA,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,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAKvD,OAAO,
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","s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