@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,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admit a decoder's framemd5 listing against a commissioned half-open frame
|
|
3
|
+
* clock: exactly one stream-zero time base, exactly `expectedFrames` video
|
|
4
|
+
* rows, and frame `i` presenting precisely `[i / fps, (i + 1) / fps)` in that
|
|
5
|
+
* time base, checked by exact BigInt cross products. Adjacent identical
|
|
6
|
+
* images are reported as holds, never rejected. Malformed rows, gaps,
|
|
7
|
+
* overlaps, reordering, excess frames and a nonzero start are refused. This
|
|
8
|
+
* proves presentation continuity of decoded bytes, not motion or quality.
|
|
9
|
+
*
|
|
10
|
+
* @param text Complete FFmpeg framemd5 output.
|
|
11
|
+
* @param expectedFrames Commissioned frame count, a positive safe integer.
|
|
12
|
+
* @param fps Commissioned frames per second, a positive safe integer.
|
|
13
|
+
* @returns The admitted frames and holds.
|
|
14
|
+
* @evidence contracts/development/common.md#meaningful-documentation Gives the purpose (Admit a decoder's framemd5 listing against a commissioned half-open frame clock: exactly one stream-zero time base, exactly `expectedFrames` video rows, and frame `i` presenting precisely `[i / fps, (i + 1) / fps)` in that time base, checked by exact BigInt cross products) and documents parameters `text`, `expectedFrames`, `fps`, the returned value as stated in this comment.
|
|
15
|
+
* @evidence contracts/development/implementation.md#principled-implementation Implements the documented behavior (Admit a decoder's framemd5 listing against a commissioned half-open frame clock: exactly one stream-zero time base, exactly `expectedFrames` video rows, and frame `i` presenting precisely `[i / fps, (i + 1) / fps)` in that time base, checked by exact BigInt cross products) directly over its typed inputs (`text`, `expectedFrames`, `fps`) as nested iteration of depth 2 (for-of over text.split(/\r?\n/u); every over [numerator, denominator]; map over trimmed .split(",")), delegating to `Number.isSafeInteger`, `text.split`, `line.trim`, `trimmed.startsWith`, `Number`; the premises are the units, frames and ranges stated in its parameter documentation, enforced only where the body throws (8 throw sites). Beyond structural 0, 1 and 2 the body uses the literals 6, 5, whose basis this answer does not independently establish and a reviewer must confirm.
|
|
16
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One operation of 90 lines and 9 top-level statements that reuses `Number.isSafeInteger`, `text.split`, `line.trim`, `trimmed.startsWith`, `Number` from their owners instead of copying them; it adds no option, layer or abstraction beyond its documented parameters.
|
|
17
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The body contains 0 `any`, 0 type assertion(s), 10 non-null assertion(s); these are the remaining shortcuts and are not justified here.
|
|
18
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Cost is driven by the sizes of `text`, `expectedFrames`, `fps`; the dominant cost is nested iteration of depth 2 (for-of over text.split(/\r?\n/u); every over [numerator, denominator]; map over trimmed .split(",")), performed once per call with 15 allocation sites (literals and constructed values). No speedup is claimed and none is measured.
|
|
19
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The operation coordinates no requests, phases or consumers and holds no cache: each call recomputes from its arguments and shares nothing, which is correct because its result depends only on them.
|
|
20
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function acquires no handle, timer, listener or task and keeps no state between calls; its 15 allocation sites become the returned value or die with the call, so nothing grows.
|
|
21
|
+
*/
|
|
22
|
+
export function auditAutoMovieDecodedFrames(
|
|
23
|
+
text: string,
|
|
24
|
+
expectedFrames: number,
|
|
25
|
+
fps: number,
|
|
26
|
+
): auditAutoMovieDecodedFrames.IResult {
|
|
27
|
+
if (
|
|
28
|
+
!Number.isSafeInteger(expectedFrames) ||
|
|
29
|
+
expectedFrames < 1 ||
|
|
30
|
+
!Number.isSafeInteger(fps) ||
|
|
31
|
+
fps < 1
|
|
32
|
+
)
|
|
33
|
+
throw new Error(
|
|
34
|
+
"A decoded audit requires a positive integral frame count and rate",
|
|
35
|
+
);
|
|
36
|
+
const frames: auditAutoMovieDecodedFrames.IFrame[] = [];
|
|
37
|
+
const repeatedImages: number[] = [];
|
|
38
|
+
let timeBase: readonly [number, number] | undefined;
|
|
39
|
+
for (const line of text.split(/\r?\n/u)) {
|
|
40
|
+
const trimmed: string = line.trim();
|
|
41
|
+
if (trimmed.length === 0) continue;
|
|
42
|
+
if (trimmed.startsWith("#")) {
|
|
43
|
+
const match: RegExpExecArray | null = /^#tb 0:\s*(\d+)\/(\d+)$/u.exec(
|
|
44
|
+
trimmed,
|
|
45
|
+
);
|
|
46
|
+
if (match !== null) {
|
|
47
|
+
if (timeBase !== undefined)
|
|
48
|
+
throw new Error("Duplicate decoded time base");
|
|
49
|
+
const numerator: number = Number(match[1]);
|
|
50
|
+
const denominator: number = Number(match[2]);
|
|
51
|
+
if (
|
|
52
|
+
![numerator, denominator].every(
|
|
53
|
+
(v: number): boolean => Number.isSafeInteger(v) && v > 0,
|
|
54
|
+
)
|
|
55
|
+
)
|
|
56
|
+
throw new Error("Invalid decoded time base");
|
|
57
|
+
timeBase = [numerator, denominator];
|
|
58
|
+
}
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
const fields: string[] = trimmed
|
|
62
|
+
.split(",")
|
|
63
|
+
.map((f: string): string => f.trim());
|
|
64
|
+
if (
|
|
65
|
+
fields.length !== 6 ||
|
|
66
|
+
!fields.slice(0, 5).every((f: string): boolean => /^-?\d+$/u.test(f)) ||
|
|
67
|
+
!/^[a-f\d]{32}$/iu.test(fields[5]!)
|
|
68
|
+
)
|
|
69
|
+
throw new Error("Malformed decoded video row");
|
|
70
|
+
const [stream, dts, pts, duration, bytes]: number[] = fields
|
|
71
|
+
.slice(0, 5)
|
|
72
|
+
.map(Number);
|
|
73
|
+
if (
|
|
74
|
+
![stream, dts, pts, duration, bytes].every(
|
|
75
|
+
(v: number | undefined): boolean =>
|
|
76
|
+
v !== undefined && Number.isSafeInteger(v),
|
|
77
|
+
) ||
|
|
78
|
+
stream !== 0 ||
|
|
79
|
+
dts !== pts ||
|
|
80
|
+
pts! < 0 ||
|
|
81
|
+
duration! <= 0 ||
|
|
82
|
+
bytes! <= 0
|
|
83
|
+
)
|
|
84
|
+
throw new Error("Invalid decoded video timing or raster extent");
|
|
85
|
+
if (frames.length >= expectedFrames)
|
|
86
|
+
throw new Error("Decoded video contains excess frames");
|
|
87
|
+
const md5: string = fields[5]!.toLowerCase();
|
|
88
|
+
if (frames.at(-1)?.md5 === md5) repeatedImages.push(frames.length);
|
|
89
|
+
frames.push({ stream: stream!, pts: pts!, duration: duration!, md5 });
|
|
90
|
+
}
|
|
91
|
+
if (timeBase === undefined || frames.length !== expectedFrames)
|
|
92
|
+
throw new Error(
|
|
93
|
+
"Decoded video is missing its time base or commissioned frames",
|
|
94
|
+
);
|
|
95
|
+
const scale: bigint = BigInt(timeBase[0]) * BigInt(fps);
|
|
96
|
+
frames.forEach(
|
|
97
|
+
(frame: auditAutoMovieDecodedFrames.IFrame, index: number): void => {
|
|
98
|
+
if (
|
|
99
|
+
BigInt(frame.pts) * scale !== BigInt(index) * BigInt(timeBase![1]) ||
|
|
100
|
+
(BigInt(frame.pts) + BigInt(frame.duration)) * scale !==
|
|
101
|
+
BigInt(index + 1) * BigInt(timeBase![1])
|
|
102
|
+
)
|
|
103
|
+
throw new Error(
|
|
104
|
+
`Decoded frame ${index} does not cover its exact presentation interval`,
|
|
105
|
+
);
|
|
106
|
+
},
|
|
107
|
+
);
|
|
108
|
+
return {
|
|
109
|
+
frameCount: frames.length,
|
|
110
|
+
durationSeconds: expectedFrames / fps,
|
|
111
|
+
timeBase,
|
|
112
|
+
frames,
|
|
113
|
+
repeatedImages,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Companion types of {@link auditAutoMovieDecodedFrames}.
|
|
118
|
+
*
|
|
119
|
+
* @evidence contracts/development/common.md#meaningful-documentation Gives the purpose (Companion types of ) and documents 2 documented members as stated in this comment.
|
|
120
|
+
* @evidence contracts/development/design.md#principled-representation Represents Companion types of : companion namespace of 2 members (`IFrame`, `IResult`); units and frames named in its text: frame, bytes, seconds, frames. It has no optional member, so no absent-value state combines with another.
|
|
121
|
+
* @evidence contracts/development/design.md#minimal-and-owned-surface Owned by the module that declares `auditAutoMovieDecodedFrames` in packages/render/src/delivery/auditAutoMovieDecodedFrames.ts; its surface is the 2 members listed and the text shows 3 other files naming it, mostly packages/render (2), test (1), so no member is declared for a presumed future need.
|
|
122
|
+
* @evidence contracts/development/design.md#prohibited-design-shortcuts Scanning the declaration finds no `any`, no `unknown`, no index signature and no cast; it duplicates no type that another owner declares as far as a name search shows.
|
|
123
|
+
*/
|
|
124
|
+
export namespace auditAutoMovieDecodedFrames {
|
|
125
|
+
/** One decoded frame. */
|
|
126
|
+
export interface IFrame {
|
|
127
|
+
/** Decoder stream index. */
|
|
128
|
+
stream: number;
|
|
129
|
+
|
|
130
|
+
/** Presentation timestamp, time-base ticks. */
|
|
131
|
+
pts: number;
|
|
132
|
+
|
|
133
|
+
/** Presentation duration, time-base ticks. */
|
|
134
|
+
duration: number;
|
|
135
|
+
|
|
136
|
+
/** Lowercase MD5 of the decoded image bytes. */
|
|
137
|
+
md5: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** An admitted decoded stream. */
|
|
141
|
+
export interface IResult {
|
|
142
|
+
/** Decoded images. */
|
|
143
|
+
frameCount: number;
|
|
144
|
+
|
|
145
|
+
/** Commissioned duration, seconds. */
|
|
146
|
+
durationSeconds: number;
|
|
147
|
+
|
|
148
|
+
/** Decoder time base. */
|
|
149
|
+
timeBase: readonly [number, number];
|
|
150
|
+
|
|
151
|
+
/** Every frame in output order. */
|
|
152
|
+
frames: IFrame[];
|
|
153
|
+
|
|
154
|
+
/** Indices of frames identical to their predecessor. */
|
|
155
|
+
repeatedImages: number[];
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check an encoded delivery's probe against its commissioned profile: exactly
|
|
3
|
+
* one H.264 video stream of the raster and integer frame rate and one AAC
|
|
4
|
+
* audio stream of the sample rate and channel count, each starting at zero
|
|
5
|
+
* and presenting exactly the commissioned whole seconds in its own rational
|
|
6
|
+
* time base, so AAC end padding never passes for film duration. Refuses
|
|
7
|
+
* missing or extra streams, wrong codecs, rasters or rates, and truncated or
|
|
8
|
+
* extended presentations. It cannot establish listening or picture quality.
|
|
9
|
+
*
|
|
10
|
+
* @param probe Unmodified FFprobe `-show_streams -of json` output, parsed.
|
|
11
|
+
* @param expected The commissioned profile.
|
|
12
|
+
* @evidence contracts/development/common.md#meaningful-documentation Gives the purpose (Check an encoded delivery's probe against its commissioned profile: exactly one H.264 video stream of the raster and integer frame rate and one AAC audio stream of the sample rate and channel count, each starting at zero and presenting exactly the commissioned whole seconds in its own rational time base, so AAC end padding never passes for film duration) and documents parameters `probe`, `expected` as stated in this comment.
|
|
13
|
+
* @evidence contracts/development/implementation.md#principled-implementation Implements the documented behavior (Check an encoded delivery's probe against its commissioned profile: exactly one H.264 video stream of the raster and integer frame rate and one AAC audio stream of the sample rate and channel count, each starting at zero and presenting exactly the commissioned whole seconds in its own rational time base, so AAC end padding never passes for film duration) directly over its typed inputs (`probe`, `expected`) as 4 sequential passes (map over streams; find over records; find over records), delegating to `Number.isSafeInteger`, `Array.isArray`, `streams.map`, `records.find`, `String`; the premises are the units, frames and ranges stated in its parameter documentation, enforced only where the body throws (5 throw sites). Beyond structural 0, 1 and 2 the body uses the literal 48000, whose basis this answer does not independently establish and a reviewer must confirm.
|
|
14
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One operation of 57 lines and 8 top-level statements that reuses `Number.isSafeInteger`, `Array.isArray`, `streams.map`, `records.find`, `String` from their owners instead of copying them; it adds no option, layer or abstraction beyond its documented parameters.
|
|
15
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The body contains 0 `any`, 2 type assertion(s), 4 non-null assertion(s); these are the remaining shortcuts and are not justified here.
|
|
16
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Cost is driven by the sizes of `probe`, `expected`; the dominant cost is 4 sequential passes (map over streams; find over records; find over records), performed once per call with 5 allocation sites (literals and constructed values). No speedup is claimed and none is measured.
|
|
17
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The operation coordinates no requests, phases or consumers and holds no cache: each call recomputes from its arguments and shares nothing, which is correct because its result depends only on them.
|
|
18
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function acquires no handle, timer, listener or task and keeps no state between calls; its 5 allocation sites become the returned value or die with the call, so nothing grows.
|
|
19
|
+
*/
|
|
20
|
+
export function auditAutoMovieEncodedPresentation(
|
|
21
|
+
probe: unknown,
|
|
22
|
+
expected: {
|
|
23
|
+
/** Whole seconds, positive. */ durationSeconds: number;
|
|
24
|
+
/** Raster width, pixels. */ width: number;
|
|
25
|
+
/** Raster height, pixels. */ height: number;
|
|
26
|
+
/** Frames per second, an integer. */ fps: number;
|
|
27
|
+
/** Audio samples per second; 48000 by default. */ sampleRate?: number;
|
|
28
|
+
/** Audio channels; 2 by default. */ channels?: number;
|
|
29
|
+
},
|
|
30
|
+
): void {
|
|
31
|
+
if (
|
|
32
|
+
probe === null ||
|
|
33
|
+
typeof probe !== "object" ||
|
|
34
|
+
!Number.isSafeInteger(expected.durationSeconds) ||
|
|
35
|
+
expected.durationSeconds < 1
|
|
36
|
+
)
|
|
37
|
+
throw new Error("Invalid encoded presentation audit input");
|
|
38
|
+
const streams: unknown = (probe as Record<string, unknown>).streams;
|
|
39
|
+
if (!Array.isArray(streams) || streams.length !== 2)
|
|
40
|
+
throw new Error("Delivery requires exactly a video and an audio stream");
|
|
41
|
+
const records: Record<string, unknown>[] = streams.map(
|
|
42
|
+
(stream: unknown): Record<string, unknown> => {
|
|
43
|
+
if (stream === null || typeof stream !== "object")
|
|
44
|
+
throw new Error("Invalid encoded stream");
|
|
45
|
+
return stream as Record<string, unknown>;
|
|
46
|
+
},
|
|
47
|
+
);
|
|
48
|
+
const video: Record<string, unknown> | undefined = records.find(
|
|
49
|
+
(s: Record<string, unknown>): boolean => s.codec_type === "video",
|
|
50
|
+
);
|
|
51
|
+
const audio: Record<string, unknown> | undefined = records.find(
|
|
52
|
+
(s: Record<string, unknown>): boolean => s.codec_type === "audio",
|
|
53
|
+
);
|
|
54
|
+
if (
|
|
55
|
+
!video ||
|
|
56
|
+
!audio ||
|
|
57
|
+
video.codec_name !== "h264" ||
|
|
58
|
+
video.width !== expected.width ||
|
|
59
|
+
video.height !== expected.height ||
|
|
60
|
+
video.avg_frame_rate !== `${expected.fps}/1` ||
|
|
61
|
+
audio.codec_name !== "aac" ||
|
|
62
|
+
audio.sample_rate !== String(expected.sampleRate ?? 48000) ||
|
|
63
|
+
audio.channels !== (expected.channels ?? 2)
|
|
64
|
+
)
|
|
65
|
+
throw new Error(
|
|
66
|
+
"Encoded presentation differs from the commissioned media profile",
|
|
67
|
+
);
|
|
68
|
+
for (const stream of records) {
|
|
69
|
+
const base: RegExpExecArray | null = /^(\d+)\/(\d+)$/u.exec(
|
|
70
|
+
String(stream.time_base),
|
|
71
|
+
);
|
|
72
|
+
const duration: string = String(stream.duration_ts);
|
|
73
|
+
if (
|
|
74
|
+
base === null ||
|
|
75
|
+
!/^\d+$/u.test(duration) ||
|
|
76
|
+
Number(stream.start_time) !== 0 ||
|
|
77
|
+
BigInt(base[1]!) < 1n ||
|
|
78
|
+
BigInt(base[2]!) < 1n ||
|
|
79
|
+
BigInt(duration) * BigInt(base[1]!) !==
|
|
80
|
+
BigInt(expected.durationSeconds) * BigInt(base[2]!)
|
|
81
|
+
)
|
|
82
|
+
throw new Error(
|
|
83
|
+
"Encoded stream has a nonzero start or an inexact commissioned duration",
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./assertProductionOpusProfile";
|
|
2
|
+
export * from "./assertProductionPngPicture";
|
|
3
|
+
export * from "./assertProductionVideoProfile";
|
|
4
|
+
export * from "./AUTOMOVIE_PRODUCTION_OPUS_PROFILE";
|
|
5
|
+
export * from "./AutoMovieProductionPngRole";
|
|
6
|
+
export * from "./IAutoMovieProductionPngProfile";
|
|
7
|
+
export * from "./IAutoMovieProductionVideoProfile";
|
|
8
|
+
export * from "./productionOpusDescription";
|
|
9
|
+
export * from "./resolveProductionPngProfile";
|
|
10
|
+
export * from "./resolveProductionVideoProfile";
|
|
11
|
+
export * from "./assertAutoMovieCaptureClock";
|
|
12
|
+
export * from "./auditAutoMovieDecodedFrames";
|
|
13
|
+
export * from "./auditAutoMovieEncodedPresentation";
|
|
14
|
+
export * from "./planAutoMovieCaptureUrl";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The capture URL of a local review page: the requested URL with its path
|
|
3
|
+
* and unrelated options kept, the given capture parameters set, and
|
|
4
|
+
* autoplay (`play`) removed because capture seeks each frame. Only an HTTP
|
|
5
|
+
* loopback host is admitted, so capture never drives a remote page.
|
|
6
|
+
*
|
|
7
|
+
* @param requested The review page URL.
|
|
8
|
+
* @param parameters Capture parameters to set, such as raster and range.
|
|
9
|
+
* @returns The capture URL.
|
|
10
|
+
* @evidence contracts/development/common.md#meaningful-documentation Gives the purpose (The capture URL of a local review page: the requested URL with its path and unrelated options kept, the given capture parameters set, and autoplay (`play`) removed because capture seeks each frame) and documents parameters `requested`, `parameters`, the returned value as stated in this comment.
|
|
11
|
+
* @evidence contracts/development/implementation.md#principled-implementation Implements the documented behavior (The capture URL of a local review page: the requested URL with its path and unrelated options kept, the given capture parameters set, and autoplay (`play`) removed because capture seeks each frame) directly over its typed inputs (`requested`, `parameters`) as a single pass (for-of over Object.entries(parameters)), delegating to `Object.entries`; the premises are the units, frames and ranges stated in its parameter documentation, enforced only where the body throws (1 throw site). Apart from structural 0, 1 and 2 the body uses no numeric literal.
|
|
12
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One operation of 12 lines and 5 top-level statements that reuses `Object.entries` from their owners instead of copying them; it adds no option, layer or abstraction beyond its documented parameters.
|
|
13
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Scanning the body finds no `any`, type assertion, non-null assertion, suppression directive or TODO, and no branch keyed on a consumer, fixture or expected answer; values come from its parameters.
|
|
14
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Cost is driven by the sizes of `requested`, `parameters`; the dominant cost is a single pass (for-of over Object.entries(parameters)), performed once per call with 3 allocation sites (literals and constructed values). No speedup is claimed and none is measured.
|
|
15
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The operation coordinates no requests, phases or consumers and holds no cache: each call recomputes from its arguments and shares nothing, which is correct because its result depends only on them.
|
|
16
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function acquires no handle, timer, listener or task and keeps no state between calls; its 3 allocation sites become the returned value or die with the call, so nothing grows.
|
|
17
|
+
*/
|
|
18
|
+
export function planAutoMovieCaptureUrl(
|
|
19
|
+
requested: string,
|
|
20
|
+
parameters: Readonly<Record<string, string>>,
|
|
21
|
+
): string {
|
|
22
|
+
const result: URL = new URL(requested);
|
|
23
|
+
if (
|
|
24
|
+
result.protocol !== "http:" ||
|
|
25
|
+
!["127.0.0.1", "localhost", "[::1]"].includes(result.hostname)
|
|
26
|
+
)
|
|
27
|
+
throw new Error("Capture requires a local HTTP review page");
|
|
28
|
+
for (const [key, value] of Object.entries(parameters))
|
|
29
|
+
result.searchParams.set(key, value);
|
|
30
|
+
result.searchParams.delete("play");
|
|
31
|
+
return result.href;
|
|
32
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import type { IAutoMovieProductionOpusDescription } from "@automovie/interface";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Parse and structurally validate the one Opus `dOps` box of an MP4 audio
|
|
5
|
+
* sample entry.
|
|
6
|
+
*
|
|
7
|
+
* `boxes` is the sample entry's child-box list as mp4box parses it, `codec` its
|
|
8
|
+
* four-character code, and `trackChannels` the `AudioSampleEntry` channel
|
|
9
|
+
* count. The result reports the box as
|
|
10
|
+
* observed; whether it matches the delivery profile is
|
|
11
|
+
* `assertProductionOpusProfile`'s question.
|
|
12
|
+
*
|
|
13
|
+
* Family 0 serializes no stream counts or mapping table and supports mono or
|
|
14
|
+
* stereo, so it reports null counts, an empty mapping and the implied channel
|
|
15
|
+
* order. Families 1 and 255 report their stream counts and ordered mapping
|
|
16
|
+
* with a null channel order, because family 255 defines no speaker meaning and
|
|
17
|
+
* this parser does not expand the family 1 order. `InputSampleRate` is
|
|
18
|
+
* reported but not compared with any track rate, because RFC 7845 makes it the
|
|
19
|
+
* informational rate of the original input.
|
|
20
|
+
*
|
|
21
|
+
* Throws `unsupported-audio-profile.sampleEntry` for a non-Opus code and
|
|
22
|
+
* `malformed-dOps` for anything else RFC 7845 section 5.1 or its MP4
|
|
23
|
+
* encapsulation forbids: not exactly one `dOps` box, a field outside its bit
|
|
24
|
+
* width, an output channel count that differs from the track's, a reserved
|
|
25
|
+
* family, a family 0 box with a mapping or more than two channels, a family 1
|
|
26
|
+
* box with more than eight channels, zero streams, more coupled than total
|
|
27
|
+
* streams, more than 255 decoded channels, or a mapping table that is not one
|
|
28
|
+
* entry per output channel each naming a decoded channel or 255 for silence.
|
|
29
|
+
*
|
|
30
|
+
* @evidence contracts/development/implementation.md#principled-implementation Each field is checked against its RFC 7845 section 5.1 bit width, and the relations are the ones that section and the Opus-in-ISOBMFF encapsulation state: family channel limits, N greater than zero, M at most N, M plus N at most 255, one mapping entry per output channel with each entry below M plus N or 255, and `OutputChannelCount` equal to the sample entry's channel count; the informational input rate and an output count below the decoded count are legal and admitted.
|
|
31
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One function reads the box and returns the interface record, with a local integer reader so every field refusal names its key; comparison with the delivery profile stays in `assertProductionOpusProfile`, so this parser reports what the file says and refuses only what no Opus file may say.
|
|
32
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The numeric limits are RFC 7845 field widths and family rules rather than fixture values, no file or encoder is special-cased, and a malformed box throws instead of being repaired or defaulted.
|
|
33
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc names each argument's source, the split from the profile check, what each family reports and why the channel order is null for nonzero families, why the input rate is not compared, and every refusal with its error prefix.
|
|
34
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Cost is linear in the child-box count B plus the mapping length C, at most 255: one filter over the boxes and two passes over the mapping, with no allocation beyond the filtered list and the copied mapping.
|
|
35
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each call parses one track's sample entry for one probe and coordinates no phases or requests whose result could be shared.
|
|
36
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function keeps no reference to the parsed boxes after returning, its result copies the mapping into a new array its caller owns, and it opens no handle or task.
|
|
37
|
+
*/
|
|
38
|
+
export const productionOpusDescription: (props: {
|
|
39
|
+
boxes: readonly unknown[] | undefined;
|
|
40
|
+
codec: string;
|
|
41
|
+
trackChannels: number;
|
|
42
|
+
}) => IAutoMovieProductionOpusDescription = (props: {
|
|
43
|
+
/** Parsed sample-entry children; absence is treated as no dOps box. */
|
|
44
|
+
boxes: readonly unknown[] | undefined;
|
|
45
|
+
|
|
46
|
+
/** Sample-entry codec spelling; the Opus family is matched case-insensitively. */
|
|
47
|
+
codec: string;
|
|
48
|
+
|
|
49
|
+
/** Channel count read from the enclosing audio sample entry. */
|
|
50
|
+
trackChannels: number;
|
|
51
|
+
}): IAutoMovieProductionOpusDescription => {
|
|
52
|
+
if (/^opus(?:\.|$)/i.test(props.codec) === false)
|
|
53
|
+
throw new Error(
|
|
54
|
+
`unsupported-audio-profile.sampleEntry: expected Opus, observed "${props.codec}".`,
|
|
55
|
+
);
|
|
56
|
+
const boxes: Record<string, unknown>[] = (props.boxes ?? []).filter(
|
|
57
|
+
(box: unknown): box is Record<string, unknown> =>
|
|
58
|
+
box !== null &&
|
|
59
|
+
typeof box === "object" &&
|
|
60
|
+
(box as { type?: unknown }).type === "dOps",
|
|
61
|
+
);
|
|
62
|
+
if (boxes.length !== 1)
|
|
63
|
+
throw new Error(
|
|
64
|
+
`malformed-dOps: expected one Opus description, observed ${boxes.length}.`,
|
|
65
|
+
);
|
|
66
|
+
const box: Record<string, unknown> = boxes[0]!;
|
|
67
|
+
const integer: (key: string, minimum: number, maximum: number) => number = (
|
|
68
|
+
key: string,
|
|
69
|
+
minimum: number,
|
|
70
|
+
maximum: number,
|
|
71
|
+
): number => {
|
|
72
|
+
const value: unknown = box[key];
|
|
73
|
+
if (
|
|
74
|
+
typeof value !== "number" ||
|
|
75
|
+
Number.isSafeInteger(value) === false ||
|
|
76
|
+
value < minimum ||
|
|
77
|
+
value > maximum
|
|
78
|
+
)
|
|
79
|
+
throw new Error(`malformed-dOps.${key}: observed ${String(value)}.`);
|
|
80
|
+
return value;
|
|
81
|
+
};
|
|
82
|
+
const version: number = integer("Version", 0, 255);
|
|
83
|
+
const outputChannelCount: number = integer("OutputChannelCount", 1, 255);
|
|
84
|
+
const preSkip: number = integer("PreSkip", 0, 65_535);
|
|
85
|
+
const inputSampleRate: number = integer("InputSampleRate", 1, 0xffff_ffff);
|
|
86
|
+
const outputGainQ7_8: number = integer("OutputGain", -32_768, 32_767);
|
|
87
|
+
const family: number = integer("ChannelMappingFamily", 0, 255);
|
|
88
|
+
const rawMapping: unknown = box.ChannelMapping;
|
|
89
|
+
if (
|
|
90
|
+
(rawMapping !== undefined || family !== 0) &&
|
|
91
|
+
Array.isArray(rawMapping) === false
|
|
92
|
+
)
|
|
93
|
+
throw new Error(
|
|
94
|
+
"malformed-dOps.ChannelMapping: expected an ordered array.",
|
|
95
|
+
);
|
|
96
|
+
const mapping: number[] = (
|
|
97
|
+
Array.isArray(rawMapping) ? (rawMapping as unknown[]) : []
|
|
98
|
+
).map((value: unknown, index: number): number => {
|
|
99
|
+
if (
|
|
100
|
+
typeof value !== "number" ||
|
|
101
|
+
Number.isSafeInteger(value) === false ||
|
|
102
|
+
value < 0 ||
|
|
103
|
+
value > 255
|
|
104
|
+
)
|
|
105
|
+
throw new Error(
|
|
106
|
+
`malformed-dOps.ChannelMapping[${index}]: observed ${String(value)}.`,
|
|
107
|
+
);
|
|
108
|
+
return value;
|
|
109
|
+
});
|
|
110
|
+
if (outputChannelCount !== props.trackChannels)
|
|
111
|
+
throw new Error(
|
|
112
|
+
"malformed-dOps: sample description and track channel counts disagree.",
|
|
113
|
+
);
|
|
114
|
+
if (family === 0) {
|
|
115
|
+
if (outputChannelCount > 2 || mapping.length !== 0)
|
|
116
|
+
throw new Error(
|
|
117
|
+
"malformed-dOps.ChannelMappingFamily: family 0 supports mono or stereo and serializes no mapping table.",
|
|
118
|
+
);
|
|
119
|
+
return {
|
|
120
|
+
kind: "opus",
|
|
121
|
+
version,
|
|
122
|
+
outputChannelCount,
|
|
123
|
+
preSkip,
|
|
124
|
+
inputSampleRate,
|
|
125
|
+
outputGainQ7_8,
|
|
126
|
+
channelMapping: {
|
|
127
|
+
family,
|
|
128
|
+
streamCount: null,
|
|
129
|
+
coupledCount: null,
|
|
130
|
+
mapping: [],
|
|
131
|
+
channelOrder:
|
|
132
|
+
outputChannelCount === 2 ? ["front-left", "front-right"] : ["mono"],
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
if (family !== 1 && family !== 255)
|
|
137
|
+
throw new Error(
|
|
138
|
+
`malformed-dOps.ChannelMappingFamily: reserved family ${family} is unsupported.`,
|
|
139
|
+
);
|
|
140
|
+
if (family === 1 && outputChannelCount > 8)
|
|
141
|
+
throw new Error(
|
|
142
|
+
`malformed-dOps.ChannelMappingFamily: family 1 supports at most 8 channels, observed ${outputChannelCount}.`,
|
|
143
|
+
);
|
|
144
|
+
const streamCount: number = integer("StreamCount", 1, 255);
|
|
145
|
+
const coupledCount: number = integer("CoupledCount", 0, 255);
|
|
146
|
+
const decodedChannels: number = streamCount + coupledCount;
|
|
147
|
+
if (
|
|
148
|
+
coupledCount > streamCount ||
|
|
149
|
+
decodedChannels > 255 ||
|
|
150
|
+
mapping.length !== outputChannelCount ||
|
|
151
|
+
mapping.some(
|
|
152
|
+
(value: number): boolean => value !== 255 && value >= decodedChannels,
|
|
153
|
+
)
|
|
154
|
+
)
|
|
155
|
+
throw new Error(
|
|
156
|
+
"malformed-dOps.ChannelMapping: stream, coupled, channel, and mapping counts disagree.",
|
|
157
|
+
);
|
|
158
|
+
return {
|
|
159
|
+
kind: "opus",
|
|
160
|
+
version,
|
|
161
|
+
outputChannelCount,
|
|
162
|
+
preSkip,
|
|
163
|
+
inputSampleRate,
|
|
164
|
+
outputGainQ7_8,
|
|
165
|
+
channelMapping: {
|
|
166
|
+
family,
|
|
167
|
+
streamCount,
|
|
168
|
+
coupledCount,
|
|
169
|
+
mapping,
|
|
170
|
+
channelOrder: null,
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { AUTOMOVIE_PRODUCTION_SOUND_EVIDENCE_RASTERS } from "@automovie/engine";
|
|
2
|
+
|
|
3
|
+
import type { AutoMovieProductionPngRole } from "./AutoMovieProductionPngRole";
|
|
4
|
+
import type { IAutoMovieProductionPngProfile } from "./IAutoMovieProductionPngProfile";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Resolve one output role to the exact PNG profile its writer must emit.
|
|
8
|
+
*
|
|
9
|
+
* A `waveform` or `spectrogram` picture takes the fixed size the engine's
|
|
10
|
+
* sound-evidence writers draw, and `width` and `height` are ignored for it. A
|
|
11
|
+
* `preview` or `guide-frame` picture takes the authored raster passed in
|
|
12
|
+
* `width` and `height`, in pixels. Every other profile field is the one
|
|
13
|
+
* literal the writers support: 8-bit straight-alpha RGBA, sRGB, square,
|
|
14
|
+
* upright and not interlaced. Throws when the resolved raster is not a
|
|
15
|
+
* positive safe-integer size, which includes a preview or guide frame called
|
|
16
|
+
* without one.
|
|
17
|
+
*
|
|
18
|
+
* @evidence contracts/development/implementation.md#principled-implementation Fixed sound-evidence sizes come from the engine writers' raster constants; other roles require positive safe-integer dimensions. This admits numeric profile records rather than encoded images and imposes no PNG field-width or decoder allocation limit; those remain serialization and probing concerns.
|
|
19
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One role switch picks the raster and one object literal spells the single supported format, so the profile shape stays in `IAutoMovieProductionPngProfile` and the comparison stays in `assertProductionPngPicture`.
|
|
20
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No caller or file is special-cased: the two fixed sizes are the engine writers' own defaults imported rather than restated, and a missing authored raster throws instead of falling back to a guessed size.
|
|
21
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc says which roles take a fixed size and which take the passed raster, that the size arguments are pixels and ignored for fixed roles, which literals every profile carries, and when the call throws.
|
|
22
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms The call does constant work: one role comparison, four integer checks and one eleven-field object, independent of image size.
|
|
23
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each call builds one small profile from its arguments and coordinates no phases or requests whose work could be shared.
|
|
24
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The PNG profile is a fresh eleven-field record handed to the validator that requested it; the engine raster constant is read, never retained, and no file handle or task is opened.
|
|
25
|
+
*/
|
|
26
|
+
export const resolveProductionPngProfile: (props: {
|
|
27
|
+
role: AutoMovieProductionPngRole;
|
|
28
|
+
width?: number;
|
|
29
|
+
height?: number;
|
|
30
|
+
}) => IAutoMovieProductionPngProfile = (props: {
|
|
31
|
+
/** Output role selecting an engine-fixed or caller-supplied raster. */
|
|
32
|
+
role: AutoMovieProductionPngRole;
|
|
33
|
+
|
|
34
|
+
/** Pixel width required for preview/guide-frame and ignored for sound-evidence roles. */
|
|
35
|
+
width?: number;
|
|
36
|
+
|
|
37
|
+
/** Pixel height required for preview/guide-frame and ignored for sound-evidence roles. */
|
|
38
|
+
height?: number;
|
|
39
|
+
}): IAutoMovieProductionPngProfile => {
|
|
40
|
+
const raster: { width: number | undefined; height: number | undefined } =
|
|
41
|
+
props.role === "waveform" || props.role === "spectrogram"
|
|
42
|
+
? AUTOMOVIE_PRODUCTION_SOUND_EVIDENCE_RASTERS[props.role]
|
|
43
|
+
: { width: props.width, height: props.height };
|
|
44
|
+
const width: number | undefined = raster.width;
|
|
45
|
+
const height: number | undefined = raster.height;
|
|
46
|
+
if (
|
|
47
|
+
width === undefined ||
|
|
48
|
+
height === undefined ||
|
|
49
|
+
Number.isSafeInteger(width) === false ||
|
|
50
|
+
width <= 0 ||
|
|
51
|
+
Number.isSafeInteger(height) === false ||
|
|
52
|
+
height <= 0
|
|
53
|
+
)
|
|
54
|
+
throw new Error(
|
|
55
|
+
`PNG role "${props.role}" requires a positive safe-integer raster.`,
|
|
56
|
+
);
|
|
57
|
+
return {
|
|
58
|
+
version: 1,
|
|
59
|
+
role: props.role,
|
|
60
|
+
width,
|
|
61
|
+
height,
|
|
62
|
+
bitDepth: 8,
|
|
63
|
+
color: "rgba",
|
|
64
|
+
alpha: "straight",
|
|
65
|
+
interlace: "none",
|
|
66
|
+
colorSpace: "srgb",
|
|
67
|
+
pixelAspect: "square",
|
|
68
|
+
orientation: "upright",
|
|
69
|
+
};
|
|
70
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { IAutoMovieProductionFrameRate } from "@automovie/interface";
|
|
2
|
+
|
|
3
|
+
import { AUTOMOVIE_MP4_SRGB_COLOUR } from "./AUTOMOVIE_MP4_SRGB_COLOUR";
|
|
4
|
+
import { AUTOMOVIE_MP4_UNITY_MATRIX } from "./AUTOMOVIE_MP4_UNITY_MATRIX";
|
|
5
|
+
import type { IAutoMovieProductionVideoProfile } from "./IAutoMovieProductionVideoProfile";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Resolve an authored raster and exact frame rate to the one H.264-in-MP4
|
|
9
|
+
* picture profile a video deliverable must carry.
|
|
10
|
+
*
|
|
11
|
+
* `width` and `height` are pixels and `frameRate` is the exact rational rate;
|
|
12
|
+
* all three pass through unchecked, so the caller supplies values it already
|
|
13
|
+
* validated. The rest is fixed: major brand `isom` with `isom` required among
|
|
14
|
+
* the compatible brands, the unity track matrix, square pixels, and full-range
|
|
15
|
+
* sRGB color code points. The returned matrix is a fresh copy, so a caller that
|
|
16
|
+
* edits it cannot change the shared constant; the color record is the shared
|
|
17
|
+
* constant itself, whose literal-typed fields admit no other value.
|
|
18
|
+
*
|
|
19
|
+
* @evidence contracts/development/implementation.md#principled-implementation The fixed fields are the ISO base media unity matrix and the ITU-T H.273 sRGB code points, read from `AUTOMOVIE_MP4_UNITY_MATRIX` and `AUTOMOVIE_MP4_SRGB_COLOUR`, the same constants the normalizer writes and the splice check reads, so the profile cannot name a matrix or color the writer does not emit.
|
|
20
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure The function only assembles the profile; validation of raster and rate stays with the callers that own the authored values, and the comparison against a probed file stays in `assertProductionVideoProfile`.
|
|
21
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No deliverable or caller is special-cased: every video deliverable gets the same fixed fields, which are standard identities rather than measured or fixture values.
|
|
22
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc gives the units of the varying fields, says they are not validated here, lists every fixed field, and states which returned part is a copy and which is shared.
|
|
23
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms The call does constant work, copying a nine-entry matrix into one new profile and sharing the constant color record.
|
|
24
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each call builds one small profile and coordinates no phases or requests whose work could be shared; the shared parts are already module constants.
|
|
25
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Only the copied nine-entry matrix and the profile object are allocated, both owned by the caller from return; the shared color constant lives for the module's lifetime, and no handle or task is opened.
|
|
26
|
+
*/
|
|
27
|
+
export const resolveProductionVideoProfile: (props: {
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
frameRate: IAutoMovieProductionFrameRate;
|
|
31
|
+
}) => IAutoMovieProductionVideoProfile = (props: {
|
|
32
|
+
/** Validated coded/display width in pixels; forwarded without admission. */
|
|
33
|
+
width: number;
|
|
34
|
+
|
|
35
|
+
/** Validated coded/display height in pixels; forwarded without admission. */
|
|
36
|
+
height: number;
|
|
37
|
+
|
|
38
|
+
/** Caller-owned rational frames-per-second identity, shared by reference. */
|
|
39
|
+
frameRate: IAutoMovieProductionFrameRate;
|
|
40
|
+
}): IAutoMovieProductionVideoProfile => ({
|
|
41
|
+
width: props.width,
|
|
42
|
+
height: props.height,
|
|
43
|
+
frameRate: props.frameRate,
|
|
44
|
+
brands: { major: "isom", requiredCompatible: ["isom"] },
|
|
45
|
+
trackMatrix: [...AUTOMOVIE_MP4_UNITY_MATRIX],
|
|
46
|
+
pixelAspect: "square",
|
|
47
|
+
color: AUTOMOVIE_MP4_SRGB_COLOUR,
|
|
48
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { IAutoMovieRenderSpec } from "@automovie/interface";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The ffmpeg argument vector that encodes a `frameName` image sequence into
|
|
5
|
+
* the spec's H.264 MP4.
|
|
6
|
+
*
|
|
7
|
+
* The vector is `-y -framerate <fps> -i <inputPattern> -c:v libx264 -pix_fmt
|
|
8
|
+
* <pixelFormat> -crf <crf> -r <fps> -s <width>x<height> -movflags +faststart
|
|
9
|
+
* <outputPath>`: input and output rates fixed to `frameFormat.fps`, the spec's
|
|
10
|
+
* pixel format and CRF, the output raster pinned to `frameFormat` so the video
|
|
11
|
+
* matches the pose-keypoint sidecar's aspect whatever the capture viewport
|
|
12
|
+
* was, and the movie box moved first for progressive playback. The raster
|
|
13
|
+
* must be even, which `yuv420p` requires; this function does not check it,
|
|
14
|
+
* and an odd raster fails inside ffmpeg.
|
|
15
|
+
*
|
|
16
|
+
* Nothing here tone maps: the frames arrive as sRGB images and the curve that
|
|
17
|
+
* produced them is a renderer setting of the capture host, owned by the
|
|
18
|
+
* scene's `environment` with the spec's `toneMapping` as the delivery default.
|
|
19
|
+
* No colour matrix, range or colour description is passed either, so ffmpeg
|
|
20
|
+
* converts the RGB frames with its default matrix and range and the stream
|
|
21
|
+
* carries no colour tag; the delivery profile's sRGB declaration is not
|
|
22
|
+
* produced by this vector. `fps` is written as its decimal string, so a
|
|
23
|
+
* non-integer rate reaches ffmpeg as that decimal rather than as a reduced
|
|
24
|
+
* rational.
|
|
25
|
+
*
|
|
26
|
+
* @evidence contracts/development/implementation.md#principled-implementation The arguments are documented ffmpeg options passed in one fixed order, with `-framerate` setting the image-sequence input clock and `-r` the output clock so no frame is dropped or duplicated, and `-s` scaling to the spec raster; the unresolved limitations are the unspecified RGB-to-YUV conversion and missing colour tags, and the decimal rate, both stated in the doc.
|
|
27
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure The single render, the sequence plan and the chunk plan all encode through this one vector, and the caller supplies only the input pattern and output path.
|
|
28
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Every spec value is passed verbatim, the CRF unchecked as the spec documents, and no host or spec is special-cased; the missing colour flags are the gap the doc names, not a compensation.
|
|
29
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc spells the exact vector, why the raster is pinned, the unchecked even-raster requirement, who owns tone mapping, and the colour and rate limitations.
|
|
30
|
+
* @evidenceExclude contracts/development/implementation.md#efficient-algorithms Building a fixed argument array chooses no algorithm.
|
|
31
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each encode builds its vector once, cheaper than caching.
|
|
32
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function returns an array of strings and starts no process; the caller owns the ffmpeg process it may start.
|
|
33
|
+
*/
|
|
34
|
+
export const ffmpegArgs: (
|
|
35
|
+
spec: IAutoMovieRenderSpec,
|
|
36
|
+
inputPattern: string,
|
|
37
|
+
outputPath: string,
|
|
38
|
+
) => string[] = (
|
|
39
|
+
spec: IAutoMovieRenderSpec,
|
|
40
|
+
inputPattern: string,
|
|
41
|
+
outputPath: string,
|
|
42
|
+
): string[] => [
|
|
43
|
+
"-y",
|
|
44
|
+
"-framerate",
|
|
45
|
+
`${spec.frameFormat.fps}`,
|
|
46
|
+
"-i",
|
|
47
|
+
inputPattern,
|
|
48
|
+
"-c:v",
|
|
49
|
+
"libx264",
|
|
50
|
+
"-pix_fmt",
|
|
51
|
+
spec.pixelFormat,
|
|
52
|
+
"-crf",
|
|
53
|
+
`${spec.crf}`,
|
|
54
|
+
"-r",
|
|
55
|
+
`${spec.frameFormat.fps}`,
|
|
56
|
+
"-s",
|
|
57
|
+
`${spec.frameFormat.width}x${spec.frameFormat.height}`,
|
|
58
|
+
"-movflags",
|
|
59
|
+
"+faststart",
|
|
60
|
+
outputPath,
|
|
61
|
+
];
|