@anvpx/motion-build 0.1.2 → 0.1.4
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/dist/audio/mix.d.ts +8 -1
- package/dist/audio/mix.js +15 -4
- package/package.json +4 -4
package/dist/audio/mix.d.ts
CHANGED
|
@@ -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
|
|
@@ -157,7 +159,12 @@ export declare const buildMusicMixArgs: (videoIn: string, clips: readonly MixCli
|
|
|
157
159
|
* verified policy's -1 dBTP (`MIX_TRUE_PEAK_DBTP`), which is what gates a pass.
|
|
158
160
|
*/
|
|
159
161
|
export declare const TARGET_LUFS = -14;
|
|
160
|
-
|
|
162
|
+
/**
|
|
163
|
+
* Aim 3 dB under the -1 dBTP delivery ceiling. The aac encoder can overshoot
|
|
164
|
+
* a linear loudnorm pass by ~1 dB on short clips; the extra headroom keeps the
|
|
165
|
+
* decoded delivery under the ceiling instead of pinning samples at 0 dBFS.
|
|
166
|
+
*/
|
|
167
|
+
export declare const TARGET_TRUE_PEAK_DB = -4;
|
|
161
168
|
export declare const TARGET_LRA = 11;
|
|
162
169
|
/** Within this drift the mix already sits at delivery level (idempotence guard). */
|
|
163
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) =>
|
|
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[
|
|
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).
|
|
@@ -305,7 +311,12 @@ export const buildMusicMixArgs = (videoIn, clips, music, out) => [
|
|
|
305
311
|
* verified policy's -1 dBTP (`MIX_TRUE_PEAK_DBTP`), which is what gates a pass.
|
|
306
312
|
*/
|
|
307
313
|
export const TARGET_LUFS = -14;
|
|
308
|
-
|
|
314
|
+
/**
|
|
315
|
+
* Aim 3 dB under the -1 dBTP delivery ceiling. The aac encoder can overshoot
|
|
316
|
+
* a linear loudnorm pass by ~1 dB on short clips; the extra headroom keeps the
|
|
317
|
+
* decoded delivery under the ceiling instead of pinning samples at 0 dBFS.
|
|
318
|
+
*/
|
|
319
|
+
export const TARGET_TRUE_PEAK_DB = -4.0;
|
|
309
320
|
export const TARGET_LRA = 11;
|
|
310
321
|
/** Within this drift the mix already sits at delivery level (idempotence guard). */
|
|
311
322
|
export const AT_TARGET_TOLERANCE_LU = 0.5;
|
|
@@ -374,7 +385,7 @@ export const buildLoudnessNormalizeFilter = (measurement) => {
|
|
|
374
385
|
`:measured_TP=${fixed(measurement.truePeakDb)}` +
|
|
375
386
|
`:measured_LRA=${fixed(measurement.lra)}` +
|
|
376
387
|
`:measured_thresh=${fixed(measurement.threshold)}` +
|
|
377
|
-
`:offset=${fixed(measurement.offset)}`);
|
|
388
|
+
`:offset=${fixed(measurement.offset)},${AUDIO_LIMITER}`);
|
|
378
389
|
};
|
|
379
390
|
/** Pass 1 argv: measure the mixed file; `-vn` keeps the video stream undecoded. */
|
|
380
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
|
+
"version": "0.1.4",
|
|
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.
|
|
35
|
-
"@anvpx/motion-schema": "0.1.
|
|
36
|
-
"@anvpx/motion-themes": "0.1.
|
|
34
|
+
"@anvpx/motion-scenes": "0.1.4",
|
|
35
|
+
"@anvpx/motion-schema": "0.1.4",
|
|
36
|
+
"@anvpx/motion-themes": "0.1.4",
|
|
37
37
|
"postprocessing": "6.39.5",
|
|
38
38
|
"three": "0.186.0"
|
|
39
39
|
},
|