The output file is opened before the run loop starts (stitch_job.rs), so when the run fails (e.g. the lookahead VRAM pre-flight) the open file rides through the session's full teardown; on Windows a retry inside that window fails with encoder initialization failed: FFmpeg: Permission denied, then recovers once teardown finishes (~27s observed).
Fix direction: drop the encoder first in the error path so the output file closes before the slow GPU/thread teardown. Needs Windows verification.
The output file is opened before the run loop starts (stitch_job.rs), so when the run fails (e.g. the lookahead VRAM pre-flight) the open file rides through the session's full teardown; on Windows a retry inside that window fails with
encoder initialization failed: FFmpeg: Permission denied, then recovers once teardown finishes (~27s observed).Fix direction: drop the encoder first in the error path so the output file closes before the slow GPU/thread teardown. Needs Windows verification.