Repository navigation
fix(cli): render rejects an unusable --video-bitrate before capture - #7098
Open
AryaKesharwani wants to merge 1 commit into
Open
AryaKesharwani wants to merge 1 commit into
AryaKesharwani wants to merge 1 commit into
Conversation
--video-bitrate went to ffmpeg unchecked, so "abc", "10x" or "0" failed (or silently ran) only after capture. Validate it with the --max-bitrate parser.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
hyperframes rendernow rejects an unusable--video-bitrateup front, with a usage error and exit code 2, instead of failing inside ffmpeg after capture.Why
--video-bitratewas only checked for being non-empty, and the raw string went to ffmpeg's-b:v. A typo likeabcor10xran the whole capture, crashed the streaming encoder, retried on a fresh screenshot session, and only then failed withRender failed.0was accepted and silently rendered.--max-bitratealready rejects these values before capture with✗ Invalid bitrate cap, so the two bitrate flags behaved differently.Real CLI in Docker (node 22, Chromium, ffmpeg), rendering a short demo project:
--video-bitrateabc✗ Render failed, exit 1 after 18s✗ Invalid video-bitrate/Got "abc". Must be a positive bitrate such as "10M" or "8000k"., exit 2 in under 1s10x08MRelated work
No existing issue. This is a tiny self-contained correction. #5549 added
videoBitrateto the studio render route, and #6444 added--max-bitrate, whose parser this reuses.How
createRenderPlanvalidates--video-bitratewith the engine'sappendRateCapArgs, the same parserparseDeliveryFlagsuses for--max-bitrate. It accepts the same<number>[k|M|G]forms and rejects zero.Test plan
rejects --video-bitrate %s before captureforabc,10x,0and0Minplan.test.ts. The new cases fail on main, andplan.test.tspasses 47/47 with the change. tsc, oxlint and oxfmt are clean.