@hyperframes/producer 0.9.31 → 0.9.33

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.
@@ -44,6 +44,7 @@ export interface RenderRequestOptions {
44
44
  bufferSize?: string;
45
45
  videoFrameFormat?: VideoFrameFormat;
46
46
  hdrMode?: RenderConfig["hdrMode"];
47
+ chromaSubsampling?: RenderConfig["chromaSubsampling"];
47
48
  pageMotionBlur?: RenderConfig["pageMotionBlur"];
48
49
  variables?: Record<string, unknown>;
49
50
  outputResolution?: CanvasResolution;
package/dist/server.d.ts CHANGED
@@ -52,6 +52,7 @@ interface RenderInput {
52
52
  keyframeIntervalSeconds?: number;
53
53
  maxBitrate?: string;
54
54
  bufferSize?: string;
55
+ chromaSubsampling?: RenderConfig["chromaSubsampling"];
55
56
  useGpu: boolean;
56
57
  debug: boolean;
57
58
  forceScreenshot?: true;
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * The files a site upload ships, as `/`-separated paths under `projectDir`. Symlinks are followed
13
13
  * (root included), top-level {@link PLAN_PROJECT_DIR_SKIP_SEGMENTS} are left out as the plan stage
14
- * does, and a dangling symlink throws.
14
+ * does, env files are left out at every depth, and a dangling symlink throws.
15
15
  */
16
16
  export declare function listSiteFiles(projectDir: string): string[];
17
17
  /**
@@ -1,13 +1,14 @@
1
- import type { EngineConfig, MotionBlurOptions } from "@hyperframes/engine";
1
+ import type { ChromaSubsampling, EngineConfig, MotionBlurOptions } from "@hyperframes/engine";
2
2
  /**
3
3
  * The format a render captures its frames in.
4
4
  *
5
- * Two independent reasons force PNG, and conflating them is how the encoder ends up
5
+ * Three independent reasons force PNG, and conflating them is how the encoder ends up
6
6
  * hunting for `frame_%06d.jpg` against files written as `.png`:
7
7
  *
8
8
  * - the output container keeps alpha, which JPEG cannot carry;
9
9
  * - motion blur is on, because the sub-frame samples are averaged pixel by pixel and
10
- * JPEG samples would be averaged after a lossy quantization.
10
+ * JPEG samples would be averaged after a lossy quantization;
11
+ * - 4:4:4 output, because Chrome's JPEG capture is already 4:2:0.
11
12
  *
12
13
  * Every consumer of "is this render PNG" reads the resolved capture format rather than
13
14
  * re-deriving it from one of the reasons.
@@ -15,9 +16,19 @@ import type { EngineConfig, MotionBlurOptions } from "@hyperframes/engine";
15
16
  export declare function resolveCaptureImageFormat(input: {
16
17
  needsAlpha: boolean;
17
18
  motionBlur: MotionBlurOptions | undefined;
19
+ chromaSubsampling?: ChromaSubsampling;
18
20
  }): "jpeg" | "png";
19
21
  /**
20
22
  * Below 100, Chrome's JPEG turns graded colour and grain into 8x8 chroma blotches that survive
21
23
  * the final encode. Draft keeps the smaller, faster frames.
22
24
  */
23
25
  export declare function resolveCaptureJpegQuality(quality: EngineConfig["quality"]): number;
26
+ /**
27
+ * The capture fields every session of a render shares. The probe session is reused for
28
+ * capture, so the probe and the main capture options both spread this.
29
+ */
30
+ export declare function resolveCaptureSurface(input: Parameters<typeof resolveCaptureImageFormat>[0], quality: EngineConfig["quality"]): {
31
+ format: "jpeg" | "png";
32
+ quality: number | undefined;
33
+ transparent: boolean;
34
+ };
@@ -0,0 +1,18 @@
1
+ /** Fail-fast gates for `chromaSubsampling: "444"`: refuse what would ship 4:2:0 colour. */
2
+ import type { ChromaSubsampling } from "@hyperframes/engine";
3
+ export interface ChromaSubsamplingRenderConfig {
4
+ chromaSubsampling?: ChromaSubsampling;
5
+ format?: string;
6
+ hdrMode?: "auto" | "force-hdr" | "force-sdr";
7
+ useGpu?: boolean;
8
+ }
9
+ /**
10
+ * Reject the config combinations 4:4:4 cannot honor. No-op unless "444" is requested,
11
+ * so this runs unconditionally at the top of `executeRenderJob`.
12
+ */
13
+ export declare function validateChromaSubsamplingConfig(config: ChromaSubsamplingRenderConfig): void;
14
+ /**
15
+ * Reject 4:4:4 once auto HDR detection has found HDR sources, before any capture
16
+ * runs. `validateChromaSubsamplingConfig` cannot see this: it depends on probing.
17
+ */
18
+ export declare function assertChromaSubsamplingSdr(config: Pick<ChromaSubsamplingRenderConfig, "chromaSubsampling">, hasHdrContent: boolean): void;
@@ -341,6 +341,8 @@ export interface StageStallRule {
341
341
  tailMs?: number;
342
342
  detail?: () => string | undefined;
343
343
  attemptOpened?: () => void;
344
+ /** Bounded work that is not progress but not a stall either: a change keeps the current window open. */
345
+ activity?: () => number;
344
346
  }
345
347
  /**
346
348
  * Classified like the per-call protocol timeout it replaces, so the capture retry ladder retries it.
@@ -10,7 +10,7 @@
10
10
  * backwards compatibility with existing test files and external callers.
11
11
  */
12
12
  import { type CanvasResolution } from "@hyperframes/core";
13
- import type { AudioElement, ExtractedFrames, ImageElement, ParallelProgress, VideoElement } from "@hyperframes/engine";
13
+ import { type AudioElement, type ExtractedFrames, type ImageElement, type ParallelProgress, type VideoElement } from "@hyperframes/engine";
14
14
  import type { CompiledComposition } from "../htmlCompiler.js";
15
15
  import { type ProducerLogger } from "../../logger.js";
16
16
  import type { ProgressCallback, RenderJob, RenderStageProgress, RenderStatus } from "../renderOrchestrator.js";
@@ -114,6 +114,9 @@ export declare function reportEncodeProgress(job: RenderJob, done: number, total
114
114
  /** Seconds of the final file written, 90% to 99%: only a complete file reaches 100. */
115
115
  export declare function reportAssembleProgress(job: RenderJob, done: number, total: number, onProgress: ProgressCallback | undefined): void;
116
116
  export declare function forgetWorkerPhases(job: object): void;
117
+ /** Counts a render's still-frame check screenshots; the capture stall watcher reads it as activity. */
118
+ export declare function noteStaticDedupActivity(job: object): void;
119
+ export declare function staticDedupActivity(job: object): number;
117
120
  export declare function describeWorkerPhases(job: object): string | undefined;
118
121
  /** Browser warm-up before the first frame, from the parallel workers' phase events. */
119
122
  export declare function reportWorkerStartup(job: RenderJob, progress: ParallelProgress, onProgress: ProgressCallback | undefined): void;
@@ -25,7 +25,7 @@
25
25
  * regex, the same first-10/first-5 slicing, and the same `console.warn`
26
26
  * prefix.
27
27
  */
28
- import { type CaptureOptions, type CaptureSession, type CompositionLengthSource, type EngineConfig, type SubTimelineWaitMemo } from "@hyperframes/engine";
28
+ import { type CaptureOptions, type CaptureSession, type CompositionLengthSource, type EngineConfig, type SubTimelineWaitMemo, type StaticDedupMemo } from "@hyperframes/engine";
29
29
  import type { CompiledComposition } from "../../htmlCompiler.js";
30
30
  import { type FileServerHandle } from "../../fileServer.js";
31
31
  import type { ProducerLogger } from "../../../logger.js";
@@ -55,6 +55,7 @@ export interface ProbeStageInput {
55
55
  needsAlpha: boolean;
56
56
  deviceScaleFactor: number;
57
57
  subTimelineWaitMemo: SubTimelineWaitMemo;
58
+ staticDedupMemo?: StaticDedupMemo;
58
59
  }
59
60
  export interface ProbeStageResult {
60
61
  /** May be reassigned from `recompileWithResolutions`. */
@@ -1,5 +1,5 @@
1
1
  import { type CanvasResolution, type Fps, type FpsInput, type HfVfxCapture } from "@hyperframes/core";
2
- import { type EngineConfig, type ExtractionPhaseBreakdown, type VideoFrameFormat, type CaptureOptions, type CaptureVideoMetadataHint, type CaptureSession, type BeforeCaptureHook, type ProresProfile, type ParallelProgress, type WorkerTask, type CapturePerfSummary, type CaptureWarning, type SubTimelineWaitOutcome, type WorkerSizing, type StaticVerificationOutcome, explainDrawElementDisabled, type CaptureFailureKind, displaySize, type MotionBlurOptions, type PageMotionBlurSummary } from "@hyperframes/engine";
2
+ import { type EngineConfig, type ExtractionPhaseBreakdown, type VideoFrameFormat, type CaptureOptions, type CaptureVideoMetadataHint, type CaptureSession, type BeforeCaptureHook, type ProresProfile, type ParallelProgress, type WorkerTask, type CapturePerfSummary, type CaptureWarning, type SubTimelineWaitOutcome, type WorkerSizing, type StaticVerificationOutcome, explainDrawElementDisabled, type CaptureFailureKind, displaySize, type ChromaSubsampling, type MotionBlurOptions, type PageMotionBlurSummary } from "@hyperframes/engine";
3
3
  import { type ReferenceBackgroundResult } from "@hyperframes/engine";
4
4
  import { type ProducerLogger } from "../logger.js";
5
5
  import { type RenderOutputFormat } from "./render/renderFormat.js";
@@ -110,6 +110,8 @@ export interface RenderConfig {
110
110
  maxBitrate?: string;
111
111
  /** Rate-cap buffer; defaults to twice `maxBitrate`. */
112
112
  bufferSize?: string;
113
+ /** MP4 chroma, default `"420"`. `"444"` captures PNG and encodes yuv444p (SDR, software). */
114
+ chromaSubsampling?: ChromaSubsampling;
113
115
  /**
114
116
  * Source-video frame extraction format. Defaults to `"auto"`, which preserves
115
117
  * the historical behavior: alpha/alpha-capable sources extract as PNG, all
@@ -574,11 +576,13 @@ export declare function captureAttemptMadeProgress(attemptTargetFrameCount: numb
574
576
  export declare function resetCaptureAttemptProgress(job: {
575
577
  framesRendered?: number;
576
578
  }): void;
579
+ /** Allowed wait for the first frame, given how long the probe's browser took to start; 0 or unknown keeps 300 s. */
580
+ export declare function firstFrameWindowMs(probeStartupMs: number | undefined): number;
577
581
  /** The no-progress rule for capture stages that have no watchdog of their own: disk, HDR, chunk. Once
578
582
  * `totalFrames` have landed the frame count can no longer change, so the stage is judged on the tail budget. */
579
583
  export declare function frameStallRule(job: {
580
584
  framesRendered?: number;
581
- }, totalFrames: number): StageStallRule;
585
+ }, totalFrames: number, probeStartupMs: number | undefined): StageStallRule;
582
586
  export declare function isRecoverableParallelCaptureError(error: unknown): boolean;
583
587
  /**
584
588
  * Turn a cryptic memory-exhaustion failure (V8 `Set maximum size exceeded`,
@@ -51,6 +51,4 @@ export declare function toExternalAssetKey(absPath: string): string;
51
51
  export declare function formatCaptureFrameName(index: number, ext: string): string;
52
52
  export declare function formatExportFrameName(index: number, ext: string): string;
53
53
  export declare function resolveRenderPaths(projectDir: string, outputPath: string | null | undefined, rendersDir?: string): RenderPaths;
54
- /** The project file a data-composition-src names, as the preview reads it; null when it leaves the project. */
55
- export declare function resolveCompositionSrc(projectDir: string, src: string): string | null;
56
54
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/producer",
3
- "version": "0.9.31",
3
+ "version": "0.9.33",
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.11.0",
37
37
  "puppeteer-core": "^25.11.0",
38
- "@hyperframes/engine": "0.9.31",
39
- "@hyperframes/core": "0.9.31",
40
- "@hyperframes/lint": "0.9.31",
41
- "@hyperframes/parsers": "0.9.31",
42
- "@hyperframes/studio-server": "0.9.31"
38
+ "@hyperframes/lint": "0.9.33",
39
+ "@hyperframes/parsers": "0.9.33",
40
+ "@hyperframes/studio-server": "0.9.33",
41
+ "@hyperframes/engine": "0.9.33",
42
+ "@hyperframes/core": "0.9.33"
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.11",
51
- "@hyperframes/aws-lambda": "0.9.31"
51
+ "@hyperframes/aws-lambda": "0.9.33"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22"