@anvpx/motion-build 0.1.3 → 0.1.5

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.
@@ -48,6 +48,8 @@ export declare const isContiguous: (scenes: readonly {
48
48
  * stay exactly as synthesized instead of being divided by the input count.
49
49
  */
50
50
  export declare const buildFilterGraph: (clips: readonly MixClip[]) => string;
51
+ /** Final sample-peak limiter; aac can overshoot the loudnorm true-peak aim. */
52
+ export declare const AUDIO_LIMITER = "alimiter=limit=0.75:level=false";
51
53
  /**
52
54
  * Deterministic ffmpeg argv: silent video plus one `-i` per wav, video passed
53
55
  * through (`-c:v copy`), narration mixed to aac. No `-shortest`: the picture is
@@ -158,11 +160,11 @@ export declare const buildMusicMixArgs: (videoIn: string, clips: readonly MixCli
158
160
  */
159
161
  export declare const TARGET_LUFS = -14;
160
162
  /**
161
- * Aim 1.5 dB under the -1 dBTP delivery ceiling. The aac encoder can overshoot
163
+ * Aim 3 dB under the -1 dBTP delivery ceiling. The aac encoder can overshoot
162
164
  * a linear loudnorm pass by ~1 dB on short clips; the extra headroom keeps the
163
165
  * decoded delivery under the ceiling instead of pinning samples at 0 dBFS.
164
166
  */
165
- export declare const TARGET_TRUE_PEAK_DB = -2.5;
167
+ export declare const TARGET_TRUE_PEAK_DB = -4;
166
168
  export declare const TARGET_LRA = 11;
167
169
  /** Within this drift the mix already sits at delivery level (idempotence guard). */
168
170
  export declare const AT_TARGET_TOLERANCE_LU = 0.5;
package/dist/audio/mix.js CHANGED
@@ -61,7 +61,12 @@ const delayed = (input, ms, label) => `[${input}:a]adelay=${ms}:all=1[${label}]`
61
61
  * `amix` runs `normalize=0` because narrated scenes never overlap, so levels
62
62
  * stay exactly as synthesized instead of being divided by the input count.
63
63
  */
64
- export const buildFilterGraph = (clips) => narrationGraph(clips, "aout");
64
+ export const buildFilterGraph = (clips) => {
65
+ const mixed = narrationGraph(clips, "mix");
66
+ return `${mixed};[mix]${AUDIO_LIMITER}[aout]`;
67
+ };
68
+ /** Final sample-peak limiter; aac can overshoot the loudnorm true-peak aim. */
69
+ export const AUDIO_LIMITER = "alimiter=limit=0.75:level=false";
65
70
  const narrationGraph = (clips, outLabel) => {
66
71
  if (clips.length === 0)
67
72
  throw new Error("mixdown needs at least one narration clip");
@@ -175,7 +180,8 @@ export const buildMusicFilterGraph = (clips, music) => {
175
180
  return (`[${musicIndex}:a]volume=${volume},aloop=loop=-1:size=2e9,atrim=duration=${total}[mbed];` +
176
181
  `${narr};[narr]apad=whole_dur=${total},asplit[nkey][nmix];` +
177
182
  `[mbed][nkey]${sidechain}[ducked];` +
178
- `[nmix][ducked]amix=inputs=2:normalize=0[aout]`);
183
+ `[nmix][ducked]amix=inputs=2:normalize=0[mix];` +
184
+ `[mix]${AUDIO_LIMITER}[aout]`);
179
185
  };
180
186
  /**
181
187
  * AU-01 frozen approved mix layout (single authority for preview + render).
@@ -306,11 +312,11 @@ export const buildMusicMixArgs = (videoIn, clips, music, out) => [
306
312
  */
307
313
  export const TARGET_LUFS = -14;
308
314
  /**
309
- * Aim 1.5 dB under the -1 dBTP delivery ceiling. The aac encoder can overshoot
315
+ * Aim 3 dB under the -1 dBTP delivery ceiling. The aac encoder can overshoot
310
316
  * a linear loudnorm pass by ~1 dB on short clips; the extra headroom keeps the
311
317
  * decoded delivery under the ceiling instead of pinning samples at 0 dBFS.
312
318
  */
313
- export const TARGET_TRUE_PEAK_DB = -2.5;
319
+ export const TARGET_TRUE_PEAK_DB = -4.0;
314
320
  export const TARGET_LRA = 11;
315
321
  /** Within this drift the mix already sits at delivery level (idempotence guard). */
316
322
  export const AT_TARGET_TOLERANCE_LU = 0.5;
@@ -379,7 +385,7 @@ export const buildLoudnessNormalizeFilter = (measurement) => {
379
385
  `:measured_TP=${fixed(measurement.truePeakDb)}` +
380
386
  `:measured_LRA=${fixed(measurement.lra)}` +
381
387
  `:measured_thresh=${fixed(measurement.threshold)}` +
382
- `:offset=${fixed(measurement.offset)}`);
388
+ `:offset=${fixed(measurement.offset)},${AUDIO_LIMITER}`);
383
389
  };
384
390
  /** Pass 1 argv: measure the mixed file; `-vn` keeps the video stream undecoded. */
385
391
  export const buildLoudnessMeasureArgs = (input) => [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anvpx/motion-build",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Storyboard compiler for @anvpx/motion: validation, scene emission and HyperFrames project output.",
5
5
  "license": "MIT",
6
6
  "author": "anvpx",
@@ -31,9 +31,9 @@
31
31
  "@fontsource/jetbrains-mono": "5.3.0",
32
32
  "@fontsource/source-serif-4": "5.3.1",
33
33
  "@fontsource/space-grotesk": "5.3.0",
34
- "@anvpx/motion-scenes": "0.1.3",
35
- "@anvpx/motion-schema": "0.1.3",
36
- "@anvpx/motion-themes": "0.1.3",
34
+ "@anvpx/motion-scenes": "0.1.5",
35
+ "@anvpx/motion-schema": "0.1.5",
36
+ "@anvpx/motion-themes": "0.1.5",
37
37
  "postprocessing": "6.39.5",
38
38
  "three": "0.186.0"
39
39
  },