Files
hyperframes/packages
WaterrrForeverandClaude Opus 5.5 f6ae9bfb43 fix(producer): duration normalization encodes from the delivery PCM, so a compliant mix is never cut (#7199)
* fix(producer): pad/trim audio from the delivery PCM, not its own AAC

The assemble stage's duration fix decoded audio.m4a and encoded it again.
That second AAC generation read about 2 dB hotter on a measured mix
(-1.8 dBTP out of the audio stage, +0.2 after the trim), so the whole-mix
cut then lowered an already compliant film by 3.4 dB, overshooting to
-2.5 dBTP. A sibling project with a slightly louder music bed escaped the
cut, so the two landed about 4 LU apart.

- The local render keeps the audio stage's PCM in the work dir until
  assembly; pad/trim and any peak correction there encode from it.
- A whole-mix cut in the audio stage is applied to that PCM too, so it
  still encodes to exactly the delivered AAC. If it cannot be rewritten
  it is removed and assembly falls back to the AAC.
- The distributed plan does not keep the PCM, so its plan dir is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(producer): name the assemble stage's PCM input by what it is

The comment-ratchet does not let assembleStage.ts gain a comment line, so
the new input says what it holds in its name instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HebQXN7wsMK6GqT3MNtqXw

* fix(producer): assembly never reuses a PCM whose delivered cut was not applied

When the audio stage cuts the whole mix and then fails to rewrite the kept
PCM, it tries to delete the PCM. Deletion is best-effort and can be refused,
for example on Windows, so the uncut PCM could stay on disk. The audio stage
handed it to assembly because the file still existed, and assembly would
then re-encode a mix louder than the AAC that was actually delivered.

The cut now reports when the PCM no longer matches the delivered AAC. The
audio stage keeps the PCM only on an explicit success, not because the file
exists, and assembly otherwise falls back to the verified AAC.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HebQXN7wsMK6GqT3MNtqXw

* test(producer): the fake-FFmpeg PCM rewrite writes its output

The true-peak correction now rewrites the kept PCM with FFmpeg and reports
the PCM as stale when that output never appears. The fake FFmpeg in this
test answered the rewrite without writing anything, so a correct run looked
like a failed rewrite. The fake now writes the output, as real FFmpeg does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HebQXN7wsMK6GqT3MNtqXw

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 01:39:01 +00:00
..
2026-11-05 01:05:50 +00:00
2026-11-05 01:05:50 +00:00
2026-11-05 01:05:50 +00:00
2026-11-05 01:05:50 +00:00
2026-11-05 01:05:50 +00:00
2026-11-05 01:05:50 +00:00
2026-11-05 01:05:50 +00:00