@automovie/render 0.0.0-stage → 0.1.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 +21 -0
- package/README.md +38 -2
- package/lib/AUTOMOVIE_GUIDE_PASSES.d.ts +11 -0
- package/lib/AUTOMOVIE_GUIDE_PASSES.js +21 -0
- package/lib/AUTOMOVIE_GUIDE_PASSES.js.map +1 -0
- package/lib/IAutoMovieCaptionEntry.d.ts +28 -0
- package/lib/IAutoMovieCaptionEntry.js +3 -0
- package/lib/IAutoMovieCaptionEntry.js.map +1 -0
- package/lib/IAutoMovieCaptionSidecar.d.ts +25 -0
- package/lib/IAutoMovieCaptionSidecar.js +3 -0
- package/lib/IAutoMovieCaptionSidecar.js.map +1 -0
- package/lib/IAutoMovieCapturedFrame.d.ts +22 -0
- package/lib/IAutoMovieCapturedFrame.js +3 -0
- package/lib/IAutoMovieCapturedFrame.js.map +1 -0
- package/lib/IAutoMovieGuidePassOutput.d.ts +23 -0
- package/lib/IAutoMovieGuidePassOutput.js +3 -0
- package/lib/IAutoMovieGuidePassOutput.js.map +1 -0
- package/lib/IAutoMoviePoseKeypointActor.d.ts +36 -0
- package/lib/IAutoMoviePoseKeypointActor.js +3 -0
- package/lib/IAutoMoviePoseKeypointActor.js.map +1 -0
- package/lib/IAutoMoviePoseKeypointFrame.d.ts +25 -0
- package/lib/IAutoMoviePoseKeypointFrame.js +3 -0
- package/lib/IAutoMoviePoseKeypointFrame.js.map +1 -0
- package/lib/IAutoMoviePoseKeypointSidecar.d.ts +21 -0
- package/lib/IAutoMoviePoseKeypointSidecar.js +3 -0
- package/lib/IAutoMoviePoseKeypointSidecar.js.map +1 -0
- package/lib/IAutoMovieRenderAdapters.d.ts +34 -0
- package/lib/IAutoMovieRenderAdapters.js +3 -0
- package/lib/IAutoMovieRenderAdapters.js.map +1 -0
- package/lib/IAutoMovieRenderAndSeeRequest.d.ts +32 -0
- package/lib/IAutoMovieRenderAndSeeRequest.js +3 -0
- package/lib/IAutoMovieRenderAndSeeRequest.js.map +1 -0
- package/lib/IAutoMovieRenderAndSeeResult.d.ts +20 -0
- package/lib/IAutoMovieRenderAndSeeResult.js +3 -0
- package/lib/IAutoMovieRenderAndSeeResult.js.map +1 -0
- package/lib/IAutoMovieRenderChunk.d.ts +48 -0
- package/lib/IAutoMovieRenderChunk.js +3 -0
- package/lib/IAutoMovieRenderChunk.js.map +1 -0
- package/lib/IAutoMovieRenderChunkPlan.d.ts +32 -0
- package/lib/IAutoMovieRenderChunkPlan.js +3 -0
- package/lib/IAutoMovieRenderChunkPlan.js.map +1 -0
- package/lib/IAutoMovieRenderPassManifest.d.ts +21 -0
- package/lib/IAutoMovieRenderPassManifest.js +3 -0
- package/lib/IAutoMovieRenderPassManifest.js.map +1 -0
- package/lib/IAutoMovieRenderReassembly.d.ts +24 -0
- package/lib/IAutoMovieRenderReassembly.js +3 -0
- package/lib/IAutoMovieRenderReassembly.js.map +1 -0
- package/lib/IAutoMovieRenderResult.d.ts +39 -0
- package/lib/IAutoMovieRenderResult.js +3 -0
- package/lib/IAutoMovieRenderResult.js.map +1 -0
- package/lib/IAutoMovieSequenceRenderAdapters.d.ts +36 -0
- package/lib/IAutoMovieSequenceRenderAdapters.js +3 -0
- package/lib/IAutoMovieSequenceRenderAdapters.js.map +1 -0
- package/lib/IAutoMovieSequenceRenderAndSeeRequest.d.ts +36 -0
- package/lib/IAutoMovieSequenceRenderAndSeeRequest.js +3 -0
- package/lib/IAutoMovieSequenceRenderAndSeeRequest.js.map +1 -0
- package/lib/IAutoMovieSequenceRenderAndSeeResult.d.ts +23 -0
- package/lib/IAutoMovieSequenceRenderAndSeeResult.js +3 -0
- package/lib/IAutoMovieSequenceRenderAndSeeResult.js.map +1 -0
- package/lib/IAutoMovieSequenceRenderFrame.d.ts +41 -0
- package/lib/IAutoMovieSequenceRenderFrame.js +3 -0
- package/lib/IAutoMovieSequenceRenderFrame.js.map +1 -0
- package/lib/IAutoMovieSequenceRenderPlan.d.ts +76 -0
- package/lib/IAutoMovieSequenceRenderPlan.js +3 -0
- package/lib/IAutoMovieSequenceRenderPlan.js.map +1 -0
- package/lib/IAutoMovieSequenceRenderResult.d.ts +44 -0
- package/lib/IAutoMovieSequenceRenderResult.js +3 -0
- package/lib/IAutoMovieSequenceRenderResult.js.map +1 -0
- package/lib/IAutoMovieSequenceRenderShotSpan.d.ts +39 -0
- package/lib/IAutoMovieSequenceRenderShotSpan.js +3 -0
- package/lib/IAutoMovieSequenceRenderShotSpan.js.map +1 -0
- package/lib/IAutoMovieSequenceRenderTransitionSpan.d.ts +39 -0
- package/lib/IAutoMovieSequenceRenderTransitionSpan.js +3 -0
- package/lib/IAutoMovieSequenceRenderTransitionSpan.js.map +1 -0
- package/lib/audio/encodeAutoMovieWavPcm16.d.ts +21 -0
- package/lib/audio/encodeAutoMovieWavPcm16.js +59 -0
- package/lib/audio/encodeAutoMovieWavPcm16.js.map +1 -0
- package/lib/audio/index.d.ts +2 -0
- package/lib/audio/index.js +19 -0
- package/lib/audio/index.js.map +1 -0
- package/lib/audio/mixAutoMovieAudioPcm.d.ts +64 -0
- package/lib/audio/mixAutoMovieAudioPcm.js +86 -0
- package/lib/audio/mixAutoMovieAudioPcm.js.map +1 -0
- package/lib/auditAutoMovieRenderObservation.d.ts +31 -0
- package/lib/auditAutoMovieRenderObservation.js +63 -0
- package/lib/auditAutoMovieRenderObservation.js.map +1 -0
- package/lib/cache/createAutoMovieHttpArtifactStore.d.ts +28 -0
- package/lib/cache/createAutoMovieHttpArtifactStore.js +66 -0
- package/lib/cache/createAutoMovieHttpArtifactStore.js.map +1 -0
- package/lib/caption/IAutoMovieBeatCaption.d.ts +22 -0
- package/lib/caption/IAutoMovieBeatCaption.js +3 -0
- package/lib/caption/IAutoMovieBeatCaption.js.map +1 -0
- package/lib/caption/autoMovieCaptionLanguageComparisonKey.d.ts +18 -0
- package/lib/caption/autoMovieCaptionLanguageComparisonKey.js +24 -0
- package/lib/caption/autoMovieCaptionLanguageComparisonKey.js.map +1 -0
- package/lib/caption/beatCaptions.d.ts +22 -0
- package/lib/caption/beatCaptions.js +50 -0
- package/lib/caption/beatCaptions.js.map +1 -0
- package/lib/caption/canonicalProductionWebVtt.d.ts +23 -0
- package/lib/caption/canonicalProductionWebVtt.js +60 -0
- package/lib/caption/canonicalProductionWebVtt.js.map +1 -0
- package/lib/caption/canonicalizeAutoMovieCaptionText.d.ts +18 -0
- package/lib/caption/canonicalizeAutoMovieCaptionText.js +24 -0
- package/lib/caption/canonicalizeAutoMovieCaptionText.js.map +1 -0
- package/lib/caption/escapeWebVttText.d.ts +17 -0
- package/lib/caption/escapeWebVttText.js +25 -0
- package/lib/caption/escapeWebVttText.js.map +1 -0
- package/lib/caption/index.d.ts +11 -0
- package/lib/caption/index.js +28 -0
- package/lib/caption/index.js.map +1 -0
- package/lib/caption/inspectAutoMovieCaptionReadabilityWithRuntime.d.ts +37 -0
- package/lib/caption/inspectAutoMovieCaptionReadabilityWithRuntime.js +129 -0
- package/lib/caption/inspectAutoMovieCaptionReadabilityWithRuntime.js.map +1 -0
- package/lib/caption/isAutoMovieWebVttIdentifier.d.ts +21 -0
- package/lib/caption/isAutoMovieWebVttIdentifier.js +28 -0
- package/lib/caption/isAutoMovieWebVttIdentifier.js.map +1 -0
- package/lib/caption/parseAutoMovieCaptionLanguage.d.ts +34 -0
- package/lib/caption/parseAutoMovieCaptionLanguage.js +121 -0
- package/lib/caption/parseAutoMovieCaptionLanguage.js.map +1 -0
- package/lib/caption/serializeAutoMovieWebVttCueText.d.ts +17 -0
- package/lib/caption/serializeAutoMovieWebVttCueText.js +27 -0
- package/lib/caption/serializeAutoMovieWebVttCueText.js.map +1 -0
- package/lib/caption/serializeAutoMovieWebVttIdentifier.d.ts +17 -0
- package/lib/caption/serializeAutoMovieWebVttIdentifier.js +27 -0
- package/lib/caption/serializeAutoMovieWebVttIdentifier.js.map +1 -0
- package/lib/caption/serializeAutoMovieWebVttSingleLineText.d.ts +19 -0
- package/lib/caption/serializeAutoMovieWebVttSingleLineText.js +26 -0
- package/lib/caption/serializeAutoMovieWebVttSingleLineText.js.map +1 -0
- package/lib/caption/webVttCaptionLanguage.d.ts +18 -0
- package/lib/caption/webVttCaptionLanguage.js +29 -0
- package/lib/caption/webVttCaptionLanguage.js.map +1 -0
- package/lib/caption/webVttTime.d.ts +19 -0
- package/lib/caption/webVttTime.js +30 -0
- package/lib/caption/webVttTime.js.map +1 -0
- package/lib/captionPlan.d.ts +1 -0
- package/lib/captionPlan.js +18 -0
- package/lib/captionPlan.js.map +1 -0
- package/lib/captionSidecar.d.ts +3 -0
- package/lib/captionSidecar.js +20 -0
- package/lib/captionSidecar.js.map +1 -0
- package/lib/captionSlice.d.ts +1 -0
- package/lib/captionSlice.js +18 -0
- package/lib/captionSlice.js.map +1 -0
- package/lib/chunkSequenceRender.d.ts +5 -0
- package/lib/chunkSequenceRender.js +22 -0
- package/lib/chunkSequenceRender.js.map +1 -0
- package/lib/delivery/AUTOMOVIE_MP4_SRGB_COLOUR.d.ts +16 -0
- package/lib/delivery/AUTOMOVIE_MP4_SRGB_COLOUR.js +20 -0
- package/lib/delivery/AUTOMOVIE_MP4_SRGB_COLOUR.js.map +1 -0
- package/lib/delivery/AUTOMOVIE_MP4_UNITY_MATRIX.d.ts +11 -0
- package/lib/delivery/AUTOMOVIE_MP4_UNITY_MATRIX.js +14 -0
- package/lib/delivery/AUTOMOVIE_MP4_UNITY_MATRIX.js.map +1 -0
- package/lib/delivery/AUTOMOVIE_PRODUCTION_OPUS_PROFILE.d.ts +15 -0
- package/lib/delivery/AUTOMOVIE_PRODUCTION_OPUS_PROFILE.js +19 -0
- package/lib/delivery/AUTOMOVIE_PRODUCTION_OPUS_PROFILE.js.map +1 -0
- package/lib/delivery/AutoMovieProductionPngRole.d.ts +14 -0
- package/lib/delivery/AutoMovieProductionPngRole.js +3 -0
- package/lib/delivery/AutoMovieProductionPngRole.js.map +1 -0
- package/lib/delivery/IAutoMovieProductionPngProfile.d.ts +41 -0
- package/lib/delivery/IAutoMovieProductionPngProfile.js +3 -0
- package/lib/delivery/IAutoMovieProductionPngProfile.js.map +1 -0
- package/lib/delivery/IAutoMovieProductionVideoProfile.d.ts +46 -0
- package/lib/delivery/IAutoMovieProductionVideoProfile.js +3 -0
- package/lib/delivery/IAutoMovieProductionVideoProfile.js.map +1 -0
- package/lib/delivery/assertAutoMovieCaptureClock.d.ts +26 -0
- package/lib/delivery/assertAutoMovieCaptureClock.js +29 -0
- package/lib/delivery/assertAutoMovieCaptureClock.js.map +1 -0
- package/lib/delivery/assertProductionOpusProfile.d.ts +23 -0
- package/lib/delivery/assertProductionOpusProfile.js +160 -0
- package/lib/delivery/assertProductionOpusProfile.js.map +1 -0
- package/lib/delivery/assertProductionPngPicture.d.ts +24 -0
- package/lib/delivery/assertProductionPngPicture.js +47 -0
- package/lib/delivery/assertProductionPngPicture.js.map +1 -0
- package/lib/delivery/assertProductionVideoProfile.d.ts +30 -0
- package/lib/delivery/assertProductionVideoProfile.js +150 -0
- package/lib/delivery/assertProductionVideoProfile.js.map +1 -0
- package/lib/delivery/auditAutoMovieDecodedFrames.d.ts +56 -0
- package/lib/delivery/auditAutoMovieDecodedFrames.js +92 -0
- package/lib/delivery/auditAutoMovieDecodedFrames.js.map +1 -0
- package/lib/delivery/auditAutoMovieEncodedPresentation.d.ts +27 -0
- package/lib/delivery/auditAutoMovieEncodedPresentation.js +62 -0
- package/lib/delivery/auditAutoMovieEncodedPresentation.js.map +1 -0
- package/lib/delivery/index.d.ts +14 -0
- package/lib/delivery/index.js +31 -0
- package/lib/delivery/index.js.map +1 -0
- package/lib/delivery/planAutoMovieCaptureUrl.d.ts +18 -0
- package/lib/delivery/planAutoMovieCaptureUrl.js +31 -0
- package/lib/delivery/planAutoMovieCaptureUrl.js.map +1 -0
- package/lib/delivery/productionOpusDescription.d.ts +41 -0
- package/lib/delivery/productionOpusDescription.js +125 -0
- package/lib/delivery/productionOpusDescription.js.map +1 -0
- package/lib/delivery/resolveProductionPngProfile.d.ts +27 -0
- package/lib/delivery/resolveProductionPngProfile.js +53 -0
- package/lib/delivery/resolveProductionPngProfile.js.map +1 -0
- package/lib/delivery/resolveProductionVideoProfile.d.ts +27 -0
- package/lib/delivery/resolveProductionVideoProfile.js +36 -0
- package/lib/delivery/resolveProductionVideoProfile.js.map +1 -0
- package/lib/ffmpegArgs.d.ts +33 -0
- package/lib/ffmpegArgs.js +56 -0
- package/lib/ffmpegArgs.js.map +1 -0
- package/lib/film/AutoMovieOrderedScalar.d.ts +15 -0
- package/lib/film/AutoMovieOrderedScalar.js +3 -0
- package/lib/film/AutoMovieOrderedScalar.js.map +1 -0
- package/lib/film/IAutoMovieProductionAudioAssetIdentity.d.ts +28 -0
- package/lib/film/IAutoMovieProductionAudioAssetIdentity.js +3 -0
- package/lib/film/IAutoMovieProductionAudioAssetIdentity.js.map +1 -0
- package/lib/film/IAutoMovieProductionAudioAssetIdentityBase.d.ts +29 -0
- package/lib/film/IAutoMovieProductionAudioAssetIdentityBase.js +3 -0
- package/lib/film/IAutoMovieProductionAudioAssetIdentityBase.js.map +1 -0
- package/lib/film/IAutoMovieProductionEncoderIdentity.d.ts +36 -0
- package/lib/film/IAutoMovieProductionEncoderIdentity.js +3 -0
- package/lib/film/IAutoMovieProductionEncoderIdentity.js.map +1 -0
- package/lib/film/IAutoMovieProductionRenderChunk.d.ts +39 -0
- package/lib/film/IAutoMovieProductionRenderChunk.js +3 -0
- package/lib/film/IAutoMovieProductionRenderChunk.js.map +1 -0
- package/lib/film/IAutoMovieProductionRenderJobPlan.d.ts +53 -0
- package/lib/film/IAutoMovieProductionRenderJobPlan.js +3 -0
- package/lib/film/IAutoMovieProductionRenderJobPlan.js.map +1 -0
- package/lib/film/IAutoMovieProductionRenderRuntimeIdentity.d.ts +31 -0
- package/lib/film/IAutoMovieProductionRenderRuntimeIdentity.js +3 -0
- package/lib/film/IAutoMovieProductionRenderRuntimeIdentity.js.map +1 -0
- package/lib/film/IAutoMovieProductionRenderTier.d.ts +25 -0
- package/lib/film/IAutoMovieProductionRenderTier.js +3 -0
- package/lib/film/IAutoMovieProductionRenderTier.js.map +1 -0
- package/lib/film/assertSingleGuidePass.d.ts +19 -0
- package/lib/film/assertSingleGuidePass.js +35 -0
- package/lib/film/assertSingleGuidePass.js.map +1 -0
- package/lib/film/equalOrderedScalars.d.ts +27 -0
- package/lib/film/equalOrderedScalars.js +52 -0
- package/lib/film/equalOrderedScalars.js.map +1 -0
- package/lib/film/index.d.ts +9 -0
- package/lib/film/index.js +26 -0
- package/lib/film/index.js.map +1 -0
- package/lib/film/normalizeAudioAssets.d.ts +21 -0
- package/lib/film/normalizeAudioAssets.js +56 -0
- package/lib/film/normalizeAudioAssets.js.map +1 -0
- package/lib/film/normalizeRenderTier.d.ts +19 -0
- package/lib/film/normalizeRenderTier.js +45 -0
- package/lib/film/normalizeRenderTier.js.map +1 -0
- package/lib/film/planProductionRenderJob.d.ts +48 -0
- package/lib/film/planProductionRenderJob.js +196 -0
- package/lib/film/planProductionRenderJob.js.map +1 -0
- package/lib/film/productionVisualDeliveryOccurrence.d.ts +20 -0
- package/lib/film/productionVisualDeliveryOccurrence.js +24 -0
- package/lib/film/productionVisualDeliveryOccurrence.js.map +1 -0
- package/lib/film/resolveProductionRenderTierFrameFormat.d.ts +21 -0
- package/lib/film/resolveProductionRenderTierFrameFormat.js +46 -0
- package/lib/film/resolveProductionRenderTierFrameFormat.js.map +1 -0
- package/lib/film/validDigest.d.ts +18 -0
- package/lib/film/validDigest.js +25 -0
- package/lib/film/validDigest.js.map +1 -0
- package/lib/film/validWaveAudioIdentity.d.ts +25 -0
- package/lib/film/validWaveAudioIdentity.js +76 -0
- package/lib/film/validWaveAudioIdentity.js.map +1 -0
- package/lib/frameName.d.ts +19 -0
- package/lib/frameName.js +24 -0
- package/lib/frameName.js.map +1 -0
- package/lib/framePattern.d.ts +16 -0
- package/lib/framePattern.js +21 -0
- package/lib/framePattern.js.map +1 -0
- package/lib/frameTimes.d.ts +20 -0
- package/lib/frameTimes.js +33 -0
- package/lib/frameTimes.js.map +1 -0
- package/lib/guidePassFrameName.d.ts +15 -0
- package/lib/guidePassFrameName.js +21 -0
- package/lib/guidePassFrameName.js.map +1 -0
- package/lib/guidePassFramePattern.d.ts +15 -0
- package/lib/guidePassFramePattern.js +21 -0
- package/lib/guidePassFramePattern.js.map +1 -0
- package/lib/guidePasses.d.ts +7 -0
- package/lib/guidePasses.js +24 -0
- package/lib/guidePasses.js.map +1 -0
- package/lib/guidePassesInternal/passExtension.d.ts +14 -0
- package/lib/guidePassesInternal/passExtension.js +18 -0
- package/lib/guidePassesInternal/passExtension.js.map +1 -0
- package/lib/index.d.ts +69 -0
- package/lib/index.js +86 -0
- package/lib/index.js.map +1 -0
- package/lib/isGuidePass.d.ts +15 -0
- package/lib/isGuidePass.js +20 -0
- package/lib/isGuidePass.js.map +1 -0
- package/lib/normalizeGuidePasses.d.ts +15 -0
- package/lib/normalizeGuidePasses.js +32 -0
- package/lib/normalizeGuidePasses.js.map +1 -0
- package/lib/planCaptionSidecar.d.ts +23 -0
- package/lib/planCaptionSidecar.js +56 -0
- package/lib/planCaptionSidecar.js.map +1 -0
- package/lib/planChunkedSequenceRender.d.ts +26 -0
- package/lib/planChunkedSequenceRender.js +132 -0
- package/lib/planChunkedSequenceRender.js.map +1 -0
- package/lib/planGuidePassOutputs.d.ts +19 -0
- package/lib/planGuidePassOutputs.js +31 -0
- package/lib/planGuidePassOutputs.js.map +1 -0
- package/lib/planPoseKeypointSidecar.d.ts +27 -0
- package/lib/planPoseKeypointSidecar.js +141 -0
- package/lib/planPoseKeypointSidecar.js.map +1 -0
- package/lib/planSequenceRender.d.ts +20 -0
- package/lib/planSequenceRender.js +99 -0
- package/lib/planSequenceRender.js.map +1 -0
- package/lib/planViewerFrameTimes.d.ts +33 -0
- package/lib/planViewerFrameTimes.js +74 -0
- package/lib/planViewerFrameTimes.js.map +1 -0
- package/lib/renderAndSee.d.ts +14 -0
- package/lib/renderAndSee.js +22 -0
- package/lib/renderAndSee.js.map +1 -0
- package/lib/renderBudgetPreflight/IAutoMovieRenderBudgetAssessment.d.ts +41 -0
- package/lib/renderBudgetPreflight/IAutoMovieRenderBudgetAssessment.js +3 -0
- package/lib/renderBudgetPreflight/IAutoMovieRenderBudgetAssessment.js.map +1 -0
- package/lib/renderBudgetPreflight/IAutoMovieRenderBudgetEvidence.d.ts +53 -0
- package/lib/renderBudgetPreflight/IAutoMovieRenderBudgetEvidence.js +3 -0
- package/lib/renderBudgetPreflight/IAutoMovieRenderBudgetEvidence.js.map +1 -0
- package/lib/renderBudgetPreflight/IAutoMovieRenderGraphicsIdentity.d.ts +27 -0
- package/lib/renderBudgetPreflight/IAutoMovieRenderGraphicsIdentity.js +3 -0
- package/lib/renderBudgetPreflight/IAutoMovieRenderGraphicsIdentity.js.map +1 -0
- package/lib/renderBudgetPreflight/assessAutoMovieRenderBudget.d.ts +28 -0
- package/lib/renderBudgetPreflight/assessAutoMovieRenderBudget.js +77 -0
- package/lib/renderBudgetPreflight/assessAutoMovieRenderBudget.js.map +1 -0
- package/lib/renderBudgetPreflight/autoMovieRenderBudgetEvidence.d.ts +23 -0
- package/lib/renderBudgetPreflight/autoMovieRenderBudgetEvidence.js +55 -0
- package/lib/renderBudgetPreflight/autoMovieRenderBudgetEvidence.js.map +1 -0
- package/lib/renderBudgetPreflight/autoMovieRenderBudgetRefusal.d.ts +17 -0
- package/lib/renderBudgetPreflight/autoMovieRenderBudgetRefusal.js +51 -0
- package/lib/renderBudgetPreflight/autoMovieRenderBudgetRefusal.js.map +1 -0
- package/lib/renderBudgetPreflight/autoMovieRenderTargetRendererOfGraphics.d.ts +22 -0
- package/lib/renderBudgetPreflight/autoMovieRenderTargetRendererOfGraphics.js +32 -0
- package/lib/renderBudgetPreflight/autoMovieRenderTargetRendererOfGraphics.js.map +1 -0
- package/lib/renderBudgetPreflight/autoMovieRenderTargetSettingsOfShot.d.ts +23 -0
- package/lib/renderBudgetPreflight/autoMovieRenderTargetSettingsOfShot.js +35 -0
- package/lib/renderBudgetPreflight/autoMovieRenderTargetSettingsOfShot.js.map +1 -0
- package/lib/renderBudgetPreflight/index.d.ts +9 -0
- package/lib/renderBudgetPreflight/index.js +26 -0
- package/lib/renderBudgetPreflight/index.js.map +1 -0
- package/lib/renderBudgetPreflight/selectAutoMovieRenderBudget.d.ts +18 -0
- package/lib/renderBudgetPreflight/selectAutoMovieRenderBudget.js +22 -0
- package/lib/renderBudgetPreflight/selectAutoMovieRenderBudget.js.map +1 -0
- package/lib/renderCaptionSidecar.d.ts +13 -0
- package/lib/renderCaptionSidecar.js +17 -0
- package/lib/renderCaptionSidecar.js.map +1 -0
- package/lib/renderObservationAudit.d.ts +1 -0
- package/lib/renderObservationAudit.js +18 -0
- package/lib/renderObservationAudit.js.map +1 -0
- package/lib/renderPathStem.d.ts +22 -0
- package/lib/renderPathStem.js +64 -0
- package/lib/renderPathStem.js.map +1 -0
- package/lib/renderPoseKeypointSidecar.d.ts +15 -0
- package/lib/renderPoseKeypointSidecar.js +19 -0
- package/lib/renderPoseKeypointSidecar.js.map +1 -0
- package/lib/renderSequenceAndSee.d.ts +14 -0
- package/lib/renderSequenceAndSee.js +32 -0
- package/lib/renderSequenceAndSee.js.map +1 -0
- package/lib/renderSequenceVideo.d.ts +15 -0
- package/lib/renderSequenceVideo.js +35 -0
- package/lib/renderSequenceVideo.js.map +1 -0
- package/lib/renderVideo.d.ts +17 -0
- package/lib/renderVideo.js +45 -0
- package/lib/renderVideo.js.map +1 -0
- package/lib/screenplay/index.d.ts +1 -0
- package/lib/screenplay/index.js +18 -0
- package/lib/screenplay/index.js.map +1 -0
- package/lib/screenplay/renderScreenplay.d.ts +25 -0
- package/lib/screenplay/renderScreenplay.js +101 -0
- package/lib/screenplay/renderScreenplay.js.map +1 -0
- package/lib/screenplay/screenplaySceneSlug.d.ts +17 -0
- package/lib/screenplay/screenplaySceneSlug.js +21 -0
- package/lib/screenplay/screenplaySceneSlug.js.map +1 -0
- package/lib/sequenceRenderPlan.d.ts +5 -0
- package/lib/sequenceRenderPlan.js +22 -0
- package/lib/sequenceRenderPlan.js.map +1 -0
- package/lib/sequenceRenderVideo.d.ts +6 -0
- package/lib/sequenceRenderVideo.js +23 -0
- package/lib/sequenceRenderVideo.js.map +1 -0
- package/lib/shotBeat.d.ts +18 -0
- package/lib/shotBeat.js +23 -0
- package/lib/shotBeat.js.map +1 -0
- package/lib/sliceCaptionSidecar.d.ts +15 -0
- package/lib/sliceCaptionSidecar.js +57 -0
- package/lib/sliceCaptionSidecar.js.map +1 -0
- package/package.json +46 -3
- package/src/AUTOMOVIE_GUIDE_PASSES.ts +19 -0
- package/src/IAutoMovieCaptionEntry.ts +32 -0
- package/src/IAutoMovieCaptionSidecar.ts +29 -0
- package/src/IAutoMovieCapturedFrame.ts +24 -0
- package/src/IAutoMovieGuidePassOutput.ts +27 -0
- package/src/IAutoMoviePoseKeypointActor.ts +39 -0
- package/src/IAutoMoviePoseKeypointFrame.ts +28 -0
- package/src/IAutoMoviePoseKeypointSidecar.ts +25 -0
- package/src/IAutoMovieRenderAdapters.ts +39 -0
- package/src/IAutoMovieRenderAndSeeRequest.ts +38 -0
- package/src/IAutoMovieRenderAndSeeResult.ts +23 -0
- package/src/IAutoMovieRenderChunk.ts +62 -0
- package/src/IAutoMovieRenderChunkPlan.ts +40 -0
- package/src/IAutoMovieRenderPassManifest.ts +25 -0
- package/src/IAutoMovieRenderReassembly.ts +28 -0
- package/src/IAutoMovieRenderResult.ts +46 -0
- package/src/IAutoMovieSequenceRenderAdapters.ts +41 -0
- package/src/IAutoMovieSequenceRenderAndSeeRequest.ts +47 -0
- package/src/IAutoMovieSequenceRenderAndSeeResult.ts +23 -0
- package/src/IAutoMovieSequenceRenderFrame.ts +48 -0
- package/src/IAutoMovieSequenceRenderPlan.ts +88 -0
- package/src/IAutoMovieSequenceRenderResult.ts +52 -0
- package/src/IAutoMovieSequenceRenderShotSpan.ts +46 -0
- package/src/IAutoMovieSequenceRenderTransitionSpan.ts +46 -0
- package/src/audio/encodeAutoMovieWavPcm16.ts +65 -0
- package/src/audio/index.ts +2 -0
- package/src/audio/mixAutoMovieAudioPcm.ts +137 -0
- package/src/auditAutoMovieRenderObservation.ts +79 -0
- package/src/cache/createAutoMovieHttpArtifactStore.ts +84 -0
- package/src/caption/IAutoMovieBeatCaption.ts +23 -0
- package/src/caption/autoMovieCaptionLanguageComparisonKey.ts +23 -0
- package/src/caption/beatCaptions.ts +59 -0
- package/src/caption/canonicalProductionWebVtt.ts +76 -0
- package/src/caption/canonicalizeAutoMovieCaptionText.ts +24 -0
- package/src/caption/escapeWebVttText.ts +23 -0
- package/src/caption/index.ts +11 -0
- package/src/caption/inspectAutoMovieCaptionReadabilityWithRuntime.ts +231 -0
- package/src/caption/isAutoMovieWebVttIdentifier.ts +26 -0
- package/src/caption/parseAutoMovieCaptionLanguage.ts +160 -0
- package/src/caption/serializeAutoMovieWebVttCueText.ts +28 -0
- package/src/caption/serializeAutoMovieWebVttIdentifier.ts +27 -0
- package/src/caption/serializeAutoMovieWebVttSingleLineText.ts +26 -0
- package/src/caption/webVttCaptionLanguage.ts +30 -0
- package/src/caption/webVttTime.ts +30 -0
- package/src/captionPlan.ts +1 -0
- package/src/captionSidecar.ts +3 -0
- package/src/captionSlice.ts +1 -0
- package/src/chunkSequenceRender.ts +5 -0
- package/src/delivery/AUTOMOVIE_MP4_SRGB_COLOUR.ts +21 -0
- package/src/delivery/AUTOMOVIE_MP4_UNITY_MATRIX.ts +14 -0
- package/src/delivery/AUTOMOVIE_PRODUCTION_OPUS_PROFILE.ts +28 -0
- package/src/delivery/AutoMovieProductionPngRole.ts +18 -0
- package/src/delivery/IAutoMovieProductionPngProfile.ts +52 -0
- package/src/delivery/IAutoMovieProductionVideoProfile.ts +48 -0
- package/src/delivery/assertAutoMovieCaptureClock.ts +37 -0
- package/src/delivery/assertProductionOpusProfile.ts +179 -0
- package/src/delivery/assertProductionPngPicture.ts +62 -0
- package/src/delivery/assertProductionVideoProfile.ts +180 -0
- package/src/delivery/auditAutoMovieDecodedFrames.ts +157 -0
- package/src/delivery/auditAutoMovieEncodedPresentation.ts +86 -0
- package/src/delivery/index.ts +14 -0
- package/src/delivery/planAutoMovieCaptureUrl.ts +32 -0
- package/src/delivery/productionOpusDescription.ts +173 -0
- package/src/delivery/resolveProductionPngProfile.ts +70 -0
- package/src/delivery/resolveProductionVideoProfile.ts +48 -0
- package/src/ffmpegArgs.ts +61 -0
- package/src/film/AutoMovieOrderedScalar.ts +15 -0
- package/src/film/IAutoMovieProductionAudioAssetIdentity.ts +40 -0
- package/src/film/IAutoMovieProductionAudioAssetIdentityBase.ts +34 -0
- package/src/film/IAutoMovieProductionEncoderIdentity.ts +42 -0
- package/src/film/IAutoMovieProductionRenderChunk.ts +47 -0
- package/src/film/IAutoMovieProductionRenderJobPlan.ts +73 -0
- package/src/film/IAutoMovieProductionRenderRuntimeIdentity.ts +37 -0
- package/src/film/IAutoMovieProductionRenderTier.ts +27 -0
- package/src/film/assertSingleGuidePass.ts +38 -0
- package/src/film/equalOrderedScalars.ts +56 -0
- package/src/film/index.ts +9 -0
- package/src/film/normalizeAudioAssets.ts +74 -0
- package/src/film/normalizeRenderTier.ts +51 -0
- package/src/film/planProductionRenderJob.ts +353 -0
- package/src/film/productionVisualDeliveryOccurrence.ts +28 -0
- package/src/film/resolveProductionRenderTierFrameFormat.ts +60 -0
- package/src/film/validDigest.ts +23 -0
- package/src/film/validWaveAudioIdentity.ts +88 -0
- package/src/frameName.ts +24 -0
- package/src/framePattern.ts +19 -0
- package/src/frameTimes.ts +36 -0
- package/src/guidePassFrameName.ts +29 -0
- package/src/guidePassFramePattern.ts +27 -0
- package/src/guidePasses.ts +7 -0
- package/src/guidePassesInternal/passExtension.ts +19 -0
- package/src/index.ts +69 -0
- package/src/isGuidePass.ts +21 -0
- package/src/normalizeGuidePasses.ts +33 -0
- package/src/planCaptionSidecar.ts +98 -0
- package/src/planChunkedSequenceRender.ts +200 -0
- package/src/planGuidePassOutputs.ts +47 -0
- package/src/planPoseKeypointSidecar.ts +289 -0
- package/src/planSequenceRender.ts +175 -0
- package/src/planViewerFrameTimes.ts +98 -0
- package/src/renderAndSee.ts +30 -0
- package/src/renderBudgetPreflight/IAutoMovieRenderBudgetAssessment.ts +53 -0
- package/src/renderBudgetPreflight/IAutoMovieRenderBudgetEvidence.ts +61 -0
- package/src/renderBudgetPreflight/IAutoMovieRenderGraphicsIdentity.ts +29 -0
- package/src/renderBudgetPreflight/assessAutoMovieRenderBudget.ts +137 -0
- package/src/renderBudgetPreflight/autoMovieRenderBudgetEvidence.ts +100 -0
- package/src/renderBudgetPreflight/autoMovieRenderBudgetRefusal.ts +82 -0
- package/src/renderBudgetPreflight/autoMovieRenderTargetRendererOfGraphics.ts +40 -0
- package/src/renderBudgetPreflight/autoMovieRenderTargetSettingsOfShot.ts +59 -0
- package/src/renderBudgetPreflight/index.ts +9 -0
- package/src/renderBudgetPreflight/selectAutoMovieRenderBudget.ts +28 -0
- package/src/renderCaptionSidecar.ts +17 -0
- package/src/renderObservationAudit.ts +1 -0
- package/src/renderPathStem.ts +61 -0
- package/src/renderPoseKeypointSidecar.ts +19 -0
- package/src/renderSequenceAndSee.ts +34 -0
- package/src/renderSequenceVideo.ts +44 -0
- package/src/renderVideo.ts +65 -0
- package/src/screenplay/index.ts +1 -0
- package/src/screenplay/renderScreenplay.ts +128 -0
- package/src/screenplay/screenplaySceneSlug.ts +29 -0
- package/src/sequenceRenderPlan.ts +5 -0
- package/src/sequenceRenderVideo.ts +6 -0
- package/src/shotBeat.ts +19 -0
- package/src/sliceCaptionSidecar.ts +85 -0
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AutoMovieFilmEffectRuntimeError,
|
|
3
|
+
type IAutoMovieProductionRenderFrame,
|
|
4
|
+
autoMovieRenderDigest,
|
|
5
|
+
canonicalizeAutoMovieJson,
|
|
6
|
+
compareCodeUnits,
|
|
7
|
+
equalProductionFrameRates,
|
|
8
|
+
productionFilmEffectEditFingerprint,
|
|
9
|
+
productionFrameBoundaryToGridTick,
|
|
10
|
+
resolveProductionFrameRate,
|
|
11
|
+
sampleProductionRenderFrame,
|
|
12
|
+
verifyProductionFilmEffectPopulation,
|
|
13
|
+
} from "@automovie/engine";
|
|
14
|
+
import type {
|
|
15
|
+
AutoMovieGuidePass,
|
|
16
|
+
IAutoMovieCompiledFilmEffect,
|
|
17
|
+
IAutoMovieFilmTimeline,
|
|
18
|
+
IAutoMovieProductionDeliverable,
|
|
19
|
+
IAutoMovieProductionDesign,
|
|
20
|
+
IAutoMovieProductionFrameRate,
|
|
21
|
+
} from "@automovie/interface";
|
|
22
|
+
|
|
23
|
+
import { canonicalProductionWebVtt } from "../caption/canonicalProductionWebVtt";
|
|
24
|
+
import type { IAutoMovieProductionAudioAssetIdentity } from "./IAutoMovieProductionAudioAssetIdentity";
|
|
25
|
+
import type { IAutoMovieProductionRenderChunk } from "./IAutoMovieProductionRenderChunk";
|
|
26
|
+
import type { IAutoMovieProductionRenderJobPlan } from "./IAutoMovieProductionRenderJobPlan";
|
|
27
|
+
import type { IAutoMovieProductionRenderRuntimeIdentity } from "./IAutoMovieProductionRenderRuntimeIdentity";
|
|
28
|
+
import type { IAutoMovieProductionRenderTier } from "./IAutoMovieProductionRenderTier";
|
|
29
|
+
import { assertSingleGuidePass } from "./assertSingleGuidePass";
|
|
30
|
+
import { normalizeAudioAssets } from "./normalizeAudioAssets";
|
|
31
|
+
import { normalizeRenderTier } from "./normalizeRenderTier";
|
|
32
|
+
import { resolveProductionRenderTierFrameFormat } from "./resolveProductionRenderTierFrameFormat";
|
|
33
|
+
import { validDigest } from "./validDigest";
|
|
34
|
+
|
|
35
|
+
/** A deliverable that renders moving images, the only kind with chunks. */
|
|
36
|
+
type IMovingDeliverable = IAutoMovieProductionDeliverable & {
|
|
37
|
+
kind: "feature" | "guide-pass";
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** One output-frame range shared by every moving deliverable's chunk. */
|
|
41
|
+
interface IRange {
|
|
42
|
+
frameStart: number;
|
|
43
|
+
frameEndExclusive: number;
|
|
44
|
+
frames: IAutoMovieProductionRenderFrame[];
|
|
45
|
+
sources: Array<{ shot: string; digest: string }>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Plan the content-addressed render chunks and publication tracks of one
|
|
50
|
+
* production edit at one tier.
|
|
51
|
+
*
|
|
52
|
+
* The tier, which defaults to final, decimates the timeline by `frameStep` and
|
|
53
|
+
* projects the raster; output frames are partitioned into ranges of at most
|
|
54
|
+
* `chunkFrames`, and every feature and guide-pass deliverable gets one chunk
|
|
55
|
+
* per range, in declaration order. A feature renders `beauty`; a guide-pass
|
|
56
|
+
* deliverable renders its declared `pass`, or, for a legacy record without
|
|
57
|
+
* one, the single pass in `guidePasses`, which defaults to `pose`. Each chunk
|
|
58
|
+
* id digests the edit, effect digests, tier, frame formats, range, pass,
|
|
59
|
+
* runtime identity and the source digest of every shot the range shows.
|
|
60
|
+
*
|
|
61
|
+
* Throws when `chunkFrames` is not a positive safe integer; a runtime,
|
|
62
|
+
* compile or source digest is malformed or missing; the tier is inadmissible
|
|
63
|
+
* or its raster is odd; the timeline's id, frame rate or runtime differs from
|
|
64
|
+
* the production's, or its length is not a multiple of `frameStep`; the effect
|
|
65
|
+
* runtimes are not exactly the timeline's current population for this
|
|
66
|
+
* production, as an `AutoMovieFilmEffectRuntimeError`; an audio asset is
|
|
67
|
+
* invalid or a cue's asset is missing or holds another sample count; or a
|
|
68
|
+
* guide pass is unknown or not single. The inputs are not changed.
|
|
69
|
+
*
|
|
70
|
+
* Current maintained callers are planner tests. This function does not execute a render, authenticate supplied runtime or source digests, or establish stored-plan currentness for an application scheduler.
|
|
71
|
+
*
|
|
72
|
+
* @evidence contracts/development/implementation.md#principled-implementation Chunk ids hash canonical JSON of the declared edit, effects, tier, formats, range, pass, runtime identity and range source digests. Engine population and production-owner checks admit effect runtimes, and exact rational frame-to-tick rounding checks cue source lengths against asset samples. Supplied identity records remain caller claims; hashing them does not authenticate renderer bytes or prove equal pixels.
|
|
73
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure Admission rules live in their helpers (`normalizeRenderTier`, `normalizeAudioAssets`, `assertSingleGuidePass`, `validDigest`) and the engine (`verifyProductionFilmEffectPopulation`, `sampleProductionRenderFrame`); this function orders them, builds each range once, and joins ranges with deliverables. The range walk repeats `planChunkedSequenceRender`'s arithmetic on purpose, because there the range index orders reassembly and here it is one field of a content-addressed slot.
|
|
74
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The `pose` default is the interface's documented legacy rule for a guide deliverable without a pass, the protocol and version literals are schema identities, and every refusal throws rather than skipping a deliverable, cue or shot.
|
|
75
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc states the tier default and decimation, the range partition and chunk order, which pass each deliverable renders including the legacy default, what a chunk id digests, every refusal with the effect error type, and that inputs are left unchanged.
|
|
76
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms For F tier output frames and S ordered segments, engine sampling costs O(F log(S+1)) plus rate reduction per frame. Range construction visits their at-most-two layers, sorts each range's distinct shot ids and shares ranges across D moving deliverables. Audio asset sorting/copying, effect verification/cloning, caption sorting/serialization and each chunk's canonical JSON/hash work depend on their complete populations and byte lengths; large runtime identities are serialized again per chunk.
|
|
77
|
+
* @evidence contracts/development/implementation.md#reuse-equivalent-work Each range's frame array and sorted source identities are built once and shared across the moving deliverables of this call. There is no cross-call cache or maintained scheduler consuming these ids to reuse completed encodes; any such effect reuse would require a host's currentness and byte checks.
|
|
78
|
+
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources All F samples are allocated even with no moving deliverable, then become collectable if no range retains them. With moving deliverables the result shares F frame records through D times ceil(F/chunkFrames) chunk records and retains copied audio/effect tracks, asset identities and caption text. Input arrays and output populations have no quota here; local indexes and digest strings become collectable after completion or refusal, with no acquired host handle or task.
|
|
79
|
+
*/
|
|
80
|
+
export const planProductionRenderJob: (props: {
|
|
81
|
+
timeline: IAutoMovieFilmTimeline;
|
|
82
|
+
effects: readonly IAutoMovieCompiledFilmEffect[];
|
|
83
|
+
production: IAutoMovieProductionDesign;
|
|
84
|
+
runtimeIdentity: IAutoMovieProductionRenderRuntimeIdentity;
|
|
85
|
+
sourceFingerprints: Readonly<Record<string, string>>;
|
|
86
|
+
audioAssets: readonly IAutoMovieProductionAudioAssetIdentity[];
|
|
87
|
+
chunkFrames: number;
|
|
88
|
+
guidePasses?: readonly Exclude<AutoMovieGuidePass, "beauty">[];
|
|
89
|
+
tier?: IAutoMovieProductionRenderTier;
|
|
90
|
+
}) => IAutoMovieProductionRenderJobPlan = (props: {
|
|
91
|
+
/** The builder-owned film edit. */
|
|
92
|
+
timeline: IAutoMovieFilmTimeline;
|
|
93
|
+
|
|
94
|
+
/** The compiled film-global effect runtimes for that edit. */
|
|
95
|
+
effects: readonly IAutoMovieCompiledFilmEffect[];
|
|
96
|
+
|
|
97
|
+
/** The production design the edit was compiled for. */
|
|
98
|
+
production: IAutoMovieProductionDesign;
|
|
99
|
+
|
|
100
|
+
/** Capture and encoder identity every chunk renders under. */
|
|
101
|
+
runtimeIdentity: IAutoMovieProductionRenderRuntimeIdentity;
|
|
102
|
+
|
|
103
|
+
/** SHA-256 source digest of every shot the edit shows, by shot id. */
|
|
104
|
+
sourceFingerprints: Readonly<Record<string, string>>;
|
|
105
|
+
|
|
106
|
+
/** Identity of every audio asset the edit's cues reference. */
|
|
107
|
+
audioAssets: readonly IAutoMovieProductionAudioAssetIdentity[];
|
|
108
|
+
|
|
109
|
+
/** Maximum output frames per chunk; a positive safe integer. */
|
|
110
|
+
chunkFrames: number;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* The one pass of a legacy guide deliverable that declares none; omitted is
|
|
114
|
+
* `pose`.
|
|
115
|
+
*/
|
|
116
|
+
guidePasses?: readonly Exclude<AutoMovieGuidePass, "beauty">[];
|
|
117
|
+
|
|
118
|
+
/** Proxy or final tier; omitted is the exact final tier. */
|
|
119
|
+
tier?: IAutoMovieProductionRenderTier;
|
|
120
|
+
}): IAutoMovieProductionRenderJobPlan => {
|
|
121
|
+
if (
|
|
122
|
+
Number.isSafeInteger(props.chunkFrames) === false ||
|
|
123
|
+
props.chunkFrames <= 0
|
|
124
|
+
)
|
|
125
|
+
throw new Error(
|
|
126
|
+
`chunkFrames must be a positive safe integer, but was ${props.chunkFrames}.`,
|
|
127
|
+
);
|
|
128
|
+
if (validDigest(props.runtimeIdentity.sourceDigest) === false)
|
|
129
|
+
throw new Error(
|
|
130
|
+
"Render runtime sourceDigest must be one current SHA-256 content identity.",
|
|
131
|
+
);
|
|
132
|
+
if (
|
|
133
|
+
props.runtimeIdentity.dialogueRuntimeIdentity !== null &&
|
|
134
|
+
validDigest(props.runtimeIdentity.dialogueRuntimeIdentity) === false
|
|
135
|
+
)
|
|
136
|
+
throw new Error(
|
|
137
|
+
"Render runtime dialogueRuntimeIdentity must be null or one current SHA-256 content identity.",
|
|
138
|
+
);
|
|
139
|
+
const tier: IAutoMovieProductionRenderTier = normalizeRenderTier(props.tier);
|
|
140
|
+
const frameFormat: IAutoMovieProductionDesign["frameFormat"] =
|
|
141
|
+
resolveProductionRenderTierFrameFormat(props.production.frameFormat, tier);
|
|
142
|
+
const outputRate: IAutoMovieProductionFrameRate =
|
|
143
|
+
resolveProductionFrameRate(frameFormat);
|
|
144
|
+
if (frameFormat.width % 2 !== 0 || frameFormat.height % 2 !== 0)
|
|
145
|
+
throw new Error(
|
|
146
|
+
"The production H.264 render adapter requires even width and height.",
|
|
147
|
+
);
|
|
148
|
+
const timelineRate: IAutoMovieProductionFrameRate =
|
|
149
|
+
resolveProductionFrameRate(props.timeline);
|
|
150
|
+
const productionRate: IAutoMovieProductionFrameRate =
|
|
151
|
+
resolveProductionFrameRate(props.production.frameFormat);
|
|
152
|
+
if (
|
|
153
|
+
props.production.id.trim().length === 0 ||
|
|
154
|
+
props.timeline.id !== props.production.id ||
|
|
155
|
+
validDigest(props.timeline.inputFingerprint) === false ||
|
|
156
|
+
equalProductionFrameRates(timelineRate, productionRate) === false ||
|
|
157
|
+
props.production.targetRuntimeSeconds !==
|
|
158
|
+
(props.timeline.totalFrames * productionRate.denominator) /
|
|
159
|
+
productionRate.numerator
|
|
160
|
+
)
|
|
161
|
+
throw new Error(
|
|
162
|
+
"The film edit differs from the production identity, frame clock, or runtime. Recompile before planning.",
|
|
163
|
+
);
|
|
164
|
+
if (props.timeline.totalFrames % tier.frameStep !== 0)
|
|
165
|
+
throw new Error(
|
|
166
|
+
`Render tier "${tier.kind}" frameStep ${tier.frameStep} does not divide the ${props.timeline.totalFrames}-frame edit. Choose a divisor so proxy and final have the same exact runtime.`,
|
|
167
|
+
);
|
|
168
|
+
const audioAssets: IAutoMovieProductionAudioAssetIdentity[] =
|
|
169
|
+
normalizeAudioAssets(props.audioAssets);
|
|
170
|
+
const assetsByPath: Map<string, IAutoMovieProductionAudioAssetIdentity> =
|
|
171
|
+
new Map(
|
|
172
|
+
audioAssets.map(
|
|
173
|
+
(
|
|
174
|
+
asset: IAutoMovieProductionAudioAssetIdentity,
|
|
175
|
+
): [string, IAutoMovieProductionAudioAssetIdentity] => [
|
|
176
|
+
asset.path,
|
|
177
|
+
asset,
|
|
178
|
+
],
|
|
179
|
+
),
|
|
180
|
+
);
|
|
181
|
+
for (const cue of props.timeline.tracks.audio) {
|
|
182
|
+
// `sourceDurationFrames` is the cue's claim about the complete asset, so
|
|
183
|
+
// it must land on exactly the asset's sample count at the asset's own rate;
|
|
184
|
+
// the trim inside that duration is the mix's own refusal.
|
|
185
|
+
const asset: IAutoMovieProductionAudioAssetIdentity | undefined =
|
|
186
|
+
assetsByPath.get(cue.asset);
|
|
187
|
+
if (
|
|
188
|
+
asset === undefined ||
|
|
189
|
+
asset.sourceFrames !==
|
|
190
|
+
productionFrameBoundaryToGridTick({
|
|
191
|
+
frame: cue.sourceDurationFrames,
|
|
192
|
+
frameRate: timelineRate,
|
|
193
|
+
ticksPerSecond: asset.sampleRate,
|
|
194
|
+
rounding: "nearest",
|
|
195
|
+
})
|
|
196
|
+
)
|
|
197
|
+
throw new Error(
|
|
198
|
+
`Audio cue "${cue.id}" lacks one digest-, format-, and duration-verified source asset.`,
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
const legacyGuidePass: Exclude<AutoMovieGuidePass, "beauty"> =
|
|
202
|
+
assertSingleGuidePass(props.guidePasses ?? ["pose"]);
|
|
203
|
+
const editFingerprint: string = productionFilmEffectEditFingerprint(
|
|
204
|
+
props.timeline,
|
|
205
|
+
);
|
|
206
|
+
verifyProductionFilmEffectPopulation({
|
|
207
|
+
timeline: props.timeline,
|
|
208
|
+
effects: props.effects,
|
|
209
|
+
});
|
|
210
|
+
for (const effect of props.effects)
|
|
211
|
+
if (effect.production !== props.production.id)
|
|
212
|
+
throw new AutoMovieFilmEffectRuntimeError(
|
|
213
|
+
"film-effect-runtime-stale",
|
|
214
|
+
`Film effect runtime "${effect.effect.id}" belongs to production "${effect.production}", not "${props.production.id}".`,
|
|
215
|
+
);
|
|
216
|
+
const effectDigests: string[] = props.effects.map(
|
|
217
|
+
(effect: IAutoMovieCompiledFilmEffect): string => effect.digest,
|
|
218
|
+
);
|
|
219
|
+
const frames: IAutoMovieProductionRenderFrame[] = Array.from(
|
|
220
|
+
{ length: props.timeline.totalFrames / tier.frameStep },
|
|
221
|
+
(_: unknown, outputFrame: number): IAutoMovieProductionRenderFrame => {
|
|
222
|
+
const timelineFrame: number = outputFrame * tier.frameStep;
|
|
223
|
+
return {
|
|
224
|
+
...sampleProductionRenderFrame(props.timeline, timelineFrame),
|
|
225
|
+
globalFrame: outputFrame,
|
|
226
|
+
timelineFrame,
|
|
227
|
+
timeSeconds:
|
|
228
|
+
(outputFrame * outputRate.denominator) / outputRate.numerator,
|
|
229
|
+
};
|
|
230
|
+
},
|
|
231
|
+
);
|
|
232
|
+
const moving: IMovingDeliverable[] = props.production.deliverables.filter(
|
|
233
|
+
(
|
|
234
|
+
deliverable: IAutoMovieProductionDeliverable,
|
|
235
|
+
): deliverable is IMovingDeliverable =>
|
|
236
|
+
deliverable.kind === "feature" || deliverable.kind === "guide-pass",
|
|
237
|
+
);
|
|
238
|
+
const ranges: IRange[] = moving.length === 0 ? [] : partition(frames, props);
|
|
239
|
+
const chunks: IAutoMovieProductionRenderChunk[] = [];
|
|
240
|
+
for (const deliverable of moving) {
|
|
241
|
+
const pass: AutoMovieGuidePass =
|
|
242
|
+
deliverable.kind === "feature"
|
|
243
|
+
? "beauty"
|
|
244
|
+
: deliverable.pass === undefined
|
|
245
|
+
? legacyGuidePass
|
|
246
|
+
: assertSingleGuidePass([deliverable.pass]);
|
|
247
|
+
ranges.forEach((range: IRange, index: number): void => {
|
|
248
|
+
chunks.push({
|
|
249
|
+
slot: `${props.production.id}:${tier.kind}:${deliverable.id}:${pass}:${index}`,
|
|
250
|
+
id: autoMovieRenderDigest(
|
|
251
|
+
canonicalizeAutoMovieJson({
|
|
252
|
+
protocol: "automovie.production-render-chunk.v4",
|
|
253
|
+
production: props.production.id,
|
|
254
|
+
tier,
|
|
255
|
+
deliverable: deliverable.id,
|
|
256
|
+
kind: deliverable.kind,
|
|
257
|
+
editFingerprint,
|
|
258
|
+
effects: effectDigests,
|
|
259
|
+
sourceFrameFormat: props.production.frameFormat,
|
|
260
|
+
frameFormat,
|
|
261
|
+
frameStart: range.frameStart,
|
|
262
|
+
frameEndExclusive: range.frameEndExclusive,
|
|
263
|
+
pass,
|
|
264
|
+
runtimeIdentity: props.runtimeIdentity,
|
|
265
|
+
sources: range.sources,
|
|
266
|
+
}),
|
|
267
|
+
),
|
|
268
|
+
deliverable: deliverable.id,
|
|
269
|
+
kind: deliverable.kind,
|
|
270
|
+
pass,
|
|
271
|
+
frameStart: range.frameStart,
|
|
272
|
+
frameEndExclusive: range.frameEndExclusive,
|
|
273
|
+
frames: range.frames,
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
return {
|
|
278
|
+
version: 4,
|
|
279
|
+
productionId: props.production.id,
|
|
280
|
+
compileFingerprint: props.timeline.inputFingerprint,
|
|
281
|
+
editFingerprint,
|
|
282
|
+
runtimeIdentity: props.runtimeIdentity,
|
|
283
|
+
tier,
|
|
284
|
+
sourceFrameFormat: structuredClone(props.production.frameFormat),
|
|
285
|
+
frameFormat,
|
|
286
|
+
totalFrames: frames.length,
|
|
287
|
+
chunkFrames: props.chunkFrames,
|
|
288
|
+
chunks,
|
|
289
|
+
tracks: {
|
|
290
|
+
captions: canonicalProductionWebVtt(props.timeline),
|
|
291
|
+
audio: structuredClone(props.timeline.tracks.audio),
|
|
292
|
+
audioAssets,
|
|
293
|
+
effects: props.effects.map(
|
|
294
|
+
(effect: IAutoMovieCompiledFilmEffect): IAutoMovieCompiledFilmEffect =>
|
|
295
|
+
structuredClone(effect),
|
|
296
|
+
),
|
|
297
|
+
},
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Split the output frames into consecutive ranges of at most `chunkFrames` and
|
|
303
|
+
* attach the code-unit-sorted source digest of every shot each range shows,
|
|
304
|
+
* throwing for a shot without a valid digest.
|
|
305
|
+
*/
|
|
306
|
+
const partition: (
|
|
307
|
+
frames: IAutoMovieProductionRenderFrame[],
|
|
308
|
+
props: {
|
|
309
|
+
chunkFrames: number;
|
|
310
|
+
sourceFingerprints: Readonly<Record<string, string>>;
|
|
311
|
+
},
|
|
312
|
+
) => IRange[] = (
|
|
313
|
+
frames: IAutoMovieProductionRenderFrame[],
|
|
314
|
+
props: {
|
|
315
|
+
chunkFrames: number;
|
|
316
|
+
sourceFingerprints: Readonly<Record<string, string>>;
|
|
317
|
+
},
|
|
318
|
+
): IRange[] => {
|
|
319
|
+
const ranges: IRange[] = [];
|
|
320
|
+
for (
|
|
321
|
+
let frameStart: number = 0;
|
|
322
|
+
frameStart < frames.length;
|
|
323
|
+
frameStart += props.chunkFrames
|
|
324
|
+
) {
|
|
325
|
+
const frameEndExclusive: number = Math.min(
|
|
326
|
+
frameStart + props.chunkFrames,
|
|
327
|
+
frames.length,
|
|
328
|
+
);
|
|
329
|
+
const range: IAutoMovieProductionRenderFrame[] = frames.slice(
|
|
330
|
+
frameStart,
|
|
331
|
+
frameEndExclusive,
|
|
332
|
+
);
|
|
333
|
+
const shots: Set<string> = new Set();
|
|
334
|
+
for (const frame of range)
|
|
335
|
+
for (const layer of frame.layers) shots.add(layer.shot);
|
|
336
|
+
ranges.push({
|
|
337
|
+
frameStart,
|
|
338
|
+
frameEndExclusive,
|
|
339
|
+
frames: range,
|
|
340
|
+
sources: [...shots]
|
|
341
|
+
.sort(compareCodeUnits)
|
|
342
|
+
.map((shot: string): { shot: string; digest: string } => {
|
|
343
|
+
const digest: string | undefined = props.sourceFingerprints[shot];
|
|
344
|
+
if (digest === undefined || validDigest(digest) === false)
|
|
345
|
+
throw new Error(
|
|
346
|
+
`Render range references shot "${shot}" without one current builder-owned source fingerprint.`,
|
|
347
|
+
);
|
|
348
|
+
return { shot, digest };
|
|
349
|
+
}),
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
return ranges;
|
|
353
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { IAutoMovieFilmTimeline } from "@automovie/interface";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Spell the identity of one timeline segment occurrence as
|
|
5
|
+
* `occurrence:<index>:<startFrame>-<endFrame>:<shot>`.
|
|
6
|
+
*
|
|
7
|
+
* `index` is the segment's zero-based position in `timeline.segments`, and the
|
|
8
|
+
* frames are its film-timeline start and exclusive end. Visual delivery lanes
|
|
9
|
+
* and the mixed-delivery conform key a source clip by this string, so a clip
|
|
10
|
+
* prepared for one edit no longer joins after a segment moves, changes length
|
|
11
|
+
* or changes shot, and two occurrences of one shot stay distinct.
|
|
12
|
+
*
|
|
13
|
+
* @evidence contracts/development/implementation.md#principled-implementation Position, frame span and shot together identify an occurrence uniquely within one timeline, because segment positions are distinct, and spelling them into one string makes equality of occurrences string equality.
|
|
14
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One template literal is the whole rule, kept in one function so the delivery validator, the conform and its tests derive the same key.
|
|
15
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No shot or segment is special-cased; the `occurrence:` prefix is the key's fixed namespace, not a compensation.
|
|
16
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc gives the exact key grammar, the meaning and unit of each part, which consumers join on it, and which edits change it.
|
|
17
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms The call does constant work beyond copying the shot id into one new string.
|
|
18
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each call formats one short key from one segment, so caching would cost more than formatting.
|
|
19
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The occurrence key is a new string the delivery join compares and discards; the segment argument is read, not referenced afterward, and no handle or task is opened.
|
|
20
|
+
*/
|
|
21
|
+
export const productionVisualDeliveryOccurrence: (
|
|
22
|
+
segment: IAutoMovieFilmTimeline["segments"][number],
|
|
23
|
+
index: number,
|
|
24
|
+
) => string = (
|
|
25
|
+
segment: IAutoMovieFilmTimeline["segments"][number],
|
|
26
|
+
index: number,
|
|
27
|
+
): string =>
|
|
28
|
+
`occurrence:${index}:${segment.startFrame}-${segment.endFrame}:${segment.shot}`;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {
|
|
2
|
+
canonicalProductionFrameRate,
|
|
3
|
+
resolveProductionFrameRate,
|
|
4
|
+
} from "@automovie/engine";
|
|
5
|
+
import type {
|
|
6
|
+
IAutoMovieProductionDesign,
|
|
7
|
+
IAutoMovieProductionFrameRate,
|
|
8
|
+
} from "@automovie/interface";
|
|
9
|
+
|
|
10
|
+
import type { IAutoMovieProductionRenderTier } from "./IAutoMovieProductionRenderTier";
|
|
11
|
+
import { normalizeRenderTier } from "./normalizeRenderTier";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Project a production's frame format through a render tier.
|
|
15
|
+
*
|
|
16
|
+
* The final tier returns a copy of the source unchanged. A proxy scales width
|
|
17
|
+
* and height by `resolutionScale`, rounding each down to an even pixel count
|
|
18
|
+
* of at least 2, divides the exact frame rate by `frameStep` and reduces it,
|
|
19
|
+
* sets `fps` to that rate's decimal value, and keeps the color space and crop.
|
|
20
|
+
* Throws when the tier is not admissible under `normalizeRenderTier` or the
|
|
21
|
+
* source frame rate is invalid on the proxy branch. Final returns the source copy before rate resolution and performs no raster or rate admission.
|
|
22
|
+
*
|
|
23
|
+
* @evidence contracts/development/implementation.md#principled-implementation Keeping every Nth frame of a rational clock n/d gives n/(d*N), reduced by canonicalProductionFrameRate after the denominator product is formed in binary64; an overflowed or unsafe term is refused by that helper. Proxy raster flooring yields even dimensions with a two-pixel minimum, which can exceed a tiny scaled source. Valid source raster and crop are caller premises, and final returns an unchecked copy.
|
|
24
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure The function owns only the projection; tier admission is `normalizeRenderTier`'s and frame-rate resolution the engine's, so the planner and publication's identity check derive the same output format from one place.
|
|
25
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No raster, rate or production is special-cased; the minimum of 2 pixels is the smallest even raster and applies only when a tiny source and scale would round to zero.
|
|
26
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc states the final-tier behavior, the raster rounding and its floor, how the rate is divided and reduced, which fields are kept, and when the call throws.
|
|
27
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms The call does constant work: one tier check, one rate resolution and reduction by greatest common divisor, and one small record copy.
|
|
28
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The planner and publication's identity check each call it once per plan or identity on a few-field record, so there is no costly equivalent work to share.
|
|
29
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function retains nothing after returning a new format its caller owns and opens no handle or task.
|
|
30
|
+
*/
|
|
31
|
+
export const resolveProductionRenderTierFrameFormat: (
|
|
32
|
+
source: IAutoMovieProductionDesign["frameFormat"],
|
|
33
|
+
tier: IAutoMovieProductionRenderTier,
|
|
34
|
+
) => IAutoMovieProductionDesign["frameFormat"] = (
|
|
35
|
+
source: IAutoMovieProductionDesign["frameFormat"],
|
|
36
|
+
tier: IAutoMovieProductionRenderTier,
|
|
37
|
+
): IAutoMovieProductionDesign["frameFormat"] => {
|
|
38
|
+
const normalized: IAutoMovieProductionRenderTier = normalizeRenderTier(tier);
|
|
39
|
+
if (normalized.kind === "final") return structuredClone(source);
|
|
40
|
+
const even: (value: number) => number = (value: number): number =>
|
|
41
|
+
Math.max(2, Math.floor((value * normalized.resolutionScale) / 2) * 2);
|
|
42
|
+
const sourceRate: IAutoMovieProductionFrameRate =
|
|
43
|
+
resolveProductionFrameRate(source);
|
|
44
|
+
const frameRate: IAutoMovieProductionFrameRate = canonicalProductionFrameRate(
|
|
45
|
+
{
|
|
46
|
+
numerator: sourceRate.numerator,
|
|
47
|
+
denominator: sourceRate.denominator * normalized.frameStep,
|
|
48
|
+
},
|
|
49
|
+
);
|
|
50
|
+
return {
|
|
51
|
+
width: even(source.width),
|
|
52
|
+
height: even(source.height),
|
|
53
|
+
fps: frameRate.numerator / frameRate.denominator,
|
|
54
|
+
frameRate,
|
|
55
|
+
colorSpace: source.colorSpace,
|
|
56
|
+
...(source.crop === undefined
|
|
57
|
+
? {}
|
|
58
|
+
: { crop: structuredClone(source.crop) }),
|
|
59
|
+
};
|
|
60
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** The content-digest grammar; it has no `g` flag, so `test` keeps no state. */
|
|
2
|
+
const DIGEST_PATTERN: RegExp = /^sha256:[0-9a-f]{64}$/;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Whether a string is one SHA-256 content digest: `sha256:` followed by 64
|
|
6
|
+
* lowercase hexadecimal digits.
|
|
7
|
+
*
|
|
8
|
+
* The render planner checks every runtime, compile and source digest it puts
|
|
9
|
+
* into a chunk identity with this, and `normalizeAudioAssets` checks asset
|
|
10
|
+
* digests. Uppercase hex and other algorithms are refused, because the digest
|
|
11
|
+
* writers emit only this spelling and identities are compared as strings.
|
|
12
|
+
*
|
|
13
|
+
* @evidence contracts/development/implementation.md#principled-implementation A fully anchored regular expression decides the fixed-length grammar exactly, and lowercase-only hex keeps one spelling per digest so string comparison is digest comparison.
|
|
14
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One predicate serves every digest check in the film planner; production and engine keep their own private copies of the same pattern, a cross-package duplication this file does not own.
|
|
15
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No digest value is special-cased; the pattern is the content-digest spelling the SHA-256 identity writers produce.
|
|
16
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc gives the exact grammar, its callers, and why other spellings are refused.
|
|
17
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms One linear regular-expression test over at most 71 matched characters, against one module-level pattern that carries no `lastIndex` state between calls.
|
|
18
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pure predicate on one short string coordinates no phases, so there is no work to share.
|
|
19
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The compiled pattern is one module constant for the process lifetime and each test allocates nothing, so retention stays at that single expression object.
|
|
20
|
+
*/
|
|
21
|
+
export const validDigest: (value: string) => boolean = (
|
|
22
|
+
value: string,
|
|
23
|
+
): boolean => DIGEST_PATTERN.test(value);
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
IAutoMovieProductionAudioProcessing,
|
|
3
|
+
IAutoMovieProductionWaveSourceFormat,
|
|
4
|
+
} from "@automovie/ingest";
|
|
5
|
+
import type { IAutoMovieProductionSoundPlan } from "@automovie/interface";
|
|
6
|
+
|
|
7
|
+
import type { IAutoMovieProductionAudioAssetIdentity } from "./IAutoMovieProductionAudioAssetIdentity";
|
|
8
|
+
import { equalOrderedScalars } from "./equalOrderedScalars";
|
|
9
|
+
|
|
10
|
+
/** Rate the decoder resamples to: the sound plan's fixed mix rate. */
|
|
11
|
+
const MIX_SAMPLE_RATE: IAutoMovieProductionSoundPlan["sampleRate"] = 48_000;
|
|
12
|
+
|
|
13
|
+
/** KSDATAFORMAT_SUBTYPE_PCM, the SubFormat GUID of integer PCM. */
|
|
14
|
+
const PCM_SUBFORMAT: string = "00000001-0000-0010-8000-00aa00389b71";
|
|
15
|
+
|
|
16
|
+
/** KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, the SubFormat GUID of IEEE float. */
|
|
17
|
+
const FLOAT_SUBFORMAT: string = "00000003-0000-0010-8000-00aa00389b71";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Whether a WAVE asset's source format and processing record are exactly what
|
|
21
|
+
* `decodeProductionAudioAsset` reports for a file of the asset's own rate and
|
|
22
|
+
* channel count, decoded for the 48 kHz mix.
|
|
23
|
+
*
|
|
24
|
+
* The asset must be mono or stereo with source rate and channels equal to its
|
|
25
|
+
* own. The encoding must be 16-bit PCM or 32-bit float in a container of the
|
|
26
|
+
* same width; the speakers must be front-center for mono and front-left,
|
|
27
|
+
* front-right for stereo; a legacy header must carry no mask or SubFormat, and
|
|
28
|
+
* an extensible one mask `0x4` or `0x3` and the PCM or float SubFormat GUID.
|
|
29
|
+
* The processing must fold to one channel at 48 kHz with `[[1]]` or
|
|
30
|
+
* `[[0.5, 0.5]]` and name the stage that the rates and channels imply.
|
|
31
|
+
*
|
|
32
|
+
* @evidence contracts/development/implementation.md#principled-implementation Each relation restates a rule of the decoder's supported subset, the WAVEFORMATEXTENSIBLE speaker masks and the KSDATAFORMAT SubFormat GUIDs, so a record the decoder emitted for this rate and channel count passes and any edited field fails; ordered fields compare through `equalOrderedScalars` because channel order is meaningful.
|
|
33
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One boolean expression mirrors the decoder record field by field, with the expected stage, speakers and matrix derived first from the channel count and the rate, so the provenance-independent rules stay in `normalizeAudioAssets`.
|
|
34
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The constants are the Microsoft speaker masks and GUIDs and the mix rate typed from `IAutoMovieProductionSoundPlan`; no file or rate is special-cased, and the predicate returns false rather than repairing a field.
|
|
35
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc names the decoder whose record this mirrors and lists every required relation for format, speakers, header and processing.
|
|
36
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms The check does constant work: a fixed set of field comparisons and two ordered comparisons of at most two entries.
|
|
37
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work `normalizeAudioAssets` calls it once per WAVE asset on that asset's own record, so there is no equivalent work to share.
|
|
38
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The predicate retains nothing after returning a boolean and opens no handle or task.
|
|
39
|
+
*/
|
|
40
|
+
export const validWaveAudioIdentity: (
|
|
41
|
+
asset: Extract<IAutoMovieProductionAudioAssetIdentity, { kind: "wave" }>,
|
|
42
|
+
) => boolean = (
|
|
43
|
+
asset: Extract<IAutoMovieProductionAudioAssetIdentity, { kind: "wave" }>,
|
|
44
|
+
): boolean => {
|
|
45
|
+
const source: IAutoMovieProductionWaveSourceFormat = asset.sourceFormat;
|
|
46
|
+
const processing: IAutoMovieProductionAudioProcessing = asset.processing;
|
|
47
|
+
const mono: boolean = asset.channels === 1;
|
|
48
|
+
const expectedSpeakers: string[] = mono
|
|
49
|
+
? ["front-center"]
|
|
50
|
+
: ["front-left", "front-right"];
|
|
51
|
+
const expectedMatrix: number[][] = mono ? [[1]] : [[0.5, 0.5]];
|
|
52
|
+
const resampled: boolean = asset.sampleRate !== MIX_SAMPLE_RATE;
|
|
53
|
+
const expectedKind: IAutoMovieProductionAudioProcessing["kind"] = mono
|
|
54
|
+
? resampled
|
|
55
|
+
? "resample"
|
|
56
|
+
: "copy"
|
|
57
|
+
: resampled
|
|
58
|
+
? "downmix-resample"
|
|
59
|
+
: "downmix";
|
|
60
|
+
return (
|
|
61
|
+
(asset.channels === 1 || asset.channels === 2) &&
|
|
62
|
+
source.kind === "wave" &&
|
|
63
|
+
source.sampleRate === asset.sampleRate &&
|
|
64
|
+
source.channels === asset.channels &&
|
|
65
|
+
(source.encoding === "pcm-s16le"
|
|
66
|
+
? source.containerBits === 16 && source.validBits === 16
|
|
67
|
+
: source.encoding === "float-f32le" &&
|
|
68
|
+
source.containerBits === 32 &&
|
|
69
|
+
source.validBits === 32) &&
|
|
70
|
+
source.layout.kind === (mono ? "mono" : "stereo") &&
|
|
71
|
+
equalOrderedScalars(source.layout.speakers, expectedSpeakers) &&
|
|
72
|
+
(source.layout.source === "legacy-default"
|
|
73
|
+
? source.header === "wave-format-ex" &&
|
|
74
|
+
source.layout.mask === null &&
|
|
75
|
+
source.subFormatGuid === null
|
|
76
|
+
: source.layout.source === "channel-mask" &&
|
|
77
|
+
source.header === "wave-format-extensible" &&
|
|
78
|
+
source.layout.mask === (mono ? 0x4 : 0x3) &&
|
|
79
|
+
source.subFormatGuid ===
|
|
80
|
+
(source.encoding === "pcm-s16le"
|
|
81
|
+
? PCM_SUBFORMAT
|
|
82
|
+
: FLOAT_SUBFORMAT)) &&
|
|
83
|
+
processing.kind === expectedKind &&
|
|
84
|
+
processing.outputChannels === 1 &&
|
|
85
|
+
processing.outputSampleRate === MIX_SAMPLE_RATE &&
|
|
86
|
+
equalOrderedScalars(processing.matrix, expectedMatrix)
|
|
87
|
+
);
|
|
88
|
+
};
|
package/src/frameName.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The file name of output frame `index` in an ffmpeg image sequence, such as
|
|
3
|
+
* `frame_00042.png`.
|
|
4
|
+
*
|
|
5
|
+
* The index is zero-padded to `pad` digits and grows wider past
|
|
6
|
+
* `10^pad - 1`, exactly as `framePattern`'s `%0<pad>d` prints it, so ffmpeg
|
|
7
|
+
* reads every name this function writes. `index` must be a non-negative
|
|
8
|
+
* safe integer and `ext` an extension without the dot; these premises are not checked here. The guide passes add their
|
|
9
|
+
* pass tag to `ext`.
|
|
10
|
+
*
|
|
11
|
+
* @evidence contracts/development/implementation.md#principled-implementation For a non-negative safe-integer index, String produces ordinary decimal digits and padStart applies the requested minimum width, matching the numbered-sequence spelling. Negative, fractional or excessively large indices are unchecked misuse; JavaScript can use exponential notation for large numbers, which would not match ffmpeg's integer pattern.
|
|
12
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure The beauty frames use the defaults and `guidePassFrameName` passes its tagged extension and pad, so every capture names its files through this one function.
|
|
13
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No index, extension or pad is special-cased.
|
|
14
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc gives an example, the padding rule past the pad width, the match with `framePattern`, and the domain of `index` and `ext`.
|
|
15
|
+
* @evidenceExclude contracts/development/implementation.md#efficient-algorithms One `padStart` over the decimal index chooses no algorithm.
|
|
16
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each call names a different frame, and formatting is cheaper than a lookup.
|
|
17
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Each name is returned to the capture or encoder plan that uses it, and the function keeps no reference.
|
|
18
|
+
*/
|
|
19
|
+
export const frameName: (
|
|
20
|
+
index: number,
|
|
21
|
+
ext?: string,
|
|
22
|
+
pad?: number,
|
|
23
|
+
) => string = (index: number, ext: string = "png", pad: number = 5): string =>
|
|
24
|
+
`frame_${String(index).padStart(pad, "0")}.${ext}`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ffmpeg image-sequence input pattern, such as `frame_%05d.png`, that
|
|
3
|
+
* matches every `frameName` written with the same `ext` and `pad`.
|
|
4
|
+
*
|
|
5
|
+
* ffmpeg expands `%0<pad>d` to each frame number from 0 upward, so the
|
|
6
|
+
* pattern names the sequence without a shell glob.
|
|
7
|
+
*
|
|
8
|
+
* @evidence contracts/development/implementation.md#principled-implementation ffmpeg's image2 demuxer reads `%0Nd` as a zero-padded decimal frame number, the same text `frameName` writes, so the two cannot disagree when called with equal arguments.
|
|
9
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure The single render, the sequence and chunk plans and `guidePassFramePattern` build their encoder input through this one function, beside `frameName`.
|
|
10
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The caller's extension and pad are interpolated as given, with no extension or width special-cased.
|
|
11
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc gives an example, the naming call it matches, and how ffmpeg reads it.
|
|
12
|
+
* @evidenceExclude contracts/development/implementation.md#efficient-algorithms One template interpolation of the pad and extension chooses no algorithm.
|
|
13
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pattern is formatted once per encode, cheaper than caching it.
|
|
14
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The pattern string goes to the caller's argument list and nothing is kept or opened.
|
|
15
|
+
*/
|
|
16
|
+
export const framePattern: (ext?: string, pad?: number) => string = (
|
|
17
|
+
ext: string = "png",
|
|
18
|
+
pad: number = 5,
|
|
19
|
+
): string => `frame_%0${pad}d.${ext}`;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The capture instants, in seconds, of a clip of `durationSeconds` sampled at
|
|
3
|
+
* `fps` frames per second.
|
|
4
|
+
*
|
|
5
|
+
* The schedule has `N = round(durationSeconds * fps)` frames at `t = i / fps`
|
|
6
|
+
* for `i` from 0 to `N - 1`. Each instant is one IEEE division of the frame
|
|
7
|
+
* index, never a running sum, so the same spec yields the same instants on
|
|
8
|
+
* every machine; that reproducibility is what separates a deterministic render
|
|
9
|
+
* from a stochastic diffusion video. A non-finite or non-positive `fps` or
|
|
10
|
+
* duration, or a duration shorter than half a frame, yields no frames.
|
|
11
|
+
*
|
|
12
|
+
* @evidence contracts/development/implementation.md#principled-implementation IEEE 754 division is correctly rounded, so `i / fps` is a pure function of its operands on every conforming host, while accumulating `1 / fps` would compound rounding error per frame; the frame count rounds to the nearest whole frame because a render can only deliver whole frames.
|
|
13
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure The single render, the sequence render plan, the caption plan, and the pose-keypoint plan all sample through this one schedule, so captions, keypoints and pixels address the same frames.
|
|
14
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Invalid clocks return an empty schedule rather than a guessed one, and no rate or duration is special-cased.
|
|
15
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc states the frame count and instant formulas with their units, why the instants are reproducible, and which inputs yield no frames.
|
|
16
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Time and space are O(N) in the frame count, one division per frame, which is the size of the schedule returned.
|
|
17
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each plan builds its schedule once per call, and the arithmetic is cheaper than keying a cache by rate and duration.
|
|
18
|
+
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned array of N numbers is the caller's and nothing else is retained; N is bounded only by the caller's duration and rate, and a count past the engine's array limit throws a `RangeError`.
|
|
19
|
+
*/
|
|
20
|
+
export const frameTimes: (fps: number, durationSeconds: number) => number[] = (
|
|
21
|
+
fps: number,
|
|
22
|
+
durationSeconds: number,
|
|
23
|
+
): number[] => {
|
|
24
|
+
if (
|
|
25
|
+
Number.isFinite(fps) === false ||
|
|
26
|
+
Number.isFinite(durationSeconds) === false ||
|
|
27
|
+
fps <= 0 ||
|
|
28
|
+
durationSeconds <= 0
|
|
29
|
+
)
|
|
30
|
+
return [];
|
|
31
|
+
const count: number = Math.round(durationSeconds * fps);
|
|
32
|
+
return Array.from(
|
|
33
|
+
{ length: count },
|
|
34
|
+
(_: unknown, index: number): number => index / fps,
|
|
35
|
+
);
|
|
36
|
+
};
|