Skip to content

fix(cli): a --start/--end render reports the window's length, not the film's - #8923

Open
Mats2208 wants to merge 1 commit into
heygen-com:mainfrom
Mats2208:fix/range-render-summary-duration
Open

Mats2208 wants to merge 1 commit into
heygen-com:mainfrom
Mats2208:fix/range-render-summary-duration

Conversation

@Mats2208

Copy link
Copy Markdown

What

After a range render, the summary line prints the length of the whole film instead of the length of the file that was written. Rendering 11 s to 12 s of a 24 s composition prints:

◇  .../out.mp4
   127.1 KB · 24.0s video · rendered in 39.0s

while ffprobe says the file is 1.000000 s (30 frames). The durationMs that renderLocal returns (used for the batch manifest row) has the same problem.

Why

The summary and durationMs read perfSummary.compositionDurationSeconds, which the orchestrator fills from composition.duration, the full film. For a range render the producer already sets job.duration to the window (totalFrames * fps.den / fps.num after resolveFrameWindow), and to the probed film duration otherwise. So the CLI was just reading the wrong field.

Related work

No issue for this one; it's a small, self-contained correction I hit while reproducing #8463 with the repro project from that issue. No overlapping PRs that I could find.

How

A small outputDurationSeconds(job) helper in commands/render.ts returns job.duration, falling back to perfSummary.compositionDurationSeconds if it is unset. printRenderComplete now takes that value instead of reading it off the perf summary, and the returned durationMs uses the same helper. Telemetry fields that are explicitly about the composition (compositionDurationMs) are left alone. The Docker path is unchanged: it has no job and already prints the render time only.

Test plan

  • Unit test added in packages/cli/src/commands/render.test.ts: the producer mock sets job.duration = 1 and compositionDurationSeconds = 24 for a range: { startSeconds: 11, endSeconds: 12 } render. It checks that the summary says 1.0s video (and not 24.0s video) and that durationMs is 1000. Without the fix it fails with expected '... 24.0s…' to contain '1.0s video'; with it, npx vitest run src/commands/render.test.ts passes (137/137).
  • Manual, macOS arm64, bundled chrome-headless-shell, the render --start/--end hangs after "detached Frame" with a system Chrome when a later sub-composition has an <img> #8463 repro project (24 s film, scene B at 11 s):
    • hyperframes render --start 11 --end 12 -o local.mp4 → 126.7 KB · 1.0s video · rendered in 4.9s, ffprobe 1.000000 s
    • hyperframes render -o full.mp4 → 425.3 KB · 24.0s video · rendered in 10.8s, ffprobe 24.000000 s (unchanged)
  • bun run build, bun run lint, bun run format:check, tsc --noEmit in packages/cli, node scripts/check-comment-citations.mjs and node scripts/comment-ratchet.mjs are clean.
  • Full packages/cli vitest run: 10082 passed, 9 failed. The failures are in files this PR doesn't touch (offload.undecodableTrack, studioServer.openWritesNothing, publishProject, whisper/manager-resolution, file watcher and Chrome process tests) and the same ones fail on main on this machine. They look tied to the local ffmpeg/whisper/filesystem setup.
  • Documentation updated (not applicable: no doc shows this line)
  • Comments follow CONTRIBUTING.md "Comments"

… film's

The render summary and the result's durationMs read the perf summary's
compositionDurationSeconds, which is the whole film. A range render writes
only its window, which job.duration measures, so a 1 s range of a 24 s film
printed "24.0s video".

This branch has not been deployed

No deployments
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