mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 04:38:33 +00:00
Extends RenderConfig.format with "png-sequence" and patches two correctness
gaps so the existing "webm" / "mov" values actually preserve the alpha
channel end-to-end.
Engine fixes:
- screenshotService.pageScreenshotCapture: drop optimizeForSpeed for PNG
captures. The fast path uses an alpha-unaware codec that crushes real
alpha values; kept for opaque jpeg captures where it is harmless.
- frameCapture: replace the inline setDefaultBackgroundColorOverride
block (which fired pre-navigation and was reset by page.goto) with a
proper initTransparentBackground() call inside initializeSession,
after the window.__hf readiness poll. This also injects the
html/body/[data-composition-id]{background:transparent !important}
stylesheet so compositions with custom body / #root backgrounds do not
defeat the override. Wired into both screenshot-mode and beginframe-mode
branches.
Producer:
- RenderConfig.format extended to "mp4" | "webm" | "mov" | "png-sequence"
with full JSDoc.
- Streaming encode is bypassed for png-sequence (frames go straight to
disk). FORMAT_EXT extended.
- New Stage-5 png-sequence branch: mkdir outputPath, copy captured PNGs as
frame_NNNNNN.png, copy audio.aac sidecar when audio is present.
- Stage-6 mux/faststart and the debug copy are wrapped in !isPngSequence.
- README.md: new "Transparent Video Output" section.
Tests:
- New fixture tests/transparency-regression/ tagged "transparency".
- New tsx script src/transparency-test.ts asserts pixel-level alpha for
webm + png-sequence outputs. Wired as "test:transparency".
- Default "test" / "test:update" scripts pass --exclude-tags transparency
so the golden-MP4 harness ignores the new fixture.
Verified locally on macOS arm64: typecheck clean across engine + producer,
producer renderOrchestrator vitest 10/10, transparency-test passes for
both webm and png-sequence with end-to-end pixel assertions.
88 lines
3.3 KiB
JSON
88 lines
3.3 KiB
JSON
{
|
|
"name": "@hyperframes/producer",
|
|
"version": "0.4.31",
|
|
"description": "HTML-to-video rendering engine using Chrome's BeginFrame API",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/heygen-com/hyperframes",
|
|
"directory": "packages/producer"
|
|
},
|
|
"files": [
|
|
"dist/"
|
|
],
|
|
"type": "module",
|
|
"main": "dist/index.js",
|
|
"types": "dist/index.d.ts",
|
|
"exports": {
|
|
".": {
|
|
"import": "./dist/index.js",
|
|
"types": "./dist/index.d.ts"
|
|
},
|
|
"./server": {
|
|
"import": "./dist/public-server.js"
|
|
}
|
|
},
|
|
"publishConfig": {
|
|
"access": "public",
|
|
"registry": "https://registry.npmjs.org/"
|
|
},
|
|
"scripts": {
|
|
"build": "bun run build:fonts && bun run --cwd ../.. build:hyperframes-runtime:modular && node build.mjs",
|
|
"build:fonts": "tsx scripts/generate-font-data.ts",
|
|
"typecheck": "tsc --noEmit",
|
|
"parity:check": "tsx src/parity-harness.ts",
|
|
"parity:fixtures": "tsx src/parity-fixtures.ts",
|
|
"parity:fixtures:ci": "tsx src/parity-fixtures.ts",
|
|
"parity:check:ci": "tsx src/parity-harness.ts --preview-url \"http://127.0.0.1:4173/minimal-wysiwyg.html\" --producer-url \"http://127.0.0.1:4173/minimal-wysiwyg.html?mode=producer\" --checkpoints \"0,0.5,1,1.5\" --allow-mismatch-ratio 0 --emulate-producer-swap true --artifacts-dir \".debug/parity-harness-ci\"",
|
|
"perf:gate": "tsx src/perf-gate.ts",
|
|
"check:runtime-conformance": "tsx src/runtime-conformance.ts",
|
|
"benchmark": "tsx src/benchmark.ts",
|
|
"bench:hdr": "tsx src/benchmark.ts --tags hdr",
|
|
"test": "tsx src/regression-harness.ts --exclude-tags transparency",
|
|
"test:update": "tsx src/regression-harness.ts --update --exclude-tags transparency",
|
|
"test:transparency": "tsx src/transparency-test.ts",
|
|
"docker:build:test": "docker build -f ../../Dockerfile.test -t hyperframes-producer:test ../..",
|
|
"docker:test": "docker run --rm --security-opt seccomp=unconfined --shm-size=2g -v ./tests:/app/packages/producer/tests hyperframes-producer:test",
|
|
"docker:test:update": "docker run --rm --security-opt seccomp=unconfined --shm-size=2g -v ./tests:/app/packages/producer/tests hyperframes-producer:test --update",
|
|
"prepublishOnly": "echo skip"
|
|
},
|
|
"dependencies": {
|
|
"@fontsource/archivo-black": "^5.2.8",
|
|
"@fontsource/eb-garamond": "^5.2.7",
|
|
"@fontsource/ibm-plex-mono": "^5.2.7",
|
|
"@fontsource/inter": "^5.2.8",
|
|
"@fontsource/jetbrains-mono": "^5.2.8",
|
|
"@fontsource/league-gothic": "^5.2.8",
|
|
"@fontsource/montserrat": "^5.2.8",
|
|
"@fontsource/nunito": "^5.2.7",
|
|
"@fontsource/oswald": "^5.2.8",
|
|
"@fontsource/outfit": "^5.2.8",
|
|
"@fontsource/space-mono": "^5.2.9",
|
|
"@hono/node-server": "^1.13.0",
|
|
"@hyperframes/core": "workspace:^",
|
|
"@hyperframes/engine": "workspace:^",
|
|
"hono": "^4.6.0",
|
|
"linkedom": "^0.18.12",
|
|
"postcss": "^8.4.0",
|
|
"puppeteer": "^24.0.0",
|
|
"puppeteer-core": "^24.39.1"
|
|
},
|
|
"devDependencies": {
|
|
"@fontsource/lato": "^5.2.7",
|
|
"@fontsource/noto-sans-jp": "^5.2.9",
|
|
"@fontsource/open-sans": "^5.2.7",
|
|
"@fontsource/playfair-display": "^5.2.8",
|
|
"@fontsource/poppins": "^5.2.7",
|
|
"@fontsource/roboto": "^5.2.10",
|
|
"@fontsource/source-code-pro": "^5.2.7",
|
|
"@types/node": "^22.10.1",
|
|
"@webgpu/types": "^0.1.69",
|
|
"esbuild": "^0.27.2",
|
|
"tsx": "^4.7.0",
|
|
"typescript": "^5.7.2"
|
|
},
|
|
"engines": {
|
|
"node": ">=22"
|
|
}
|
|
}
|