Skip to content

Expose size-targeted export (“fit under N MB”) in the UI - #55

Merged
JeremySNR merged 1 commit into
mainfrom
cursor/size-targeted-export-627e
Sep 6, 2026
Merged

Expose size-targeted export (“fit under N MB”) in the UI#55
JeremySNR merged 1 commit into
mainfrom
cursor/size-targeted-export-627e

Conversation

@JeremySNR

@JeremySNR JeremySNR commented Sep 6, 2026

Copy link
Copy Markdown
Owner

What does this change?

Closes #48. The two-pass size-targeted encoder was already in uploadBudget.ts / render.ts with no UI. This adds a megabyte cap in Settings → Export and in the editor export panel, passes it as RenderJob.sizeTargetBytes, and shows the achieved file size after export (plus a note when the planner had to downscale, or when the clip is simply too long for the cap).

Why?

Discord, email, WhatsApp and similar destinations reject large files. Rendering once to a budget beats rendering at a quality target and re-compressing.

How did you test it?

  • npm test (231 tests)
  • npm run typecheck
  • npm run lint
  • scripts/test-uploadsize.ts — 18 MB cap → 17.87 MB; 4 MB cap → 3.93 MB (downscaled)
  • scripts/smoke-test.sh — editor export panel and Settings → Export both show the new control

Anything to watch out for?

Preview is unchanged: this only affects export encoding. Quality and GPU encoder are ignored while a size cap is on (same as the existing renderer contract — the cap decides bitrate, on CPU x264). Export all uses the same Settings value as the editor.

Settings export tab with size limit
Editor export panel with size limit toggle

Open in Web Open in Cursor 

The two-pass encoder already knew how to land under a byte cap; nothing in
the UI could turn it on. Add a megabyte limit in Settings and the editor
export panel, pass it through as sizeTargetBytes, and show the achieved
size (plus a downscale/over-budget note) after the file is written.

Closes #48

Co-authored-by: Jeremy Smith <JeremySNR@users.noreply.github.com>
@JeremySNR
JeremySNR marked this pull request as ready for review September 6, 2026 11:32
@JeremySNR
JeremySNR merged commit a61bc97 into main Sep 6, 2026
4 checks passed

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Size cap can be exceeded
    • Added a post-export cap-exceeded warning when finished bytes exceed sizeTargetBytes, stopped downscale/overBudget copy from implying the file fits, and corrected the planner and ExportResult docs about the 150 kbps floor.

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit 8343bcb. Configure here.

<p className="mt-2 text-[11px] leading-relaxed text-amber-400">
This edit is long for the size cap — the picture may look soft. A shorter trim would
hold up better.
</p>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Size cap can be exceeded

Medium Severity

The overBudget note and ExportResult comment say the file still meets the cap. The encoder’s 150 kbps floor can push long edits over sizeTargetBytes, so a whole-video export at an 8 MB Discord preset can finish around 18 MB and get rejected.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8343bcb. Configure here.

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.

Expose size-targeted export ("fit under N MB") in the UI

2 participants