Skip to content

fix(export): skip redundant AAC re-encode during final mux#293

Closed
meiiie wants to merge 1 commit into
webadderallorg:mainfrom
meiiie:fix/export-audio-copy-fastpath
Closed

fix(export): skip redundant AAC re-encode during final mux#293
meiiie wants to merge 1 commit into
webadderallorg:mainfrom
meiiie:fix/export-audio-copy-fastpath

Conversation

@meiiie
Copy link
Copy Markdown
Collaborator

@meiiie meiiie commented Apr 20, 2026

Summary

  • avoid re-encoding source audio during final FFmpeg mux when the export is in the safe copy-source path and the source audio is already AAC-compatible
  • thread source audio codec metadata from the exporters to the native/fallback mux boundary
  • add focused unit coverage for the copy-vs-transcode decision logic

Root Cause

The final FFmpeg mux path always re-encoded audio to AAC, even when the export was simply reattaching an unedited source audio track that was already AAC-compatible for MP4. That extra transcode work made the FFmpeg subprocess the long pole near 99% finalization.

Validation

  • node .\\node_modules\\typescript\\bin\\tsc --noEmit
  • node .\\node_modules\\vitest\\vitest.mjs run electron/ipc/nativeVideoExport.test.ts
  • node .\\node_modules\\@biomejs\\biome\\bin\\biome check electron/electron-env.d.ts electron/preload.ts electron/ipc/nativeVideoExport.ts electron/ipc/export/native-video.ts src/lib/exporter/modernVideoExporter.ts src/lib/exporter/videoExporter.ts electron/ipc/nativeVideoExport.test.ts
  • local FFmpeg A/B benchmark on recording-1776619033302.mp4:
    • -c:a copy: average 202.42 ms
    • -c:a aac -b:a 192k: average 634.17 ms

Issues

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c5ce9f25-a027-4805-b98e-7ae310b1e526

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

This was referenced Apr 20, 2026
This was linked to issues Apr 20, 2026
@meiiie
Copy link
Copy Markdown
Collaborator Author

meiiie commented Apr 20, 2026

Closing this draft to keep the export queue focused on the better-validated edited-track follow-up in #297. The copy-source fast path still looks directionally useful, but I do not have enough end-to-end validation to keep it open as a separate PR right now.

@meiiie meiiie closed this Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

export time out Export stuck 99%

1 participant