Fix merge timeout: O(D) trim+overlay+concat replaces O(N×D) chained overlays#3
Open
anoob-optiroai wants to merge 2 commits into
Open
Fix merge timeout: O(D) trim+overlay+concat replaces O(N×D) chained overlays#3anoob-optiroai wants to merge 2 commits into
anoob-optiroai wants to merge 2 commits into
Conversation
- Switch from macos-latest (arm64/Apple Silicon) to macos-13 (Intel x64) because electron-builder has a known hdiutil/background.tiff crash on arm64 - Set dmg.background: null to avoid the .background/background.tiff lookup - Set hardenedRuntime: false (no signing cert configured) - Build separate x64 and arm64 DMG targets (cross-compiled from Intel runner) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The old _apply_alpha_transitions chained N overlay filters on the full base video, making FFmpeg do O(N × duration) encoding work. With 30 transitions on a 47-minute video this exceeded the 900 s timeout. The new approach splits the base video into segments in a single FFmpeg pass, applies each transition overlay only to its ~1.2 s window, then concatenates — O(duration) work regardless of transition count. Also uses integer frame arithmetic for cut_times (zero float drift) and scales timeout to 5× video duration (min 30 min) to handle long presentations gracefully. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
_apply_alpha_transitionschained N overlay filters on the full base video. FFmpeg had to encode the entire video N times (once per overlay link in the chain). With 30 transitions on a 47-minute video, that's ~24 hours of encoding work — impossible within the 900 s timeout.frame_acc += fcin integer counts,cut_times.append(frame_acc / FPS)) instead oft_acc += dfloat accumulation — eliminates sync drift at 6-7 minutes.max(1800, base_dur × 5)seconds so long presentations are handled gracefully.Test plan
🤖 Generated with Claude Code