cutawan icon indicating copy to clipboard operation
cutawan copied to clipboard

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

Open JeremySNR opened this issue 3 months ago • 1 comments

The renderer can already encode a clip to land under a hard byte cap, and does it properly: src/shared/uploadBudget.ts plans the bitrate up front, then render.ts runs a size-targeted two-pass x264 encode. Rendering once to a budget beats rendering at a quality target and re-compressing, which costs an extra lossy generation and spends bits reproducing the first encoder's artefacts.

The catch: nothing in the UI exposes it. The capability arrived alongside an integration that has since been removed, so the code and its tests are still here (tests/uploadBudget.test.ts, scripts/test-uploadsize.ts) with no way for a user to reach it.

What's needed

  • A "fit under a size limit" option in the export panel, with a target in MB.
  • Pass it through as RenderJob.sizeTargetBytes, which the renderer already understands.
  • Show the achieved size afterwards, and say when the target forced a downscale (the planner already reports this).

Why anyone would want it: Discord's non-Nitro upload limit, email attachment ceilings, WhatsApp, and a few platforms that reject large files outright.

Good first issue because the hard part (the encoder work) is done and tested. This is plumbing plus a small piece of UI. Start at planUploadEncode in src/shared/uploadBudget.ts and sizeTargetBytes in src/main/pipeline/render.ts.

JeremySNR avatar Sep 02 '26 07:09 JeremySNR

Picking this up: the encoder path already exists, so this will be a Settings + editor export-panel control that passes RenderJob.sizeTargetBytes, then shows the achieved file size (and whether the planner had to downscale).

JeremySNR avatar Sep 06 '26 09:09 JeremySNR