@softure-ai/marketing-kit 0.15.0 → 0.17.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.
Files changed (108) hide show
  1. package/CHANGELOG.md +91 -0
  2. package/README.md +138 -16
  3. package/dist/config/schema.d.ts +2 -1
  4. package/dist/config/schema.d.ts.map +1 -1
  5. package/dist/config/schema.js +7 -0
  6. package/dist/config/schema.js.map +1 -1
  7. package/dist/footage/clip-sound.d.ts +58 -0
  8. package/dist/footage/clip-sound.d.ts.map +1 -0
  9. package/dist/footage/clip-sound.js +103 -0
  10. package/dist/footage/clip-sound.js.map +1 -0
  11. package/dist/footage/declick.d.ts +1 -1
  12. package/dist/footage/declick.d.ts.map +1 -1
  13. package/dist/footage/declick.js +3 -4
  14. package/dist/footage/declick.js.map +1 -1
  15. package/dist/footage/draft.d.ts +19 -5
  16. package/dist/footage/draft.d.ts.map +1 -1
  17. package/dist/footage/draft.js +92 -22
  18. package/dist/footage/draft.js.map +1 -1
  19. package/dist/footage/elevenlabs.d.ts +5 -0
  20. package/dist/footage/elevenlabs.d.ts.map +1 -1
  21. package/dist/footage/elevenlabs.js +10 -3
  22. package/dist/footage/elevenlabs.js.map +1 -1
  23. package/dist/footage/failure.d.ts +12 -1
  24. package/dist/footage/failure.d.ts.map +1 -1
  25. package/dist/footage/failure.js +10 -1
  26. package/dist/footage/failure.js.map +1 -1
  27. package/dist/footage/fake.d.ts +10 -1
  28. package/dist/footage/fake.d.ts.map +1 -1
  29. package/dist/footage/fake.js +19 -4
  30. package/dist/footage/fake.js.map +1 -1
  31. package/dist/footage/hyperframes-capture.d.ts +30 -0
  32. package/dist/footage/hyperframes-capture.d.ts.map +1 -0
  33. package/dist/footage/hyperframes-capture.js +80 -0
  34. package/dist/footage/hyperframes-capture.js.map +1 -0
  35. package/dist/footage/isolate-ranges.d.ts +34 -6
  36. package/dist/footage/isolate-ranges.d.ts.map +1 -1
  37. package/dist/footage/isolate-ranges.js +90 -23
  38. package/dist/footage/isolate-ranges.js.map +1 -1
  39. package/dist/footage/loudness.d.ts +16 -2
  40. package/dist/footage/loudness.d.ts.map +1 -1
  41. package/dist/footage/loudness.js +10 -7
  42. package/dist/footage/loudness.js.map +1 -1
  43. package/dist/footage/paid.d.ts +12 -2
  44. package/dist/footage/paid.d.ts.map +1 -1
  45. package/dist/footage/paid.js +8 -3
  46. package/dist/footage/paid.js.map +1 -1
  47. package/dist/footage/pipeline.d.ts +14 -2
  48. package/dist/footage/pipeline.d.ts.map +1 -1
  49. package/dist/footage/pipeline.js +55 -46
  50. package/dist/footage/pipeline.js.map +1 -1
  51. package/dist/footage/providers.d.ts +5 -0
  52. package/dist/footage/providers.d.ts.map +1 -1
  53. package/dist/footage/providers.js.map +1 -1
  54. package/dist/footage/render.d.ts +1 -1
  55. package/dist/footage/render.d.ts.map +1 -1
  56. package/dist/footage/render.js +4 -3
  57. package/dist/footage/render.js.map +1 -1
  58. package/dist/footage/speech-ranges.d.ts +79 -11
  59. package/dist/footage/speech-ranges.d.ts.map +1 -1
  60. package/dist/footage/speech-ranges.js +137 -17
  61. package/dist/footage/speech-ranges.js.map +1 -1
  62. package/dist/index.d.ts +9 -6
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +8 -5
  65. package/dist/index.js.map +1 -1
  66. package/dist/og/index.d.ts +2 -0
  67. package/dist/og/index.d.ts.map +1 -1
  68. package/dist/og/index.js +2 -0
  69. package/dist/og/index.js.map +1 -1
  70. package/dist/og/photo-cover.d.ts +74 -0
  71. package/dist/og/photo-cover.d.ts.map +1 -0
  72. package/dist/og/photo-cover.js +357 -0
  73. package/dist/og/photo-cover.js.map +1 -0
  74. package/dist/og/photo.d.ts +51 -0
  75. package/dist/og/photo.d.ts.map +1 -0
  76. package/dist/og/photo.js +154 -0
  77. package/dist/og/photo.js.map +1 -0
  78. package/dist/voice/provider-failure.d.ts +41 -0
  79. package/dist/voice/provider-failure.d.ts.map +1 -0
  80. package/dist/voice/provider-failure.js +68 -0
  81. package/dist/voice/provider-failure.js.map +1 -0
  82. package/dist/voice/provider.d.ts +7 -1
  83. package/dist/voice/provider.d.ts.map +1 -1
  84. package/dist/voice/provider.js +1 -1
  85. package/dist/voice/provider.js.map +1 -1
  86. package/package.json +2 -1
  87. package/schema/marketing.schema.json +6 -0
  88. package/src/config/schema.ts +7 -0
  89. package/src/footage/clip-sound.ts +124 -0
  90. package/src/footage/declick.ts +3 -4
  91. package/src/footage/draft.ts +123 -22
  92. package/src/footage/elevenlabs.ts +11 -3
  93. package/src/footage/failure.ts +14 -1
  94. package/src/footage/fake.ts +28 -4
  95. package/src/footage/hyperframes-capture.ts +100 -0
  96. package/src/footage/isolate-ranges.ts +124 -29
  97. package/src/footage/loudness.ts +17 -8
  98. package/src/footage/paid.ts +25 -3
  99. package/src/footage/pipeline.ts +68 -47
  100. package/src/footage/providers.ts +5 -0
  101. package/src/footage/render.ts +4 -3
  102. package/src/footage/speech-ranges.ts +184 -19
  103. package/src/index.ts +49 -1
  104. package/src/og/index.ts +28 -0
  105. package/src/og/photo-cover.ts +442 -0
  106. package/src/og/photo.ts +177 -0
  107. package/src/voice/provider-failure.ts +98 -0
  108. package/src/voice/provider.ts +7 -2
