From 22d33de32fc2fa04bd4efeb83c7268af1813d45c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Sun, 31 May 2026 13:26:56 +0000 Subject: [PATCH 1/3] fix(engine): remove amix normalize=0 to fix audio on FFmpeg 4.x/6.x amix's normalize=0 option is absent from many FFmpeg builds (e.g. FFmpeg 4.2 on Ubuntu 20.04). When the option is not recognized, FFmpeg fails the entire filter graph initialization, processCompositionAudio returns success:false, and the assembled video has no audio stream. Replace normalize=0 + weights='1...' with the amix default behavior (normalize=true, divides by track count) and multiply the master output gain by the track count to restore the original per-track volumes. The net volume is identical across all FFmpeg versions. Fixes #1136-adjacent: reported as 'audio doesn't play' in rendered MP4. --- packages/engine/src/services/audioMixer.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/engine/src/services/audioMixer.ts b/packages/engine/src/services/audioMixer.ts index bb31a7099..b47d6171c 100644 --- a/packages/engine/src/services/audioMixer.ts +++ b/packages/engine/src/services/audioMixer.ts @@ -398,9 +398,11 @@ async function mixAudioTracks( }); const mixInputs = tracks.map((_, i) => `[a${i}]`).join(""); - const weights = tracks.map(() => "1").join(" "); - const mixFilter = `${mixInputs}amix=inputs=${tracks.length}:duration=longest:dropout_transition=0:normalize=0:weights='${weights}'[mixed]`; - const postMixGainFilter = `[mixed]volume=${masterOutputGain}[out]`; + const mixFilter = `${mixInputs}amix=inputs=${tracks.length}:duration=longest:dropout_transition=0[mixed]`; + // amix divides output by inputs count (default normalize=true). Multiply master + // gain by track count so per-track volumes authored in data-volume are preserved. + const compensatedGain = masterOutputGain * tracks.length; + const postMixGainFilter = `[mixed]volume=${formatFilterNumber(compensatedGain)}[out]`; const fullFilter = [...filterParts, mixFilter, postMixGainFilter].join(";"); return [ From 8f7f69d67415093c24f458f0e51769ddf22e1f77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Sun, 31 May 2026 13:34:47 +0000 Subject: [PATCH 2/3] fix(producer): strip img crossorigin + fix audioExtractor normalize=0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two follow-up fixes: 1. htmlCompiler: strip crossorigin attribute from elements during compilation. External images (e.g. S3) with crossorigin='anonymous' force CORS-mode requests against the renderer's localhost file server, which S3 rejects → images render blank. Matches the existing video strip at line 261. 2. audioExtractor: same amix normalize=0 bug as audioMixer.ts. The audioExtractor path is used for