Skip to content

feat: give studio an output shape - #152

Open
nmbrthirteen wants to merge 1 commit into
mainfrom
studio-format
Open

feat: give studio an output shape#152
nmbrthirteen wants to merge 1 commit into
mainfrom
studio-format

Conversation

@nmbrthirteen

@nmbrthirteen nmbrthirteen commented Aug 10, 2026

Copy link
Copy Markdown
Owner

What

podcli studio now takes --format vertical|horizontal|square, the same choice process has always offered.

Why

services/formats.py exists, in its own words, so "the render pipeline is parameterized on format instead of hardcoding 1080x1920 per call site". studio was the call site that missed it, and had the vertical canvas baked into all three of its stages: the fragment render, the two bookend cards, and the concat that stitches them.

How

Most of it was already wired and simply never passed:

  • generate_clip has taken a format argument all along; clip_studio.py never gave it one.
  • render-bookend.mjs already accepts --width and --height; clip_studio.py never gave it those either.
  • Only the concat filtergraph genuinely hardcoded the canvas.

All three stages now read one FormatSpec, so they cannot disagree. That last one matters on its own: without it, a correctly rendered square fragment would be pillarboxed back onto a vertical canvas by the final step.

Compatibility

Additive. --format defaults to vertical, every stage defaults to the 1080x1920 it used before, and a caller that builds the namespace without a format at all still gets the old behaviour rather than an AttributeError. No existing caller changes shape.

Tests

611 pass, up from 603. The 8 new ones cover the hand-off from cmd_studio to the render script, the defaults on all three stages, and that the concat stops normalising onto the wrong canvas.

tests/test_ai_fallback.py::test_find_cli_falls_back_to_shell_lookup fails on my machine and fails identically on untouched main: it finds a real claude at ~/.local/bin that the test's mock does not isolate. Unrelated to this change.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for vertical, horizontal, and square output formats in the studio command.
    • The selected format is applied consistently across clip rendering, bookends, and final video assembly.
    • Vertical format remains the default.
  • Tests

    • Added coverage to verify format selection and correct canvas dimensions for all supported formats.

`process` has taken --format since formats.py was written to be the single
source of truth for clip dimensions. `studio` never did, and had 1080x1920
baked into all three of its stages: the fragment render, the two bookend cards,
and the concat that stitches them.

The pieces were already there. generate_clip takes a format and clip_studio
never passed one; render-bookend.mjs takes --width and --height and clip_studio
never passed those either; only the concat filtergraph genuinely hardcoded the
canvas. All three now read one FormatSpec, so they cannot disagree about the
shape and a square fragment is no longer pillarboxed onto a vertical canvas by
the last step.

Additive throughout. --format defaults to vertical, every stage defaults to the
1080x1920 it used before, and a caller that builds the namespace without a
format at all still gets the old behaviour rather than a crash.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 936f757e-0e64-454a-a357-64e00f517ec9

📥 Commits

Reviewing files that changed from the base of the PR and between 43e31c0 and 5ce12d0.

📒 Files selected for processing (3)
  • backend/cli.py
  • backend/clip_studio.py
  • tests/test_studio_format.py

📝 Walkthrough

Walkthrough

The studio command now supports vertical, horizontal, and square output formats. The selected dimensions flow through fragment rendering, bookends, video normalization, and concatenation. Tests cover propagation and default vertical behavior.

Changes

Studio format support

Layer / File(s) Summary
CLI format contract
backend/cli.py, backend/clip_studio.py
The studio commands accept --format {vertical,horizontal,square} and default to vertical. The selected value is forwarded to clip processing.
Format-aware rendering pipeline
backend/clip_studio.py
get_format supplies dimensions for fragments, intro and outro bookends, FFmpeg normalization, and concatenation.
Format propagation tests
tests/test_studio_format.py
Tests verify forwarding, vertical defaults, canvas dimensions, and positive dimensions for all supported formats.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant cmd_studio
  participant clip_studio.py
  participant RemotionRenderer
  participant FFmpeg
  cmd_studio->>clip_studio.py: forward selected format
  clip_studio.py->>clip_studio.py: resolve dimensions with get_format
  clip_studio.py->>RemotionRenderer: render fragments and bookends
  clip_studio.py->>FFmpeg: normalize and concatenate videos
Loading

Possibly related PRs

  • nmbrthirteen/podcli#4: Introduces the studio command and clip_studio.py orchestration extended by this change.

Suggested reviewers: teethatkamsai

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding configurable output shapes to the studio command.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch studio-format

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.

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.

1 participant