package/CHANGELOG.md CHANGED
@@ -4,6 +4,97 @@ 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.17.0
8
+
9
+ - **Cached speech ranges land at the pre-gained level (#1159):** since the speech pre-gain (#1139) `isolateSpeechRanges`
10
+ lays every cleaned window over the clip's pre-gained sound, but a range cached from the un-gained sound kept its old
11
+ level, so the voice dropped by the clip's pre-gain (about 17 dB on a quiet phone clip) inside that window. Now:
12
+ - a bought range records the gain of the sound it was cut from next to its cached file
13
+ (`<path>.gain.json`, `{ "inputGainDb": <dB> }`; `getSpeechRangeGainPath`, `formatSpeechRangeGain`,
14
+ `readSpeechRangeGain`). Commit it with the cached file;
15
+ - each laid window is raised by the clip's pre-gain minus that gain. A cached range without a record is told apart by
16
+ its loudness against the same range of the clip's pre-gained sound (`getRangeInputGainDb`, `buildRangeMeasureArgs`),
17
+ so ranges bought before 0.16.0 and with 0.16.0 both land right. Cache keys are unchanged: nothing is bought again;
18
+ - each range answers the `gainDb` it was raised by (`LaidRange.gainDb` in `buildRangeLayArgs`), and
19
+ `IsolatedSpeech.speechGainDb` and `TranscribeOutcome.speechGainDb` (optional in the type, always answered) give each
20
+ clip's pre-gain in dB, so an app that lays its own cached ranges over the speech map can apply the same correction.
21
+
22
+ - **Photo cover layouts (#1163):** `renderPhotoCover` takes `layout` (`PHOTO_COVER_LAYOUTS`: `photo`,
23
+ `title-bottom`, `title-center`, `title-top`, `kicker-title`, `pill`), `kicker` (at most 40 characters, drawn by
24
+ `kicker-title` above the caption) and `tone` (`light`: light text over a dark scrim, the default; `dark`: dark text
25
+ over a light scrim). Each layout keeps its text to its part of the centre 4:5 band (the lower half, the middle third
26
+ or the upper half), measured on the drawn pixels, and refuses text that does not fit. The scrim follows the text
27
+ (from the bottom, from the top, a stripe behind a centred title); the `pill` label (at most 32 characters) sits in a
28
+ rounded box of the dark colour instead. An overlong kicker or pill label, a character the fonts cannot draw in either,
29
+ a layout without the text it needs and a text its layout does not draw are errors. Without `layout` a call draws what
30
+ it drew in 0.16.0.
31
+
32
+ ## 0.16.0
33
+
34
+ - **Provider failures carry structured details (#1141):** a failed answer of a footage provider (`TtsResult` with
35
+ `ok: false`) carries `providerFailure` next to `error`: `{ kind, status, code, message, requestId, isRetryable }`,
36
+ `kind` one of `refused` | `rate_limited` | `unavailable` | `timeout` | `connection`. The ElevenLabs speech to text,
37
+ voice isolation and music providers set it on every failed request (the HTTP status, the provider's code and
38
+ message from the body's `detail`, truncated, the `request-id` header; a missing key is `refused` with code
39
+ `missing_api_key`). `isRetryable` is true for 5xx, 408, 429, a timeout and a failed connection. Every field is safe
40
+ to log; `describeProviderFailure` gives one line. `error` keeps its sentences; `providerFailure` is optional, so a
41
+ custom provider still compiles.
42
+ - `isolateSpeechRanges` asks a range again only when its failure is retryable (a 400 `audio_too_short` is asked
43
+ once), and a `failed` outcome carries `providerFailure` (null when the provider gave none).
44
+ - `FootageFailure` gets `{ kind: "provider", provider }` for a failed speech to text, voice isolation or music call;
45
+ `isRetryableFootageFailure` follows `provider.isRetryable`. A provider that gives no details still answers
46
+ `process`. An exhaustive `switch` on `failure.kind` needs the new case.
47
+ - **A lossless, pre-gained speech chain (#1139):** quiet phone speech is no longer encoded lossily before its gain.
48
+ `transcribeFootage` (and `--placeholder`) extracts each clip's sound from its source with the normalize step's own
49
+ seek and length into `audio/<clip>.wav` (24-bit, 48 kHz stereo), pre-gained right away to about -23 LUFS with its
50
+ true peak at or under -3 dBTP (`prepareClipSounds`, `SPEECH_PRE_GAIN`; a non-talking clip takes the talking clips'
51
+ mean gain, so a b-roll's own sound keeps its relation to the speech). The Voice Isolator and speech to text get that
52
+ WAV, on the whole-clip path and in `isolateSpeechRanges` (ranges cut to WAV, laid to `audio/<clip>.ranges.wav`); the
53
+ cached cleaned voice is decoded to `audio/<clip>.isolated.wav`. The speech chain writes float WAV throughout
54
+ (`speech.raw.wav`, `speech.declicked.wav`, `speech.wav`; `getSpeechChainFiles`, the composition plays
55
+ `assets/speech.wav`), so the film's final AAC is the only lossy encode. `buildSpeechArgs`, `buildLoudnessArgs`,
56
+ `buildRangeLayArgs`, `buildRangeAudioArgs`, `buildAudioArgs` and the declick encode pick the codec by the output's
57
+ extension (`getAudioCodecArgs`: `.wav` lossless, `.flac`, else MP3), so an app's own `.mp3` names still work. The
58
+ speech map now points at those WAVs instead of the normalized clips. Cache keys are unchanged: nothing is bought
59
+ again, and a cleaned voice bought earlier (from the un-gained sound) is reused as it is.
60
+ - **`mixLoudness.audioBitrateKbps`** (192 to 512, default 192): the finished sound's AAC bitrate; `buildMixArgs` takes
61
+ `bitrateKbps`.
62
+ - **The footage draft plays at the render's loudness (#1143):** `renderFootageDraft` runs the render's sound chain:
63
+ the speech track's loudness pass (`loudness`) after its cut and declick, then the render's mix stage over speech and
64
+ music (`mixLoudness`, its `attempts`, `warnTolerance` and true peak ceiling), whose AAC is copied into the draft. A
65
+ draft of quiet speech (about -40 LUFS at the source) no longer plays near -32 LUFS against the render's -14.
66
+ `FootageDraft` gains `loudness` (as measured, `warning` on a near miss) and `mix` (what the stage did); a mix that
67
+ misses its target fails the draft with `{ kind: "loudness" }`, as it fails the render. `onProgress` reports the
68
+ items `loudness` and `mix`. `buildFootageDraftArgs` takes `mix` (an encoded mix to copy). The draft's speech files
69
+ take the render's names (`getSpeechChainFiles`).
70
+ - **Speech ranges reach the Voice Isolator's minimum input (#1140):** a range shorter than the provider accepts is no
71
+ longer sent, refused three times and left uncleaned.
72
+ - `IsolationProvider.minSeconds`: the shortest input the provider accepts; the ElevenLabs provider declares 4.6 s
73
+ (`ELEVENLABS_ISOLATION_MIN_SECONDS`).
74
+ - `planSpeechRanges` plans source ranges: ranges of a clip at most `mergeGap` seconds apart (default 2) are merged
75
+ into one; with `minSeconds`, a range still shorter is widened symmetrically with the clip's own context to the
76
+ minimum plus `minPad` (default 0.4 s), and `range.heard` keeps the part the cut hears, which is all that is laid.
77
+ A range that cannot reach the minimum is marked `skip` and never sent (`outcome: { kind: "skipped" }`).
78
+ - `isolateSpeechRanges`, `estimateSpeechRanges` and `estimateFootageFilm` (`isolate: "segments"`) plan with the
79
+ provider's minimum and take `mergeGap` and `minPad`; the estimate prices exactly the ranges sent and marks a
80
+ skipped one (`skipped`, at 0).
81
+ - A range refused on every attempt leaves no cut file under `<buildDir>/audio/ranges/`.
82
+ - `createFakeIsolationProvider({ minSeconds })` refuses a shorter input with `audio_too_short`.
83
+ - **Cache keys:** merged and widened ranges are new ranges, so ranges an app has already paid for per segment are
84
+ not found again. Pass `mergeGap: null` to keep the per-segment ranges (short ones are still widened when the
85
+ provider declares a minimum).
86
+ - **`renderFootage` reports how hyperframes captured the frames (#1145):** the rendered value carries `capture`
87
+ (`{ path, gpu, seconds, isEncodeStreamed, fallbackHint }`, null when hyperframes printed no summary), read from
88
+ hyperframes' summary line, so an app can log or alert on a render that took the slower screenshot path.
89
+ `readHyperframesCapture(lines)` parses hyperframes' output on its own. The README's "Footage films in a worker"
90
+ says that `lowMemory: true` pins screenshot capture (about 30 % slower on one CPU). Code that builds a
91
+ `RenderedFootage` itself now needs `capture`.
92
+ - **A video cover from a photo (#1137):** `renderPhotoCover({ photo, size, focus, caption, colors, fonts, quality })`
93
+ draws a vertical video cover (1080×1920 by default) from a JPEG or PNG (path or bytes): scaled to cover and cropped
94
+ around `focus`, EXIF orientation applied, with an optional caption in the brand's heading font over a soft scrim,
95
+ kept in the lower half of the centre 4:5 band (`getCoverBand`). An overlong caption and a missing glyph are errors.
96
+ Returns `{ jpeg, width, height, bytes }`. New dependency: `jpeg-js` (pure JavaScript JPEG encoder).
97
+
7
98
  ## 0.15.0
8
99
 
9
100
  - **The footage film's mix is bounded:** `buildFilmMixArgs` pads to the film's length (`apad=whole_dur`), trims and
package/README.md CHANGED
@@ -716,6 +716,14 @@ softure-marketing footage <film> --step=render # the EDL as it is, maybe e
716
716
  track without words is not gated. The log and the result's `declick` (`{ level, impulses, gateDb }`, null when
717
717
  off) carry the count. `"off"` (the default) runs no extra pass: the speech track is unchanged. ffmpeg's `adeclick`
718
718
  misses these clicks, which sit well below the speech peaks.
719
+ - **A lossless speech chain (issue #1139):** each clip's sound is read from its source (with the clip's trim) into
720
+ `audio/<clip>.wav`, 24-bit 48 kHz stereo, and pre-gained right away by one linear gain to about −23 LUFS, its true
721
+ peak kept at or under −3 dBTP (`SPEECH_PRE_GAIN`); a b-roll or other non-talking clip takes the mean gain of the
722
+ talking clips, so its own sound under the speech keeps its level against it. The voice isolator and speech to text
723
+ hear that WAV; the cleaned voice the provider answers is decoded to `audio/<clip>.isolated.wav`. Every stage after
724
+ it (`assets/speech.raw.wav`, `speech.declicked.wav`, `speech.wav`) is float WAV, so quiet speech is never encoded
725
+ lossily at its quiet level and the film's final AAC (`mixLoudness.audioBitrateKbps`, 192 to 512 kbps, default 192,
726
+ 48 kHz) is the only lossy encode.
719
727
  - **Publishable output:** the speech track is measured and normalized to `loudness` (default −14 LUFS integrated,
720
728
  −1 dBTP true peak; two-pass `loudnorm`, one linear gain) before the music goes under it, so a quiet phone clip is
721
729
  not left quiet and a loud one does not clip; `"loudness": false` leaves it as filmed. **Before hyperframes renders a
@@ -781,8 +789,10 @@ A failed result is `{ ok: false, error, failure }`: `error` is the sentence for
781
789
  on. `loudness` (the mix or the finished film misses `mixLoudness`; `failure.loudness` is the last
782
790
  `{ integrated, truePeak }`, null for a mix silent after its limiter), `publishable` (`failure.problems`: container,
783
791
  profile, fast start) and `input` (the film, its EDL, fonts, files or settings) fail the same way again;
784
- `process` (a process that exited, the network, the disk) may not. `isRetryableFootageFailure(failure)` says which,
785
- so an admin panel offers "render again" only where it can help:
792
+ `process` (a process that exited, the network, the disk) may not. A paid provider's failure (speech to text, voice
793
+ isolation, music) is `provider`, with the provider's structured `failure.provider` (below), retryable only when the
794
+ provider says so. `isRetryableFootageFailure(failure)` says which, so an admin panel offers "render again" only where
795
+ it can help:
786
796
 
787
797
  ```ts
788
798
  if (!result.ok) showError(result.error, { canRetry: isRetryableFootageFailure(result.failure) });
@@ -790,6 +800,23 @@ if (!result.ok) showError(result.error, { canRetry: isRetryableFootageFailure(re
790
800
 
791
801
  A failed ffmpeg step throws and an abort rejects with the signal's reason, as before; treat a throw as transient.
792
802
 
803
+ A provider's failed answer (`TtsResult` with `ok: false`) carries, next to its `error` sentence, `providerFailure`
804
+ whenever the provider answered or the kit refused before asking (the ElevenLabs providers always set it on a failed
805
+ request; a custom provider may leave it out):
806
+
807
+ ```ts
808
+ type ProviderFailure = {
809
+ kind: "refused" | "rate_limited" | "unavailable" | "timeout" | "connection";
810
+ status: number | null; // HTTP status; null without an answer
811
+ code: string | null; // the provider's error code, e.g. "audio_too_short"; "missing_api_key" without a key
812
+ message: string | null; // the provider's message, at most 300 characters
813
+ requestId: string | null; // the `request-id` / `x-request-id` header, or the body's request_id
814
+ isRetryable: boolean; // 5xx, 408, 429, a timeout, a failed connection
815
+ };
816
+ ```
817
+
818
+ Every field is safe to log: no key, path, transcript or audio. `describeProviderFailure(failure)` gives it in one line.
819
+
793
820
  **Editing with an agent.** The kit holds no language model; the editorial choices stay with the caller, who gets
794
821
  the means to make them:
795
822
 
@@ -859,23 +886,44 @@ await renderFootage(film, clips, { ...transcript, speech: isolated.value.speech
859
886
 
860
887
  - The ranges are every segment's sound span (and the picture clip's own span when `audio.ownVolume` keeps it under)
861
888
  widened by `margin` (default 0.25 s, so a cut's cross-fade reads cleaned sound), clamped to the clip, in whole
862
- milliseconds. Ranges are not merged: identical ranges and ranges inside another are dropped, the rest stay apart.
889
+ milliseconds. Identical ranges and ranges inside another are dropped, and ranges of a clip at most `mergeGap`
890
+ seconds apart (default 2; `null` keeps them apart, `Infinity` isolates each clip's whole used span once) are sent as
891
+ one range: they are source ranges, not cut segments.
892
+ - The isolation provider names the shortest input it accepts (`IsolationProvider.minSeconds`; 4.6 s for the
893
+ ElevenLabs Voice Isolator, `ELEVENLABS_ISOLATION_MIN_SECONDS`). A range still shorter is widened symmetrically with
894
+ the clip's own context to the minimum plus `minPad` (default 0.4 s), inside the clip, and only the part the cut hears
895
+ (`range.heard`) is laid back. A range that cannot reach the minimum (a clip shorter than it) is never sent: it is
896
+ marked `skip: { reason: "too_short", minSeconds }`, answered with outcome `skipped`, keeps the clip's own sound and
897
+ is priced at 0 with `skipped` in the estimate. A provider without `minSeconds` gets every range as it is.
863
898
  - Each range is cached as `<cacheDir>/<film>/<key>.isolated.mp3`, keyed by the clip's bytes and trim, the range and the
864
899
  provider: an unchanged segment is never paid twice and a changed cut pays only its new ranges. `onCharge` reports
865
900
  each with step `isolate`, the clip id as `item` (or `chargeItem(range)`, e.g. the app's segment id, for one ledger
866
901
  entry per range) and its `range` in seconds. An app that already holds paid ranges under its own keys passes
867
902
  `rangeCache: (range, clipKey) => ({ key, path })` to both the block and the estimate.
868
903
  - A range the provider refuses is asked again (`retry: { attempts, delaysMs, wait }`, default 3 attempts after 1 s and
869
- 2 s, the wait stopped by `signal`). A range refused on every attempt does not fail the call: its window keeps the
870
- clip's own sound, the other ranges are laid, and only a cancel throws. Each range carries an `outcome`: `cached`,
871
- `bought` (with `attempts`), `failed` (with the last `error` and `attempts`) or `not_bought` (without `isCommit`).
872
- - Each clip's cleaned windows are laid over its own sound into `<buildDir>/audio/<clip>.ranges.mp3`, as long as the
904
+ 2 s, the wait stopped by `signal`), unless its `providerFailure` says `isRetryable: false` (a 400 `audio_too_short`
905
+ fails the same way every time, so it is asked once). A range refused on every attempt does not fail the call: its
906
+ window keeps the clip's own sound, the other ranges are laid, and only a cancel throws; its cut file under
907
+ `<buildDir>/audio/ranges/` is removed. Each range carries an `outcome`: `cached`, `bought` (with `attempts`), `failed`
908
+ (with the last `error`, `attempts` and `providerFailure`, null when the provider gave none), `skipped` (too short for
909
+ the provider) or `not_bought` (without `isCommit`).
910
+ - Each range is cut for the isolator from the clip's lossless, pre-gained sound (`<buildDir>/audio/<clip>.wav`, as
911
+ the speech chain reads it) as WAV, and the gain it was cut at is recorded next to its cached file
912
+ (`<path>.gain.json`, `getSpeechRangeGainPath`; commit it with the file). Every window lands at the level of the
913
+ clip's pre-gained sound (#1159): a range cached before the pre-gain (#1139) was cleaned from the un-gained sound, so
914
+ it is raised by the clip's pre-gain. A range without a record is told apart by its loudness against the same range
915
+ of the clip's sound (`getRangeInputGainDb`: nearer to the clip's gain under it means un-gained). Each range answers
916
+ the `gainDb` it was raised by, and the outcome answers `speechGainDb`, each clip's pre-gain, as `transcribeFootage`
917
+ does: an app that lays its own cached ranges over the speech map raises one cut from the un-gained sound by it.
918
+ - Each clip's cleaned windows are laid over its lossless sound into `<buildDir>/audio/<clip>.ranges.wav`, as long as the
873
919
  clip; overlapping ranges switch at the middle of their overlap, and a mono answer goes to both channels at full level.
874
920
  Every join is a linear crossfade of `fadeMs` (default 15; 0 switches at once): centred on a switch between two
875
921
  ranges, inside the window at a range's own edge, the clip's sound under one minus the windows' gains.
876
922
  - Without `isCommit` only cached ranges are laid (a free draft); `ranges` says which are `cached` and `laid`.
877
- - `estimateFootageFilm(film, { …, isolate: "segments", margin })` prices isolation on those ranges instead of whole
878
- clips; both estimates need the cut (`edl`, or `edl.json` in `buildDir`).
923
+ - `estimateFootageFilm(film, { …, isolate: "segments", margin, mergeGap, minPad })` prices isolation on exactly the
924
+ ranges the block will send instead of whole clips; both estimates need the cut (`edl`, or `edl.json` in `buildDir`).
925
+ - `createFakeIsolationProvider({ minSeconds })` declares a minimum and refuses a shorter input with
926
+ `audio_too_short` (its `refused` lists them), for tests of an app's own flow.
879
927
 
880
928
  ### Footage films in a worker
881
929
 
@@ -978,6 +1026,25 @@ const result = await renderFootageFilm(film, {
978
1026
  hyperframes' `--workers` and `--low-memory-mode` / `--no-low-memory-mode` (by default hyperframes turns its
979
1027
  low-memory profile on by itself at 8 GB or less, reading a cgroup v2 limit).
980
1028
 
1029
+ - **Capture path.** hyperframes' low-memory profile (`lowMemory: true`, or its own default at 8 GB or less) pins
1030
+ screenshot capture, the slower path; Chrome's heap cap, GPU budget and frame caches follow the cgroup limit
1031
+ regardless. Measured on one CPU under a 1536 MiB cgroup (chrome-headless-shell, software GL), a 37.1 s film of 15
1032
+ segments captured in 156.4 s with `lowMemory: true` (screenshot) against 110.3 s with `lowMemory: false`
1033
+ (beginframe), about 30 % slower, at a memory peak of 598 MB against 608 MB. The rendered value's `capture` says
1034
+ which path a render took (#1145), read from hyperframes' summary line; log or alert on it:
1035
+
1036
+ ```ts
1037
+ if (result.ok && result.value.kind === "rendered" && result.value.capture?.path === "screenshot") {
1038
+ logger.warn("footage captured on the screenshot path", { seconds: result.value.capture.seconds, hint: result.value.capture.fallbackHint });
1039
+ }
1040
+ ```
1041
+
1042
+ `capture` is `{ path, gpu, seconds, isEncodeStreamed, fallbackHint }`: `path` `beginframe`, `screenshot` or
1043
+ `drawelement`; `gpu` `software` or `hardware`; `seconds` per stage hyperframes printed (`compile`, `extract`,
1044
+ `audio`, `probe`, `setup`, `capture`, `encode`, `assemble`); `isEncodeStreamed` when the encode ran during the
1045
+ capture; `fallbackHint` hyperframes' `Screenshot capture (slower): …` line. It is null when hyperframes printed no
1046
+ summary. `readHyperframesCapture(lines)` is the parser on its own.
1047
+
981
1048
  - **Encoder speed.** hyperframes encodes while it captures, with libx264 at the quality tier's preset and CRF:
982
1049
  `draft` `ultrafast` CRF 28, `standard` `medium` CRF 18, `high` `slow` CRF 15. On one CPU the `medium` encode
983
1050
  shares the core with Chrome and takes about half the capture. `crf` (a whole number from 0 to 51) passes
@@ -1032,15 +1099,15 @@ CMD ["node", "dist/worker.js"]
1032
1099
  `renderFootageDraft` makes a free draft of a cut film with ffmpeg alone (no hyperframes, no browser), so an app can
1033
1100
  show the owner what the paid render will look like in seconds instead of minutes: the cut at a small width (540×960
1034
1101
  for 9:16 by default), the film's captions burned in (placed like the render's, the caption preset included), zoom
1035
- cuts, cross-fades and Ken Burns b-roll as the render draws them, the speech track and the film's music when it costs
1036
- nothing. It takes the same clips, transcript and EDL as `renderFootage` and spends nothing:
1102
+ cuts, cross-fades and Ken Burns b-roll as the render draws them, and the render's sound: the speech track's stages,
1103
+ the film's music when it costs nothing, and the mix brought to the film's loudness target. It takes the same clips, transcript and EDL as `renderFootage` and spends nothing:
1037
1104
 
1038
1105
  ```ts
1039
1106
  import { checkFootageTools, cutFootage, prepareFootage, renderFootageDraft, transcribeFootage } from "@softure-ai/marketing-kit";
1040
1107
 
1041
1108
  const problems = await checkFootageTools({ needsRender: false, needsDraft: true }); // ass (libass + libfreetype), xfade, zoompan
1042
1109
  const draft = await renderFootageDraft(film, clips, transcript, edl, { buildDir, output: "draft.mp4", width: 540, brand, cacheDir, providers, log, signal: job.signal, onProgress });
1043
- // draft.value: { output, music, captionFont, seconds, width, height, bytes }: H.264 yuv420p and AAC with fast start, exactly the cut's length
1110
+ // draft.value: { output, music, captionFont, seconds, width, height, bytes, declick, loudness, mix }: H.264 yuv420p and AAC with fast start, exactly the cut's length
1044
1111
  ```
1045
1112
 
1046
1113
  What the draft matches and what it leaves out:
@@ -1060,12 +1127,18 @@ What the draft matches and what it leaves out:
1060
1127
  It is ducked under the speech, looped and faded to the cut's length exactly as in the render. No provider is ever
1061
1128
  called: music that is not cached yet (or a draft without `cacheDir` and `providers`) gives a draft without music,
1062
1129
  `music: "not_cached"` in the result and a log line; `"none"` when the film has none, `"played"` otherwise.
1063
- - **Left out:** the loudness pass (speech and music are mixed as they are), the end card, the cover and the sound
1064
- effects (whoosh, pop).
1130
+ - **The render's sound chain:** the speech is cut, declicked and brought to `loudness` with the render's functions and
1131
+ file names (`getSpeechChainFiles`), the music is ducked under it, and the mix goes through the render's mix stage
1132
+ (`mixFootage`: `mixLoudness` with its `attempts`, `warnTolerance` and true peak ceiling). The stage's AAC is copied
1133
+ into the draft, not encoded again, so the draft plays at the render's loudness: quiet speech from a clip-on mic no
1134
+ longer drafts 18 dB under the film. The draft answers as the render does: `loudness` (`integrated`, `truePeak`,
1135
+ `warning` on a near miss) and `mix` (what the stage did); a mix that misses its target fails with
1136
+ `{ kind: "loudness" }`. `loudness: null` and `mixLoudness: null` skip those stages as in the render.
1137
+ - **Left out:** the end card, the cover and the sound effects (whoosh, pop); the mix has speech and music only.
1065
1138
  - `buildFootageDraftArgs`, `buildFootageDraftCaptions` (an ASS file) and `planFootageDraft` are the pure builders, for an
1066
1139
  app that runs ffmpeg its own way. ffmpeg runs in `<buildDir>/draft/`, so the captions and font paths are relative.
1067
- - `onProgress` reports the stage `draft` (the speech track, its declick when the film sets one, the music track when it
1068
- plays, then the film).
1140
+ - `onProgress` reports the stage `draft` (the speech track, its declick when the film sets one, its loudness pass, the
1141
+ music track when it plays, the mix, then the film).
1069
1142
  - `threads` sets ffmpeg's threads for every segment's decoder, the filter graph and the encoder. ffmpeg otherwise
1070
1143
  follows the host's cores, not a container's CPU quota, and the draft opens one decoder per segment: pass the
1071
1144
  worker's CPU limit (`threads: 1` on a 1-CPU worker), as with `normalize.threads`. The extra threads buy no speed
@@ -1144,6 +1217,54 @@ export default async function Image(): Promise<Response> {
1144
1217
  renders without a `marketing.json` at all. For a carousel, pass `slide` (1-based) to either function;
1145
1218
  `countOgSlides(template, data)` says how many there are.
1146
1219
 
1220
+ ### A video cover from a photo
1221
+
1222
+ `renderPhotoCover` (from `@softure-ai/marketing-kit/og` or the root) draws a Reels, Shorts or TikTok cover from a
1223
+ photo the owner picks, instead of a frame of the film:
1224
+
1225
+ ```ts
1226
+ import { loadOgFonts, renderPhotoCover } from "@softure-ai/marketing-kit/og";
1227
+
1228
+ const fonts = loadOgFonts(config.brand.fonts);
1229
+ if (!fonts.ok) throw new Error(fonts.error);
1230
+ const cover = await renderPhotoCover({
1231
+ photo: "covers/street.jpg", // a JPEG or PNG path, or its bytes
1232
+ focus: { x: 0.5, y: 0.35 }, // optional, the centre by default
1233
+ caption: "Stop working at 49", // optional
1234
+ colors: config.brand.colors,
1235
+ fonts: fonts.value,
1236
+ });
1237
+ if (!cover.ok) throw new Error(cover.error);
1238
+ // cover.value: { jpeg, width: 1080, height: 1920, bytes }
1239
+ ```
1240
+
1241
+ - The photo is scaled to cover `size` (1080×1920 by default) and cropped so the `focus` point (fractions of the
1242
+ upright photo's width and height) sits as near the centre as the photo allows. EXIF orientation (JPEG `APP1`, PNG
1243
+ `eXIf`) is applied first.
1244
+ - The text is set in the brand's heading font (the loaded weight nearest 700), centred, in the lighter of the brand's
1245
+ `foreground` and `background`, with a soft shadow and a gradient scrim of the darker one behind it. `tone: "dark"`
1246
+ swaps them (dark text over a light scrim); `tone: "light"` is the default. The text keeps to its part of the centre
1247
+ 4:5 band (1080×1350 of 1080×1920; `getCoverBand(size)`), which the platforms keep when they crop the cover for the
1248
+ profile grid; a long caption wraps. A caption over 80 characters, a kicker over 40, a pill label over 32, text whose
1249
+ drawn pixels reach outside its part of the band (measured on the pixels, so it holds for any font) and a character
1250
+ the fonts cannot draw are errors, never drawn or clipped.
1251
+ - `layout` picks where the text goes (`PHOTO_COVER_LAYOUTS`). Without it, a caption is `title-bottom` and no caption
1252
+ is `photo`, so a call without `layout` draws what it always drew. A layout that needs a text it was not given, or a
1253
+ text its layout does not draw, is an error.
1254
+
1255
+ | `layout` | Draws | Example |
1256
+ | --- | --- | --- |
1257
+ | `photo` | the cropped photo alone | `{ layout: "photo" }` |
1258
+ | `title-bottom` | the caption in the lower half of the band, the scrim rising from the bottom | `{ layout: "title-bottom", caption: "Stop working at 49" }` |
1259
+ | `title-center` | the caption in the band's middle third, the scrim a soft stripe behind it | `{ layout: "title-center", caption: "One evening, real numbers" }` |
1260
+ | `title-top` | the caption in the upper half of the band, the scrim falling from the top | `{ layout: "title-top", caption: "Retire at 49?" }` |
1261
+ | `kicker-title` | a small kicker line above the caption, in the lower half | `{ layout: "kicker-title", kicker: "Episode 3", caption: "The early retirement plan" }` |
1262
+ | `pill` | the caption as a short label in a rounded box of the dark colour (the box is its scrim), in the lower half | `{ layout: "pill", caption: "Lisbon, Portugal" }` |
1263
+
1264
+ - The result is a baseline JPEG (`quality` 90 by default) of exactly the size, with its `width`, `height` and
1265
+ `bytes`. No network, no system fonts. An ICC profile in the photo (e.g. Display P3) is not converted: its values are
1266
+ taken as sRGB.
1267
+
1147
1268
  ## Requirements
1148
1269
 
1149
1270
  - Node 22, **ffmpeg** in PATH.
@@ -1163,6 +1284,7 @@ renders without a `marketing.json` at all. For a carousel, pass `slide` (1-based
1163
1284
  | Sound effects | the project's | not bundled; `sfx` names the files |
1164
1285
  | ElevenLabs | paid API | key from `ELEVENLABS_API_KEY`, only with `--commit` |
1165
1286
  | satori, @resvg/resvg-js | MPL-2.0 | npm dependencies, unmodified; resvg ships a prebuilt native binary per platform |
1287
+ | jpeg-js | BSD-3-Clause | npm dependency, unmodified, pure JavaScript (the photo cover's JPEG encoder) |
1166
1288
 
1167
1289
  ## Limitations
1168
1290
 
@@ -3422,9 +3422,9 @@ export declare const marketingSchema: z.ZodObject<{
3422
3422
  jump: z.ZodDefault<z.ZodEnum<{
3423
3423
  fade: "fade";
3424
3424
  cut: "cut";
3425
+ auto: "auto";
3425
3426
  zoom: "zoom";
3426
3427
  whoosh: "whoosh";
3427
- auto: "auto";
3428
3428
  }>>;
3429
3429
  clip: z.ZodDefault<z.ZodEnum<{
3430
3430
  fade: "fade";
@@ -3494,6 +3494,7 @@ export declare const marketingSchema: z.ZodObject<{
3494
3494
  }>>;
3495
3495
  attempts: z.ZodOptional<z.ZodNumber>;
3496
3496
  warnTolerance: z.ZodOptional<z.ZodNumber>;
3497
+ audioBitrateKbps: z.ZodOptional<z.ZodNumber>;
3497
3498
  }, z.core.$strict>]>>;
3498
3499
  cover: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
3499
3500
  at: z.ZodOptional<z.ZodNumber>;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4BxB;;;;;;GAMG;AAEH,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AAEpD,eAAO,MAAM,SAAS,wCAAyC,CAAC;AAEhE,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,eAAO,MAAM,UAAU,qDAAsD,CAAC;AAE9E,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAmqBnD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmGmG,CAAC;AAEhI,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC;AAC7D,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAEjE,iEAAiE;AACjE,eAAO,MAAM,oBAAoB,6EAA6E,CAAC;AAE/G,mFAAmF;AACnF,wBAAgB,sBAAsB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAMhE"}
@@ -573,6 +573,13 @@ const footageSchema = z
573
573
  .max(3)
574
574
  .optional()
575
575
  .describe("A near-miss band in LU (0.2 to 3, at least tolerance): a mix outside target ± tolerance but inside target ± warnTolerance, under the true peak limit, finishes with a warning instead of failing."),
576
+ audioBitrateKbps: z
577
+ .number()
578
+ .int()
579
+ .min(192)
580
+ .max(512)
581
+ .optional()
582
+ .describe("The finished sound's AAC bitrate in kbps (192 to 512, default 192): the film's only lossy audio encode."),
576
583
  })
577
584
  .refine((mix) => mix.warnTolerance === undefined || mix.warnTolerance >= (mix.tolerance ?? 1), { path: ["warnTolerance"], message: "must be at least tolerance (default 1)" }),
578
585
  ])