@softure-ai/marketing-kit 0.8.0 → 0.9.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 CHANGED
@@ -4,6 +4,30 @@ Newest first. Each version lists what changed for an app that uses `@softure-ai/
4
4
  production, the version gets a line `verified in: <app>@<commit>` ([docs/05](../../docs/05-adoption-playbook.md),
5
5
  "Definition of done"). Versions before the first one below are described in their GitHub Releases (`marketing-kit@x.y.z`).
6
6
 
7
+ ## 0.9.1
8
+
9
+ - **A draft render with `crf` keeps its picture (#1051):** the final pass of `renderFootage` copies an H.264 yuv420p
10
+ picture in Constrained Baseline, Main or High (was High only). `quality: "draft"` encodes with libx264
11
+ `ultrafast`, which writes Constrained Baseline, so a `draft` + `crf: 18` render was encoded a second time at
12
+ `medium` and ended slower than `standard`; now it is copied (about 540 s instead of 858 s for the issue's 56.7 s
13
+ film at one CPU). A picture outside those profiles is still re-encoded to High. `findFinishProblems` and the
14
+ finish log line name the profile; new export `PUBLISHABLE_H264_PROFILES`.
15
+
16
+ ## 0.9.0
17
+
18
+ - **The footage draft looks and sounds like the render (#1050):** `renderFootageDraft` follows the film's
19
+ `captionStyle`: a `highlight` film gets the render's chunks of up to four words on an opaque box of
20
+ `captionBackground`, in `captionText`, the word being said in `captionHighlight` for 0.32 s. New options `brand`
21
+ (the `FootageBrand` the render takes: the body font's TrueType or OpenType file, named by its own family, and the
22
+ caption colours; DejaVu Sans when the font has no such file) and `cacheDir` / `providers`: a `file` music source, or
23
+ generated music already in the paid cache, plays ducked, looped and faded as in the render. The draft never calls a
24
+ provider; the result gains `music` (`"none"`, `"played"`, `"not_cached"`) and `captionFont`, and the log says why
25
+ there is no music. `buildFootageDraftCaptions` takes `film.captionStyle` and `colors`, `buildFootageDraftArgs` takes
26
+ `music`. New exports: `findFootageMusic` (the render's music lookup, now shared), `chooseFootageDraftFont`,
27
+ `readFontFamilyName`, `toAssColor`, `FOOTAGE_DRAFT_CAPTION_COLORS`, `FootageDraftMusic`, `FootageMusicLookup`.
28
+ A call without the new options draws a `phrase` film exactly as before. README "A fast draft before the render":
29
+ what the draft matches and what it leaves out.
30
+
7
31
  ## 0.8.0
8
32
 
9
33
  - **A faster HDR tone map in footage normalize (#1037):** `normalizeFootage` (and so `prepareFootage`) tone-maps an
package/README.md CHANGED
@@ -691,8 +691,8 @@ softure-marketing footage <film> --step=render # the EDL as it is, maybe e
691
691
  not left quiet and a loud one does not clip; `"loudness": false` leaves it as filmed. hyperframes' render then gets
692
692
  a final pass: the whole mix (speech, music, sound effects) is measured and normalized to `mixLoudness` (default
693
693
  −14 LUFS, −1 dBTP, the same two-pass `loudnorm`; a silent mix is left as it is; `"mixLoudness": false` keeps the
694
- mix as rendered), so the published file plays at the platforms' level whatever the music adds; H.264 High, yuv420p,
695
- AAC 48 kHz stereo, `+faststart` (the `moov` box first, so a platform or a scheduler streaming the URL starts at
694
+ mix as rendered), so the published file plays at the platforms' level whatever the music adds; H.264 yuv420p in
695
+ Constrained Baseline, Main or High (another picture is re-encoded to High), AAC 48 kHz stereo, `+faststart` (the `moov` box first, so a platform or a scheduler streaming the URL starts at
696
696
  once), the picture copied when the render already matches (the sound too when no loudness pass changes it); ffprobe checks
697
697
  the result, and a film that does not match fails the run. A **cover** JPG is written next to the film
698
698
  (`<film>.jpg`) from the second `cover.at`, by default the middle of the first talking segment; `"cover": false`
@@ -870,8 +870,10 @@ const result = await renderFootageFilm(film, {
870
870
  | `quality: "draft", crf: 18` | 393 s | 6.9 s | 173 MB |
871
871
 
872
872
  Against `medium` CRF 18 the fast film scores PSNR 44.3 dB and SSIM 0.99; it is about twice as big (24 Mbit/s),
873
- far under the platforms' upload limits, and they encode it again. The final pass copies the picture, so nothing
874
- else changes.
873
+ far under the platforms' upload limits, and they encode it again. `ultrafast` writes H.264 Constrained Baseline,
874
+ which the final pass copies like High (#1051), so the whole run gains the encoder's time: in the issue's run
875
+ `renderFootage` took 858 s with the fast tier when that pass still re-encoded the picture at `medium` (about 320 s),
876
+ against 835 s for `standard`; with the copy the fast run takes about 540 s.
875
877
 
876
878
  **Container recipe.** [`docker/footage-worker.Dockerfile`](docker/footage-worker.Dockerfile) is a worker base image:
877
879
  `node:22-trixie-slim`, Debian's ffmpeg 7.1 (libzimg, so `zscale` and `tonemap`, and the HEVC decoder), the libraries and
@@ -893,25 +895,40 @@ CMD ["node", "dist/worker.js"]
893
895
 
894
896
  `renderFootageDraft` makes a free draft of a cut film with ffmpeg alone (no hyperframes, no browser), so an app can
895
897
  show the owner what the paid render will look like in seconds instead of minutes: the cut at a small width (540×960
896
- for 9:16 by default), the film's captions burned in as plain phrases (placed like the render's, the caption preset
897
- included), zoom cuts, cross-fades and Ken Burns b-roll as the render draws them, and the speech track. No loudness
898
- pass, music, end card or cover. It takes the same clips, transcript and EDL as `renderFootage` and spends nothing:
898
+ for 9:16 by default), the film's captions burned in (placed like the render's, the caption preset included), zoom
899
+ cuts, cross-fades and Ken Burns b-roll as the render draws them, the speech track and the film's music when it costs
900
+ nothing. It takes the same clips, transcript and EDL as `renderFootage` and spends nothing:
899
901
 
900
902
  ```ts
