fix: preserve render audio intent#580
Closed
miguel-heygen wants to merge 1 commit intomainfrom
Closed
Conversation
b719597 to
ece625c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Studio previews can be correct while the rendered MP4 has bad audio timing or the wrong mix for A-roll projects that use a muted visual
<video>plus a separate<audio>track.The Studio Export button in local Vite preview could also fail before rendering because the dev adapter accidentally called a cached producer import promise like a function.
What this fixes
data-has-audio="true"on every<video>during timing compilation.data-has-audio="true".-shortestdropping the last captured frame because of AAC padding.Root cause
The timing compiler promoted muted visual videos into audible render inputs. In projects with separate audio, the renderer could then mix the embedded video audio as an extra source even though browser preview keeps the muted video silent. Separately, final FFmpeg muxing used
-shortest, which could cut one captured frame when the AAC sidecar carried encoder padding beyond the video stream.For the Studio Export button,
packages/studio/vite.config.tsstored_producerModulePromise = createRetryingModuleLoader(... )()but later didreturn _producerModulePromise(). That throws_producerModulePromise is not a functionwhen the render job starts.Verification
Local
bun run --filter @hyperframes/core test -- src/compiler/timingCompiler.test.tsbun run --filter @hyperframes/engine test -- src/services/chunkEncoder.test.tsbun test packages/producer/src/services/htmlCompiler.test.tsbunx --bun vitest run packages/producer/src/services/renderOrchestrator.test.tsbun run --filter @hyperframes/studio test -- vite.producer.test.tsbun run --filter @hyperframes/core typecheckbun run --filter @hyperframes/engine typecheckbun run --filter @hyperframes/producer typecheckbun run --filter @hyperframes/studio typecheckbunx oxfmt --check packages/core/src/compiler/timingCompiler.ts packages/core/src/compiler/timingCompiler.test.ts packages/engine/src/index.ts packages/engine/src/services/chunkEncoder.ts packages/engine/src/services/chunkEncoder.test.ts packages/producer/src/services/chunkEncoder.ts packages/producer/src/services/compilationTester.ts packages/producer/src/services/htmlCompiler.test.ts packages/producer/src/services/renderOrchestrator.ts packages/producer/src/services/timingCompiler.ts packages/studio/vite.config.tsbunx oxlint packages/core/src/compiler/timingCompiler.ts packages/core/src/compiler/timingCompiler.test.ts packages/engine/src/index.ts packages/engine/src/services/chunkEncoder.ts packages/engine/src/services/chunkEncoder.test.ts packages/producer/src/services/chunkEncoder.ts packages/producer/src/services/compilationTester.ts packages/producer/src/services/htmlCompiler.test.ts packages/producer/src/services/renderOrchestrator.ts packages/producer/src/services/timingCompiler.ts packages/studio/vite.config.tsgit diff --checkbun packages/cli/src/cli.ts validate /Users/miguel07code/Downloads/hyperframes-roll-overlaybun packages/cli/src/cli.ts validate /tmp/hyperframes-different-repro/hyperframes-differentRender repros:
/Users/miguel07code/Downloads/hyperframes-roll-overlayrendered to/tmp/hf-roll-overlay-fixed2.mp4: final MP4 has500video frames,16.666667svideo duration, and16.666667scontainer duration./tmp/hyperframes-different-repro/hyperframes-differentrendered to/tmp/hf-different-fixed.mp4: compiled metadata reportsaudioCount: 1, final MP4 has537video frames,17.900000svideo duration,17.900000saudio duration, and17.900000scontainer duration.packages/studio/data/renders/hyperframes-different_2026-05-01_20-13-36.mp4with537video frames and17.900000saudio/video/container duration.Browser
/tmp/hyperframes-different-repro/hyperframes-different.agent-browser: openedhttp://localhost:5194, captured a screenshot, clicked Play, captured a playing screenshot, and stopped a recording.agent-browser: openedhttp://localhost:5194/#project/hyperframes-different, opened the Renders panel, selected Draft/MP4, clicked Export, captured the rendering state, and verified the render completed./tmp/hf-audio-render-proof/browser/different-preview.png/tmp/hf-audio-render-proof/browser/different-preview-playing.png/tmp/hf-audio-render-proof/browser/different-preview.webm/tmp/hf-audio-render-proof/browser/studio-export-rendering.png/tmp/hf-audio-render-proof/browser/studio-export-complete.png/tmp/hf-audio-render-proof/browser/studio-export-fixed.webmNotes
The second supplied project still has authored composition warnings unrelated to this fix:
composition_file_too_largeforcompositions/mograph-overlay.htmland contrast warnings from validation. This PR leaves those project-content issues unchanged.