@hyperframes/producer 0.9.30 → 0.9.32

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;
@@ -0,0 +1,4 @@
1
+ /** The folder a host that ships its own GSAP names, so a render needs no network for it. */
2
+ export declare const GSAP_VENDOR_DIR_ENV = "HYPERFRAMES_GSAP_VENDOR_DIR";
3
+ /** The host's bytes for exactly the default CDN's GSAP file; a mirror's URL differs, so it never matches. */
4
+ export declare function bundledScript(url: string): Uint8Array | null;
@@ -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;
@@ -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";
@@ -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`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/producer",
3
- "version": "0.9.30",
3
+ "version": "0.9.32",
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/core": "0.9.30",
39
- "@hyperframes/lint": "0.9.30",
40
- "@hyperframes/engine": "0.9.30",
41
- "@hyperframes/parsers": "0.9.30",
42
- "@hyperframes/studio-server": "0.9.30"
38
+ "@hyperframes/engine": "0.9.32",
39
+ "@hyperframes/core": "0.9.32",
40
+ "@hyperframes/parsers": "0.9.32",
41
+ "@hyperframes/studio-server": "0.9.32",
42
+ "@hyperframes/lint": "0.9.32"
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.30"
51
+ "@hyperframes/aws-lambda": "0.9.32"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22"