901
903
  import { checkFootageTools, cutFootage, prepareFootage, renderFootageDraft, transcribeFootage } from "@softure-ai/marketing-kit";
902
904
 
903
905
  const problems = await checkFootageTools({ needsRender: false, needsDraft: true }); // ass (libass + libfreetype), xfade, zoompan
904
- const draft = await renderFootageDraft(film, clips, transcript, edl, { buildDir, output: "draft.mp4", width: 540, log, signal: job.signal, onProgress });
905
- // draft.value: { output, seconds, width, height, bytes }: H.264 yuv420p and AAC with fast start, exactly the cut's length
906
+ const draft = await renderFootageDraft(film, clips, transcript, edl, { buildDir, output: "draft.mp4", width: 540, brand, cacheDir, providers, log, signal: job.signal, onProgress });
907
+ // draft.value: { output, music, captionFont, seconds, width, height, bytes }: H.264 yuv420p and AAC with fast start, exactly the cut's length
906
908
  ```
907
909
 
908
- - A prototype-sized check: a 4.5 s 9:16 cut with a fade, a zoom cut, Ken Burns and captions drafts in about a second on
909
- 4 cores; the work grows with the film's length, not with a browser capture.
910
- - The captions are drawn with DejaVu Sans Bold subset to Latin with every Polish letter, shipped in
911
- [`fonts/`](fonts/README.md) (`FOOTAGE_DRAFT_FONT`); a highlight-style film is drafted with plain phrases.
910
+ What the draft matches and what it leaves out:
911
+
912
+ - **Captions follow `captionStyle`.** `phrase`: the render's phrases in white with a dark outline and shadow.
913
+ `highlight`: the render's chunks of up to four words on an opaque box of the brand's `captionBackground` (its alpha
914
+ kept), in `captionText`, each word in `captionHighlight` for the 0.32 s the render lights it. libass draws a square
915
+ box per line: no rounded corners, no drop shadow, no pop-in, and the colour switches instead of fading back.
916
+ - **The brand's body font** (`brand`, the value `renderFootage` takes): the TrueType or OpenType file of
917
+ `brand.fonts.body` closest to the captions' weight (650, normal style first) is copied to the draft's `fonts/`
918
+ and named by the family the file itself declares (libass matches that, not the CSS family). A body font shipped only
919
+ as WOFF or WOFF2, or no `brand`, draws in DejaVu Sans Bold subset to Latin with every Polish letter, shipped in
920
+ [`fonts/`](fonts/README.md) (`FOOTAGE_DRAFT_FONT`), and the log says so. Without `brand` a highlight film uses
921
+ `FOOTAGE_DRAFT_CAPTION_COLORS`. `captionMaxLines` is not applied: the draft wraps at the caption box.
922
+ - **Music without spending** (`cacheDir`, `providers`, as `renderFootage` takes them): a `file` source plays as is;
923
+ a `prompt` or `video` source plays only when its paid cache entry exists (`findFootageMusic`, the render's lookup).
924
+ It is ducked under the speech, looped and faded to the cut's length exactly as in the render. No provider is ever
925
+ called: music that is not cached yet (or a draft without `cacheDir` and `providers`) gives a draft without music,
926
+ `music: "not_cached"` in the result and a log line; `"none"` when the film has none, `"played"` otherwise.
927
+ - **Left out:** the loudness pass (speech and music are mixed as they are), the end card, the cover and the sound
928
+ effects (whoosh, pop).
912
929
  - `buildFootageDraftArgs`, `buildFootageDraftCaptions` (an ASS file) and `planFootageDraft` are the pure builders, for an
913
930
  app that runs ffmpeg its own way. ffmpeg runs in `<buildDir>/draft/`, so the captions and font paths are relative.
914
- - `onProgress` reports the stage `draft` (the speech track, then the film).
931
+ - `onProgress` reports the stage `draft` (the speech track, the music track when it plays, then the film).
915
932
  - `threads` sets ffmpeg's threads for every segment's decoder, the filter graph and the encoder. ffmpeg otherwise
916
933
  follows the host's cores, not a container's CPU quota, and the draft opens one decoder per segment: pass the
917
934
  worker's CPU limit (`threads: 1` on a 1-CPU worker), as with `normalize.threads`. The extra threads buy no speed
@@ -98,7 +98,7 @@ export async function runFootage(config, options) {
98
98
  return;
99
99
  const { output, seconds, bytes, width, height, durationSeconds, cover } = rendered.value;
100
100
  console.log(`\n✓ ${output} (${seconds.toFixed(1)} s, ${film.format})`);
101
- console.log(` ${width}×${height}, ${durationSeconds.toFixed(2)} s, ${(bytes / 1_000_000).toFixed(1)} MB, H.264 High, AAC 48 kHz stereo, fast start`);
101
+ console.log(` ${width}×${height}, ${durationSeconds.toFixed(2)} s, ${(bytes / 1_000_000).toFixed(1)} MB, H.264, AAC 48 kHz stereo, fast start`);
102
102
  if (cover !== null)
103
103
  console.log(`✓ ${cover}: cover`);
104
104
  const posts = writeFootagePosts(config, film);
@@ -1 +1 @@
1
- {"version":3,"file":"footage.js","sourceRoot":"","sources":["../../src/cli/footage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,kBAAkB,EAA4C,MAAM,qBAAqB,CAAC;AACzI,OAAO,EAAE,gCAAgC,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,UAAU,EAAE,mBAAmB,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,iBAAiB,EAA6B,MAAM,wBAAw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C,CAAC;IACpF,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO;IAC9C,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,OAAO,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACvE,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,IAAI,MAAM,KAAK,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,2CAA2C,CAAC,CAAC;IACjJ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;IACrD,MAAM,KAAK,GAAG,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,gDAAgD,IAAI,CAAC,EAAE,QAAQ,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,KAAK,aAAa,CAAC,CAAC;AACxI,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { BrandFont } from "../config/config.js";
2
+ import { type TtsResult } from "../voice/provider.js";
3
+ /**
4
+ * The family a TrueType or OpenType file names itself (name ID 1): the Windows Unicode record first, US English
5
+ * first among those, else the Macintosh Roman one. An error value for WOFF, WOFF2, a collection or a broken file.
6
+ */
7
+ export declare function readFontFamilyName(data: Buffer): TtsResult<string>;
8
+ /** The font file the draft draws captions with, and the family libass knows it by. */
9
+ export interface FootageDraftFontChoice {
10
+ file: string;
11
+ family: string;
12
+ }
13
+ /**
14
+ * The body font's file closest to the render's caption weight (normal style first) that libass can read, with its own
15
+ * family name; null when the brand has no body font or none of its files is a readable TrueType or OpenType font.
16
+ */
17
+ export declare function chooseFootageDraftFont(font: BrandFont | null, read?: (path: string) => Buffer): FootageDraftFontChoice | null;
18
+ //# sourceMappingURL=draft-font.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-font.d.ts","sourceRoot":"","sources":["../../src/footage/draft-font.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAY,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AA2C/D;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAyBlE;AAWD,sFAAsF;AACtF,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,EAAE,IAAI,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAqB,GAAG,sBAAsB,GAAG,IAAI,CAQ3I"}
@@ -0,0 +1,105 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { err, ok } from "../voice/provider.js";
3
+ /**
4
+ * The font file a footage draft's captions are drawn with. libass (ffmpeg's `ass` filter) loads the files in the
5
+ * draft's `fonts/` folder and matches a style's font name against the family each file names in its own `name` table,
6
+ * not against the CSS family a brand config gives it, so the draft reads that name from the file. FreeType reads
7
+ * TrueType and OpenType files; a brand font shipped only as WOFF or WOFF2 is not used.
8
+ */
9
+ const SFNT_SIGNATURES = new Set([0x00010000, 0x74727565 /* true */, 0x4f54544f /* OTTO */]);
10
+ const NAME_TAG = 0x6e616d65; // name
11
+ const FAMILY_NAME_ID = 1;
12
+ /** The caption weight of the render's CSS (`getCaptionPillCss`, `.phrase`). */
13
+ const CAPTION_WEIGHT = 650;
14
+ class OutOfBounds extends Error {
15
+ }
16
+ function readUint16(data, offset) {
17
+ if (offset < 0 || offset + 2 > data.length)
18
+ throw new OutOfBounds();
19
+ return data.readUInt16BE(offset);
20
+ }
21
+ function readUint32(data, offset) {
22
+ if (offset < 0 || offset + 4 > data.length)
23
+ throw new OutOfBounds();
24
+ return data.readUInt32BE(offset);
25
+ }
26
+ function decodeName(bytes, platform) {
27
+ if (platform === 1)
28
+ return bytes.toString("latin1");
29
+ let text = "";
30
+ for (let index = 0; index + 1 < bytes.length; index += 2)
31
+ text += String.fromCharCode(bytes.readUInt16BE(index));
32
+ return text;
33
+ }
34
+ function findNameTable(data) {
35
+ const count = readUint16(data, 4);
36
+ for (let index = 0; index < count; index++) {
37
+ const record = 12 + index * 16;
38
+ if (readUint32(data, record) === NAME_TAG)
39
+ return readUint32(data, record + 8);
40
+ }
41
+ return null;
42
+ }
43
+ /**
44
+ * The family a TrueType or OpenType file names itself (name ID 1): the Windows Unicode record first, US English
45
+ * first among those, else the Macintosh Roman one. An error value for WOFF, WOFF2, a collection or a broken file.
46
+ */
47
+ export function readFontFamilyName(data) {
48
+ try {
49
+ if (!SFNT_SIGNATURES.has(readUint32(data, 0)))
50
+ return err("the file is not a TrueType or OpenType font");
51
+ const table = findNameTable(data);
52
+ if (table === null)
53
+ return err("the font has no name table");
54
+ const count = readUint16(data, table + 2);
55
+ const strings = table + readUint16(data, table + 4);
56
+ let best = null;
57
+ for (let index = 0; index < count; index++) {
58
+ const record = table + 6 + index * 12;
59
+ const platform = readUint16(data, record);
60
+ const language = readUint16(data, record + 4);
61
+ if (readUint16(data, record + 6) !== FAMILY_NAME_ID || (platform !== 3 && platform !== 1))
62
+ continue;
63
+ const length = readUint16(data, record + 8);
64
+ const start = strings + readUint16(data, record + 10);
65
+ if (start + length > data.length)
66
+ throw new OutOfBounds();
67
+ const rank = platform === 3 ? (language === 0x0409 ? 0 : 1) : 2;
68
+ const name = decodeName(data.subarray(start, start + length), platform).trim();
69
+ if (name.length > 0 && (best === null || rank < best.rank))
70
+ best = { rank, name };
71
+ }
72
+ return best === null ? err("the font names no family") : ok(best.name);
73
+ }
74
+ catch (error) {
75
+ if (error instanceof OutOfBounds)
76
+ return err("the font file is cut short");
77
+ throw error;
78
+ }
79
+ }
80
+ /** How far a file's weight (`400`, or a variable range `100 900`) is from the caption weight; 0 inside a range. */
81
+ function getWeightDistance(file) {
82
+ const [low, high] = file.weight.split(/\s+/).map(Number);
83
+ if (low === undefined || Number.isNaN(low))
84
+ return Number.POSITIVE_INFINITY;
85
+ const top = high === undefined || Number.isNaN(high) ? low : high;
86
+ if (CAPTION_WEIGHT >= low && CAPTION_WEIGHT <= top)
87
+ return 0;
88
+ return Math.min(Math.abs(CAPTION_WEIGHT - low), Math.abs(CAPTION_WEIGHT - top));
89
+ }
90
+ /**
91
+ * The body font's file closest to the render's caption weight (normal style first) that libass can read, with its own
92
+ * family name; null when the brand has no body font or none of its files is a readable TrueType or OpenType font.
93
+ */
94
+ export function chooseFootageDraftFont(font, read = readFileSync) {
95
+ if (font === null)
96
+ return null;
97
+ const files = [...font.files].sort((a, b) => Number(a.style === "italic") - Number(b.style === "italic") || getWeightDistance(a) - getWeightDistance(b));
98
+ for (const file of files) {
99
+ const family = readFontFamilyName(read(file.path));
100
+ if (family.ok)
101
+ return { file: file.path, family: family.value };
102
+ }
103
+ return null;
104
+ }
105
+ //# sourceMappingURL=draft-font.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-font.js","sourceRoot":"","sources":["../../src/footage/draft-font.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,OAAO,EAAE,GAAG,EAAE,EAAE,EAAkB,MAAM,sBAAsB,CAAC;AAE/D;;;;;GAKG;AAEH,MAAM,eAAe,GAAG,IAAI,GAAG,CAA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CAAC;IAClE,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,13 +1,16 @@
1
- import type { CaptionLayout, LayoutOverride } from "../compose/timeline.js";
1
+ import { type CaptionLayout, type LayoutOverride } from "../compose/timeline.js";
2
+ import type { BrandColors } from "../config/colors.js";
2
3
  import type { TimedWord } from "../voice/voiceover.js";
3
4
  import { type Edl } from "./edl.js";
4
5
  import { type FootageFilm } from "./film.js";
5
6
  import { type Frame } from "./normalize.js";
6
- import { type FootageResult, type FootageRunOptions, type PreparedClip, type TranscribeOutcome } from "./pipeline.js";
7
+ import { type FootageBrand, type FootageResult, type FootageRunOptions, type PreparedClip, type TranscribeOutcome } from "./pipeline.js";
7
8
  /**
8
9
  * A fast draft of a footage film, ffmpeg only (no hyperframes, no browser): the cut at a small width with the film's
9
- * phrase captions burned in, its zoom cuts (eased as in the render), cross-fades and Ken Burns b-roll drawn as the full render draws them, and
10
- * the speech track. No loudness pass, music, end card or cover. What an app shows the owner before the paid render.
10
+ * captions burned in (its caption style, in the brand's body font and caption colours), its zoom cuts (eased as in the
11
+ * render), cross-fades and Ken Burns b-roll drawn as the full render draws them, the speech track and the ducked music
12
+ * when it costs nothing. No loudness pass, end card, cover or sound effects. What an app shows the owner before the paid
13
+ * render.
11
14
  */
12
15
  /** The draft's default width: 540 makes a 540×960 draft of a 9:16 film. */
13
16
  export declare const FOOTAGE_DRAFT_WIDTH = 540;
@@ -16,10 +19,23 @@ export declare const FOOTAGE_DRAFT_FONT: {
16
19
  readonly family: "DejaVu Sans";
17
20
  readonly file: string;
18
21
  };
22
+ /** The caption colours of a `highlight` draft made without a brand. */
23
+ export declare const FOOTAGE_DRAFT_CAPTION_COLORS: {
24
+ readonly captionBackground: "#111111";
25
+ readonly captionText: "#ffffff";
26
+ readonly captionHighlight: "#ffd400";
27
+ };
19
28
  /** The draft's frame: the film's frame scaled to `width`, both sides even (H.264 yuv420p needs them even). */
20
29
  export declare function getFootageDraftFrame(frame: Frame, width?: number): Frame;
30
+ /**
31
+ * A hex colour (`#rgb`, `#rgba`, `#rrggbb`, `#rrggbbaa`) as an ASS colour, `&HAABBGGRR&`-style without the closing
32
+ * `&`: ASS writes blue first and counts alpha the other way round (00 is opaque).
33
+ */
34
+ export declare function toAssColor(hex: string): string;
35
+ /** The caption colours the draft paints with (`BrandColors`). */
36
+ export type FootageDraftCaptionColors = Pick<BrandColors, "captionBackground" | "captionText" | "captionHighlight">;
21
37
  export interface FootageDraftCaptionsInput {
22
- film: Pick<FootageFilm, "captions">;
38
+ film: Pick<FootageFilm, "captions" | "captionStyle">;
23
39
  edl: Edl;
24
40
  /** The film's words in film time (`remapWords`). */
25
41
  words: TimedWord[];
@@ -27,13 +43,17 @@ export interface FootageDraftCaptionsInput {
27
43
  caption: CaptionLayout;
28
44
  /** The film's full frame; the ASS file is laid out in it and libass scales it to the draft. */
29
45
  frame: Frame;
30
- /** The font family the captions are drawn in; default `FOOTAGE_DRAFT_FONT.family`. */
46
+ /** The font family the captions are drawn in, as the font file names it; default `FOOTAGE_DRAFT_FONT.family`. */
31
47
  fontFamily?: string;
48
+ /** The `highlight` pill's colours; default `FOOTAGE_DRAFT_CAPTION_COLORS`. A `phrase` caption is white, as in the render. */
49
+ colors?: FootageDraftCaptionColors;
32
50
  }
33
51
  /**
34
- * The draft's captions as an ASS subtitle file: the film's phrases (`phraseChunks`) shown for the render's spans
35
- * (`getCaptionSpans`), white bold text with a dark outline and shadow, centred in the caption box from its top (or
36
- * from its foot, with `bottom`). Null when the film has no captions or nothing is said.
52
+ * The draft's captions as an ASS subtitle file, shown for the render's spans (`getCaptionSpans`) and centred in the
53
+ * caption box from its top (or from its foot, with `bottom`). `phrase` (the default): the film's phrases
54
+ * (`phraseChunks`), white bold text with a dark outline and shadow. `highlight`: the render's chunks of up to four
55
+ * words (`captionChunks`) on an opaque box of `captionBackground`, in `captionText`, the word being said in
56
+ * `captionHighlight`. Null when the film has no captions or nothing is said.
37
57
  */
38
58
  export declare function buildFootageDraftCaptions(input: FootageDraftCaptionsInput): string | null;
39
59
  export interface FootageDraftArgsInput {
@@ -43,6 +63,8 @@ export interface FootageDraftArgsInput {
43
63
  clips: Record<string, string>;
44
64
  /** The cut speech track (`buildSpeechArgs`). */
45
65
  speech: string;
66
+ /** The ducked music track (`buildMusicArgs`, as long as the cut), mixed under the speech; null or absent for none. */
67
+ music?: string | null;
46
68
  /** The film's full frame (the normalized clips' size). */
47
69
  frame: Frame;
48
70
  /** The draft's width; default 540. */
@@ -88,21 +110,35 @@ export declare function planFootageDraft(film: Pick<FootageFilm, "edit">, edl: E
88
110
  * speech track under it; H.264 yuv420p and AAC with fast start, exactly the cut's length.
89
111
  */
90
112
  export declare function buildFootageDraftArgs(input: FootageDraftArgsInput): string[];
91
- export interface RenderFootageDraftOptions extends Pick<FootageRunOptions, "buildDir" | "log" | "signal" | "onProgress"> {
113
+ export interface RenderFootageDraftOptions extends Pick<FootageRunOptions, "buildDir" | "log" | "signal" | "onProgress">, Partial<Pick<FootageRunOptions, "cacheDir" | "providers">> {
92
114
  /** The draft MP4. */
93
115
  output: string;
94
116
  /** The draft's width; default 540 (540×960 for a 9:16 film). */
95
117
  width?: number;
96
118
  /** A project's override of the format's caption box (`marketing.json` `layout`), as the render takes it. */
97
119
  layout?: LayoutOverride;
120
+ /**
121
+ * The brand the render takes (`renderFootage`'s `brand`): the captions are drawn in its body font (a TrueType or
122
+ * OpenType file; DejaVu Sans when it has none) and its caption colours. Without it, DejaVu Sans and
123
+ * `FOOTAGE_DRAFT_CAPTION_COLORS`.
124
+ */
125
+ brand?: {
126
+ colors: FootageDraftCaptionColors;
127
+ fonts: Pick<FootageBrand["fonts"], "body">;
128
+ };
98
129
  /**
99
130
  * ffmpeg's threads for the draft's decoders, filter graph and encoder (`buildFootageDraftArgs`); by default ffmpeg's
100
131
  * own choice, which follows the host's cores. Set it from a CPU-limited container's quota.
101
132
  */
102
133
  threads?: number;
103
134
  }
135
+ /** The draft's music: the film has none, it played (a file, or generated music from the cache), or it is not cached yet. */
136
+ export type FootageDraftMusic = "none" | "played" | "not_cached";
104
137
  export interface FootageDraft {
105
138
  output: string;
139
+ music: FootageDraftMusic;
140
+ /** The family the captions are drawn in; null without captions. */
141
+ captionFont: string | null;
106
142
  /** The draft's length: the cut's. */
107
143
  seconds: number;
108
144
  width: number;
@@ -110,8 +146,9 @@ export interface FootageDraft {
110
146
  bytes: number;
111
147
  }
112
148
  /**
113
- * Makes the draft of a cut film: the speech track, the captions file and the font in `<buildDir>/draft/`, then one
114
- * ffmpeg run (`buildFootageDraftArgs`). Spends nothing; takes the same clips, transcript and EDL as `renderFootage`.
149
+ * Makes the draft of a cut film: the speech track, the ducked music track (when it costs nothing), the captions file
150
+ * and its font in `<buildDir>/draft/`, then one ffmpeg run (`buildFootageDraftArgs`). Spends nothing: no provider is
151
+ * called; takes the same clips, transcript and EDL as `renderFootage`.
115
152
  */
116
153
  export declare function renderFootageDraft(film: FootageFilm, clips: PreparedClip[], transcript: Extract<TranscribeOutcome, {
117
154
  kind: "ready";
@@ -1 +1 @@
1
- {"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../../src/footage/draft.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EAAgD,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAClF,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAA8B,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAY,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAIhI;;;;GAIG;AAEH,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,qIAAqI;AACrI,eAA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