@hyperframes/producer 0.9.93 → 0.9.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -64,10 +64,13 @@ export declare function createCaptureCalibrationConfig(cfg: EngineConfig): Engin
64
64
  export declare function estimateMeasuredCaptureCostMultiplier(samples: CaptureCalibrationSample[]): CaptureCostEstimate;
65
65
  /** Auto mode chose the hardware GPU and calibration measured it slow: worth timing software too. */
66
66
  export declare function shouldCalibrateSoftwareGpu(requestedMode: EngineConfig["browserGpuMode"], resolvedMode: "software" | "hardware", hardware: CaptureCostEstimate | undefined): boolean;
67
+ export declare function settleAutoGpuChoice(hardware: CaptureCostEstimate | undefined, software: CaptureCostEstimate | undefined): "software" | "hardware" | undefined;
67
68
  /** Auto mode keeps the hardware GPU unless software measured strictly faster. */
68
69
  export declare function pickAutoGpuModeFromCalibration(hardware: CaptureCostEstimate, software: CaptureCostEstimate | undefined): "software" | "hardware";
69
70
  export declare function selectCaptureCalibrationFrames(totalFrames: number): number[];
70
- export declare function measureCaptureCostFromSession(session: CaptureSession, totalFrames: number, fps: number, log?: ProducerLogger): Promise<{
71
+ export declare function measureCaptureCostFromSession(session: CaptureSession, totalFrames: number, fps: number, log?: ProducerLogger,
72
+ /** The film frame a range render starts at; samples are taken inside its window. */
73
+ firstFrame?: number): Promise<{
71
74
  estimate: CaptureCostEstimate;
72
75
  samples: CaptureCalibrationSample[];
73
76
  }>;
@@ -0,0 +1,17 @@
1
+ import type { Fps } from "@hyperframes/core";
2
+ import type { CapturePlan } from "./capturePlan.js";
3
+ /** A part of the film in seconds of the film; the output starts at 0. No end = to the film's end. */
4
+ export interface RenderRange {
5
+ startSeconds: number;
6
+ endSeconds?: number;
7
+ }
8
+ /** The film frames `[startFrame, endFrame)` a render captures. */
9
+ export interface FrameWindow {
10
+ startFrame: number;
11
+ endFrame: number;
12
+ }
13
+ /** The frames a range covers at an exact frame rate; an end past the film stops at the film's end. */
14
+ export declare function resolveFrameWindow(range: RenderRange, fps: Fps, filmFrames: number): FrameWindow;
15
+ export declare function windowStartFrame(frameWindow: FrameWindow | undefined): number;
16
+ /** The disk and layered routes capture a frame window; the streaming routes render whole films. */
17
+ export declare function assertRangeSupported(frameWindow: FrameWindow | undefined, route: CapturePlan["kind"]): void;
@@ -0,0 +1,15 @@
1
+ import type { EngineConfig } from "@hyperframes/engine";
2
+ export type GpuChoice = "software" | "hardware";
3
+ /** Where this machine's measured GPU choice lives, and the key it is valid for. */
4
+ export interface GpuChoiceStore {
5
+ file: string;
6
+ key: string;
7
+ }
8
+ /** A store only when the caller gave a file and version and the probe reached a hardware GPU. */
9
+ export declare function gpuChoiceStore(cfg: Pick<EngineConfig, "gpuChoiceFile" | "hyperframesVersion">, gpu: string | undefined): GpuChoiceStore | undefined;
10
+ /** The stored choice when it was measured for this key; undefined means measure. */
11
+ export declare function readGpuChoice(store: GpuChoiceStore): GpuChoice | undefined;
12
+ export declare function writeGpuChoice(store: GpuChoiceStore, mode: GpuChoice, measured: {
13
+ hardwareP95Ms?: number;
14
+ softwareP95Ms?: number;
15
+ }): void;
@@ -25,9 +25,14 @@ export interface AudioStageInput {
25
25
  workDir: string;
26
26
  /** `join(workDir, "compiled")`; passed through to the audio mixer for asset resolution. */
27
27
  compiledDir: string;
28
- /** Probed video frame count and exact frame rate define the delivered audio length. */
28
+ /** The film's frame count and exact frame rate define the mixed audio length. */
29
29
  totalFrames: number;
30
30
  fps: Fps;
31
+ /** Deliver only these film frames' audio, cut from the whole mix. */
32
+ frameWindow?: {
33
+ startFrame: number;
34
+ endFrame: number;
35
+ };
31
36
  /** Timeout forwarded to ffmpeg subprocesses used by the audio mixer. */
32
37
  ffmpegProcessTimeout: number;
33
38
  /** Master gain forwarded to the audio mixer. */
@@ -8,6 +8,7 @@
8
8
  * frame primitives the sequential loop uses, so the primitives are
9
9
  * centralized here.
10
10
  */
11
+ import type { Fps } from "@hyperframes/core";
11
12
  import { type BeforeCaptureHook, type CaptureSession, type ElementStackingInfo } from "@hyperframes/engine";
12
13
  import type { ProducerLogger } from "../../../logger.js";
13
14
  import { type HdrCompositeContext, type HdrVideoFrameSource, type TransitionRange } from "../../hdrCompositor.js";
@@ -39,7 +40,7 @@ export declare function distributeLayeredHybridFrameRanges(totalFrames: number,
39
40
  end: number;
40
41
  }>;
41
42
  /** Build a Set of frame indices that fall inside any transition window. */
42
- export declare function partitionTransitionFrames(transitionRanges: ReadonlyArray<Pick<TransitionRange, "startFrame" | "endFrame">>, totalFrames: number): Set<number>;
43
+ export declare function partitionTransitionFrames(transitionRanges: ReadonlyArray<Pick<TransitionRange, "startFrame" | "endFrame">>, totalFrames: number, firstFrame?: number): Set<number>;
43
44
  export interface LayeredTransitionBuffers {
44
45
  bufferA: Buffer;
45
46
  bufferB: Buffer;
@@ -113,3 +114,5 @@ export declare function cleanupEndedHdrVideos(args: {
113
114
  sceneElements: Record<string, string[]>;
114
115
  log: ProducerLogger;
115
116
  }): void;
117
+ export declare function transitionAtFrame(transitionRanges: TransitionRange[], frame: number): TransitionRange | undefined;
118
+ export declare function cleanupHdrVideosEndedBefore(firstFrame: number, fps: Fps, transitionRanges: TransitionRange[], state: Omit<Parameters<typeof cleanupEndedHdrVideos>[0], "time" | "activeTransition">): void;
@@ -6,6 +6,7 @@ import { type ReferenceBackgroundResult } from "@hyperframes/engine";
6
6
  import { type ProducerLogger } from "../logger.js";
7
7
  import { type RenderOutputFormat } from "./render/renderFormat.js";
8
8
  import { type MissingPathFacts } from "./render/missingPath.js";
9
+ import { type FrameWindow, type RenderRange } from "./render/frameWindow.js";
9
10
  import { type RenderCaptureObservability, type RenderObservabilitySummary, type OpenStallAttempt, type StageStallRule } from "./render/observability.js";
10
11
  import { type HdrPerfSummary } from "./render/hdrPerf.js";
11
12
  export declare function sampleDirectoryBytes(dir: string): number;
@@ -88,6 +89,8 @@ export interface RenderConfig {
88
89
  */
89
90
  motionBlur?: MotionBlurOptions;
90
91
  pageMotionBlur?: "off";
92
+ /** Render only this part of the film; the output starts at its start. Absent renders the whole film. */
93
+ range?: RenderRange;
91
94
  workers?: number;
92
95
  /** Wall-time budget in ms for the whole render. Absent or 0 disables the ETA guard. */
93
96
  maxRenderMs?: number;
@@ -459,6 +462,8 @@ export interface RenderJob extends Partial<ReferenceBackgroundResult> {
459
462
  outputPath?: string;
460
463
  duration?: number;
461
464
  totalFrames?: number;
465
+ /** The film frames a `range` render captures; `totalFrames` and `duration` then describe this window. */
466
+ frameWindow?: FrameWindow;
462
467
  framesRendered?: number;
463
468
  perfSummary?: RenderPerfSummary;
464
469
  audioLoweredDb?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/producer",
3
- "version": "0.9.93",
3
+ "version": "0.9.94",
4
4
  "description": "HTML-to-video rendering engine using Chrome's BeginFrame API",
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,11 +35,11 @@
35
35
  "postcss": "^8.4.0",
36
36
  "puppeteer": "~25.13.0",
37
37
  "puppeteer-core": "^25.13.0",
38
- "@hyperframes/core": "0.9.93",
39
- "@hyperframes/engine": "0.9.93",
40
- "@hyperframes/parsers": "0.9.93",
41
- "@hyperframes/lint": "0.9.93",
42
- "@hyperframes/studio-server": "0.9.93"
38
+ "@hyperframes/engine": "0.9.94",
39
+ "@hyperframes/parsers": "0.9.94",
40
+ "@hyperframes/core": "0.9.94",
41
+ "@hyperframes/studio-server": "0.9.94",
42
+ "@hyperframes/lint": "0.9.94"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/node": "^25.0.10",
@@ -48,7 +48,7 @@
48
48
  "tsx": "^4.21.0",
49
49
  "typescript": "^5.7.2",
50
50
  "vitest": "^4.1.12",
51
- "@hyperframes/aws-lambda": "0.9.93"
51
+ "@hyperframes/aws-lambda": "0.9.94"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22"