Skip to content

fix(encode): exempt --frame from the codec/container guard - #197

Merged
LeadcodeDev merged 1 commit into
mainfrom
fix/codec-guard-single-frame
Aug 12, 2026
Merged

fix(encode): exempt --frame from the codec/container guard#197
LeadcodeDev merged 1 commit into
mainfrom
fix/codec-guard-single-frame

Conversation

@LeadcodeDev

Copy link
Copy Markdown
Owner

Regression from #194, on main.

What

$ rustmotion render -f s.json -o f.png --frame 0
Error: codec 'h264' cannot be written into a .png file — use -o <file>.mp4

The guard ran before cmd_render's single-frame branch. A --frame still is written by render_single_frame and never reaches an encoder, so the codec is not part of that operation at all.

--frame is the documented way to preview a scene (SKILL.md, and the wizard's "propose a preview" step), so this broke a normal path.

How

if frame.is_none() around the guard, in both cmd_render and cmd_watch. prores into .mp4 is still refused.

What I should have caught

Every local check passed — fmt, clippy -D warnings, cargo test --workspace — because nothing exercised --frame. The guard's own five tests covered the mapping and not the callers. A test pins the reason .png is in no codec's list, so the exemption reads as deliberate rather than as an oversight to be "fixed" later.

The guard added in #194 ran before cmd_render's single-frame branch, so

    rustmotion render -f s.json -o f.png --frame 0

failed with "codec 'h264' cannot be written into a .png file". A --frame
still is written by render_single_frame and never reaches an encoder, so the
codec is not part of that operation — the check does not apply.

This is a regression I shipped in #194: every local check passed because none
of them exercised --frame, which is the documented way to preview a scene.
@LeadcodeDev
LeadcodeDev merged commit aabfc5c into main Aug 12, 2026
3 checks passed
@LeadcodeDev
LeadcodeDev deleted the fix/codec-guard-single-frame branch August 12, 2026 15:42
@LeadcodeDev LeadcodeDev added the bug Something isn't working label Aug 12, 2026
@LeadcodeDev LeadcodeDev self-assigned this Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant