Skip to content

feat: add --compute flag for gpu encoding#57

Merged
a-essawy merged 1 commit into
mainfrom
feat/gpu-compute-flag
Jun 13, 2026
Merged

feat: add --compute flag for gpu encoding#57
a-essawy merged 1 commit into
mainfrom
feat/gpu-compute-flag

Conversation

@a-essawy

Copy link
Copy Markdown
Contributor

What

Adds a --compute <auto|cpu|gpu> flag to rb ffmpeg, exposing the now-live GPU/compute routing option of the FFmpeg job type.

  • auto (default behavior when omitted) — server auto-routes NVENC/CUDA commands to GPU
  • gpu — forces GPU (NVENC on NVIDIA L4, Pro plan)
  • cpu — forces CPU

Changes

  • Parse --compute in the global-flag loop; it takes a value (added to the globalFlagsWithValue set so it's stripped from the FFmpeg args passed through to the executor).
  • Validate the value against auto|cpu|gpu; an invalid value errors with a clear message and exits 2, matching the existing flag-error convention.
  • Include compute in the submit params only when the user passed it, so default submissions are byte-identical to before.
  • Help line: --compute <mode> Run on cpu or gpu hardware (auto, cpu, gpu; gpu needs Pro).

Tests

Four new cases in ffmpeg-command.test.ts: --compute gpu puts compute: "gpu" in params; auto/cpu accepted; invalid values rejected; omitting the flag leaves compute out of params.

Verification

  • pnpm typecheck — clean
  • pnpm test — 134 pass / 0 fail

@a-essawy a-essawy merged commit c6cb3b6 into main Jun 13, 2026
2 checks passed
@a-essawy a-essawy mentioned this pull request Jun 13, 2026
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