dsh-hyperframes 0.3.1 → 0.4.0
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.
- package/README.en.md +6 -5
- package/README.md +7 -6
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -0
- package/package.json +63 -63
- package/skills/embedded-captions/SKILL.md +28 -3
- package/skills/embedded-captions/references/aesthetic-principles.md +2 -3
- package/skills/embedded-captions/references/rail.md +1 -1
- package/skills/embedded-captions/scripts/check-occlusion.cjs +4 -1
- package/skills/embedded-captions/scripts/check-overflow.cjs +1 -0
- package/skills/embedded-captions/scripts/check-rail-climax.cjs +5 -1
- package/skills/embedded-captions/scripts/fixtures/heroless/theme.json +11 -0
- package/skills/embedded-captions/scripts/hf-cli.cjs +33 -0
- package/skills/embedded-captions/scripts/make-theme.cjs +95 -57
- package/skills/embedded-captions/scripts/make-theme.test.mjs +131 -0
- package/skills/embedded-captions/scripts/matte.cjs +1 -13
- package/skills/embedded-captions/scripts/measure-layout.cjs +2 -1
- package/skills/embedded-captions/scripts/preview-frames.cjs +39 -11
- package/skills/embedded-captions/scripts/preview-frames.test.mjs +24 -0
- package/skills/embedded-captions/scripts/render-and-composite.sh +8 -52
- package/skills/embedded-captions/scripts/safe-zones.cjs +4 -1
- package/skills/embedded-captions/scripts/transcribe.cjs +5 -14
- package/skills/embedded-captions/scripts/transcribe.test.mjs +41 -0
- package/skills/faceless-explainer/SKILL.md +20 -16
- package/skills/faceless-explainer/references/story-design.md +1 -1
- package/skills/faceless-explainer/scripts/assemble-index.mjs +6 -4
- package/skills/faceless-explainer/scripts/assemble-index.test.mjs +57 -2
- package/skills/faceless-explainer/scripts/audio.mjs +2 -0
- package/skills/faceless-explainer/scripts/build-frame.mjs +6 -3
- package/skills/faceless-explainer/scripts/captions.mjs +7 -4
- package/skills/faceless-explainer/scripts/frame-packets.mjs +4 -4
- package/skills/faceless-explainer/scripts/lib/bgm-volume.mjs +4 -0
- package/skills/faceless-explainer/scripts/lib/captured-fonts.mjs +58 -0
- package/skills/{hyperframes-core → faceless-explainer}/scripts/lib/frame-packets-core.mjs +5 -23
- package/skills/faceless-explainer/scripts/lib/storyboard.mjs +1 -1
- package/skills/faceless-explainer/scripts/lib/transitions.json +3 -3
- package/skills/faceless-explainer/scripts/transitions.mjs +1 -0
- package/skills/faceless-explainer/scripts/transitions.test.mjs +2 -0
- package/skills/faceless-explainer/sub-agents/frame-worker.md +1 -1
- package/skills/figma/SKILL.md +2 -0
- package/skills/general-video/SKILL.md +13 -11
- package/skills/general-video/scripts/frame-packets.mjs +4 -4
- package/skills/general-video/scripts/lib/frame-packets-core.mjs +194 -0
- package/skills/general-video/sub-agents/frame-worker.md +1 -1
- package/skills/hyperframes/SKILL.md +40 -30
- package/skills/{hyperframes-core → hyperframes}/references/brief-contract.md +15 -15
- package/skills/{hyperframes-core → hyperframes}/references/brief-format.md +8 -8
- package/skills/hyperframes/references/capability-menu.md +2 -2
- package/skills/{hyperframes-core → hyperframes}/references/frame-worker-core.md +1 -1
- package/skills/hyperframes/references/intent-interview.md +16 -16
- package/skills/hyperframes/references/plugin-installation.md +43 -0
- package/skills/{hyperframes-core → hyperframes}/references/production-loop.md +11 -11
- package/skills/hyperframes/references/review-loop.md +37 -0
- package/skills/hyperframes/references/route-briefs.md +1 -1
- package/skills/hyperframes/references/routes/motion-graphics.md +1 -1
- package/skills/{hyperframes-core → hyperframes}/references/script-format.md +3 -3
- package/skills/hyperframes/references/skill-lifecycle.md +2 -0
- package/skills/{hyperframes-core → hyperframes}/references/storyboard-format.md +3 -34
- package/skills/hyperframes/scripts/lib/frame-packets-core.mjs +194 -0
- package/skills/hyperframes/scripts/plugin-cli.mjs +88 -0
- package/skills/hyperframes/scripts/plugin-cli.test.mjs +117 -0
- package/skills/hyperframes-animation/SKILL.md +5 -1
- package/skills/hyperframes-animation/adapters/gsap.md +1 -1
- package/skills/hyperframes-animation/adapters/lottie.md +15 -2
- package/skills/hyperframes-animation/adapters/three.md +14 -0
- package/skills/hyperframes-animation/blueprints/titlecard-reveal.md +1 -1
- package/skills/hyperframes-animation/references/motion-blur.md +133 -0
- package/skills/hyperframes-animation/rules/cursor-click-ripple.md +1 -1
- package/skills/hyperframes-animation/rules/dynamic-content-sequencing.md +1 -1
- package/skills/hyperframes-animation/rules/hacker-flip-3d.md +1 -1
- package/skills/hyperframes-animation/rules/kinetic-beat-slam.md +2 -2
- package/skills/hyperframes-animation/rules/motion-blur-streak.md +1 -1
- package/skills/hyperframes-animation/rules/vertical-spring-ticker.md +1 -1
- package/skills/hyperframes-animation/scripts/package-loader.mjs +47 -16
- package/skills/hyperframes-animation/scripts/package-loader.test.mjs +52 -0
- package/skills/hyperframes-animation/techniques.md +1 -1
- package/skills/hyperframes-animation/transitions/TRANSITION-REGISTRY.md +3 -3
- package/skills/hyperframes-animation/transitions/css-push.md +4 -4
- package/skills/hyperframes-audio/SKILL.md +30 -22
- package/skills/hyperframes-audio/scripts/carve.mjs +6 -3
- package/skills/hyperframes-audio/scripts/carve.test.mjs +16 -1
- package/skills/hyperframes-cli/SKILL.md +44 -35
- package/skills/hyperframes-cli/references/init-and-scaffold.md +8 -6
- package/skills/hyperframes-cli/references/lint-validate-inspect.md +3 -3
- package/skills/hyperframes-cli/references/preview-render.md +35 -32
- package/skills/hyperframes-cli/references/upgrade-info-misc.md +50 -1
- package/skills/hyperframes-core/SKILL.md +30 -24
- package/skills/hyperframes-core/references/composition-patterns.md +3 -42
- package/skills/hyperframes-core/references/creator-editing-recipes.md +131 -7
- package/skills/hyperframes-core/references/data-attributes.md +11 -11
- package/skills/hyperframes-core/references/determinism-rules.md +2 -19
- package/skills/hyperframes-core/references/full-screen-motion.md +0 -9
- package/skills/hyperframes-core/references/minimal-composition.md +2 -2
- package/skills/hyperframes-core/references/sub-compositions.md +3 -66
- package/skills/hyperframes-core/references/tailwind.md +1 -20
- package/skills/hyperframes-core/references/tracks-and-clips.md +2 -6
- package/skills/hyperframes-core/references/variables-and-media.md +3 -3
- package/skills/hyperframes-creative/SKILL.md +2 -0
- package/skills/hyperframes-creative/references/house-style.md +15 -15
- package/skills/hyperframes-creative/references/story-spine.md +3 -1
- package/skills/hyperframes-creative/references/storyboard-recipe.md +57 -0
- package/skills/hyperframes-creative/references/typography.md +1 -1
- package/skills/hyperframes-creative/scripts/package-loader.mjs +47 -16
- package/skills/hyperframes-creative/scripts/package-loader.test.mjs +52 -0
- package/skills/hyperframes-keyframes/SKILL.md +4 -2
- package/skills/hyperframes-registry/SKILL.md +3 -1
- package/skills/hyperframes-registry/references/contributing.md +8 -2
- package/skills/hyperframes-registry/references/discovery.md +20 -34
- package/skills/hyperframes-studio/SKILL.md +77 -0
- package/skills/media-use/SKILL.md +14 -12
- package/skills/media-use/audio/references/captions/authoring.md +4 -0
- package/skills/media-use/audio/references/remove-background.md +1 -1
- package/skills/media-use/audio/references/tts-to-captions.md +11 -2
- package/skills/media-use/audio/references/tts.md +84 -6
- package/skills/media-use/audio/scripts/audio.mjs +15 -6
- package/skills/media-use/audio/scripts/gemini-pipeline.test.mjs +113 -0
- package/skills/media-use/audio/scripts/lib/audio-meta.mjs +39 -0
- package/skills/media-use/audio/scripts/lib/audio-meta.test.mjs +136 -0
- package/skills/media-use/audio/scripts/lib/bgm-volume.mjs +4 -0
- package/skills/media-use/audio/scripts/lib/bgm.mjs +2 -6
- package/skills/media-use/audio/scripts/lib/gemini-auth.mjs +43 -0
- package/skills/media-use/audio/scripts/lib/gemini-auth.py +52 -0
- package/skills/media-use/audio/scripts/lib/gemini-auth.test.mjs +86 -0
- package/skills/media-use/audio/scripts/lib/gemini-auth_test.py +90 -0
- package/skills/media-use/audio/scripts/lib/gemini-tts.mjs +122 -0
- package/skills/media-use/audio/scripts/lib/gemini-tts.test.mjs +243 -0
- package/skills/media-use/audio/scripts/lib/heygen.mjs +2 -1
- package/skills/media-use/audio/scripts/lib/tts.mjs +15 -3
- package/skills/media-use/audio/scripts/wait-bgm.mjs +8 -4
- package/skills/media-use/audio/scripts/wait-bgm.test.mjs +65 -0
- package/skills/media-use/references/audio.md +3 -2
- package/skills/media-use/references/grading.md +7 -7
- package/skills/media-use/references/media-treatment-recipes.md +1 -1
- package/skills/media-use/references/memory.md +2 -2
- package/skills/media-use/references/meta.md +2 -2
- package/skills/media-use/references/operations.md +15 -13
- package/skills/media-use/references/resolve.md +22 -11
- package/skills/media-use/references/setup-providers.md +11 -11
- package/skills/media-use/scripts/audio-duck.mjs +19 -27
- package/skills/media-use/scripts/compatibility.test.mjs +96 -0
- package/skills/media-use/scripts/lib/config-lock.mjs +45 -0
- package/skills/media-use/scripts/lib/duck.mjs +16 -10
- package/skills/media-use/scripts/lib/media-fetch.mjs +85 -0
- package/skills/media-use/scripts/lib/media-home.mjs +20 -0
- package/skills/media-use/scripts/lib/npx-sync.mjs +28 -2
- package/skills/media-use/scripts/lib/prefs-store.mjs +2 -2
- package/skills/media-use/scripts/lib/recipe-store.mjs +2 -2
- package/skills/media-use/scripts/lib/telemetry.mjs +29 -41
- package/skills/media-use/scripts/lib/transcriptCutFade.mjs +21 -0
- package/skills/media-use/scripts/prefs.mjs +1 -1
- package/skills/media-use/scripts/recipe.mjs +1 -1
- package/skills/media-use/scripts/resolve-plugin.test.mjs +62 -0
- package/skills/media-use/scripts/resolve.mjs +27 -1267
- package/skills/media-use/scripts/transcribe.mjs +39 -25
- package/skills/media-use/scripts/transcribe.test.mjs +112 -0
- package/skills/media-use/scripts/transcript-cut.mjs +39 -8
- package/skills/media-use/scripts/transcript-cut.test.mjs +117 -0
- package/skills/motion-graphics/SKILL.md +3 -1
- package/skills/motion-graphics/agents/builder.md +1 -0
- package/skills/motion-graphics/agents/director.md +2 -1
- package/skills/motion-graphics/catalog-map.md +25 -13
- package/skills/motion-graphics/categories/charts/module.md +2 -1
- package/skills/motion-graphics/categories/lower-thirds/module.md +4 -0
- package/skills/motion-graphics/categories/news/module.md +1 -1
- package/skills/motion-graphics/references/motion-vocabulary.md +4 -0
- package/skills/music-to-video/SKILL.md +8 -6
- package/skills/music-to-video/references/montage.md +3 -6
- package/skills/music-to-video/references/motion-primitives/3d-card-flip/index.html +10 -111
- package/skills/music-to-video/references/motion-primitives/3d-card-flip/scene.html +119 -0
- package/skills/music-to-video/references/motion-primitives/bg-flow-field/index.html +11 -284
- package/skills/music-to-video/references/motion-primitives/bg-flow-field/scene.html +294 -0
- package/skills/music-to-video/references/motion-primitives/binary-decrypt/index.html +10 -76
- package/skills/music-to-video/references/motion-primitives/binary-decrypt/scene.html +85 -0
- package/skills/music-to-video/references/motion-primitives/blur-resolve/index.html +10 -52
- package/skills/music-to-video/references/motion-primitives/blur-resolve/scene.html +60 -0
- package/skills/music-to-video/references/motion-primitives/braam-punch/index.html +10 -92
- package/skills/music-to-video/references/motion-primitives/braam-punch/scene.html +100 -0
- package/skills/music-to-video/references/motion-primitives/chromatic-split/index.html +10 -103
- package/skills/music-to-video/references/motion-primitives/chromatic-split/scene.html +111 -0
- package/skills/music-to-video/references/motion-primitives/chrome-sweep/index.html +10 -60
- package/skills/music-to-video/references/motion-primitives/chrome-sweep/scene.html +68 -0
- package/skills/music-to-video/references/motion-primitives/counting-punch/index.html +10 -110
- package/skills/music-to-video/references/motion-primitives/counting-punch/scene.html +119 -0
- package/skills/music-to-video/references/motion-primitives/crash-zoom-in/index.html +10 -112
- package/skills/music-to-video/references/motion-primitives/crash-zoom-in/scene.html +120 -0
- package/skills/music-to-video/references/motion-primitives/datamosh-smear/index.html +10 -121
- package/skills/music-to-video/references/motion-primitives/datamosh-smear/scene.html +131 -0
- package/skills/music-to-video/references/motion-primitives/directional-fill/index.html +10 -90
- package/skills/music-to-video/references/motion-primitives/directional-fill/scene.html +103 -0
- package/skills/music-to-video/references/motion-primitives/dolly-zoom/index.html +10 -94
- package/skills/music-to-video/references/motion-primitives/dolly-zoom/scene.html +102 -0
- package/skills/music-to-video/references/motion-primitives/electric-arc/index.html +10 -100
- package/skills/music-to-video/references/motion-primitives/electric-arc/scene.html +105 -0
- package/skills/music-to-video/references/motion-primitives/flash-cut/index.html +10 -89
- package/skills/music-to-video/references/motion-primitives/flash-cut/scene.html +97 -0
- package/skills/music-to-video/references/motion-primitives/gooey-metaball/index.html +10 -197
- package/skills/music-to-video/references/motion-primitives/gooey-metaball/scene.html +206 -0
- package/skills/music-to-video/references/motion-primitives/hard-cut/index.html +10 -74
- package/skills/music-to-video/references/motion-primitives/hard-cut/scene.html +82 -0
- package/skills/music-to-video/references/motion-primitives/hypercut-whip/index.html +10 -36
- package/skills/music-to-video/references/motion-primitives/hypercut-whip/scene.html +44 -0
- package/skills/music-to-video/references/motion-primitives/iris-open/index.html +10 -61
- package/skills/music-to-video/references/motion-primitives/iris-open/scene.html +69 -0
- package/skills/music-to-video/references/motion-primitives/kinetic-letter-in/index.html +10 -55
- package/skills/music-to-video/references/motion-primitives/kinetic-letter-in/scene.html +64 -0
- package/skills/music-to-video/references/motion-primitives/liquid-morph/index.html +10 -88
- package/skills/music-to-video/references/motion-primitives/liquid-morph/scene.html +96 -0
- package/skills/music-to-video/references/motion-primitives/mask-reveal/index.html +10 -66
- package/skills/music-to-video/references/motion-primitives/mask-reveal/scene.html +74 -0
- package/skills/music-to-video/references/motion-primitives/mosaic-pack/index.html +10 -81
- package/skills/music-to-video/references/motion-primitives/mosaic-pack/scene.html +89 -0
- package/skills/music-to-video/references/motion-primitives/neon-flicker/index.html +10 -65
- package/skills/music-to-video/references/motion-primitives/neon-flicker/scene.html +73 -0
- package/skills/music-to-video/references/motion-primitives/outline-to-fill/index.html +10 -74
- package/skills/music-to-video/references/motion-primitives/outline-to-fill/scene.html +82 -0
- package/skills/music-to-video/references/motion-primitives/palette-flip/index.html +10 -89
- package/skills/music-to-video/references/motion-primitives/palette-flip/scene.html +97 -0
- package/skills/music-to-video/references/motion-primitives/particle-burst/index.html +10 -98
- package/skills/music-to-video/references/motion-primitives/particle-burst/scene.html +106 -0
- package/skills/music-to-video/references/motion-primitives/pixel-dissolve/index.html +10 -78
- package/skills/music-to-video/references/motion-primitives/pixel-dissolve/scene.html +86 -0
- package/skills/music-to-video/references/motion-primitives/radial-burst-lines/index.html +10 -117
- package/skills/music-to-video/references/motion-primitives/radial-burst-lines/scene.html +130 -0
- package/skills/music-to-video/references/motion-primitives/screen-shake/index.html +10 -70
- package/skills/music-to-video/references/motion-primitives/screen-shake/scene.html +78 -0
- package/skills/music-to-video/references/motion-primitives/slot-machine-reveal/index.html +10 -87
- package/skills/music-to-video/references/motion-primitives/slot-machine-reveal/scene.html +100 -0
- package/skills/music-to-video/references/motion-primitives/spotlight-sweep/index.html +10 -94
- package/skills/music-to-video/references/motion-primitives/spotlight-sweep/scene.html +102 -0
- package/skills/music-to-video/references/motion-primitives/staggered-exit/index.html +10 -74
- package/skills/music-to-video/references/motion-primitives/staggered-exit/scene.html +82 -0
- package/skills/music-to-video/references/motion-primitives/text-spectral-rays/index.html +11 -271
- package/skills/music-to-video/references/motion-primitives/text-spectral-rays/scene.html +280 -0
- package/skills/music-to-video/references/motion-primitives/text-wave-distort/index.html +10 -92
- package/skills/music-to-video/references/motion-primitives/text-wave-distort/scene.html +106 -0
- package/skills/music-to-video/references/motion-primitives/tile-mosaic/index.html +10 -101
- package/skills/music-to-video/references/motion-primitives/tile-mosaic/scene.html +109 -0
- package/skills/music-to-video/references/motion-primitives/typewriter-reveal/index.html +10 -79
- package/skills/music-to-video/references/motion-primitives/typewriter-reveal/scene.html +91 -0
- package/skills/music-to-video/references/motion-primitives/word-grid-burst/index.html +10 -83
- package/skills/music-to-video/references/motion-primitives/word-grid-burst/scene.html +96 -0
- package/skills/music-to-video/references/planning.md +2 -2
- package/skills/music-to-video/scripts/lib/storyboard.mjs +1 -1
- package/skills/music-to-video/sub-agents/frame-worker.md +2 -2
- package/skills/pr-to-video/SKILL.md +20 -16
- package/skills/pr-to-video/references/code-vocabulary.md +14 -12
- package/skills/pr-to-video/references/story-design.md +1 -1
- package/skills/pr-to-video/scripts/assemble-index.mjs +6 -4
- package/skills/pr-to-video/scripts/assemble-index.test.mjs +57 -2
- package/skills/pr-to-video/scripts/audio.mjs +2 -0
- package/skills/pr-to-video/scripts/build-frame.mjs +6 -3
- package/skills/pr-to-video/scripts/captions.mjs +7 -4
- package/skills/pr-to-video/scripts/captions.test.mjs +41 -0
- package/skills/pr-to-video/scripts/frame-packets.mjs +4 -4
- package/skills/pr-to-video/scripts/lib/bgm-volume.mjs +4 -0
- package/skills/pr-to-video/scripts/lib/captured-fonts.mjs +58 -0
- package/skills/pr-to-video/scripts/lib/frame-packets-core.mjs +194 -0
- package/skills/pr-to-video/scripts/lib/storyboard.mjs +1 -1
- package/skills/pr-to-video/scripts/lib/transitions.json +3 -3
- package/skills/pr-to-video/scripts/transitions.mjs +7 -5
- package/skills/pr-to-video/sub-agents/frame-worker.md +1 -1
- package/skills/product-launch-video/SKILL.md +20 -16
- package/skills/product-launch-video/references/story-design.md +1 -1
- package/skills/product-launch-video/scripts/assemble-index.mjs +6 -4
- package/skills/product-launch-video/scripts/assemble-index.test.mjs +57 -2
- package/skills/product-launch-video/scripts/audio.mjs +2 -0
- package/skills/product-launch-video/scripts/audio.test.mjs +16 -0
- package/skills/product-launch-video/scripts/build-frame-subsets.test.mjs +152 -0
- package/skills/product-launch-video/scripts/build-frame.mjs +6 -3
- package/skills/product-launch-video/scripts/captions.mjs +7 -4
- package/skills/product-launch-video/scripts/frame-packets.mjs +4 -4
- package/skills/product-launch-video/scripts/lib/bgm-volume.mjs +4 -0
- package/skills/product-launch-video/scripts/lib/captured-fonts.mjs +58 -0
- package/skills/product-launch-video/scripts/lib/frame-packets-core.mjs +194 -0
- package/skills/product-launch-video/scripts/lib/storyboard.mjs +1 -1
- package/skills/product-launch-video/scripts/lib/transitions.json +3 -3
- package/skills/product-launch-video/scripts/transitions.mjs +7 -5
- package/skills/product-launch-video/scripts/transitions.test.mjs +68 -0
- package/skills/product-launch-video/sub-agents/frame-worker.md +1 -1
- package/skills/remotion-to-hyperframes/SKILL.md +7 -4
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/expected.json +5 -5
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/hf-src/compositions/title.html +31 -0
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/hf-src/index.html +10 -25
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/README.md +8 -8
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/expected.json +9 -9
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/hf-src/compositions/scene-1.html +35 -0
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/hf-src/compositions/scene-2.html +35 -0
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/hf-src/compositions/scene-3.html +36 -0
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/hf-src/index.html +28 -71
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/expected.json +3 -3
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/hf-src/compositions/scene-1.html +52 -0
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/hf-src/compositions/scene-2.html +99 -0
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/hf-src/compositions/scene-3.html +55 -0
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/hf-src/index.html +13 -212
- package/skills/remotion-to-hyperframes/references/api-map.md +16 -16
- package/skills/remotion-to-hyperframes/references/limitations.md +7 -7
- package/skills/remotion-to-hyperframes/references/lottie.md +5 -7
- package/skills/remotion-to-hyperframes/references/media.md +3 -3
- package/skills/remotion-to-hyperframes/references/parameters.md +5 -0
- package/skills/remotion-to-hyperframes/references/sequencing.md +71 -18
- package/skills/slideshow/SKILL.md +4 -1
- package/skills/slideshow/references/standalone-harness.md +0 -3
- package/skills/talking-head-recut/SKILL.md +10 -1
- package/skills/hyperframes-core/references/review-loop.md +0 -41
- package/skills/media-use/scripts/lib/adopt.mjs +0 -128
- package/skills/media-use/scripts/lib/adopt.test.mjs +0 -95
- package/skills/media-use/scripts/lib/bgm-provider.mjs +0 -20
- package/skills/media-use/scripts/lib/brand-provider.mjs +0 -59
- package/skills/media-use/scripts/lib/bundled-sfx-provider.mjs +0 -108
- package/skills/media-use/scripts/lib/bundled-sfx-provider.test.mjs +0 -85
- package/skills/media-use/scripts/lib/cache.mjs +0 -150
- package/skills/media-use/scripts/lib/candidates.mjs +0 -91
- package/skills/media-use/scripts/lib/candidates.test.mjs +0 -155
- package/skills/media-use/scripts/lib/codex-provider.mjs +0 -161
- package/skills/media-use/scripts/lib/codex-provider.test.mjs +0 -34
- package/skills/media-use/scripts/lib/coverage.test.mjs +0 -117
- package/skills/media-use/scripts/lib/cube-build.mjs +0 -181
- package/skills/media-use/scripts/lib/cube-build.test.mjs +0 -80
- package/skills/media-use/scripts/lib/cube-validate.mjs +0 -198
- package/skills/media-use/scripts/lib/cube-validate.test.mjs +0 -125
- package/skills/media-use/scripts/lib/cutlist.test.mjs +0 -148
- package/skills/media-use/scripts/lib/duck.test.mjs +0 -118
- package/skills/media-use/scripts/lib/error-diffusion.test.mjs +0 -102
- package/skills/media-use/scripts/lib/freeze.mjs +0 -70
- package/skills/media-use/scripts/lib/freeze.test.mjs +0 -46
- package/skills/media-use/scripts/lib/grade-analyzer.mjs +0 -264
- package/skills/media-use/scripts/lib/grade-analyzer.test.mjs +0 -285
- package/skills/media-use/scripts/lib/heygen-cli.mjs +0 -191
- package/skills/media-use/scripts/lib/heygen-cli.test.mjs +0 -301
- package/skills/media-use/scripts/lib/heygen-search.mjs +0 -45
- package/skills/media-use/scripts/lib/heygen-search.test.mjs +0 -49
- package/skills/media-use/scripts/lib/heygen-video-provider.mjs +0 -127
- package/skills/media-use/scripts/lib/heygen-video-provider.test.mjs +0 -344
- package/skills/media-use/scripts/lib/image-provider.mjs +0 -44
- package/skills/media-use/scripts/lib/local-models.mjs +0 -318
- package/skills/media-use/scripts/lib/local-models.test.mjs +0 -220
- package/skills/media-use/scripts/lib/local-run.mjs +0 -78
- package/skills/media-use/scripts/lib/local-run.test.mjs +0 -121
- package/skills/media-use/scripts/lib/logo-provider.mjs +0 -222
- package/skills/media-use/scripts/lib/logo-provider.test.mjs +0 -137
- package/skills/media-use/scripts/lib/ltx-video-provider.mjs +0 -94
- package/skills/media-use/scripts/lib/ltx-video-provider.test.mjs +0 -316
- package/skills/media-use/scripts/lib/lut-preset-provider.mjs +0 -266
- package/skills/media-use/scripts/lib/lut-preset-provider.test.mjs +0 -176
- package/skills/media-use/scripts/lib/manifest.test.mjs +0 -388
- package/skills/media-use/scripts/lib/match.mjs +0 -47
- package/skills/media-use/scripts/lib/mflux-provider.mjs +0 -128
- package/skills/media-use/scripts/lib/mflux-provider.test.mjs +0 -174
- package/skills/media-use/scripts/lib/misses.mjs +0 -49
- package/skills/media-use/scripts/lib/misses.test.mjs +0 -78
- package/skills/media-use/scripts/lib/npx-sync.test.mjs +0 -50
- package/skills/media-use/scripts/lib/parakeet-words.test.mjs +0 -44
- package/skills/media-use/scripts/lib/prefs-store.test.mjs +0 -189
- package/skills/media-use/scripts/lib/probe.mjs +0 -39
- package/skills/media-use/scripts/lib/probe.test.mjs +0 -31
- package/skills/media-use/scripts/lib/providers.mjs +0 -5
- package/skills/media-use/scripts/lib/recipe-store.test.mjs +0 -367
- package/skills/media-use/scripts/lib/registry.mjs +0 -218
- package/skills/media-use/scripts/lib/registry.test.mjs +0 -261
- package/skills/media-use/scripts/lib/search.mjs +0 -24
- package/skills/media-use/scripts/lib/search.test.mjs +0 -32
- package/skills/media-use/scripts/lib/sfx-provider.mjs +0 -23
- package/skills/media-use/scripts/lib/specs.mjs +0 -132
- package/skills/media-use/scripts/lib/specs.test.mjs +0 -157
- package/skills/media-use/scripts/lib/stats.mjs +0 -117
- package/skills/media-use/scripts/lib/stats.test.mjs +0 -165
- package/skills/media-use/scripts/lib/telemetry.test.mjs +0 -373
- package/skills/media-use/scripts/lib/tts-local-provider.mjs +0 -92
- package/skills/media-use/scripts/lib/tts-local-provider.test.mjs +0 -72
- package/skills/media-use/scripts/lib/usage.mjs +0 -57
- package/skills/media-use/scripts/lib/usage.test.mjs +0 -54
- package/skills/media-use/scripts/lib/voice-provider.mjs +0 -57
- package/skills/media-use/scripts/lib/voice-provider.test.mjs +0 -46
- package/skills/media-use/scripts/resolve.test.mjs +0 -1120
- /package/skills/{hyperframes-core → hyperframes}/references/subagent-dispatch.md +0 -0
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
// Vendored plain-JS copy of packages/core/src/mediaGradeAnalyzer.ts.
|
|
2
|
-
// packages/core/src/mediaGradeAnalyzer.vendoredParity.test.ts guards behavior drift.
|
|
3
|
-
import { execFileSync } from "node:child_process";
|
|
4
|
-
import { basename, extname } from "node:path";
|
|
5
|
-
|
|
6
|
-
const IMAGE_EXT = new Set([".jpg", ".jpeg", ".png", ".webp", ".gif", ".bmp", ".tif", ".tiff"]);
|
|
7
|
-
const SAMPLE_FRAMES = 5;
|
|
8
|
-
const DEFAULT_TIMEOUT_MS = 15_000;
|
|
9
|
-
|
|
10
|
-
const ADJUST_LIMITS = {
|
|
11
|
-
exposure: { min: -2, max: 2 },
|
|
12
|
-
contrast: { min: -1, max: 1 },
|
|
13
|
-
whites: { min: -1, max: 1 },
|
|
14
|
-
blacks: { min: -1, max: 1 },
|
|
15
|
-
temperature: { min: -1, max: 1 },
|
|
16
|
-
tint: { min: -1, max: 1 },
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
function clamp(value, key) {
|
|
20
|
-
const limit = ADJUST_LIMITS[key];
|
|
21
|
-
if (!Number.isFinite(value)) return 0;
|
|
22
|
-
return Math.min(limit.max, Math.max(limit.min, value));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function round(value) {
|
|
26
|
-
const rounded = Math.round(value * 1000) / 1000;
|
|
27
|
-
return Object.is(rounded, -0) ? 0 : rounded;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function average(values) {
|
|
31
|
-
return values.reduce((sum, value) => sum + value, 0) / Math.max(1, values.length);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function probeMedia(mediaPath, ffprobePath) {
|
|
35
|
-
try {
|
|
36
|
-
const raw = execFileSync(
|
|
37
|
-
ffprobePath,
|
|
38
|
-
[
|
|
39
|
-
"-v",
|
|
40
|
-
"error",
|
|
41
|
-
"-select_streams",
|
|
42
|
-
"v:0",
|
|
43
|
-
"-show_entries",
|
|
44
|
-
"stream=color_space,color_transfer,color_primaries,pix_fmt,duration:format=duration",
|
|
45
|
-
"-of",
|
|
46
|
-
"json",
|
|
47
|
-
"--",
|
|
48
|
-
mediaPath,
|
|
49
|
-
],
|
|
50
|
-
{ encoding: "utf8", timeout: 5_000, stdio: ["ignore", "pipe", "pipe"] },
|
|
51
|
-
);
|
|
52
|
-
const parsed = JSON.parse(raw);
|
|
53
|
-
const stream = Array.isArray(parsed.streams) ? (parsed.streams[0] ?? {}) : {};
|
|
54
|
-
const duration = Number(stream.duration ?? parsed.format?.duration);
|
|
55
|
-
const text = (key) =>
|
|
56
|
-
typeof stream[key] === "string" && stream[key] ? stream[key] : "unknown";
|
|
57
|
-
return {
|
|
58
|
-
duration: Number.isFinite(duration) && duration > 0 ? duration : null,
|
|
59
|
-
colorSpace: text("color_space"),
|
|
60
|
-
transfer: text("color_transfer"),
|
|
61
|
-
primaries: text("color_primaries"),
|
|
62
|
-
pixelFormat: text("pix_fmt"),
|
|
63
|
-
};
|
|
64
|
-
} catch {
|
|
65
|
-
return {
|
|
66
|
-
duration: null,
|
|
67
|
-
colorSpace: "unknown",
|
|
68
|
-
transfer: "unknown",
|
|
69
|
-
primaries: "unknown",
|
|
70
|
-
pixelFormat: "unknown",
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export function parseMediaTreatmentSignalStats(raw) {
|
|
76
|
-
const frames = [];
|
|
77
|
-
let current = null;
|
|
78
|
-
for (const line of String(raw).split(/\r?\n/)) {
|
|
79
|
-
const frame = line.match(/^frame:\d+.*pts_time:([+-]?(?:\d+(?:\.\d+)?|\.\d+))/);
|
|
80
|
-
if (frame) {
|
|
81
|
-
if (current) frames.push(current);
|
|
82
|
-
current = { ptsTime: Number(frame[1]) };
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
const stat = line.match(/lavfi\.signalstats\.([A-Z]+)=([+-]?(?:\d+(?:\.\d+)?|\.\d+))/);
|
|
86
|
-
if (!stat) continue;
|
|
87
|
-
current ??= {};
|
|
88
|
-
current[stat[1]] = Number(stat[2]);
|
|
89
|
-
}
|
|
90
|
-
if (current) frames.push(current);
|
|
91
|
-
return frames.filter(
|
|
92
|
-
(frame) =>
|
|
93
|
-
Number.isFinite(frame.YMIN) &&
|
|
94
|
-
Number.isFinite(frame.YLOW) &&
|
|
95
|
-
Number.isFinite(frame.YAVG) &&
|
|
96
|
-
Number.isFinite(frame.YHIGH) &&
|
|
97
|
-
Number.isFinite(frame.YMAX) &&
|
|
98
|
-
Number.isFinite(frame.UAVG) &&
|
|
99
|
-
Number.isFinite(frame.VAVG),
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function summarizeFrames(frames) {
|
|
104
|
-
if (frames.length === 0) throw new Error("FFmpeg returned no analyzable video frames");
|
|
105
|
-
return {
|
|
106
|
-
frames: frames.length,
|
|
107
|
-
yMin: Math.min(...frames.map((frame) => frame.YMIN)),
|
|
108
|
-
yLow: average(frames.map((frame) => frame.YLOW)),
|
|
109
|
-
yAvg: average(frames.map((frame) => frame.YAVG)),
|
|
110
|
-
yHigh: average(frames.map((frame) => frame.YHIGH)),
|
|
111
|
-
yMax: Math.max(...frames.map((frame) => frame.YMAX)),
|
|
112
|
-
uAvg: average(frames.map((frame) => frame.UAVG)),
|
|
113
|
-
vAvg: average(frames.map((frame) => frame.VAVG)),
|
|
114
|
-
satAvg: average(frames.map((frame) => frame.SATAVG ?? 0)),
|
|
115
|
-
shadowClipRisk: average(frames.map((frame) => (frame.YLOW <= 16 ? 1 : 0))),
|
|
116
|
-
highlightClipRisk: average(frames.map((frame) => (frame.YHIGH >= 235 ? 1 : 0))),
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function suggestedExposure(normalizedAverage, yLow, yHigh) {
|
|
121
|
-
if (normalizedAverage < 0.28 && yHigh / 255 < 0.65) {
|
|
122
|
-
return clamp((0.32 - normalizedAverage) * 1.2, "exposure");
|
|
123
|
-
}
|
|
124
|
-
if (normalizedAverage > 0.72 && yLow / 255 > 0.3) {
|
|
125
|
-
return clamp((0.68 - normalizedAverage) * 1.2, "exposure");
|
|
126
|
-
}
|
|
127
|
-
return 0;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function suggestedTemperature(uAverage, vAverage) {
|
|
131
|
-
const chromaWarmth = (vAverage - 128 + (128 - uAverage)) / 128;
|
|
132
|
-
return Math.abs(chromaWarmth) >= 0.08 ? clamp(-chromaWarmth * 0.25, "temperature") : 0;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function suggestedTint(uAverage, vAverage) {
|
|
136
|
-
const cast = uAverage + vAverage - 256;
|
|
137
|
-
return Math.abs(cast) >= 10 ? clamp(-cast / 512, "tint") : 0;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export function statsToAdjust(stats) {
|
|
141
|
-
const yMin = Number(stats.yMin);
|
|
142
|
-
const yLow = Number(stats.yLow ?? stats.yMin);
|
|
143
|
-
const yMax = Number(stats.yMax);
|
|
144
|
-
const yHigh = Number(stats.yHigh ?? stats.yMax);
|
|
145
|
-
const yAvg = Number(stats.yAvg);
|
|
146
|
-
const uAvg = Number(stats.uAvg);
|
|
147
|
-
const vAvg = Number(stats.vAvg);
|
|
148
|
-
const shadowClipRisk = Number(stats.shadowClipRisk ?? (yLow <= 16 ? 1 : 0));
|
|
149
|
-
const highlightClipRisk = Number(stats.highlightClipRisk ?? (yHigh >= 235 ? 1 : 0));
|
|
150
|
-
const percentileSpread = (yHigh - yLow) / 255;
|
|
151
|
-
const normalizedAverage = yAvg / 255;
|
|
152
|
-
const contrast = percentileSpread < 0.35 ? clamp((0.35 - percentileSpread) * 0.4, "contrast") : 0;
|
|
153
|
-
|
|
154
|
-
return {
|
|
155
|
-
adjust: {
|
|
156
|
-
exposure: round(suggestedExposure(normalizedAverage, yLow, yHigh)),
|
|
157
|
-
contrast: round(contrast),
|
|
158
|
-
blacks: round(clamp(shadowClipRisk * 0.08, "blacks")),
|
|
159
|
-
whites: round(clamp(-highlightClipRisk * 0.08, "whites")),
|
|
160
|
-
temperature: round(suggestedTemperature(uAvg, vAvg)),
|
|
161
|
-
tint: round(suggestedTint(uAvg, vAvg)),
|
|
162
|
-
},
|
|
163
|
-
measured: {
|
|
164
|
-
frames: Number(stats.frames ?? 1),
|
|
165
|
-
yMin: round(yMin),
|
|
166
|
-
yLow: round(yLow),
|
|
167
|
-
yAvg: round(yAvg),
|
|
168
|
-
yHigh: round(yHigh),
|
|
169
|
-
yMax: round(yMax),
|
|
170
|
-
uAvg: round(uAvg),
|
|
171
|
-
vAvg: round(vAvg),
|
|
172
|
-
satAvg: round(Number(stats.satAvg ?? 0)),
|
|
173
|
-
shadowClipRisk: round(shadowClipRisk),
|
|
174
|
-
highlightClipRisk: round(highlightClipRisk),
|
|
175
|
-
},
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export function summarizeMediaTreatmentAnalysis(probe, frames) {
|
|
180
|
-
const result = statsToAdjust(summarizeFrames(frames));
|
|
181
|
-
const hdr = ["smpte2084", "arib-std-b67"].includes(probe.transfer);
|
|
182
|
-
const diagnosis = [];
|
|
183
|
-
if (result.measured.shadowClipRisk > 0) {
|
|
184
|
-
diagnosis.push("sampled frames contain deep or clipped shadows");
|
|
185
|
-
}
|
|
186
|
-
if (result.measured.highlightClipRisk > 0) {
|
|
187
|
-
diagnosis.push("sampled frames contain bright or clipped highlights");
|
|
188
|
-
}
|
|
189
|
-
if (diagnosis.length === 0) diagnosis.push("no obvious technical imbalance in sampled frames");
|
|
190
|
-
|
|
191
|
-
const warnings = [];
|
|
192
|
-
if (hdr) warnings.push("HDR transfer detected; the realtime treatment path is SDR/Rec.709.");
|
|
193
|
-
if (probe.colorSpace === "unknown" || probe.transfer === "unknown") {
|
|
194
|
-
warnings.push(
|
|
195
|
-
"Source color metadata is incomplete; camera LOG cannot be identified reliably from container metadata alone.",
|
|
196
|
-
);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
return {
|
|
200
|
-
...result,
|
|
201
|
-
source: {
|
|
202
|
-
colorSpace: probe.colorSpace,
|
|
203
|
-
transfer: probe.transfer,
|
|
204
|
-
primaries: probe.primaries,
|
|
205
|
-
pixelFormat: probe.pixelFormat,
|
|
206
|
-
hdr,
|
|
207
|
-
log: "unknown",
|
|
208
|
-
},
|
|
209
|
-
diagnosis,
|
|
210
|
-
warnings,
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
export function analyzeMediaGrade(
|
|
215
|
-
mediaPath,
|
|
216
|
-
{ ffmpegPath = "ffmpeg", ffprobePath = "ffprobe" } = {},
|
|
217
|
-
) {
|
|
218
|
-
try {
|
|
219
|
-
const probe = probeMedia(mediaPath, ffprobePath);
|
|
220
|
-
const isImage = IMAGE_EXT.has(extname(mediaPath).toLowerCase());
|
|
221
|
-
const fps =
|
|
222
|
-
!isImage && probe.duration
|
|
223
|
-
? Math.max(0.1, Math.min(2, SAMPLE_FRAMES / probe.duration))
|
|
224
|
-
: null;
|
|
225
|
-
const filters = [
|
|
226
|
-
fps ? `fps=${fps.toFixed(4)}` : null,
|
|
227
|
-
"format=yuv444p",
|
|
228
|
-
"signalstats",
|
|
229
|
-
"metadata=print:file=-",
|
|
230
|
-
]
|
|
231
|
-
.filter(Boolean)
|
|
232
|
-
.join(",");
|
|
233
|
-
const raw = execFileSync(
|
|
234
|
-
ffmpegPath,
|
|
235
|
-
[
|
|
236
|
-
"-hide_banner",
|
|
237
|
-
"-nostdin",
|
|
238
|
-
"-v",
|
|
239
|
-
"error",
|
|
240
|
-
"-i",
|
|
241
|
-
mediaPath,
|
|
242
|
-
"-vf",
|
|
243
|
-
filters,
|
|
244
|
-
"-frames:v",
|
|
245
|
-
String(SAMPLE_FRAMES),
|
|
246
|
-
"-f",
|
|
247
|
-
"null",
|
|
248
|
-
"-",
|
|
249
|
-
],
|
|
250
|
-
{
|
|
251
|
-
encoding: "utf8",
|
|
252
|
-
timeout: Number(process.env.HYPERFRAMES_ANALYZE_TIMEOUT_MS) || DEFAULT_TIMEOUT_MS,
|
|
253
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
254
|
-
},
|
|
255
|
-
);
|
|
256
|
-
return summarizeMediaTreatmentAnalysis(probe, parseMediaTreatmentSignalStats(raw));
|
|
257
|
-
} catch (error) {
|
|
258
|
-
throw new Error(`grade analysis failed for ${mediaPath}: ${error.message}`);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
export function formatMeasuredNote(mediaPath, measured) {
|
|
263
|
-
return `media-use: measured ${basename(mediaPath)}: frames=${measured.frames}, YMIN=${measured.yMin}, YLOW=${measured.yLow}, YAVG=${measured.yAvg}, YHIGH=${measured.yHigh}, YMAX=${measured.yMax}, UAVG=${measured.uAvg}, VAVG=${measured.vAvg}; adjust is a starting suggestion`;
|
|
264
|
-
}
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
import { strict as assert } from "node:assert";
|
|
2
|
-
import { execFileSync, spawnSync } from "node:child_process";
|
|
3
|
-
import { existsSync, mkdtempSync, rmSync, unlinkSync } from "node:fs";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
import { tmpdir } from "node:os";
|
|
6
|
-
import { test } from "node:test";
|
|
7
|
-
import {
|
|
8
|
-
analyzeMediaGrade,
|
|
9
|
-
formatMeasuredNote,
|
|
10
|
-
parseMediaTreatmentSignalStats,
|
|
11
|
-
statsToAdjust,
|
|
12
|
-
summarizeMediaTreatmentAnalysis,
|
|
13
|
-
} from "./grade-analyzer.mjs";
|
|
14
|
-
|
|
15
|
-
const SIGNALSTATS = `frame:0 pts:0 pts_time:0
|
|
16
|
-
lavfi.signalstats.YMIN=0
|
|
17
|
-
lavfi.signalstats.YLOW=8
|
|
18
|
-
lavfi.signalstats.YAVG=100
|
|
19
|
-
lavfi.signalstats.YHIGH=240
|
|
20
|
-
lavfi.signalstats.YMAX=255
|
|
21
|
-
lavfi.signalstats.UAVG=120
|
|
22
|
-
lavfi.signalstats.VAVG=140
|
|
23
|
-
lavfi.signalstats.SATAVG=40
|
|
24
|
-
frame:1 pts:2000 pts_time:2
|
|
25
|
-
lavfi.signalstats.YMIN=10
|
|
26
|
-
lavfi.signalstats.YLOW=20
|
|
27
|
-
lavfi.signalstats.YAVG=130
|
|
28
|
-
lavfi.signalstats.YHIGH=220
|
|
29
|
-
lavfi.signalstats.YMAX=245
|
|
30
|
-
lavfi.signalstats.UAVG=130
|
|
31
|
-
lavfi.signalstats.VAVG=125
|
|
32
|
-
lavfi.signalstats.SATAVG=60`;
|
|
33
|
-
|
|
34
|
-
// The "Test: skills" CI job runs bare `node --test` with no ffmpeg on PATH (by
|
|
35
|
-
// design — skills tests are meant to be node-builtin-only). Tests that shell to
|
|
36
|
-
// ffmpeg skip there and run wherever ffmpeg is present (locally, dev).
|
|
37
|
-
const FFMPEG_SKIP =
|
|
38
|
-
spawnSync("ffmpeg", ["-version"], { stdio: "ignore" }).status === 0
|
|
39
|
-
? false
|
|
40
|
-
: "ffmpeg not on PATH";
|
|
41
|
-
|
|
42
|
-
const ADJUST_LIMITS = {
|
|
43
|
-
exposure: { min: -2, max: 2 },
|
|
44
|
-
contrast: { min: -1, max: 1 },
|
|
45
|
-
highlights: { min: -1, max: 1 },
|
|
46
|
-
shadows: { min: -1, max: 1 },
|
|
47
|
-
whites: { min: -1, max: 1 },
|
|
48
|
-
blacks: { min: -1, max: 1 },
|
|
49
|
-
temperature: { min: -1, max: 1 },
|
|
50
|
-
tint: { min: -1, max: 1 },
|
|
51
|
-
vibrance: { min: -1, max: 1 },
|
|
52
|
-
saturation: { min: -1, max: 1 },
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
function makeFrame(dir, name, color) {
|
|
56
|
-
const out = join(dir, name);
|
|
57
|
-
execFileSync(
|
|
58
|
-
"ffmpeg",
|
|
59
|
-
[
|
|
60
|
-
"-hide_banner",
|
|
61
|
-
"-loglevel",
|
|
62
|
-
"error",
|
|
63
|
-
"-f",
|
|
64
|
-
"lavfi",
|
|
65
|
-
"-i",
|
|
66
|
-
`color=c=${color}:s=64x64`,
|
|
67
|
-
"-frames:v",
|
|
68
|
-
"1",
|
|
69
|
-
"-y",
|
|
70
|
-
out,
|
|
71
|
-
],
|
|
72
|
-
{ stdio: "pipe" },
|
|
73
|
-
);
|
|
74
|
-
return out;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function assertWithinLimits(adjust) {
|
|
78
|
-
for (const [key, value] of Object.entries(adjust)) {
|
|
79
|
-
const limit = ADJUST_LIMITS[key];
|
|
80
|
-
assert.ok(limit, `unexpected adjust key ${key}`);
|
|
81
|
-
assert.ok(value >= limit.min && value <= limit.max, `${key} out of range: ${value}`);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
test("under-exposed synthetic frame suggests positive exposure", { skip: FFMPEG_SKIP }, () => {
|
|
86
|
-
const dir = mkdtempSync(join(tmpdir(), "mu-grade-under-"));
|
|
87
|
-
try {
|
|
88
|
-
const file = makeFrame(dir, "under.png", "0x202020");
|
|
89
|
-
const { adjust, measured } = analyzeMediaGrade(file);
|
|
90
|
-
assert.ok(measured.frames >= 1);
|
|
91
|
-
assert.ok(adjust.exposure > 0, `expected positive exposure, got ${adjust.exposure}`);
|
|
92
|
-
assertWithinLimits(adjust);
|
|
93
|
-
} finally {
|
|
94
|
-
rmSync(dir, { recursive: true, force: true });
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
test(
|
|
99
|
-
"over-exposed synthetic frame pulls exposure down without inventing clipping",
|
|
100
|
-
{ skip: FFMPEG_SKIP },
|
|
101
|
-
() => {
|
|
102
|
-
const dir = mkdtempSync(join(tmpdir(), "mu-grade-over-"));
|
|
103
|
-
try {
|
|
104
|
-
const file = makeFrame(dir, "over.png", "white");
|
|
105
|
-
const { adjust } = analyzeMediaGrade(file);
|
|
106
|
-
assert.ok(adjust.exposure < 0, `expected negative exposure, got ${adjust.exposure}`);
|
|
107
|
-
assert.ok(adjust.whites <= 0, `expected non-positive whites, got ${adjust.whites}`);
|
|
108
|
-
assertWithinLimits(adjust);
|
|
109
|
-
} finally {
|
|
110
|
-
rmSync(dir, { recursive: true, force: true });
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
);
|
|
114
|
-
|
|
115
|
-
test(
|
|
116
|
-
"warm-cast synthetic frame suggests negative temperature correction",
|
|
117
|
-
{ skip: FFMPEG_SKIP },
|
|
118
|
-
() => {
|
|
119
|
-
const dir = mkdtempSync(join(tmpdir(), "mu-grade-warm-"));
|
|
120
|
-
try {
|
|
121
|
-
const file = makeFrame(dir, "warm.png", "orange");
|
|
122
|
-
const { adjust } = analyzeMediaGrade(file);
|
|
123
|
-
assert.ok(adjust.temperature < 0, `expected cooling correction, got ${adjust.temperature}`);
|
|
124
|
-
assertWithinLimits(adjust);
|
|
125
|
-
} finally {
|
|
126
|
-
rmSync(dir, { recursive: true, force: true });
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
);
|
|
130
|
-
|
|
131
|
-
test("low-spread stats suggest positive contrast", () => {
|
|
132
|
-
const { adjust } = statsToAdjust({
|
|
133
|
-
frames: 1,
|
|
134
|
-
yMin: 104,
|
|
135
|
-
yMax: 116,
|
|
136
|
-
yAvg: 110,
|
|
137
|
-
uAvg: 128,
|
|
138
|
-
vAvg: 128,
|
|
139
|
-
});
|
|
140
|
-
assert.ok(adjust.contrast > 0, `expected positive contrast, got ${adjust.contrast}`);
|
|
141
|
-
assertWithinLimits(adjust);
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
test("malformed media fails cleanly", () => {
|
|
145
|
-
assert.throws(
|
|
146
|
-
() => analyzeMediaGrade(join(tmpdir(), "does-not-exist.png")),
|
|
147
|
-
/grade analysis failed/,
|
|
148
|
-
);
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
test(
|
|
152
|
-
"media path with shell metacharacters is passed as argv, not a shell string",
|
|
153
|
-
{
|
|
154
|
-
skip: FFMPEG_SKIP,
|
|
155
|
-
},
|
|
156
|
-
() => {
|
|
157
|
-
const dir = mkdtempSync(join(tmpdir(), "mu-grade-shell-"));
|
|
158
|
-
const sentinel = join(process.cwd(), "mu-grade-shell-sentinel.png");
|
|
159
|
-
try {
|
|
160
|
-
if (existsSync(sentinel)) unlinkSync(sentinel);
|
|
161
|
-
const file = makeFrame(dir, "frame; touch mu-grade-shell-sentinel.png", "orange");
|
|
162
|
-
const result = analyzeMediaGrade(file);
|
|
163
|
-
assert.ok(result.measured.frames >= 1);
|
|
164
|
-
assert.equal(existsSync(sentinel), false);
|
|
165
|
-
} finally {
|
|
166
|
-
if (existsSync(sentinel)) unlinkSync(sentinel);
|
|
167
|
-
rmSync(dir, { recursive: true, force: true });
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
);
|
|
171
|
-
|
|
172
|
-
test("measured note is a stderr-safe single-line summary", () => {
|
|
173
|
-
const note = formatMeasuredNote("/tmp/frame.png", {
|
|
174
|
-
frames: 1,
|
|
175
|
-
yMin: 10,
|
|
176
|
-
yMax: 240,
|
|
177
|
-
yAvg: 80,
|
|
178
|
-
uAvg: 120,
|
|
179
|
-
vAvg: 140,
|
|
180
|
-
});
|
|
181
|
-
assert.match(note, /^media-use: measured /);
|
|
182
|
-
assert.match(note, /YMIN=10/);
|
|
183
|
-
assert.match(note, /YMAX=240/);
|
|
184
|
-
assert.match(note, /YAVG=80/);
|
|
185
|
-
assert.equal(note.includes("\n"), false);
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
test("parses deterministic FFmpeg signalstats frames", () => {
|
|
189
|
-
const frames = parseMediaTreatmentSignalStats(SIGNALSTATS);
|
|
190
|
-
assert.equal(frames.length, 2);
|
|
191
|
-
assert.deepEqual(
|
|
192
|
-
{
|
|
193
|
-
ptsTime: frames[0]?.ptsTime,
|
|
194
|
-
YLOW: frames[0]?.YLOW,
|
|
195
|
-
YAVG: frames[0]?.YAVG,
|
|
196
|
-
YHIGH: frames[0]?.YHIGH,
|
|
197
|
-
SATAVG: frames[0]?.SATAVG,
|
|
198
|
-
},
|
|
199
|
-
{ ptsTime: 0, YLOW: 8, YAVG: 100, YHIGH: 240, SATAVG: 40 },
|
|
200
|
-
);
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
test("keeps adjust output while adding HDR metadata and warnings", () => {
|
|
204
|
-
const result = summarizeMediaTreatmentAnalysis(
|
|
205
|
-
{
|
|
206
|
-
duration: 4,
|
|
207
|
-
colorSpace: "bt2020nc",
|
|
208
|
-
transfer: "smpte2084",
|
|
209
|
-
primaries: "bt2020",
|
|
210
|
-
pixelFormat: "yuv420p10le",
|
|
211
|
-
},
|
|
212
|
-
parseMediaTreatmentSignalStats(SIGNALSTATS),
|
|
213
|
-
);
|
|
214
|
-
|
|
215
|
-
assert.deepEqual(
|
|
216
|
-
{
|
|
217
|
-
blacks: result.adjust.blacks,
|
|
218
|
-
whites: result.adjust.whites,
|
|
219
|
-
frames: result.measured.frames,
|
|
220
|
-
yLow: result.measured.yLow,
|
|
221
|
-
yHigh: result.measured.yHigh,
|
|
222
|
-
satAvg: result.measured.satAvg,
|
|
223
|
-
shadowClipRisk: result.measured.shadowClipRisk,
|
|
224
|
-
highlightClipRisk: result.measured.highlightClipRisk,
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
blacks: 0.04,
|
|
228
|
-
whites: -0.04,
|
|
229
|
-
frames: 2,
|
|
230
|
-
yLow: 14,
|
|
231
|
-
yHigh: 230,
|
|
232
|
-
satAvg: 50,
|
|
233
|
-
shadowClipRisk: 0.5,
|
|
234
|
-
highlightClipRisk: 0.5,
|
|
235
|
-
},
|
|
236
|
-
);
|
|
237
|
-
assert.equal(result.source.hdr, true);
|
|
238
|
-
assert.equal(result.source.log, "unknown");
|
|
239
|
-
assert.match(result.warnings[0] ?? "", /HDR/);
|
|
240
|
-
});
|
|
241
|
-
|
|
242
|
-
test("does not force middle-gray exposure onto healthy intentional contrast", () => {
|
|
243
|
-
const result = summarizeMediaTreatmentAnalysis(
|
|
244
|
-
{
|
|
245
|
-
duration: 4,
|
|
246
|
-
colorSpace: "bt709",
|
|
247
|
-
transfer: "bt709",
|
|
248
|
-
primaries: "bt709",
|
|
249
|
-
pixelFormat: "yuv420p",
|
|
250
|
-
},
|
|
251
|
-
[
|
|
252
|
-
{
|
|
253
|
-
YMIN: 20,
|
|
254
|
-
YLOW: 42,
|
|
255
|
-
YAVG: 122,
|
|
256
|
-
YHIGH: 190,
|
|
257
|
-
YMAX: 220,
|
|
258
|
-
UAVG: 128,
|
|
259
|
-
VAVG: 128,
|
|
260
|
-
SATAVG: 40,
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
YMIN: 18,
|
|
264
|
-
YLOW: 38,
|
|
265
|
-
YAVG: 118,
|
|
266
|
-
YHIGH: 196,
|
|
267
|
-
YMAX: 225,
|
|
268
|
-
UAVG: 128,
|
|
269
|
-
VAVG: 128,
|
|
270
|
-
SATAVG: 42,
|
|
271
|
-
},
|
|
272
|
-
],
|
|
273
|
-
);
|
|
274
|
-
|
|
275
|
-
assert.deepEqual(
|
|
276
|
-
{
|
|
277
|
-
exposure: result.adjust.exposure,
|
|
278
|
-
blacks: result.adjust.blacks,
|
|
279
|
-
whites: result.adjust.whites,
|
|
280
|
-
temperature: result.adjust.temperature,
|
|
281
|
-
tint: result.adjust.tint,
|
|
282
|
-
},
|
|
283
|
-
{ exposure: 0, blacks: 0, whites: 0, temperature: 0, tint: 0 },
|
|
284
|
-
);
|
|
285
|
-
});
|