Skip to content

feat(transcode): --target size targeting and Custom size row - #1

Draft
ButtercupRobrts wants to merge 5 commits into
feat/transcode-quality-size-upstreamfrom
feat/transcode-target-size-upstream
Draft

ButtercupRobrts wants to merge 5 commits into
feat/transcode-quality-size-upstreamfrom
feat/transcode-target-size-upstream

Conversation

@ButtercupRobrts

Copy link
Copy Markdown
Owner

Summary

Stacked on omacom#12135 (upstream omacom/omarchy) — will be rebased onto quattro once that lands.

  • --target <size> flag for video transcodes: free-text sizes (25M, 1.5G, 500K, 25MB, bare 25 = MB), decimal units matching file managers and upload limits
  • Bitrate derived from probed duration minus 192k audio budget; resolution auto-steps 4k→1080p→720p when the budget can't fit, with honest refusal naming the achievable minimum
  • Two-pass encode + one overshoot retry; pass workdir is a per-run mktemp dir cleaned via trap
  • Custom size… row on the interactive mp4 quality menu routes through the identical pipeline — interactive runs are argv-identical to --target
  • gif and picture inputs refuse --target; positional quality + --target are mutually exclusive

Test plan

  • test/shell.d/transcode-quality-test.sh — 93/93 (parse matrix, refusal ordering, planner floors, two-pass argv, retry math, sentinel containment)
  • ./test/cli — 112/112
  • Live dogfood: --target refusal path and Custom size… → 400M encode verified in the real menu

Generated with Devin

@ButtercupRobrts
ButtercupRobrts force-pushed the feat/transcode-quality-size-upstream branch from b9535ec to 0886701 Compare September 27, 2026 16:52
ButtercupRobrts and others added 5 commits September 27, 2026 18:52
- --target flag + parse_target_size normalization for free-text sizes
- plan_target: duration probe, bitrate math, floor-based resolution step-down
- transcode_video_target: two-pass encode, pass-scoped toast, one overshoot retry
- refusal matrix: conflicts, gif/picture, below-floor, audio-only, >=source, bad probes
- pass-aware ffmpeg stub + notification -p/-r id stub in shell harness
- select_quality appends an mp4-gated Custom size… sentinel row last,
  single-sourced via $custom_label with a mandatory subtext so
  --default-index 1 and uniform row heights survive
- post-strip sentinel branch mints target:<bytes> through the return
  channel; the tier whitelist keeps rejecting every other foreign label
- new prompt_target_size helper wraps parse_target_size in a bounded
  for-1-2 loop: Esc cancels, empty/unparseable buys one hinted re-prompt
- main() unwraps target:<bytes> inside the menu gate into
  target_bytes/target_token/quality="" -- the planner, output_path, and
  dispatch are byte-identical to a --target run
- plan_target floor case gains the IN-03 *) arm; --target reject loop
  gains the IN-01 empty-string token
- omarchy-menu-input stub (FAKE_INPUT/FAKE_INPUT$n knobs, unset = exit 1
  tripwire) ships in the same commit so the suite can never hang on the
  real binary's done_file spin-wait
--target, size estimates, refusal minimums, and the done notification
now all mean 1 MB = 1,000,000 bytes (numfmt --from/--to=si), matching
file managers and upload limits like Discord's 25 MB cap. Previously
IEC/MiB units made a 400M target budget ~419 MB, so outputs read ~16 MB
larger than asked in the Files app.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@ButtercupRobrts
ButtercupRobrts force-pushed the feat/transcode-target-size-upstream branch from be3ba95 to 5b6090f Compare September 27, 2026 16:52
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