Repository navigation
fix(mask): report ffmpeg's error when it dies mid-write - #17
Merged
Merged
Conversation
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.
What
materialize_mask_videonow catches theBrokenPipeErrorfrom the frame writes, waits for ffmpeg, and raisesmask ffmpeg failed (rc=N) after K of N frames: <ffmpeg stderr>. The frame-count check still runs whenever ffmpeg exits 0, so it still fails closed.Why
The Ace Basin day render (sc-2026-02-21, 352,934 frames at 4K) failed on 2026-10-25 at 18:54 ET with
cabin leak repair failed, keeping the original mask: [Errno 32] Broken pipe. The cabin repair rebuilds the whole mask through this function. When ffmpeg exits, the next stdin write raises beforeproc.wait()and the stderr read, so we lost ffmpeg's reason and how far the stream got. Started by hand on the same timeline, the same ffmpeg command wrote 600 frames cleanly, so the cause is still unknown. A recurrence will now name it.Tests
test_ffmpeg_dying_mid_write_reports_its_own_errorintests/test_mask.py. Its output path is a directory, so ffmpeg exits at once, and 512x512 frames overflow the pipe buffer on the first write. It failed with the sameBrokenPipeError: [Errno 32] Broken pipebefore the fix and passes after.ruff checkis clean.ruff format --checkstill flags one existing ffprobe call intests/test_mask.pythat this change doesn't touch; CI runsruff checkonly.