feat(producer): distributed and range renders honour page motion blur (#7311)

* feat(producer): distributed and range renders honour page motion blur

A film with data-motion-blur="on" blurs the same way however it is rendered. plan() no longer
forces the synthetic job to pageMotionBlur "off", so the plan locks screenshot capture for a
blurred film as a whole render does, and renderChunk() no longer defaults the page's off switch
to "distributed-render". An explicit pageMotionBlur "off" in the config still stands the page down.

Hosted renders pick this up after the next OSS release and a producer pin bump; a render of a
blur-on film that goes distributed changes output then.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* test(producer): the default tier blurs the same in chunks; docs agree distributed renders blur

Two files compare plan -> renderChunk -> assemble with the tier attribute removed, so `auto`
(the filter tier) decides, against a whole render: held-card and callbacks (the muted-callback
path). The skill's motion reference no longer says distributed renders are off. The rewritten
R19 plan test gets 60 s for its three plan() calls.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Vance Ingalls
2026-11-09 09:10:46 +00:00
committed by GitHub
co-authored by Claude Sonnet 5.5
parent e351253724
commit c38ac5438c
22 changed files with 448 additions and 26 deletions
+2 -1
View File
@@ -69,7 +69,7 @@ A page that asks for capture gets the filter tier instead when capture cannot ru
This is decided once for the whole composition, from the first frame. A defect the scan misses (a WebGL canvas added late, say) is caught per frame instead: that one frame is rendered sharp and counted in `failedFrames`.
Blur is off, and stays off, for HDR renders, distributed renders, and renders that use the engine's own sub-frame blur.
Blur is off, and stays off, for HDR renders and renders that use the engine's own sub-frame blur. Distributed renders (`plan`, `renderChunk`, `assemble`, as the AWS Lambda and Google Cloud Run adapters run them) and `--start`/`--end` range renders blur like a whole local render. Pass `--page-motion-blur off` (or `pageMotionBlur: "off"` in a distributed config) to render them sharp.
### Find out which one is drawing
@@ -88,6 +88,7 @@ In the page, `window.__hfMotionBlur.report()` returns `state`, `tier`, `reason`,
## Cost and limits
- **Render time.** It varies by film. On an 8 s test composition with four whips, a render took 9.8 s with capture, 5.2–5.4 s with the filter tier and 5.3–5.9 s with no blur (two runs each, including startup). On two real 1080p films the filter tier cost more than capture, measured as CPU seconds of the whole render (wall time was too noisy on a loaded machine): `spacex-launch` (77 movers, 39.5 s) took 547–552 CPU s with the filter tier, 302–320 with capture and 184–193 with no blur (three runs each, 2.9 times no blur); `k3-promo` (106 movers, 16.5 s) took 236, 205 and 117 (one run per arm, 2.0 times no blur). The two films do not order by mover count, and the cause of the difference was not isolated. The filter tier draws each mover as at least 32 offset copies per frame; capture adds a second paint per blurred frame.
- **Distributed renders.** Blur applies in every chunk, drawn with the filter tier on `auto`. Measured on two real 1080p films with plan, `renderChunk` and assemble at 240 frames per chunk, in a software-GPU Chrome 153 on a machine other work was loading (load average 12 to 25), one run per arm: summed chunk CPU seconds went from 155 to 246 (1.6 times) on `k3-promo` and from 338 to 545 (1.6 times) on `spacex-launch`; summed chunk wall time rose 1.2 and 1.4 times. A film with `data-motion-blur="on"` also plans screenshot capture instead of BeginFrame capture, and the measured cost includes that switch.
- **Editing.** The filter tier never wraps anything. With capture the root is wrapped only while playing or rendering; paused, it is plain DOM, so click-to-select works.
- **Capture only.** Blurred preview can run at half the frame rate on heavy compositions, and a `<video>` drawn through the capture looks about 2–3% darker in the browser editor preview than in normal playback. Renders are not affected.
- **Preview and render.** `auto` draws the same way in both. A page that asks for capture previews with the filter tier in a browser without HTML in Canvas, so a spin or zoom looks softer there than in the render.
+1 -1
View File
@@ -22,6 +22,6 @@ The same attributes drive the browser editor preview and `hyperframes render`.
- `npx hyperframes check` reports `motion_blur_filter_fallback`, `motion_blur_no_movers` and `motion_blur_unverified`
- `hyperframes render --page-motion-blur off` renders without the composition's blur
- Blur is off for HDR, distributed, and sub-frame-blur renders
- Blur is off for HDR and sub-frame-blur renders; distributed and `--start`/`--end` range renders blur like a whole render
Full guide: https://hyperframes.heygen.com/guides/motion-blur
@@ -9,6 +9,13 @@
"src/services/htmlCompiler.heif.test.ts",
"src/services/vfxDeterminism.test.ts",
"src/services/distributed/assemble.test.ts",
"src/services/distributed/blurChunks.callbacks.integration.test.ts",
"src/services/distributed/blurChunks.callbacksFilter.integration.test.ts",
"src/services/distributed/blurChunks.configOff.integration.test.ts",
"src/services/distributed/blurChunks.heldCard.integration.test.ts",
"src/services/distributed/blurChunks.heldCardFilter.integration.test.ts",
"src/services/distributed/blurChunks.onceGuardLabel.integration.test.ts",
"src/services/distributed/blurChunks.scrollList.integration.test.ts",
"src/services/distributed/chunkBoundary.test.ts",
"src/services/distributed/crossWorkerIdempotency.test.ts",
"src/services/distributed/plan.masterBus.test.ts",
+5 -3
View File
@@ -32,9 +32,11 @@ const vitestFiles = tests.filter((test) => test.runner === "vitest").map((test)
const vitestEnv = unit
? { NODE_OPTIONS: `${process.env.NODE_OPTIONS ?? ""} --import ${noNetwork.href}`.trim() }
: {};
// Files that start many Chromes at once run alone, after the rest: next to them, the Chrome
// node-count assertions in coreRuntimeBrowser.test.ts see a different garbage-collection schedule.
const runsAlone = (file) => /\/blurDifferential(\.\w+)?\.integration\.test\.ts$/.test(file);
// Files that start many Chromes at once run alone, after the rest and one file at a time: next to
// them, the Chrome node-count assertions in coreRuntimeBrowser.test.ts see a different
// garbage-collection schedule.
const runsAlone = (file) =>
/(^|\/)blur(Differential|Chunks)[^/]*\.integration\.test\.ts$/.test(file);
const shared = vitestFiles.filter((file) => !runsAlone(file));
const alone = vitestFiles.filter(runsAlone);
if (shared.length > 0) run(["x", "vitest", "run", ...shared], vitestEnv);
@@ -0,0 +1,210 @@
import { spawnSync } from "node:child_process";
import { mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { afterAll, beforeAll, expect } from "vitest";
import { decodePng, getFfmpegBinary, resolveConfig } from "@hyperframes/engine";
import {
compareTiles,
type Differential,
type Rgba,
} from "../../../../../engine/src/services/__fixtures__/blurDifferential.js";
import {
FIXTURES,
type BlurFixture,
} from "../../../../../engine/src/services/__fixtures__/motionBlur/fixtures.js";
import {
INVARIANTS,
RENDER_OUTSIDE_MAX_MAE,
} from "../../../../../engine/src/services/__fixtures__/motionBlur/thresholds.js";
import { createRenderJob, executeRenderJob } from "../../renderOrchestrator.js";
import { assemble } from "../assemble.js";
import { plan, type DistributedRenderConfig } from "../plan.js";
import { renderChunk } from "../renderChunk.js";
export const HAS_FFMPEG =
spawnSync(getFfmpegBinary(), ["-version"], { encoding: "utf-8" }).status === 0;
const FPS = 30;
/** Four workers over 60 frames start at 0, 15, 30 and 45, so no block starts where a 20-frame chunk does. */
export const WHOLE_WORKERS = 4;
const CHUNK_SIZE = 20;
export const RENDER_TIMEOUT_MS = 600_000;
const quietLogger = { info() {}, warn() {}, error() {}, debug() {} };
export const fixtureNamed = (name: string): BlurFixture => {
const f = FIXTURES.find((x) => x.name === name);
if (!f) throw new Error(`missing fixture ${name}`);
return f;
};
/** The fixture with its `data-motion-blur-tier` removed, so `auto` itself picks the tier (the filter tier). */
function withoutTierAttribute(f: BlurFixture): BlurFixture {
const html = (blur: "on" | "off"): string => {
const pinned = f.html(blur);
const stripped = pinned.replace(/ data-motion-blur-tier="[a-z]+"/, "");
if (blur === "on" && stripped === pinned) throw new Error(`${f.name} pins no tier to remove`);
return stripped;
};
return { ...f, html };
}
/** A scratch directory for the suite, whose fontconfig draws grayscale text so DOM glyphs and the capture canvas agree. */
export function useBlurScratch(): () => string {
let root = "";
let prior: string | undefined;
beforeAll(() => {
root = mkdtempSync(join(tmpdir(), "hf-blur-chunks-"));
prior = process.env.FONTCONFIG_FILE;
const conf = join(root, "fonts.conf");
writeFileSync(
conf,
`<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd"><fontconfig>
<include ignore_missing="yes">/etc/fonts/fonts.conf</include>
<match target="font"><edit name="rgba" mode="assign"><const>none</const></edit></match>
</fontconfig>`,
);
process.env.FONTCONFIG_FILE = conf;
});
afterAll(() => {
if (prior === undefined) delete process.env.FONTCONFIG_FILE;
else process.env.FONTCONFIG_FILE = prior;
rmSync(root, { recursive: true, force: true });
});
return () => root;
}
function decodeFrames(dir: string): Rgba[] {
return readdirSync(dir)
.filter((file) => file.endsWith(".png"))
.sort()
.map((file) => decodePng(readFileSync(join(dir, file))));
}
function writeProject(root: string, f: BlurFixture, blur: "on" | "off", tag: string) {
const workDir = join(root, `${f.name}-${tag}`);
const projectDir = join(workDir, "project");
mkdirSync(projectDir, { recursive: true });
writeFileSync(join(projectDir, "index.html"), f.html(blur));
return { workDir, projectDir };
}
/** The normal in-process render: the page's own `data-motion-blur` decides. */
export async function renderWhole(
root: string,
f: BlurFixture,
blur: "on" | "off",
workers: number,
): Promise<Rgba[]> {
const { workDir, projectDir } = writeProject(root, f, blur, `whole-${blur}`);
const outputDir = join(workDir, "frames");
const job = createRenderJob({
fps: FPS,
format: "png-sequence",
quality: "standard",
hdrMode: "force-sdr",
useGpu: false,
workers,
logger: quietLogger,
producerConfig: resolveConfig({ browserGpuMode: "software" }),
});
await executeRenderJob(job, projectDir, outputDir);
const frames = decodeFrames(outputDir);
rmSync(workDir, { recursive: true, force: true });
return frames;
}
/** plan() then renderChunk() per chunk then assemble(), the way a Lambda or Cloud Run fan-out runs. */
export async function renderChunked(
root: string,
f: BlurFixture,
blur: "on" | "off",
tag: string,
config: Partial<DistributedRenderConfig> = {},
): Promise<Rgba[]> {
const { workDir, projectDir } = writeProject(root, f, blur, tag);
const planDir = join(workDir, "plan");
const chunksDir = join(workDir, "chunks");
const outputDir = join(workDir, "frames");
mkdirSync(planDir, { recursive: true });
mkdirSync(chunksDir, { recursive: true });
const planned = await plan(
projectDir,
{
fps: FPS,
width: f.width,
height: f.height,
format: "png-sequence",
chunkSize: CHUNK_SIZE,
rejectOnSystemFonts: false,
failClosedFontFetch: false,
...config,
},
planDir,
);
const chunkPaths: string[] = [];
for (let i = 0; i < planned.chunkCount; i++) {
const chunkPath = join(chunksDir, `chunk-${String(i).padStart(4, "0")}`);
await renderChunk(planDir, i, chunkPath);
chunkPaths.push(chunkPath);
}
await assemble(planDir, chunkPaths, null, outputDir);
const frames = decodeFrames(outputDir);
rmSync(workDir, { recursive: true, force: true });
return frames;
}
const wholeFrameMask = (frame: Rgba): Uint8Array => new Uint8Array(frame.width * frame.height);
function at(frames: readonly Rgba[], n: number): Rgba {
const frame = frames[n];
if (!frame) throw new Error(`missing frame ${n}`);
return frame;
}
/** Whole-frame tile comparison of every frame: no trail is masked out, chunk boundaries included. */
export function compareEveryFrame(
reference: readonly Rgba[],
actual: readonly Rgba[],
): { frame: number; differential: Differential }[] {
if (actual.length !== reference.length) {
throw new Error(`frame count ${actual.length} differs from ${reference.length}`);
}
return reference.map((frame, n) => ({
frame: n,
differential: compareTiles(frame, at(actual, n), wholeFrameMask(frame), "outside", {
block: INVARIANTS.block,
maxMae: RENDER_OUTSIDE_MAX_MAE,
}),
}));
}
export function worstMae(results: readonly { differential: Differential }[]): number {
return Math.max(...results.map((x) => x.differential.worstMae));
}
export function expectEqualFrames(
label: string,
results: readonly { frame: number; differential: Differential }[],
): void {
const firstBad = results
.filter((x) => x.differential.bad.length > 0)
.slice(0, 5)
.map((x) => ({ frame: x.frame, bad: x.differential.bad.slice(0, 3) }));
expect(
results.flatMap((x) => x.differential.bad),
`${label} ${JSON.stringify(firstBad)}`,
).toEqual([]);
}
/** The frames of plan() -> renderChunk() -> assemble() with blur on equal a whole in-process render with blur on. */
export async function expectChunksEqualWhole(
root: string,
name: string,
tier: "capture" | "auto" = "capture",
): Promise<void> {
const f = tier === "auto" ? withoutTierAttribute(fixtureNamed(name)) : fixtureNamed(name);
const whole = await renderWhole(root, f, "on", WHOLE_WORKERS);
const chunked = await renderChunked(root, f, "on", "chunked-on");
expectEqualFrames(name, compareEveryFrame(whole, chunked));
}
@@ -0,0 +1,21 @@
// Page motion blur through plan() -> renderChunk() -> assemble() on `callbacks`: the frames a fan-out
// assembles equal the frames a whole in-process render draws, chunk boundaries included.
// Needs Chrome and ffmpeg: integration lane.
import { describe, it } from "vitest";
import {
expectChunksEqualWhole,
HAS_FFMPEG,
RENDER_TIMEOUT_MS,
useBlurScratch,
} from "./__test_utils__/blurChunkRender.js";
describe.skipIf(!HAS_FFMPEG)("page motion blur in a distributed render: callbacks", () => {
const root = useBlurScratch();
it(
"chunks of 20 frames assemble to the whole render's frames",
() => expectChunksEqualWhole(root(), "callbacks"),
RENDER_TIMEOUT_MS,
);
});
@@ -0,0 +1,24 @@
// The default tier through plan() -> renderChunk() -> assemble() on `callbacks`: with no
// data-motion-blur-tier on the root, `auto` draws with the filter tier, and the frames a fan-out
// assembles equal a whole in-process render's. Needs Chrome and ffmpeg: integration lane.
import { describe, it } from "vitest";
import {
expectChunksEqualWhole,
HAS_FFMPEG,
RENDER_TIMEOUT_MS,
useBlurScratch,
} from "./__test_utils__/blurChunkRender.js";
describe.skipIf(!HAS_FFMPEG)(
"page motion blur in a distributed render, auto tier: callbacks",
() => {
const root = useBlurScratch();
it(
"chunks of 20 frames assemble to the whole render's frames",
() => expectChunksEqualWhole(root(), "callbacks", "auto"),
RENDER_TIMEOUT_MS,
);
},
);
@@ -0,0 +1,41 @@
// An explicit pageMotionBlur "off" in the distributed config still stands the page's blur down:
// the escape hatch behind `hyperframes render --page-motion-blur off`. Needs Chrome and ffmpeg:
// integration lane.
import { describe, expect, it } from "vitest";
import { RENDER_OUTSIDE_MAX_MAE } from "../../../../engine/src/services/__fixtures__/motionBlur/thresholds.js";
import {
compareEveryFrame,
expectEqualFrames,
fixtureNamed,
HAS_FFMPEG,
RENDER_TIMEOUT_MS,
renderChunked,
renderWhole,
useBlurScratch,
WHOLE_WORKERS,
worstMae,
} from "./__test_utils__/blurChunkRender.js";
describe.skipIf(!HAS_FFMPEG)("page motion blur in a distributed render: config off", () => {
const root = useBlurScratch();
it(
"keeps pageMotionBlur off when the config says off",
async () => {
const f = fixtureNamed("held-card");
const wholeOff = await renderWhole(root(), f, "off", WHOLE_WORKERS);
const stoodDown = await renderChunked(root(), f, "on", "chunked-config-off", {
pageMotionBlur: "off",
});
expectEqualFrames("config off", compareEveryFrame(wholeOff, stoodDown));
const blurred = await renderChunked(root(), f, "on", "chunked-on");
expect(
worstMae(compareEveryFrame(wholeOff, blurred)),
"blur on must differ from blur off, or the comparison above proves nothing",
).toBeGreaterThan(RENDER_OUTSIDE_MAX_MAE);
},
RENDER_TIMEOUT_MS,
);
});
@@ -0,0 +1,21 @@
// Page motion blur through plan() -> renderChunk() -> assemble() on `held-card`: the frames a fan-out
// assembles equal the frames a whole in-process render draws, chunk boundaries included.
// Needs Chrome and ffmpeg: integration lane.
import { describe, it } from "vitest";
import {
expectChunksEqualWhole,
HAS_FFMPEG,
RENDER_TIMEOUT_MS,
useBlurScratch,
} from "./__test_utils__/blurChunkRender.js";
describe.skipIf(!HAS_FFMPEG)("page motion blur in a distributed render: held-card", () => {
const root = useBlurScratch();
it(
"chunks of 20 frames assemble to the whole render's frames",
() => expectChunksEqualWhole(root(), "held-card"),
RENDER_TIMEOUT_MS,
);
});
@@ -0,0 +1,24 @@
// The default tier through plan() -> renderChunk() -> assemble() on `held-card`: with no
// data-motion-blur-tier on the root, `auto` draws with the filter tier, and the frames a fan-out
// assembles equal a whole in-process render's. Needs Chrome and ffmpeg: integration lane.
import { describe, it } from "vitest";
import {
expectChunksEqualWhole,
HAS_FFMPEG,
RENDER_TIMEOUT_MS,
useBlurScratch,
} from "./__test_utils__/blurChunkRender.js";
describe.skipIf(!HAS_FFMPEG)(
"page motion blur in a distributed render, auto tier: held-card",
() => {
const root = useBlurScratch();
it(
"chunks of 20 frames assemble to the whole render's frames",
() => expectChunksEqualWhole(root(), "held-card", "auto"),
RENDER_TIMEOUT_MS,
);
},
);
@@ -0,0 +1,21 @@
// Page motion blur through plan() -> renderChunk() -> assemble() on `once-guard-label`: the frames a fan-out
// assembles equal the frames a whole in-process render draws, chunk boundaries included.
// Needs Chrome and ffmpeg: integration lane.
import { describe, it } from "vitest";
import {
expectChunksEqualWhole,
HAS_FFMPEG,
RENDER_TIMEOUT_MS,
useBlurScratch,
} from "./__test_utils__/blurChunkRender.js";
describe.skipIf(!HAS_FFMPEG)("page motion blur in a distributed render: once-guard-label", () => {
const root = useBlurScratch();
it(
"chunks of 20 frames assemble to the whole render's frames",
() => expectChunksEqualWhole(root(), "once-guard-label"),
RENDER_TIMEOUT_MS,
);
});
@@ -0,0 +1,21 @@
// Page motion blur through plan() -> renderChunk() -> assemble() on `scroll-list`: the frames a fan-out
// assembles equal the frames a whole in-process render draws, chunk boundaries included.
// Needs Chrome and ffmpeg: integration lane.
import { describe, it } from "vitest";
import {
expectChunksEqualWhole,
HAS_FFMPEG,
RENDER_TIMEOUT_MS,
useBlurScratch,
} from "./__test_utils__/blurChunkRender.js";
describe.skipIf(!HAS_FFMPEG)("page motion blur in a distributed render: scroll-list", () => {
const root = useBlurScratch();
it(
"chunks of 20 frames assemble to the whole render's frames",
() => expectChunksEqualWhole(root(), "scroll-list"),
RENDER_TIMEOUT_MS,
);
});
@@ -18,8 +18,8 @@ describe("buildChunkCaptureOptions", () => {
).toBe("off");
});
it("turns the page's capture motion blur off: a distributed render has no preview to match (R19)", () => {
expect(buildChunkCaptureOptions(input).pageMotionBlur).toBe("distributed-render");
it("leaves the composition's own data-motion-blur in charge when the planner froze no value", () => {
expect(buildChunkCaptureOptions(input).pageMotionBlur).toBeUndefined();
});
it("asks for no engine motion blur either", () => {
@@ -162,7 +162,7 @@ export function buildChunkCaptureOptions(input: {
...(videoCaptureBeyondViewport !== undefined
? { captureBeyondViewport: videoCaptureBeyondViewport }
: {}),
pageMotionBlur: encoder.pageMotionBlur ?? "distributed-render",
pageMotionBlur: encoder.pageMotionBlur,
// A fixed warmup count keeps `beginFrameTimeTicks` host-independent.
lockWarmupTicks: true,
requiresWebGpu: compositionRequiresWebGpu(input.html),
@@ -192,15 +192,18 @@ describe("distributed synthetic render job", () => {
expect(job.config.variables).toEqual(variables);
});
it("turns the page's capture motion blur off for the plan probe (R19)", () => {
const job = buildSyntheticRenderJob({
fps: { num: 30, den: 1 },
format: "mp4",
quality: "high",
hdrMode: "force-sdr",
entryFile: "index.html",
});
expect(job.config.pageMotionBlur).toBe("off");
it("leaves the page's own motion blur in charge for the plan probe, unless the config says off", () => {
const job = (pageMotionBlur?: "off") =>
buildSyntheticRenderJob({
fps: { num: 30, den: 1 },
format: "mp4",
quality: "high",
hdrMode: "force-sdr",
entryFile: "index.html",
pageMotionBlur,
});
expect(job().config.pageMotionBlur).toBeUndefined();
expect(job("off").config.pageMotionBlur).toBe("off");
});
it("keeps the production software-GPU launch on BeginFrame control", () => {
@@ -582,25 +585,27 @@ describe("resolveChunkPlan", () => {
});
describe("plan() and page motion blur (R19)", () => {
const planCaptureMode = async (html: string, name: string) => {
const planCaptureMode = async (html: string, name: string, pageMotionBlur?: "off") => {
const dir = join(runRoot, name);
mkdirSync(dir, { recursive: true });
writeFileSync(join(dir, "index.html"), html, "utf-8");
const planDir = join(runRoot, `${name}-plan`);
await plan(dir, { fps: 30, width: 320, height: 240, format: "mp4" }, planDir);
await plan(dir, { fps: 30, width: 320, height: 240, format: "mp4", pageMotionBlur }, planDir);
const meta = JSON.parse(readFileSync(join(planDir, "meta", "encoder.json"), "utf-8"));
return { captureMode: meta.captureMode ?? null, forceScreenshot: meta.forceScreenshot ?? null };
};
it("does not route a data-motion-blur composition through screenshot capture", async () => {
it("routes a data-motion-blur composition through screenshot capture unless the config says off", async () => {
const blur = FIXTURE_HTML.replace(
'data-composition-id="root"',
'data-composition-id="root" data-motion-blur="on"',
);
const plain = await planCaptureMode(FIXTURE_HTML, "blur-plain");
const blurred = await planCaptureMode(blur, "blur-on");
expect(blurred).toEqual(plain);
}, 30_000);
expect(blurred).toEqual({ captureMode: "screenshot", forceScreenshot: true });
expect(plain).toEqual({ captureMode: "beginframe", forceScreenshot: false });
expect(await planCaptureMode(blur, "blur-config-off", "off")).toEqual(plain);
}, 60_000);
});
describe("buildChunkSlices", () => {
@@ -1228,6 +1228,7 @@ async function compilePlanComposition(
logger: config.logger,
producerConfig: cfg,
variables: config.variables,
pageMotionBlur: config.pageMotionBlur,
});
const entryFile = config.entryFile ?? "index.html";
const htmlPath = join(projectDir, entryFile);
@@ -676,6 +676,7 @@ export async function renderChunk(
bitrate: encoder.bitrate,
hdrMode: "force-sdr",
entryFile: "index.html",
pageMotionBlur: encoder.pageMotionBlur,
});
job.totalFrames = framesInChunk;
job.duration = (framesInChunk * plan.dimensions.fpsDen) / plan.dimensions.fpsNum;
@@ -32,3 +32,24 @@ describe("validateDistributedRenderConfig minParallelChunks", () => {
);
});
});
describe("validateDistributedRenderConfig pageMotionBlur", () => {
it("accepts off, the one value that stands the page's blur down, and no value", () => {
expect(() =>
validateDistributedRenderConfig({ ...base, format: "mp4", pageMotionBlur: "off" }),
).not.toThrow();
expect(() => validateDistributedRenderConfig({ ...base, format: "mp4" })).not.toThrow();
});
it("refuses any other value", () => {
for (const value of ["on", "distributed-render", "hdr-render", ""]) {
expect(() =>
validateDistributedRenderConfig({
...base,
format: "mp4",
pageMotionBlur: value as unknown as "off",
}),
).toThrow('must be "off" when provided');
}
});
});
@@ -444,6 +444,7 @@ export interface SyntheticRenderJobInput {
producerConfig?: RenderConfig["producerConfig"];
/** Render-time overrides consumed by the plan browser probe. */
variables?: RenderConfig["variables"];
pageMotionBlur?: RenderConfig["pageMotionBlur"];
}
/**
@@ -471,7 +472,7 @@ export function buildSyntheticRenderJob(input: SyntheticRenderJobInput): RenderJ
strictness: input.strictness,
producerConfig: input.producerConfig,
variables: input.variables,
pageMotionBlur: "off",
pageMotionBlur: input.pageMotionBlur,
};
return createRenderJob(renderConfig);
}
+1 -1
View File
@@ -46,7 +46,7 @@
"packages/producer/tests/**/*.test.ts"
],
"sources": {
"packages/producer/scripts/run-test-lane.mjs": "b6adeeead65842e10ee0ea14dfc91328e4d17f93adab49b66f7548fa3369be2d",
"packages/producer/scripts/run-test-lane.mjs": "4515ef37e756e000d6d3774b66154cba0821bdf7bd3f7da7d1dd3afa69bb7be8",
"packages/producer/scripts/test-classification.mjs": "e0874fac79225203b38778b144adb753a656afa0f78e08758001ff32ba9a0c62",
".github/workflows/ci.yml#job#producer-source-tests": "45da72aa6cf08cdfd5bcf5311e89f12af4842f9eebc6735df19da8c02f4d4864",
"packages/producer/package.json#script#test:unit": "ae6beda8319d166774be958ea5593cd27dbf7f6c9bce1d787a3fe28dfc3477b1",
+1 -1
View File
@@ -6,7 +6,7 @@
"files": 2
},
"hyperframes": {
"hash": "17e33f68596da873",
"hash": "5100eacf7dc137af",
"files": 78
},
"hyperframes-cli": {
+1 -1
View File
@@ -5,7 +5,7 @@
Measured frame by frame from the official HyperFrames launch films. These are defaults: a reference the person gave, or a Moment that does otherwise on purpose, wins for its own beat.
- **Moves**: a fast move takes 0.3–0.6 s and carries motion blur on its own ease, peaking at its fastest frame: 6–12 px on text-sized elements, 15–20 px full-frame, horizontal-only on a horizontal move. One move is one tween.
- **Render-time blur**: for fast 2D movers, `data-motion-blur="on"` on the composition root smears them along their real path in preview and render (opt-in; also `data-motion-blur-shutter` for a longer smear, 360 is strong; `-events="on"` when the motion is set from a timeline callback such as a `render(t)` function). Suggest it when the person asks for blur or a filmic look and the piece moves fast. It draws with a per-element filter that works over WebGL and in any Chrome (cost varies by film; on two real films it cost more than capture) (spins and zooms soften rather than streak); `data-motion-blur-tier="capture"` opts into the truer capture, which loses anything in front of a mover and ignores blend modes. It is off only for HDR and distributed renders. Opt a subtree out with `data-motion-blur="off"`, e.g. a seam that already carries its own blur. After adding it run `hyperframes check`. Guide: /guides/motion-blur.
- **Render-time blur**: for fast 2D movers, `data-motion-blur="on"` on the composition root smears them along their real path in preview and render (opt-in; also `data-motion-blur-shutter` for a longer smear, 360 is strong; `-events="on"` when the motion is set from a timeline callback such as a `render(t)` function). Suggest it when the person asks for blur or a filmic look and the piece moves fast. It draws with a per-element filter that works over WebGL and in any Chrome (cost varies by film; on two real films it cost more than capture) (spins and zooms soften rather than streak); `data-motion-blur-tier="capture"` opts into the truer capture, which loses anything in front of a mover and ignores blend modes. It is off for HDR renders and renders that use the engine's own sub-frame blur; distributed and `--start`/`--end` range renders blur like a whole render, and `hyperframes render --page-motion-blur off` renders without it. Opt a subtree out with `data-motion-blur="off"`, e.g. a seam that already carries its own blur. After adding it run `hyperframes check`. Guide: /guides/motion-blur.
- **Arrive slow, leave clean**: long-tailed ease-outs on arrivals; landing takes longer than leaving. An exit is one smooth motion, never slide, stop, then leave. Entrances that are too snappy read as glitches; slowing the whole video by about a second often fixes it.
- **Ease by role**: an arrival lands on a long tail (`expo.out`, `power4.out`), a camera move or a colour flood eases both ways (`power2.inOut`), a zoom through or an exit accelerates (`power3.in`). The same `power2.out` at 0.5 s on everything is the flat default that makes a film feel generated. Linear only for rotation, progress and constant speed that is the point.
- **Springs** are named by damping ratio: 1.0 never bounces, 0.7-0.85 reads premium, 0.4-0.6 playful, under 0.3 a cartoon. Position and size may bounce; opacity and colour never do. GSAP's `elastic.out(1, 0.5)` and `back.out(1.4)` are the nearest built-ins; a closed-form spring of `t` keeps any frame renderable on its own.