dsh-drawai 0.3.4 → 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/LICENSE +4142 -0
- package/README.md +43 -10
- package/lib/audio-media.js +147 -0
- package/lib/audio-service.js +66 -0
- package/lib/canvas-format.js +134 -0
- package/lib/client.js +5075 -181
- package/lib/comfyui-default-workflow.mjs +1825 -0
- package/lib/comfyui-workflow.mjs +426 -0
- package/lib/document-commands.js +12 -0
- package/lib/document-core.js +29 -0
- package/lib/drawing-tasks.js +26 -0
- package/lib/imagegen.mjs +596 -0
- package/lib/index.js +1758 -129
- package/lib/media.js +26 -13
- package/lib/mgstyle-core.js +75 -0
- package/lib/motion/apply.js +180 -0
- package/lib/motion/asset-pack-lock.js +10 -0
- package/lib/motion/asset-pack.js +335 -0
- package/lib/motion/assets.js +290 -0
- package/lib/motion/audio.js +103 -0
- package/lib/motion/audiolevel.js +63 -0
- package/lib/motion/audiomix.js +144 -0
- package/lib/motion/beats.js +337 -0
- package/lib/motion/builtin-assets.js +62 -0
- package/lib/motion/canvas-spec.js +442 -0
- package/lib/motion/capture.js +95 -0
- package/lib/motion/cards.js +80 -0
- package/lib/motion/collect.js +447 -0
- package/lib/motion/delivery.js +112 -0
- package/lib/motion/edge-speech.py +90 -0
- package/lib/motion/entry.jsx +73 -0
- package/lib/motion/export.js +200 -0
- package/lib/motion/ffmpeg.js +42 -0
- package/lib/motion/fonts.js +71 -0
- package/lib/motion/jobs.js +113 -0
- package/lib/motion/json.js +4 -0
- package/lib/motion/media-catalog.js +59 -0
- package/lib/motion/mgstyles/BRIEF-TEMPLATE.md +63 -0
- package/lib/motion/mgstyles/briefs/01-flat-vector.md +104 -0
- package/lib/motion/mgstyles/briefs/02-line-art.md +97 -0
- package/lib/motion/mgstyles/briefs/03-isometric.md +108 -0
- package/lib/motion/mgstyles/briefs/05-cel-boil.md +145 -0
- package/lib/motion/mgstyles/briefs/06-collage.md +149 -0
- package/lib/motion/mgstyles/briefs/07-liquid.md +106 -0
- package/lib/motion/mgstyles/briefs/08-morph.md +111 -0
- package/lib/motion/mgstyles/briefs/09-bauhaus.md +150 -0
- package/lib/motion/mgstyles/briefs/10-synthwave.md +151 -0
- package/lib/motion/mgstyles/briefs/12-aurora-glass.md +147 -0
- package/lib/motion/mgstyles/briefs/18-hanazi.md +140 -0
- package/lib/motion/mgstyles/briefs/19-paperclip.md +156 -0
- package/lib/motion/mgstyles/briefs/20-pixel.md +118 -0
- package/lib/motion/mgstyles/briefs/22-hud.md +118 -0
- package/lib/motion/mgstyles/catalog.d/01-flat-vector.json +34 -0
- package/lib/motion/mgstyles/catalog.d/02-line-art.json +34 -0
- package/lib/motion/mgstyles/catalog.d/03-isometric.json +35 -0
- package/lib/motion/mgstyles/catalog.d/05-cel-boil.json +28 -0
- package/lib/motion/mgstyles/catalog.d/06-collage.json +28 -0
- package/lib/motion/mgstyles/catalog.d/07-liquid.json +28 -0
- package/lib/motion/mgstyles/catalog.d/08-morph.json +28 -0
- package/lib/motion/mgstyles/catalog.d/09-bauhaus.json +28 -0
- package/lib/motion/mgstyles/catalog.d/10-synthwave.json +28 -0
- package/lib/motion/mgstyles/catalog.d/12-aurora-glass.json +28 -0
- package/lib/motion/mgstyles/catalog.d/18-hanazi.json +28 -0
- package/lib/motion/mgstyles/catalog.d/19-paperclip.json +28 -0
- package/lib/motion/mgstyles/catalog.d/20-pixel.json +28 -0
- package/lib/motion/mgstyles/catalog.d/22-hud.json +28 -0
- package/lib/motion/mgstyles/catalog.json +1356 -0
- package/lib/motion/mgstyles/upstream/README.md +147 -0
- package/lib/motion/mgstyles/upstream/README.zh-CN.md +147 -0
- package/lib/motion/mgstyles/upstream/demos/01-flat-vector/cues.json +1 -0
- package/lib/motion/mgstyles/upstream/demos/01-flat-vector/index.html +712 -0
- package/lib/motion/mgstyles/upstream/demos/02-line-art/cues.json +331 -0
- package/lib/motion/mgstyles/upstream/demos/02-line-art/film.js +676 -0
- package/lib/motion/mgstyles/upstream/demos/02-line-art/index.html +18 -0
- package/lib/motion/mgstyles/upstream/demos/02-line-art/tools/dump_timing.mjs +26 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/cues.json +109 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/index.html +25 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/anim.js +82 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/main.js +219 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/night5.js +180 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/render.js +202 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/title.js +167 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/title5.js +294 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/ui.js +141 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/world.js +1399 -0
- package/lib/motion/mgstyles/upstream/demos/05-cel-boil/cues.json +157 -0
- package/lib/motion/mgstyles/upstream/demos/05-cel-boil/index.html +34 -0
- package/lib/motion/mgstyles/upstream/demos/05-cel-boil/js/engine.js +326 -0
- package/lib/motion/mgstyles/upstream/demos/05-cel-boil/js/scene.js +2036 -0
- package/lib/motion/mgstyles/upstream/demos/06-collage/assets/gen/layout.json +157 -0
- package/lib/motion/mgstyles/upstream/demos/06-collage/cues.json +80 -0
- package/lib/motion/mgstyles/upstream/demos/06-collage/index.html +889 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/cues.json +100 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/index.html +108 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/engine.js +153 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/links.js +64 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/lookdev.js +46 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/scene.js +963 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/shaders.js +647 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/textsdf.js +114 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/type.js +50 -0
- package/lib/motion/mgstyles/upstream/demos/08-morph/cues.json +131 -0
- package/lib/motion/mgstyles/upstream/demos/08-morph/glyphs.json +1 -0
- package/lib/motion/mgstyles/upstream/demos/08-morph/index.html +901 -0
- package/lib/motion/mgstyles/upstream/demos/09-bauhaus/cues.json +270 -0
- package/lib/motion/mgstyles/upstream/demos/09-bauhaus/film.js +697 -0
- package/lib/motion/mgstyles/upstream/demos/09-bauhaus/index.html +12 -0
- package/lib/motion/mgstyles/upstream/demos/10-synthwave/cues.json +44 -0
- package/lib/motion/mgstyles/upstream/demos/10-synthwave/index.html +1028 -0
- package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/cues.json +67 -0
- package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/index.html +16 -0
- package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/main.js +967 -0
- package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/shaders.js +468 -0
- package/lib/motion/mgstyles/upstream/demos/18-hanazi/cues.json +117 -0
- package/lib/motion/mgstyles/upstream/demos/18-hanazi/index.html +541 -0
- package/lib/motion/mgstyles/upstream/demos/19-paperclip/assets/countries-110m.json +1 -0
- package/lib/motion/mgstyles/upstream/demos/19-paperclip/assets/stickers/meta.json +34 -0
- package/lib/motion/mgstyles/upstream/demos/19-paperclip/cues.json +285 -0
- package/lib/motion/mgstyles/upstream/demos/19-paperclip/index.html +599 -0
- package/lib/motion/mgstyles/upstream/demos/20-pixel/cues.json +42 -0
- package/lib/motion/mgstyles/upstream/demos/20-pixel/film.js +914 -0
- package/lib/motion/mgstyles/upstream/demos/20-pixel/index.html +18 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/cues.json +108 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/index.html +125 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/holo.js +275 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/hud.js +855 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/post.js +150 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/util.js +65 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/v5.js +142 -0
- package/lib/motion/mgstyles/upstream/harness/render.mjs +319 -0
- package/lib/motion/mgstyles/upstream/manifest.json +269 -0
- package/lib/motion/mgstyles/upstream/prompts/01-flat-vector.md +98 -0
- package/lib/motion/mgstyles/upstream/prompts/02-line-art.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/03-isometric.md +97 -0
- package/lib/motion/mgstyles/upstream/prompts/05-cel-boil.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/06-collage.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/07-liquid.md +98 -0
- package/lib/motion/mgstyles/upstream/prompts/08-morph.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/09-bauhaus.md +96 -0
- package/lib/motion/mgstyles/upstream/prompts/10-synthwave.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/12-aurora-glass.md +96 -0
- package/lib/motion/mgstyles/upstream/prompts/18-hanazi.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/19-paperclip.md +96 -0
- package/lib/motion/mgstyles/upstream/prompts/20-pixel.md +96 -0
- package/lib/motion/mgstyles/upstream/prompts/22-hud.md +95 -0
- package/lib/motion/mgstyles/upstream/rubric.md +51 -0
- package/lib/motion/mgstyles/upstream/template.md +36 -0
- package/lib/motion/pixelqa.js +198 -0
- package/lib/motion/preview.js +95 -0
- package/lib/motion/project.js +395 -0
- package/lib/motion/qa.js +290 -0
- package/lib/motion/reference-media.jsx +10 -0
- package/lib/motion/render-settings.js +112 -0
- package/lib/motion/render.js +159 -0
- package/lib/motion/scene-kit.js +183 -0
- package/lib/motion/sfx.js +232 -0
- package/lib/motion/shotcraft/ClipCard.tsx +204 -0
- package/lib/motion/shotcraft/catalog.json +2461 -0
- package/lib/motion/shotcraft/upstream/SKILL.md +286 -0
- package/lib/motion/shotcraft/upstream/assets/lib/Caption.tsx +54 -0
- package/lib/motion/shotcraft/upstream/assets/lib/ClipCard.tsx +200 -0
- package/lib/motion/shotcraft/upstream/assets/lib/DigitRoll.tsx +45 -0
- package/lib/motion/shotcraft/upstream/assets/lib/FlashCut.tsx +20 -0
- package/lib/motion/shotcraft/upstream/assets/lib/FlatPanel.tsx +65 -0
- package/lib/motion/shotcraft/upstream/assets/lib/PageCam.tsx +151 -0
- package/lib/motion/shotcraft/upstream/assets/lib/VerticalTicker.tsx +129 -0
- package/lib/motion/shotcraft/upstream/assets/lib/helpers/camera.tsx +75 -0
- package/lib/motion/shotcraft/upstream/assets/lib/helpers/motion.ts +40 -0
- package/lib/motion/shotcraft/upstream/assets/lib/helpers/rand.ts +11 -0
- package/lib/motion/shotcraft/upstream/assets/lib/helpers/shake.ts +10 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/__pycache__/sfx-source.cpython-313.pyc +0 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/build-readme-cover.mjs +49 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/capture-template.mjs +210 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/sfx-source.py +423 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/smoke-render-demos.py +170 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/test_sfx_source.py +157 -0
- package/lib/motion/shotcraft/upstream/demos/README.md +120 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Brand.tsx +112 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Fixtures.tsx +647 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Look.tsx +316 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Motion.tsx +82 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/PageCam2D.tsx +115 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Polish.tsx +243 -0
- package/lib/motion/shotcraft/upstream/demos/_textures/live-layout.json +389 -0
- package/lib/motion/shotcraft/upstream/demos/camera/basic-3d-scene/Basic3DScene.tsx +250 -0
- package/lib/motion/shotcraft/upstream/demos/camera/crash-zoom-punch/CrashImpactReal.tsx +305 -0
- package/lib/motion/shotcraft/upstream/demos/camera/crash-zoom-punch/CrashZoomReal.tsx +246 -0
- package/lib/motion/shotcraft/upstream/demos/camera/cursor-flyover/CursorFlyover.tsx +390 -0
- package/lib/motion/shotcraft/upstream/demos/camera/depth-layer-moves/MultiplaneReal.tsx +138 -0
- package/lib/motion/shotcraft/upstream/demos/camera/graze-face-tour/GrazeFaceTour.tsx +542 -0
- package/lib/motion/shotcraft/upstream/demos/camera/overhead-camera-moves/OverheadTabletopDrop.tsx +315 -0
- package/lib/motion/shotcraft/upstream/demos/camera/overhead-camera-moves/TiltReveal.tsx +299 -0
- package/lib/motion/shotcraft/upstream/demos/camera/space-camera-moves/DroneDiveLanding.tsx +173 -0
- package/lib/motion/shotcraft/upstream/demos/camera/space-camera-moves/ExplodedView.tsx +348 -0
- package/lib/motion/shotcraft/upstream/demos/camera/steep-tilt-glide/SteepTiltGlide.tsx +366 -0
- package/lib/motion/shotcraft/upstream/demos/camera/tension-camera-moves/BulletTimeFreezeOrbit.tsx +279 -0
- package/lib/motion/shotcraft/upstream/demos/camera/tension-camera-moves/PullBackIsolation.tsx +184 -0
- package/lib/motion/shotcraft/upstream/demos/camera/terminal-3d/Terminal3D.tsx +390 -0
- package/lib/motion/shotcraft/upstream/demos/data/before-after-slider-scrub/BeforeAfterSliderScrub.tsx +155 -0
- package/lib/motion/shotcraft/upstream/demos/data/chart-live-moves/AxisRescaleShockV2.tsx +303 -0
- package/lib/motion/shotcraft/upstream/demos/data/chart-live-moves/OscilloscopeStreamV2.tsx +290 -0
- package/lib/motion/shotcraft/upstream/demos/data/chart-live-moves/UnitDotSwarmRegroupV2.tsx +278 -0
- package/lib/motion/shotcraft/upstream/demos/data/gauge-readout-moves/NeedleSweepSelftest.tsx +307 -0
- package/lib/motion/shotcraft/upstream/demos/data/gauge-readout-moves/TapeScrollFixedPointer.tsx +215 -0
- package/lib/motion/shotcraft/upstream/demos/data/scroll-brake-moves/BrakeReticleLock.tsx +299 -0
- package/lib/motion/shotcraft/upstream/demos/data/scroll-brake-moves/ChangelogScrollBrake.tsx +232 -0
- package/lib/motion/shotcraft/upstream/demos/data/timeline-travel/TimelineTravel.tsx +290 -0
- package/lib/motion/shotcraft/upstream/demos/effects/assemble-then-type-flyin/AssembleThenTypeFlyin.tsx +273 -0
- package/lib/motion/shotcraft/upstream/demos/effects/aurora-bloom-bg-flip/AuroraBloomBgFlip.tsx +167 -0
- package/lib/motion/shotcraft/upstream/demos/effects/brand-frame-snap/BrandFrameSnap.tsx +536 -0
- package/lib/motion/shotcraft/upstream/demos/effects/fui-hud-moves/ReticleLockOn.tsx +164 -0
- package/lib/motion/shotcraft/upstream/demos/effects/glow-flyline-moves/FlylineArc.tsx +175 -0
- package/lib/motion/shotcraft/upstream/demos/effects/glow-flyline-moves/GlowOrbAmbient.tsx +197 -0
- package/lib/motion/shotcraft/upstream/demos/effects/glow-flyline-moves/OrbFlylineRelay.tsx +241 -0
- package/lib/motion/shotcraft/upstream/demos/effects/icon-performance-moves/AttentionBounce.tsx +279 -0
- package/lib/motion/shotcraft/upstream/demos/effects/impact-feedback/AnimeImpact.tsx +230 -0
- package/lib/motion/shotcraft/upstream/demos/effects/impact-feedback/HitCounter.tsx +345 -0
- package/lib/motion/shotcraft/upstream/demos/effects/light-play-moves/SheenSweepRetry.tsx +275 -0
- package/lib/motion/shotcraft/upstream/demos/effects/light-play-moves/SpotlightSweepReveal.tsx +229 -0
- package/lib/motion/shotcraft/upstream/demos/effects/radial-ripple-phone-chips/RadialRipplePhoneChips.tsx +312 -0
- package/lib/motion/shotcraft/upstream/demos/effects/riso-print-hits/RisoMisregistrationHit.tsx +222 -0
- package/lib/motion/shotcraft/upstream/demos/effects/scan-bracket-sweep/ScanBracketSweep.tsx +295 -0
- package/lib/motion/shotcraft/upstream/demos/effects/scanline-annotate-focus/ScanlineAnnotateFocus.tsx +329 -0
- package/lib/motion/shotcraft/upstream/demos/effects/scanline-assemble-flyin/ScanlineAssembleFlyin.tsx +315 -0
- package/lib/motion/shotcraft/upstream/demos/effects/slam-entrance-moves/ImpactBurstKit.tsx +264 -0
- package/lib/motion/shotcraft/upstream/demos/effects/slam-entrance-moves/KanadaPerspectiveSnap.tsx +260 -0
- package/lib/motion/shotcraft/upstream/demos/effects/slam-entrance-moves/ScoreSlam.tsx +263 -0
- package/lib/motion/shotcraft/upstream/demos/effects/spotlight-sweep-moves/CornerSpotlightReveal.tsx +123 -0
- package/lib/motion/shotcraft/upstream/demos/effects/spotlight-sweep-moves/GlowWakeSleepPanel.tsx +187 -0
- package/lib/motion/shotcraft/upstream/demos/effects/spotlight-sweep-moves/SlideSpotlightPan.tsx +175 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/autolayout-gap-dial/AutolayoutGapDial.tsx +305 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/canvas-materialize-moves/DiagramCascadeBuild.tsx +350 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/canvas-materialize-moves/PanelToCanvasMaterialize.tsx +352 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/chip-grid-single-select-blackout/ChipGridSingleSelectBlackout.tsx +218 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/collab-cursor-moves/CursorCastEnsemble.tsx +297 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/glass-pill-dictation-typing/GlassPillDictationTyping.tsx +157 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/hashtag-to-pill-materialize/HashtagToPillMaterialize.tsx +218 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/picker-carousel-feature-cycle/PickerCarouselFeatureCycle.tsx +202 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/segmented-thumb-hero/SegmentedThumbHero.tsx +265 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/theme-switch-moves/PaletteThemeRipple.tsx +457 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/theme-switch-moves/ThemeSweepToggle.tsx +446 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/type-and-filter/TypeAndFilter.tsx +249 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/voice-waveform-live/VoiceWaveformLive.tsx +278 -0
- package/lib/motion/shotcraft/upstream/demos/opening/crane-rise-reveal/CraneRiseReveal.tsx +332 -0
- package/lib/motion/shotcraft/upstream/demos/opening/dataviz-landscape-open/DatavizLandscapeOpen.tsx +358 -0
- package/lib/motion/shotcraft/upstream/demos/opening/fracture/Fracture.tsx +201 -0
- package/lib/motion/shotcraft/upstream/demos/opening/icon-field-colorize/IconFieldColorize.tsx +200 -0
- package/lib/motion/shotcraft/upstream/demos/opening/letterspace-materialize/LetterspaceMaterialize.tsx +208 -0
- package/lib/motion/shotcraft/upstream/demos/opening/magician-card-flourish/MagicianCardFlourish.tsx +341 -0
- package/lib/motion/shotcraft/upstream/demos/opening/orbit-ring-title-open/OrbitRingTitleOpen.tsx +389 -0
- package/lib/motion/shotcraft/upstream/demos/opening/spotlight-hero-card/SpotlightHeroCard.tsx +293 -0
- package/lib/motion/shotcraft/upstream/demos/opening/stroke-segment-build/StrokeSegmentBuild.tsx +183 -0
- package/lib/motion/shotcraft/upstream/demos/opening/text-as-mask/TextAsMask.tsx +245 -0
- package/lib/motion/shotcraft/upstream/demos/outro/grain-dissolve/GrainDissolve.tsx +222 -0
- package/lib/motion/shotcraft/upstream/demos/outro/logo-shrink-wordmark-lockup/LogoShrinkWordmarkLockup.tsx +223 -0
- package/lib/motion/shotcraft/upstream/demos/outro/neon-triple-marquee/NeonTripleMarquee.tsx +217 -0
- package/lib/motion/shotcraft/upstream/demos/outro/outro-group-photo-launch/OutroGroupPhotoLaunch.tsx +343 -0
- package/lib/motion/shotcraft/upstream/demos/outro/ui-strip-away-outro/UiStripAwayOutro.tsx +357 -0
- package/lib/motion/shotcraft/upstream/demos/outro/ui-to-brand-morph/IconFlipBloomLogo.tsx +187 -0
- package/lib/motion/shotcraft/upstream/demos/outro/ui-to-brand-morph/InputMorphsIntoLogo.tsx +333 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/beat-cut-moves/PaparazziFlash.tsx +274 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/beat-step-list-theme-cycle/BeatStepListThemeCycle.tsx +270 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/panel-grid-moves/ComicPanelSplit.tsx +430 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/quad-split-parallel-scenes/QuadSplitParallelScenes.tsx +252 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/rhythm-interrupt-moves/JumpCutPunchIn.tsx +106 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/sakuga-timing-shift/SakugaTimingShift.tsx +288 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/speed-ramp-freeze/FreezeAnnotateReal.tsx +362 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/trailer-grammar-moves/TrailerBumper.tsx +168 -0
- package/lib/motion/shotcraft/upstream/demos/transition/bottom-push-stack-wipe/BottomPushStackWipe.tsx +310 -0
- package/lib/motion/shotcraft/upstream/demos/transition/card-flip-reveal/CardFlipReveal.tsx +261 -0
- package/lib/motion/shotcraft/upstream/demos/transition/card-flock-tumble/CardFlockTumble.tsx +459 -0
- package/lib/motion/shotcraft/upstream/demos/transition/circle-match-iris/CircleMatchIris.tsx +294 -0
- package/lib/motion/shotcraft/upstream/demos/transition/gradient-transition/GradientTransition.tsx +161 -0
- package/lib/motion/shotcraft/upstream/demos/transition/line-carry-transition/LineCarryTransition.tsx +248 -0
- package/lib/motion/shotcraft/upstream/demos/transition/mosaic-reframe/MosaicReframe.tsx +359 -0
- package/lib/motion/shotcraft/upstream/demos/transition/page-turn-transitions/BarnDoorSplit.tsx +227 -0
- package/lib/motion/shotcraft/upstream/demos/transition/print-texture-transitions/InkBleedReveal.tsx +162 -0
- package/lib/motion/shotcraft/upstream/demos/transition/shot-transitions/PortalWipeV2.tsx +248 -0
- package/lib/motion/shotcraft/upstream/demos/transition/shot-transitions/WhipBrakeReal.tsx +186 -0
- package/lib/motion/shotcraft/upstream/demos/transition/tear-streak-transitions/GlitchDisplace.tsx +355 -0
- package/lib/motion/shotcraft/upstream/demos/transition/transition-hidden-cut/InvisibleCut.tsx +272 -0
- package/lib/motion/shotcraft/upstream/demos/transition/transition-hidden-cut/LightLeakBurn.tsx +262 -0
- package/lib/motion/shotcraft/upstream/demos/transition/transition-hidden-cut/VersusSlam.tsx +217 -0
- package/lib/motion/shotcraft/upstream/demos/transition/transition-travel/LetterformZoom.tsx +285 -0
- package/lib/motion/shotcraft/upstream/demos/transition/white-flash-logo-simplify-cut/WhiteFlashLogoSimplifyCut.tsx +205 -0
- package/lib/motion/shotcraft/upstream/demos/transition/wipe-transitions/BlindsSlice.tsx +178 -0
- package/lib/motion/shotcraft/upstream/demos/typography/blur-slide/BlurSlide.tsx +147 -0
- package/lib/motion/shotcraft/upstream/demos/typography/brace-expand/BraceExpand.tsx +143 -0
- package/lib/motion/shotcraft/upstream/demos/typography/brand-ink-open/BrandInkOpen.tsx +134 -0
- package/lib/motion/shotcraft/upstream/demos/typography/countdown-arc-scatter/CountdownArcScatter.tsx +217 -0
- package/lib/motion/shotcraft/upstream/demos/typography/flying-words/FlyingWords.tsx +198 -0
- package/lib/motion/shotcraft/upstream/demos/typography/glitch-cycle/GlitchCycle.tsx +221 -0
- package/lib/motion/shotcraft/upstream/demos/typography/gradient-word-sweep/GradientWordSweep.tsx +312 -0
- package/lib/motion/shotcraft/upstream/demos/typography/lead-word-zoom-assemble/LeadWordZoomAssemble.tsx +261 -0
- package/lib/motion/shotcraft/upstream/demos/typography/marker-underline-title/MarkerUnderlineTitle.tsx +121 -0
- package/lib/motion/shotcraft/upstream/demos/typography/outline-word-fill/OutlineWordFill.tsx +153 -0
- package/lib/motion/shotcraft/upstream/demos/typography/paper-title-card/PaperTitleCard.tsx +179 -0
- package/lib/motion/shotcraft/upstream/demos/typography/pill-chip-slot-cycle-handled/PillChipSlotCycleHandled.tsx +140 -0
- package/lib/motion/shotcraft/upstream/demos/typography/pill-slot-cycle/PillSlotCycle.tsx +309 -0
- package/lib/motion/shotcraft/upstream/demos/typography/text-column-converge/TextColumnConverge.tsx +191 -0
- package/lib/motion/shotcraft/upstream/demos/typography/title-demote-to-label/TitleDemoteToLabel.tsx +292 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-assembly-moves/LetterformDriftAssembly.tsx +135 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-assembly-moves/SplitTextStagger.tsx +124 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-assembly-moves/TextOnPath.tsx +255 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-entrance-moves/LetterDropPhysics.tsx +173 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-rhythm-sync/FontWeightPump.tsx +225 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-rhythm-sync/KaraokeFillSync.tsx +141 -0
- package/lib/motion/shotcraft/upstream/demos/typography/typewriter-moves/TypewriterErrorRetype.tsx +137 -0
- package/lib/motion/shotcraft/upstream/demos/typography/vertical-word-roll-blur-cycle/VerticalWordRollBlurCycle.tsx +147 -0
- package/lib/motion/shotcraft/upstream/demos/typography/word-relay-filmstrip/WordRelayFilmstrip.tsx +409 -0
- package/lib/motion/shotcraft/upstream/demos/typography/word-relay-geometry/WordRelayGeometry.tsx +280 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/avatar-bracket-carousel/AvatarBracketCarousel.tsx +271 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/bezier-source-converge-merge/BezierSourceConvergeMerge.tsx +385 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/card-stack/CardStack.tsx +312 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/carousel-3d/Carousel3D.tsx +303 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/clipcard-looping/ClipCardLooping.tsx +77 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/cloner-depth-echo/ClonerDepthEcho.tsx +311 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/deck-deal-flyin/DeckDealFlyin.tsx +307 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/doc-park-left-pill-deal/DocParkLeftPillDeal.tsx +349 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/document-typewriter-reveal/DocumentTypewriterReveal.tsx +255 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/draw-svg-trace/DrawSvgTrace.tsx +244 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/element-body-moves/ContactShadowLift.tsx +217 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/integration-hub-map/IntegrationHubMap.tsx +652 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/list-reveal/ListReveal.tsx +153 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/list-stack-press/ListStackPress.tsx +238 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/neon-frame-forerun/NeonFrameForerun.tsx +324 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/neon-frame-orbit-drop/NeonFrameForerunOrbit.tsx +354 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/page-waterfall-wall/PageWaterfallWall.tsx +101 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/page-waterfall-wall/VerticalTicker.tsx +129 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/product-card-progressive-assemble/ProductCardProgressiveAssemble.tsx +297 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/radial-wave/RadialWave.tsx +57 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/research-card-stack-scroll/ResearchCardStackScroll.tsx +155 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/row-embed/RowEmbed.tsx +175 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/value-stagger-gradient/ValueStaggerGradient.tsx +153 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/wall-reveal-moves/BentoLightUp.tsx +146 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/wall-reveal-moves/WireframeDrawOn.tsx +226 -0
- package/lib/motion/shotcraft/upstream/gallery/api/library.json +1 -0
- package/lib/motion/shotcraft/upstream/manifest.json +2715 -0
- package/lib/motion/shotcraft/upstream/references/aesthetic-rules.md +193 -0
- package/lib/motion/shotcraft/upstream/references/final-review.md +121 -0
- package/lib/motion/shotcraft/upstream/references/guided-free-creation.md +199 -0
- package/lib/motion/shotcraft/upstream/references/jianying-export.md +183 -0
- package/lib/motion/shotcraft/upstream/references/music-beat-sync.md +257 -0
- package/lib/motion/shotcraft/upstream/references/pipeline.md +382 -0
- package/lib/motion/shotcraft/upstream/references/publish-upload-post.md +111 -0
- package/lib/motion/shotcraft/upstream/references/sequences/promo-energy-arc.md +50 -0
- package/lib/motion/shotcraft/upstream/references/sfx-sourcing.md +95 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/basic-3d-scene.md +41 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/crash-zoom-punch.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/cursor-flyover.md +39 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/depth-layer-moves.md +39 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/graze-face-tour.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/overhead-camera-moves.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/space-camera-moves.md +46 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/steep-tilt-glide.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/tension-camera-moves.md +43 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/terminal-3d.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/before-after-slider-scrub.md +48 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/chart-live-moves.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/gauge-readout-moves.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/scroll-brake-moves.md +46 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/timeline-travel.md +44 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/assemble-then-type-flyin.md +63 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/aurora-bloom-bg-flip.md +54 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/brand-frame-snap.md +58 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/fui-hud-moves.md +35 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/glow-flyline-moves.md +53 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/icon-performance-moves.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/impact-feedback.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/light-play-moves.md +46 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/radial-ripple-phone-chips.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/riso-print-hits.md +49 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/scan-bracket-sweep.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/scanline-annotate-focus.md +53 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/scanline-assemble-flyin.md +53 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/slam-entrance-moves.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/spotlight-sweep-moves.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/autolayout-gap-dial.md +60 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/canvas-materialize-moves.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/chip-grid-single-select-blackout.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/collab-cursor-moves.md +41 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/glass-pill-dictation-typing.md +53 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/hashtag-to-pill-materialize.md +60 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/picker-carousel-feature-cycle.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/segmented-thumb-hero.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/theme-switch-moves.md +47 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/type-and-filter.md +37 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/voice-waveform-live.md +54 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/brand-ink-open.md +36 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/crane-rise-reveal.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/dataviz-landscape-open.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/fracture.md +40 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/icon-field-colorize.md +60 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/letterspace-materialize.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/magician-card-flourish.md +73 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/orbit-ring-title-open.md +87 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/spotlight-hero-card.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/stroke-segment-build.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/text-as-mask.md +59 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/grain-dissolve.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/logo-shrink-wordmark-lockup.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/neon-triple-marquee.md +59 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/outro-group-photo-launch.md +39 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/ui-strip-away-outro.md +61 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/ui-to-brand-morph.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/beat-cut-moves.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/beat-step-list-theme-cycle.md +66 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/panel-grid-moves.md +43 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/quad-split-parallel-scenes.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/rhythm-interrupt-moves.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/sakuga-timing-shift.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/speed-ramp-freeze.md +44 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/trailer-grammar-moves.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/bottom-push-stack-wipe.md +63 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/card-flip-reveal.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/card-flock-tumble.md +63 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/circle-match-iris.md +58 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/gradient-transition.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/line-carry-transition.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/mosaic-reframe.md +49 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/page-turn-transitions.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/print-texture-transitions.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/shot-transitions.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/tear-streak-transitions.md +48 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/transition-hidden-cut.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/transition-travel.md +43 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/white-flash-logo-simplify-cut.md +41 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/wipe-transitions.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/blur-slide.md +59 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/brace-expand.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/countdown-arc-scatter.md +65 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/document-typewriter-reveal.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/flying-words.md +64 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/glitch-cycle.md +64 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/gradient-word-sweep.md +54 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/lead-word-zoom-assemble.md +91 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/marker-underline-title.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/outline-word-fill.md +66 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/paper-title-card.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/pill-chip-slot-cycle-handled.md +66 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/pill-slot-cycle.md +58 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/text-column-converge.md +61 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/title-demote-to-label.md +64 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/type-assembly-moves.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/type-entrance-moves.md +41 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/type-rhythm-sync.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/typewriter-moves.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/vertical-word-roll-blur-cycle.md +63 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/word-relay-filmstrip.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/word-relay-geometry.md +75 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/avatar-bracket-carousel.md +59 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/bezier-source-converge-merge.md +67 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/card-stack.md +60 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/carousel-3d.md +66 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/cloner-depth-echo.md +40 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/deck-deal-flyin.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/doc-park-left-pill-deal.md +62 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/draw-svg-trace.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/element-body-moves.md +37 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/integration-hub-map.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/list-reveal.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/list-stack-press.md +43 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/neon-frame-forerun.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/neon-frame-orbit-drop.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/page-waterfall-wall.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/product-card-progressive-assemble.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/radial-wave.md +49 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/research-card-stack-scroll.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/row-embed.md +36 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/value-stagger-gradient.md +64 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/wall-reveal-moves.md +47 -0
- package/lib/motion/shotcraft/upstream/references/sound-design.md +170 -0
- package/lib/motion/shotcraft/upstream/references/workbench.md +157 -0
- package/lib/motion/shotcraft/upstream/template/TEMPLATE.md +103 -0
- package/lib/motion/shotcraft/upstream/template/THEMES.md +44 -0
- package/lib/motion/shotcraft/upstream/template/package.json +20 -0
- package/lib/motion/shotcraft/upstream/template/remotion.config.ts +6 -0
- package/lib/motion/shotcraft/upstream/template/src/Root.tsx +17 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/Caption.tsx +65 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/DigitRoll.tsx +48 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/FlashCut.tsx +24 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/Main.tsx +192 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/PaperTitleCard.tsx +111 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/PageCam.tsx +150 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneDetail.tsx +158 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneFlyIn.tsx +468 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneOpen.tsx +552 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneOutroLive.tsx +411 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/ScenePapers.tsx +200 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneWbr.tsx +324 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live-layout.json +389 -0
- package/lib/motion/shotcraft/upstream/template/src/index.ts +4 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/ThemedFilm.tsx +7 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/manifest.tsx +68 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/palette-assets.json +1 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/palette-assets.ts +24 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/palettes.json +74 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/visual-theme.tsx +91 -0
- package/lib/motion/shotcraft/upstream/template/src/workbench.ts +213 -0
- package/lib/motion/shotcraft/upstream/template/tsconfig.json +15 -0
- package/lib/motion/spec.js +113 -0
- package/lib/motion/style-engine.js +153 -0
- package/lib/motion/style-frames.js +268 -0
- package/lib/motion/sync.js +214 -0
- package/lib/motion/theme.js +121 -0
- package/lib/motion/voice.js +417 -0
- package/lib/motion-agent-files.js +82 -0
- package/lib/motion-agent-protocol.js +66 -0
- package/lib/motion-agent-tools.js +196 -0
- package/lib/motion-agent.js +171 -0
- package/lib/motion-capture.js +92 -0
- package/lib/motion-core.js +238 -0
- package/lib/motion-film-review.js +71 -0
- package/lib/motion-library.js +210 -0
- package/lib/motion-planner.js +254 -0
- package/lib/motion-project.js +80 -0
- package/lib/motion-render-worker.js +145 -0
- package/lib/motion-session.js +32 -0
- package/lib/motion-source.js +49 -0
- package/lib/motion-tasks.js +452 -0
- package/lib/motion-vision.js +43 -0
- package/lib/mxfile.js +27 -7
- package/lib/routing/node-runtime.js +14 -0
- package/lib/routing/router.js +211 -0
- package/lib/routing/vendor/README.md +96 -0
- package/lib/routing/vendor/libavoid-routing.js +753 -0
- package/lib/routing/vendor/libavoid.min.js +59 -0
- package/lib/shotcard-core.js +39 -0
- package/lib/shotcard-reference.js +56 -0
- package/lib/style-kernel.js +37 -3
- package/lib/task-patches.js +26 -2
- package/lib/video-export.js +17 -2
- package/package.json +29 -4
package/lib/motion/qa.js
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
// 帧检:把"片子到底有没有毛病"变成一份带帧号的报告,而不是靠人眼逐帧看。
|
|
2
|
+
//
|
|
3
|
+
// 上游 template 里有一份 final-review.md 讲怎么验片,但没有脚本;这里把它
|
|
4
|
+
// 落成可执行的四类检查(全部基于 ffmpeg,不引入新依赖):
|
|
5
|
+
//
|
|
6
|
+
// 1. 结构 帧数 / 时长与 timeline 是否一致(硬错误)
|
|
7
|
+
// 2. 黑场 整段纯黑(blackdetect)——通常是某镜没渲染出来
|
|
8
|
+
// 3. 呆帧 画面静止多久(freezedetect)——设计留白还是漏了动画
|
|
9
|
+
// 4. 闪烁 单帧亮度突变又立刻复原(手算 Y 均值序列)
|
|
10
|
+
// 5. 空白 近乎纯色的帧(内容是"忘了放东西")
|
|
11
|
+
// 6. 越界 四边安全区里出现了墨色(文字压边)
|
|
12
|
+
// 7. 响度 综合响度 / 真峰值 / 静音段(ebur128)
|
|
13
|
+
//
|
|
14
|
+
// 报告落 .out/qa/framecq/report.json,同时给一份能直接读的 markdown 摘要。
|
|
15
|
+
|
|
16
|
+
import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync, rmSync } from 'node:fs'
|
|
17
|
+
import { join, resolve as resolvePath } from 'node:path'
|
|
18
|
+
import { runFfmpeg } from './ffmpeg.js'
|
|
19
|
+
import { pixelQuality } from './pixelqa.js'
|
|
20
|
+
import { parseProjectJson } from './json.js'
|
|
21
|
+
|
|
22
|
+
const DEFAULTS = {
|
|
23
|
+
freezeSeconds: 1.2, // 静止超过这个时长就记一笔
|
|
24
|
+
flashDelta: 18, // 单帧亮度突变阈值(0–255)
|
|
25
|
+
emptyDelta: 18, // 亮度极差小于它就当空白帧
|
|
26
|
+
emptyFrames: 8, // 连续多少帧算"一段空白"
|
|
27
|
+
marginRatio: 0.035, // 四边安全区宽度(占画面宽/高)
|
|
28
|
+
marginDark: 170, // 安全区里出现比这更暗的像素=内容压边
|
|
29
|
+
blackPixThreshold: 0.10,
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function qaDir(dir) {
|
|
33
|
+
return join(dir, '.out', 'qa', 'framecq')
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function parseStats(text) {
|
|
37
|
+
const rows = []
|
|
38
|
+
let row = null
|
|
39
|
+
for (const line of text.split(/\r?\n/)) {
|
|
40
|
+
const head = /^frame:(\d+)\s+pts:\S+\s+pts_time:([\d.]+)/.exec(line)
|
|
41
|
+
if (head) { row = { frame: Number(head[1]), t: Number(head[2]) }; rows.push(row); continue }
|
|
42
|
+
const kv = /^lavfi\.signalstats\.(\w+)=(-?[\d.]+)/.exec(line)
|
|
43
|
+
if (kv && row) row[kv[1].toLowerCase()] = Number(kv[2])
|
|
44
|
+
}
|
|
45
|
+
return rows
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function runs(flags) {
|
|
49
|
+
const out = []
|
|
50
|
+
let start = -1
|
|
51
|
+
for (let i = 0; i <= flags.length; i += 1) {
|
|
52
|
+
if (i < flags.length && flags[i]) { if (start < 0) start = i; continue }
|
|
53
|
+
if (start >= 0) { out.push({ from: start, to: i - 1, length: i - start }); start = -1 }
|
|
54
|
+
}
|
|
55
|
+
return out
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const second = (value) => Math.round(value * 100) / 100
|
|
59
|
+
|
|
60
|
+
export async function runFrameQa({ dir, file, timeline, options = {} }) {
|
|
61
|
+
// 工具层会把没传的参数也写成 undefined 传进来,展开时会把默认值顶掉(freezeSeconds 变 undefined,
|
|
62
|
+
// 静止判定就整段失效)—— 所以先剔掉 undefined 再合。
|
|
63
|
+
const given = Object.fromEntries(Object.entries(options).filter(([, value]) => value !== undefined))
|
|
64
|
+
const settings = { ...DEFAULTS, ...given }
|
|
65
|
+
const source = resolvePath(file || join(dir, '.out', 'film.mp4'))
|
|
66
|
+
if (!existsSync(source)) throw new Error('没有成片可检:先 motion_render start 出一版(' + source + ')')
|
|
67
|
+
if (!timeline || !Array.isArray(timeline.shots)) throw new Error('缺少 timeline,无法把发现问题归到镜头')
|
|
68
|
+
const fps = Number(timeline.fps) || 30
|
|
69
|
+
const work = qaDir(dir)
|
|
70
|
+
rmSync(work, { recursive: true, force: true })
|
|
71
|
+
mkdirSync(work, { recursive: true })
|
|
72
|
+
const call = (args, extra = {}) => runFfmpeg(args, { cwd: work, ...extra })
|
|
73
|
+
const read = (name) => existsSync(join(work, name)) ? readFileSync(join(work, name), 'utf8') : ''
|
|
74
|
+
|
|
75
|
+
// 缩成 480 宽再做统计:统计量对分辨率不敏感,解码却快一个量级。
|
|
76
|
+
await call(['-i', source, '-an', '-vf', 'scale=480:-2', '-c:v', 'libx264', '-crf', '30', '-preset', 'veryfast', 'scaled.mp4'])
|
|
77
|
+
await call(['-i', 'scaled.mp4', '-an', '-vf', 'signalstats,metadata=print:file=stats.txt', '-f', 'null', '-'])
|
|
78
|
+
const stats = parseStats(read('stats.txt'))
|
|
79
|
+
if (!stats.length) throw new Error('ffmpeg 没有输出逐帧统计,成片可能无法解码')
|
|
80
|
+
|
|
81
|
+
const bands = { left: '0:0', right: 'iw-iw*R:0', top: '0:0', bottom: '0:ih-ih*R' }
|
|
82
|
+
const cropOf = {
|
|
83
|
+
left: 'crop=iw*R:ih:0:0', right: 'crop=iw*R:ih:iw-iw*R:0',
|
|
84
|
+
top: 'crop=iw:ih*R:0:0', bottom: 'crop=iw:ih*R:0:ih-ih*R',
|
|
85
|
+
}
|
|
86
|
+
const margins = {}
|
|
87
|
+
for (const band of Object.keys(cropOf)) {
|
|
88
|
+
const filter = cropOf[band].replace(/R/g, String(settings.marginRatio)) + ',signalstats,metadata=print:file=m-' + band + '.txt'
|
|
89
|
+
await call(['-i', 'scaled.mp4', '-an', '-vf', filter, '-f', 'null', '-'])
|
|
90
|
+
margins[band] = parseStats(read('m-' + band + '.txt'))
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const detected = await call(['-i', source, '-an', '-vf',
|
|
94
|
+
'blackdetect=d=0.10:pix_th=' + settings.blackPixThreshold + ',freezedetect=n=-55dB:d=' + Math.max(0.3, settings.freezeSeconds) / 2, '-f', 'null', '-'], { allowFail: true })
|
|
95
|
+
.catch((error) => String(error.stderr || error.message || ''))
|
|
96
|
+
const blacks = [...detected.matchAll(/black_start:([\d.]+)\s+black_end:([\d.]+)\s+black_duration:([\d.]+)/g)]
|
|
97
|
+
.map((match) => ({ from: Number(match[1]), to: Number(match[2]), seconds: Number(match[3]) }))
|
|
98
|
+
// freezedetect 三行分开打:start → duration → end。按出现顺序串起来。
|
|
99
|
+
const freezes = []
|
|
100
|
+
let open = null
|
|
101
|
+
for (const line of detected.split(/\r?\n/)) {
|
|
102
|
+
let match
|
|
103
|
+
if ((match = /freeze_start:\s*([\d.]+)/.exec(line))) { open = { from: Number(match[1]) }; freezes.push(open); continue }
|
|
104
|
+
if (open && (match = /freeze_duration:\s*([\d.]+)/.exec(line))) { open.seconds = Number(match[1]); continue }
|
|
105
|
+
if (open && (match = /freeze_end:\s*([\d.]+)/.exec(line))) { open.to = Number(match[1]); open = null }
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const shotAt = (time) => {
|
|
109
|
+
const frame = Math.round(time * fps)
|
|
110
|
+
const shot = timeline.shots.find((item) => frame >= item.startFrame && frame < item.startFrame + item.durationFrames)
|
|
111
|
+
return shot ? shot.id : '(镜头之间)'
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// 单帧突变:比前后两帧都跳、而前后两帧彼此接近 —— 那是闪,不是运动。
|
|
115
|
+
const flashes = []
|
|
116
|
+
for (let i = 1; i < stats.length - 1; i += 1) {
|
|
117
|
+
const before = stats[i - 1].yavg, here = stats[i].yavg, after = stats[i + 1].yavg
|
|
118
|
+
if (before === undefined || here === undefined || after === undefined) continue
|
|
119
|
+
if (Math.abs(here - before) > settings.flashDelta && Math.abs(here - after) > settings.flashDelta && Math.abs(before - after) < 8)
|
|
120
|
+
flashes.push({ frame: stats[i].frame, t: stats[i].t, yavg: here })
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// 空白帧:亮度极差极小(既没有字也没有图)。
|
|
124
|
+
const flat = stats.map((row) => (row.ymax ?? 0) - (row.ymin ?? 0) < settings.emptyDelta)
|
|
125
|
+
const blanks = runs(flat).filter((run) => run.length >= settings.emptyFrames)
|
|
126
|
+
.map((run) => ({ from: stats[run.from].t, to: stats[run.to].t, frames: run.length }))
|
|
127
|
+
|
|
128
|
+
const marginHits = {}
|
|
129
|
+
for (const band of Object.keys(margins)) {
|
|
130
|
+
const rows = margins[band]
|
|
131
|
+
const dark = rows.map((row) => (row.ymin ?? 255) < settings.marginDark)
|
|
132
|
+
marginHits[band] = runs(dark).filter((run) => run.length >= 3)
|
|
133
|
+
.map((run) => ({ from: second(rows[run.from]?.t ?? 0), to: second(rows[run.to]?.t ?? 0), frames: run.length }))
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// 像素级三项:色带、抗锯齿、字体。走原始灰度字节,所以能看见「这帧糊不糊」。
|
|
137
|
+
// 关掉它的方式:options.pixels === false(例如只想快速看结构问题)。
|
|
138
|
+
let pixels = null
|
|
139
|
+
if (settings.pixels !== false) {
|
|
140
|
+
try {
|
|
141
|
+
pixels = await pixelQuality({ source, work, timeline, dir, samples: settings.pixelSamples || 3 })
|
|
142
|
+
} catch (error) {
|
|
143
|
+
pixels = { error: error.message || String(error) }
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const hasAudio = /Stream #\S+.*: Audio:/.test(await call(['-i', source], { allowFail: true }).catch(() => ''))
|
|
148
|
+
let audio = { hasAudio, checked: false }
|
|
149
|
+
if (hasAudio) {
|
|
150
|
+
const measured = await call(['-i', source, '-vn', '-af', 'ebur128=peak=true,silencedetect=noise=-50dB:d=0.5', '-f', 'null', '-'])
|
|
151
|
+
.catch((error) => String(error.stderr || ''))
|
|
152
|
+
const summary = measured.slice(measured.lastIndexOf('Summary:'))
|
|
153
|
+
const grab = (pattern) => { const found = pattern.exec(summary); return found ? Number(found[1]) : null }
|
|
154
|
+
audio = {
|
|
155
|
+
hasAudio, checked: true,
|
|
156
|
+
integratedLufs: grab(/I:\s*(-?[\d.]+) LUFS/), truePeakDb: grab(/Peak:\s*(-?[\d.]+) dBFS/),
|
|
157
|
+
silence: [...measured.matchAll(/silence_start:\s*([\d.]+)/g)].map((m) => Number(m[1])).slice(0, 12),
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const durationSeconds = stats.length / fps
|
|
162
|
+
const expectedFrames = Number(timeline.durationInFrames)
|
|
163
|
+
const checks = []
|
|
164
|
+
const add = (level, id, message, detail) => checks.push({ level, id, message, ...(detail === undefined ? {} : { detail }) })
|
|
165
|
+
|
|
166
|
+
if (Math.abs(stats.length - expectedFrames) > 1)
|
|
167
|
+
add('fail', 'frames', '成片帧数 ' + stats.length + ' 与时间轴 ' + expectedFrames + ' 不一致(差 ' + (stats.length - expectedFrames) + ' 帧)')
|
|
168
|
+
else add('pass', 'frames', '帧数 ' + stats.length + ' 与时间轴一致')
|
|
169
|
+
|
|
170
|
+
for (const black of blacks) add('fail', 'black', '纯黑段 ' + second(black.from) + 's–' + second(black.to) + 's(' + second(black.seconds) + 's)', shotAt(black.from))
|
|
171
|
+
if (!blacks.length) add('pass', 'black', '没有纯黑段')
|
|
172
|
+
|
|
173
|
+
const longFreezes = freezes.filter((item) => item.seconds >= settings.freezeSeconds)
|
|
174
|
+
for (const freeze of longFreezes) {
|
|
175
|
+
const heavy = freeze.seconds >= settings.freezeSeconds * 2
|
|
176
|
+
add(heavy ? 'warn' : 'info', 'freeze',
|
|
177
|
+
'画面静止 ' + second(freeze.seconds) + 's(' + second(freeze.from) + 's–' + second(freeze.to ?? freeze.from + freeze.seconds) + 's)'
|
|
178
|
+
+ (heavy ? '' : ',像是设计停留'), shotAt(freeze.from))
|
|
179
|
+
}
|
|
180
|
+
if (!longFreezes.length) add('pass', 'freeze', '没有超过 ' + settings.freezeSeconds + 's 的静止段')
|
|
181
|
+
else if (!longFreezes.some((item) => item.seconds >= settings.freezeSeconds * 2)) add('pass', 'freeze', '静止段都在设计停留的量级(<' + settings.freezeSeconds * 2 + 's)')
|
|
182
|
+
|
|
183
|
+
for (const flash of flashes.slice(0, 8)) add('warn', 'flash', '第 ' + flash.frame + ' 帧亮度突变(' + second(flash.t) + 's,Y≈' + second(flash.yavg) + ')', shotAt(flash.t))
|
|
184
|
+
if (!flashes.length) add('pass', 'flash', '没有单帧闪烁')
|
|
185
|
+
|
|
186
|
+
for (const blank of blanks) add('warn', 'blank', '近乎空白 ' + second(blank.from) + 's–' + second(blank.to) + 's(' + blank.frames + ' 帧)', shotAt(blank.from))
|
|
187
|
+
if (!blanks.length) add('pass', 'blank', '没有连续空白帧')
|
|
188
|
+
|
|
189
|
+
let marginCount = 0
|
|
190
|
+
for (const [band, hits] of Object.entries(marginHits)) {
|
|
191
|
+
if (!hits.length) continue
|
|
192
|
+
marginCount += hits.length
|
|
193
|
+
add('warn', 'margin-' + band, band + ' 侧安全区有内容 ' + hits.length + ' 段,最长起于 ' + hits[0].from + 's', hits.slice(0, 4))
|
|
194
|
+
}
|
|
195
|
+
if (!marginCount) add('pass', 'margin', '四边安全区干净')
|
|
196
|
+
|
|
197
|
+
if (pixels && !pixels.error) {
|
|
198
|
+
const worst = pixels.banding && pixels.banding.worst
|
|
199
|
+
const bandingSteps = settings.bandingSteps || 10
|
|
200
|
+
if (worst && worst.longest >= bandingSteps)
|
|
201
|
+
add('warn', 'banding', '渐变出现阶梯色带(最长 ' + worst.longest + ' 段、共 ' + worst.steps + ' 级,' + worst.time + 's 第 ' + worst.y + ' 行)—— 多半是 8bit 量化没配抖动', shotAt(worst.time))
|
|
202
|
+
else add('pass', 'banding', '没有检出色带阶梯' + (worst ? '(最长 ' + worst.longest + ' 段)' : ''))
|
|
203
|
+
|
|
204
|
+
const aaValue = pixels.aa ? pixels.aa.average : null
|
|
205
|
+
if (aaValue !== null) {
|
|
206
|
+
const aaMin = settings.aaMin === undefined ? 0.3 : settings.aaMin
|
|
207
|
+
if (aaValue < aaMin) add('warn', 'aa', '斜边过渡像素占比 ' + aaValue + '(低于 ' + aaMin + ')—— 边缘像台阶,考虑开累积或超采样')
|
|
208
|
+
else add('pass', 'aa', '斜边过渡像素占比 ' + aaValue)
|
|
209
|
+
} else {
|
|
210
|
+
// 测不出不等于没问题:整帧近乎单色时 Sobel 找不到过渡像素。
|
|
211
|
+
// 这时候报 pass 会让「平涂深色底 + 细线」这种最该检查的片子悄悄过关。
|
|
212
|
+
add('info', 'aa', '量不出斜边过渡(画面近乎单色或对比过低),AA 未验证;等有内容的帧再检一次')
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const missing = (pixels.fonts && pixels.fonts.missing) || []
|
|
216
|
+
if (missing.length) add('fail', 'font', '场景声明了 ' + missing.length + ' 个没注册的字体(会静默退回系统字体):' + missing.map((item) => item.family).join('、'), missing.map((item) => item.file))
|
|
217
|
+
else add('pass', 'font', '字体都有注册或字体文件' + (pixels.fonts && pixels.fonts.families && pixels.fonts.families.length ? '(' + pixels.fonts.families.join(' / ') + ')' : ''))
|
|
218
|
+
} else if (pixels && pixels.error) add('info', 'pixels', '像素级检查没跑成:' + pixels.error)
|
|
219
|
+
|
|
220
|
+
if (audio.checked) {
|
|
221
|
+
if (audio.truePeakDb !== null && audio.truePeakDb > -0.1) add('warn', 'audio-peak', '真峰值 ' + audio.truePeakDb + ' dBFS,已贴顶')
|
|
222
|
+
else if (audio.truePeakDb !== null) add('pass', 'audio-peak', '真峰值 ' + audio.truePeakDb + ' dBFS')
|
|
223
|
+
if (audio.integratedLufs !== null && audio.integratedLufs < -45) add('warn', 'audio-level', '综合响度 ' + audio.integratedLufs + ' LUFS,整片近乎无声')
|
|
224
|
+
else if (audio.integratedLufs !== null) add('pass', 'audio-level', '综合响度 ' + audio.integratedLufs + ' LUFS')
|
|
225
|
+
if (audio.silence.length > 2) add('info', 'audio-silence', '有 ' + audio.silence.length + ' 处静音起点(设计上的空拍请忽略)', audio.silence)
|
|
226
|
+
} else add('info', 'audio', '成片没有音轨')
|
|
227
|
+
|
|
228
|
+
const byShot = timeline.shots.map((shot) => {
|
|
229
|
+
const from = shot.startFrame / fps, to = (shot.startFrame + shot.durationFrames) / fps
|
|
230
|
+
const inside = (time) => time >= from - 0.02 && time < to - 0.02
|
|
231
|
+
return {
|
|
232
|
+
id: shot.id, from, to, seconds: second(shot.durationFrames / fps),
|
|
233
|
+
freeze: second(Math.max(0, ...freezes.filter((item) => inside(item.from)).map((item) => item.seconds || 0))),
|
|
234
|
+
black: blacks.filter((item) => inside(item.from)).length,
|
|
235
|
+
blank: blanks.filter((item) => inside(item.from)).length,
|
|
236
|
+
flash: flashes.filter((item) => inside(item.t)).length,
|
|
237
|
+
margin: Object.values(marginHits).flat().filter((item) => inside(item.from)).length,
|
|
238
|
+
}
|
|
239
|
+
})
|
|
240
|
+
|
|
241
|
+
const fails = checks.filter((item) => item.level === 'fail').length
|
|
242
|
+
const warns = checks.filter((item) => item.level === 'warn').length
|
|
243
|
+
const report = {
|
|
244
|
+
generatedAt: new Date().toISOString(), file: source, fps, frames: stats.length, durationSeconds: second(durationSeconds),
|
|
245
|
+
verdict: fails ? 'fail' : warns ? 'warn' : 'pass', summary: { fail: fails, warn: warns, pass: checks.length - fails - warns },
|
|
246
|
+
shots: byShot, checks, audio, pixels,
|
|
247
|
+
freezeSegments: freezes.map((item) => ({ from: second(item.from), to: item.to === undefined ? null : second(item.to), seconds: second(item.seconds || 0) })).filter((item) => item.seconds >= settings.freezeSeconds),
|
|
248
|
+
settings,
|
|
249
|
+
}
|
|
250
|
+
writeFileSync(join(work, 'report.json'), JSON.stringify(report, null, 2) + '\n', 'utf8')
|
|
251
|
+
// 统一入口:渲染期的 report(worker 写的渲染规格/采样帧)与帧检结论合成一份,
|
|
252
|
+
// 读报告的人不需要知道有两个目录。
|
|
253
|
+
try {
|
|
254
|
+
const merged = join(dir, '.out', 'qa', 'report.json')
|
|
255
|
+
const base = existsSync(merged) ? parseProjectJson(readFileSync(merged, 'utf8')) : {}
|
|
256
|
+
base.frameQa = { generatedAt: report.generatedAt, verdict: report.verdict, summary: report.summary, checks, audio, pixels }
|
|
257
|
+
writeFileSync(merged, JSON.stringify(base, null, 2) + '\n', 'utf8')
|
|
258
|
+
} catch { /* 合并失败不该影响帧检结论 */ }
|
|
259
|
+
for (const name of readdirSync(work)) if (/\.(raw|log)$/.test(name)) rmSync(join(work, name), { force: true })
|
|
260
|
+
for (const name of ['stats.txt', 'm-left.txt', 'm-right.txt', 'm-top.txt', 'm-bottom.txt', 'scaled.mp4', 'ff.log'])
|
|
261
|
+
rmSync(join(work, name), { force: true })
|
|
262
|
+
return report
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export function readQaReport(dir) {
|
|
266
|
+
const file = join(qaDir(dir), 'report.json')
|
|
267
|
+
if (!existsSync(file)) return null
|
|
268
|
+
return parseProjectJson(readFileSync(file, 'utf8'))
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export function renderMarkdown(report) {
|
|
272
|
+
const line = (item) => '- [' + item.level + '] ' + item.message + (typeof item.detail === 'string' ? ' → ' + item.detail : '')
|
|
273
|
+
return [
|
|
274
|
+
'# 帧检报告',
|
|
275
|
+
'',
|
|
276
|
+
'结论:**' + report.verdict + '** (fail ' + report.summary.fail + ' / warn ' + report.summary.warn + ' / pass ' + report.summary.pass + ')',
|
|
277
|
+
'成片:' + report.frames + ' 帧 · ' + report.durationSeconds + 's · ' + report.fps + 'fps',
|
|
278
|
+
'',
|
|
279
|
+
'## 逐镜',
|
|
280
|
+
'',
|
|
281
|
+
'| 镜头 | 时长 | 最长静止 | 黑场 | 空白 | 闪烁 | 越界 |',
|
|
282
|
+
'| --- | --- | --- | --- | --- | --- | --- |',
|
|
283
|
+
...report.shots.map((shot) => '| ' + shot.id + ' | ' + shot.seconds + 's | ' + shot.freeze + 's | ' + shot.black + ' | ' + shot.blank + ' | ' + shot.flash + ' | ' + shot.margin + ' |'),
|
|
284
|
+
'',
|
|
285
|
+
'## 发现',
|
|
286
|
+
'',
|
|
287
|
+
...report.checks.map(line),
|
|
288
|
+
'',
|
|
289
|
+
].join('\n')
|
|
290
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Img, OffthreadVideo, staticFile } from 'remotion'
|
|
3
|
+
export function ReferenceMedia({ referenceId, index = 0, assets, style = {}, region }) {
|
|
4
|
+
const asset = (assets[referenceId] || []).at(index)
|
|
5
|
+
if (!asset) throw new Error('场景缺少参考素材:' + referenceId + ':' + index)
|
|
6
|
+
if(region && (!Array.isArray(region)||region.length!==4||region.some(value=>!Number.isFinite(value))||region[0]<0||region[1]<0||region[2]<=0||region[3]<=0||region[0]+region[2]>1.001||region[1]+region[3]>1.001))throw new Error('参考素材裁切区域无效')
|
|
7
|
+
const props = { src: staticFile(asset.src), style: region ? {position:'absolute',objectFit:'fill',width:100/region[2]+'%',height:100/region[3]+'%',left:-region[0]/region[2]*100+'%',top:-region[1]/region[3]*100+'%'} : { objectFit: 'contain', ...style } }
|
|
8
|
+
const media=asset.kind === 'video' ? <OffthreadVideo {...props} muted /> : <Img {...props} />
|
|
9
|
+
return region?<div style={{...style,position:style.position||'relative',overflow:'hidden'}}>{media}</div>:media
|
|
10
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// 渲染规格:把「这一帧怎么变成文件」从散落的默认值里收成一份可校验、可记录、可复现的数据。
|
|
2
|
+
//
|
|
3
|
+
// 为什么要有这个文件:spec.js 说的是「这条片子是什么」(宽高 / 帧率 / 时长),
|
|
4
|
+
// 这里说的是「它怎么落成文件」(编码、色彩标签、超采样、并发、超时)。
|
|
5
|
+
// 两者混在一起,就会出现「想渲 3840 再缩 1920」这种根本表达不出来的事。
|
|
6
|
+
//
|
|
7
|
+
// 读取优先级:timeline.json 的 render → 调用参数 → RENDER_DEFAULTS。
|
|
8
|
+
// 越界的值不静默接受,也不让整条渲染失败:夹到边界并把原因写进 warnings,
|
|
9
|
+
// 由调用方决定是提示还是拒渲。
|
|
10
|
+
|
|
11
|
+
export const RENDER_DEFAULTS = {
|
|
12
|
+
codec: 'h264',
|
|
13
|
+
crf: 14, // 交付级质量;18 是「看一眼」的档,不是母版
|
|
14
|
+
preset: 'slow', // renderMedia 的 x264Preset
|
|
15
|
+
pixelFormat: 'yuv420p',
|
|
16
|
+
colorSpace: 'bt709', // 淡紫底 #EEEAFC 不标 bt709 就会偏色 + 出色带
|
|
17
|
+
scale: 1, // 2 = 渲 3840 再缩回 1920(超采样),只对成片生效
|
|
18
|
+
concurrency: 2,
|
|
19
|
+
audioBitrate: '320k',
|
|
20
|
+
sampleRate: 48000,
|
|
21
|
+
timeoutMs: 30 * 60 * 1000,
|
|
22
|
+
// 下面两个是场景层参数:插件不执行它们,只记录并把它们交给 scene-kit。
|
|
23
|
+
samples: 1, // 同帧子渲染次数(GPU 内累积)
|
|
24
|
+
shutter: 0.5, // 快门开角比例,1 = 360°
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const LIMITS = {
|
|
28
|
+
codec: ['h264', 'h265', 'vp8', 'vp9'],
|
|
29
|
+
crf: [10, 18],
|
|
30
|
+
preset: ['ultrafast', 'superfast', 'veryfast', 'faster', 'fast', 'medium', 'slow', 'slower', 'veryslow'],
|
|
31
|
+
pixelFormat: ['yuv420p', 'yuv422p', 'yuv444p'],
|
|
32
|
+
colorSpace: ['bt709', 'bt2020-10', 'bt2020-12'],
|
|
33
|
+
scale: [1, 2],
|
|
34
|
+
concurrency: [1, 4],
|
|
35
|
+
samples: [1, 16],
|
|
36
|
+
shutter: [0, 1],
|
|
37
|
+
timeoutMs: [60000, 6 * 60 * 60 * 1000],
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const NUMERIC = new Set(['crf', 'scale', 'concurrency', 'samples', 'shutter', 'timeoutMs', 'sampleRate'])
|
|
41
|
+
|
|
42
|
+
function clean(input) {
|
|
43
|
+
if (!input || typeof input !== 'object') return {}
|
|
44
|
+
return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== undefined && value !== null && value !== ''))
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function resolveRenderSettings(timeline, overrides = {}) {
|
|
48
|
+
const stored = timeline && typeof timeline.render === 'object' ? timeline.render : {}
|
|
49
|
+
const merged = { ...RENDER_DEFAULTS, ...clean(stored), ...clean(overrides) }
|
|
50
|
+
const warnings = []
|
|
51
|
+
const settings = {}
|
|
52
|
+
for (const key of Object.keys(RENDER_DEFAULTS)) {
|
|
53
|
+
const value = merged[key]
|
|
54
|
+
const limit = LIMITS[key]
|
|
55
|
+
if (!limit) { settings[key] = value; continue }
|
|
56
|
+
if (NUMERIC.has(key)) {
|
|
57
|
+
const number = Number(value)
|
|
58
|
+
if (!Number.isFinite(number)) {
|
|
59
|
+
warnings.push(key + ' 不是数字(' + String(value) + '),用默认 ' + RENDER_DEFAULTS[key])
|
|
60
|
+
settings[key] = RENDER_DEFAULTS[key]
|
|
61
|
+
continue
|
|
62
|
+
}
|
|
63
|
+
if (number < limit[0] || number > limit[1]) {
|
|
64
|
+
const clamped = Math.min(Math.max(number, limit[0]), limit[1])
|
|
65
|
+
warnings.push(key + ' = ' + number + ' 超出允许范围 ' + limit[0] + '–' + limit[1] + ',已夹到 ' + clamped)
|
|
66
|
+
settings[key] = clamped
|
|
67
|
+
continue
|
|
68
|
+
}
|
|
69
|
+
settings[key] = Math.round(number * 1000) / 1000
|
|
70
|
+
continue
|
|
71
|
+
}
|
|
72
|
+
if (!limit.includes(value)) {
|
|
73
|
+
warnings.push(key + ' = ' + String(value) + ' 不在 ' + limit.join('/') + ' 里,用默认 ' + RENDER_DEFAULTS[key])
|
|
74
|
+
settings[key] = RENDER_DEFAULTS[key]
|
|
75
|
+
continue
|
|
76
|
+
}
|
|
77
|
+
settings[key] = value
|
|
78
|
+
}
|
|
79
|
+
// 超采样与累积是相乘的:scale² × samples。两条同时拉满能把单帧成本推到 64 倍,
|
|
80
|
+
// 那时不是「慢一点」,是必然撞超时,所以先算预算再开跑。
|
|
81
|
+
const pixels = Number(timeline?.width || 1920) * Number(timeline?.height || 1080)
|
|
82
|
+
const cost = settings.scale * settings.scale * settings.samples
|
|
83
|
+
const budget = 8 // 等效像素放大倍数的上限(1080p × 8)
|
|
84
|
+
settings.estimatedCost = Math.round(cost * 100) / 100
|
|
85
|
+
if (cost > budget) {
|
|
86
|
+
const suggestSamples = Math.max(1, Math.floor(budget / (settings.scale * settings.scale)))
|
|
87
|
+
warnings.push('scale=' + settings.scale + ' × samples=' + settings.samples + ' 相当于 ' + settings.estimatedCost
|
|
88
|
+
+ ' 倍像素工作量(预算 ' + budget + ');建议 samples 降到 ' + suggestSamples + ' 或关掉超采样')
|
|
89
|
+
}
|
|
90
|
+
settings.pixels = pixels
|
|
91
|
+
settings.warnings = warnings
|
|
92
|
+
return settings
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// 超时按帧数放大:settings.timeoutMs 是 300 帧整片的预算,
|
|
96
|
+
// 样片(几十帧)不该按整片等,长片(1200 帧)也不该被 30 分钟卡死。
|
|
97
|
+
export function timeoutFor(settings, frames) {
|
|
98
|
+
const base = Number(settings?.timeoutMs) || RENDER_DEFAULTS.timeoutMs
|
|
99
|
+
const count = Number(frames) || 300
|
|
100
|
+
const scale = Math.max(0.25, Math.min(4, count / 300))
|
|
101
|
+
return Math.round(base * scale)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// 写进报告的一行字:出问题时要能一眼看出「这条片子是用什么参数渲的」。
|
|
105
|
+
export function describeRenderSettings(settings) {
|
|
106
|
+
const s = settings || RENDER_DEFAULTS
|
|
107
|
+
return [
|
|
108
|
+
s.codec, 'crf=' + s.crf, 'preset=' + s.preset, s.pixelFormat, s.colorSpace,
|
|
109
|
+
'scale=' + s.scale, 'concurrency=' + s.concurrency,
|
|
110
|
+
'audio=' + s.audioBitrate + '/' + Math.round(s.sampleRate / 1000) + 'k',
|
|
111
|
+
].join(' · ')
|
|
112
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// 渲染入口:把"工程目录 + 一个操作"翻译成一次 worker 调用。
|
|
2
|
+
//
|
|
3
|
+
// 三条规则(对应之前 58 分钟里最贵的三个坑):
|
|
4
|
+
// 1. 永远异步:调用方拿到 jobId 就返回,不要把对话卡在 await 上;
|
|
5
|
+
// 2. 永远复用 bundle:预览和全片共用 .out/bundle/.drawai-bundle-key;
|
|
6
|
+
// 3. 永远先出图:预览走 renderStill,几秒钟,不跑全片。
|
|
7
|
+
|
|
8
|
+
import { fork } from 'node:child_process'
|
|
9
|
+
import { fileURLToPath } from 'node:url'
|
|
10
|
+
import { createHash } from 'node:crypto'
|
|
11
|
+
import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from 'node:fs'
|
|
12
|
+
import { join } from 'node:path'
|
|
13
|
+
import { buildComposition, readTimeline } from './project.js'
|
|
14
|
+
import { assetsHash } from './assets.js'
|
|
15
|
+
import { normalizeMix } from './audiomix.js'
|
|
16
|
+
import { writeBundledFonts } from './fonts.js'
|
|
17
|
+
import { syncRevision, filmHash } from './sync.js'
|
|
18
|
+
import { resolveRenderSettings, timeoutFor, describeRenderSettings } from './render-settings.js'
|
|
19
|
+
|
|
20
|
+
const WORKER = fileURLToPath(new URL('../motion-render-worker.js', import.meta.url))
|
|
21
|
+
// entry.jsx 是打包入口:它改了(比如加了 <Audio>)也必须重建 bundle,
|
|
22
|
+
// 否则会拿旧缓存渲染出一条没有声音的片子。
|
|
23
|
+
const ENTRY = fileURLToPath(new URL('./entry.jsx', import.meta.url))
|
|
24
|
+
|
|
25
|
+
export function outputPath(dir, name = 'film.mp4') {
|
|
26
|
+
return join(dir, '.out', name)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// bundle 的缓存键 = 所有场景源码 + 时间轴 + 尺寸 + 素材指纹。改任何一个字节就重建一次。
|
|
30
|
+
export function bundleKey(composition, projectDir) {
|
|
31
|
+
const hash = createHash('sha256')
|
|
32
|
+
hash.update(JSON.stringify({
|
|
33
|
+
width: composition.width, height: composition.height, fps: composition.fps,
|
|
34
|
+
durationFrames: composition.durationFrames,
|
|
35
|
+
shots: composition.shots.map((shot) => [shot.id, shot.startFrame, shot.durationFrames]),
|
|
36
|
+
assets: projectDir ? assetsHash(projectDir) : '',
|
|
37
|
+
}))
|
|
38
|
+
for (const shot of composition.shots) hash.update(shot.sceneSource)
|
|
39
|
+
if (projectDir && existsSync(projectDir)) {
|
|
40
|
+
const walk = (rel = '') => {
|
|
41
|
+
for (const entry of readdirSync(join(projectDir, rel), { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
42
|
+
if (entry.isDirectory() && ['.out', 'assets', 'node_modules', '.git'].includes(entry.name)) continue
|
|
43
|
+
const next = rel ? join(rel, entry.name) : entry.name
|
|
44
|
+
if (entry.isDirectory()) walk(next)
|
|
45
|
+
else if (entry.isSymbolicLink()) throw new Error('视频工程源码目录不支持符号链接:' + next)
|
|
46
|
+
else if (entry.isFile() && /\.(?:[cm]?[jt]sx?|css|json|svg|wasm)$/i.test(entry.name)) {
|
|
47
|
+
const content = readFileSync(join(projectDir, next))
|
|
48
|
+
hash.update(JSON.stringify([next.replace(/\\/g, '/'), content.length])).update(content)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
walk()
|
|
53
|
+
}
|
|
54
|
+
hash.update(readFileSync(ENTRY))
|
|
55
|
+
return hash.digest('hex')
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function prepare(dir, options) {
|
|
59
|
+
writeBundledFonts(dir)
|
|
60
|
+
const composition = options.composition || buildComposition(dir)
|
|
61
|
+
if (!options.composition) composition.bundledFonts = true
|
|
62
|
+
const outDirectory = join(dir, '.out')
|
|
63
|
+
mkdirSync(outDirectory, { recursive: true })
|
|
64
|
+
const publicDir = join(dir, 'assets')
|
|
65
|
+
return { composition, outDirectory, publicDir: existsSync(publicDir) ? publicDir : undefined }
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// 起一个 render worker。返回 { promise, cancel }:
|
|
69
|
+
// promise 在 done/error/exit 时结算,不阻塞调用方。
|
|
70
|
+
export function renderProject(dir, options = {}) {
|
|
71
|
+
const { composition, outDirectory, publicDir } = prepare(dir, options)
|
|
72
|
+
const timeline = readTimeline(dir)
|
|
73
|
+
const syncReceipt = timeline.sync ? { revision: syncRevision(dir, timeline), fps: timeline.fps } : null
|
|
74
|
+
const operation = options.operation || 'still'
|
|
75
|
+
// 预览永远按 1× 渲:我们要看的是构图和字,不是锯齿;超采样留给成片。
|
|
76
|
+
const settings = resolveRenderSettings(timeline, options.render)
|
|
77
|
+
const render = operation === 'still' ? { ...settings, scale: 1, samples: 1, estimatedCost: 1 } : settings
|
|
78
|
+
const output = options.output || outputPath(dir, operation === 'still' ? 'still.mp4' : 'film.mp4')
|
|
79
|
+
// 场景拿到的 plan.render 必须是**夹取后的**值:只透传时间轴原值的话,
|
|
80
|
+
// 没写 render 的工程在场景里看到的是 {},默认采样数就丢了。
|
|
81
|
+
composition.render = render
|
|
82
|
+
const bundleDir = join(outDirectory, 'bundle')
|
|
83
|
+
const request = {
|
|
84
|
+
composition,
|
|
85
|
+
projectDirectory: dir,
|
|
86
|
+
output,
|
|
87
|
+
publicDir,
|
|
88
|
+
bundleDir,
|
|
89
|
+
bundleKey: bundleKey(composition, dir),
|
|
90
|
+
reuseBundle: options.reuseBundle !== false,
|
|
91
|
+
keepBundle: true,
|
|
92
|
+
preserveSources: true,
|
|
93
|
+
operation,
|
|
94
|
+
assets: options.assets || {},
|
|
95
|
+
render,
|
|
96
|
+
frames: operation === 'still' ? (options.frames || []).map((frame) => Math.round(Number(frame))) : undefined,
|
|
97
|
+
frameRange: options.frameRange,
|
|
98
|
+
qaDirectory: join(outDirectory, 'qa'),
|
|
99
|
+
poster: join(outDirectory, 'poster.png'),
|
|
100
|
+
}
|
|
101
|
+
if (operation === 'still' && !request.frames.length) throw new Error('预览需要至少一帧,例如 frames:[0,60,120]')
|
|
102
|
+
if (operation === 'still' && request.frames.some((frame) => !Number.isInteger(frame) || frame < 0 || frame >= composition.durationFrames))
|
|
103
|
+
throw new Error('预览帧超出 0–' + (composition.durationFrames - 1))
|
|
104
|
+
|
|
105
|
+
const child = fork(WORKER, [], { windowsHide: true, stdio: ['ignore', 'ignore', 'pipe', 'ipc'], execArgv: [] })
|
|
106
|
+
let settled = false
|
|
107
|
+
let cancelTimer
|
|
108
|
+
const rendered = new Promise((resolve, reject) => {
|
|
109
|
+
const finish = (fn, value) => { if (settled) return; settled = true; clearTimeout(cancelTimer); fn(value) }
|
|
110
|
+
const timeout = setTimeout(() => { child.kill(); finish(reject, new Error('渲染超过 ' + Math.round(timeoutFor(render, composition.durationFrames) / 60000) + ' 分钟,请拆小场景或在 timeline.json 的 render.timeoutMs 里放大预算')) }, options.timeoutMs || timeoutFor(render, composition.durationFrames))
|
|
111
|
+
let stderr = ''
|
|
112
|
+
child.stderr.on('data', (bytes) => { stderr = (stderr + bytes).slice(-4000) })
|
|
113
|
+
child.on('message', (message) => {
|
|
114
|
+
if (message.type === 'progress') options.onProgress?.(message)
|
|
115
|
+
if (message.type === 'done') { clearTimeout(timeout); finish(resolve, { ...message, output, bundleDir }) }
|
|
116
|
+
if (message.type === 'error') { clearTimeout(timeout); finish(reject, new Error(message.error)) }
|
|
117
|
+
})
|
|
118
|
+
child.on('error', (error) => { clearTimeout(timeout); finish(reject, error) })
|
|
119
|
+
child.on('exit', (code) => {
|
|
120
|
+
clearTimeout(timeout)
|
|
121
|
+
if (!settled) finish(reject, new Error('渲染进程退出(' + code + '):' + stderr))
|
|
122
|
+
})
|
|
123
|
+
child.send(request)
|
|
124
|
+
})
|
|
125
|
+
const cancel = () => {
|
|
126
|
+
if (child.connected) child.send({ type: 'cancel' })
|
|
127
|
+
cancelTimer = setTimeout(() => child.kill(), 5000)
|
|
128
|
+
}
|
|
129
|
+
// 渲完之后再过一遍响度归一 + 限幅。
|
|
130
|
+
// 只对整片做:切片渲染(frameRange)归一化会把片段当整条量,结果是错的。
|
|
131
|
+
// 归一化的目标可以在 timeline.json 的 audioMix 里改,也可以在调用时用 options.mix 覆盖。
|
|
132
|
+
const promise = rendered.then(async (result) => {
|
|
133
|
+
if (operation !== 'full' || options.frameRange) return result
|
|
134
|
+
if (!(composition.audio || []).length) return result
|
|
135
|
+
let config = {}
|
|
136
|
+
try { config = { ...(readTimeline(dir).audioMix || {}) } } catch { config = {} }
|
|
137
|
+
config = { ...config, ...(options.mix || {}) }
|
|
138
|
+
if (config.normalize === false) return result
|
|
139
|
+
options.onProgress?.({ type: 'progress', phase: 'mixing', progress: 0.97 })
|
|
140
|
+
try {
|
|
141
|
+
const mix = await normalizeMix(output, { ...config, cwd: outDirectory, log: join(outDirectory, 'mix.log'), timeoutMs: 180000 })
|
|
142
|
+
return { ...result, mix }
|
|
143
|
+
} catch (error) {
|
|
144
|
+
// 混音后级失败不该让一条已经渲好的片子作废:带着错误回去,由调用方提示。
|
|
145
|
+
return { ...result, mixError: error.message }
|
|
146
|
+
}
|
|
147
|
+
})
|
|
148
|
+
const completed = promise.then((result) => {
|
|
149
|
+
if (operation === 'full' && !options.frameRange && syncReceipt) writeFileSync(output + '.sync.json', JSON.stringify({ ...syncReceipt, filmHash: filmHash(output) }))
|
|
150
|
+
return { ...result, render, renderSummary: describeRenderSettings(render) }
|
|
151
|
+
})
|
|
152
|
+
return { promise: completed, cancel, output, bundleDir, render }
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export function outputInfo(file) {
|
|
156
|
+
if (!existsSync(file)) return null
|
|
157
|
+
const stat = statSync(file)
|
|
158
|
+
return { path: file, bytes: stat.size, at: stat.mtime.toISOString() }
|
|
159
|
+
}
|