@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,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.canonicalProductionWebVtt = void 0;
|
|
4
|
+
const engine_1 = require("@automovie/engine");
|
|
5
|
+
const serializeAutoMovieWebVttCueText_1 = require("./serializeAutoMovieWebVttCueText");
|
|
6
|
+
const serializeAutoMovieWebVttIdentifier_1 = require("./serializeAutoMovieWebVttIdentifier");
|
|
7
|
+
const serializeAutoMovieWebVttSingleLineText_1 = require("./serializeAutoMovieWebVttSingleLineText");
|
|
8
|
+
const webVttCaptionLanguage_1 = require("./webVttCaptionLanguage");
|
|
9
|
+
const webVttTime_1 = require("./webVttTime");
|
|
10
|
+
/**
|
|
11
|
+
* Serialize a compiled timeline's caption track as the one canonical WebVTT
|
|
12
|
+
* file its caption deliverable must equal byte for byte.
|
|
13
|
+
*
|
|
14
|
+
* The header carries the timeline id. Cues are ordered by start frame, then end
|
|
15
|
+
* frame, then id in code-unit order, and each cue's frame interval maps to
|
|
16
|
+
* whole milliseconds with nearest rounding on the exact production frame rate.
|
|
17
|
+
* The payload sits in a `<lang>` span, inside a `<v>` voice span when the cue
|
|
18
|
+
* names a speaker, and every block ends with a blank line. Throws when an id is
|
|
19
|
+
* not a WebVTT identifier, a language is not a well-formed RFC 5646 tag, the
|
|
20
|
+
* timeline's `fps` disagrees with its exact frame rate, or a cue interval is
|
|
21
|
+
* empty or collapses on the millisecond clock.
|
|
22
|
+
*
|
|
23
|
+
* @evidence contracts/development/implementation.md#principled-implementation The cue syntax follows the W3C WebVTT file grammar: identifiers are preserved verbatim, cue text and annotations are escaped by the shared serializers, and times come from `productionFrameIntervalToGridTicks`, whose BigInt arithmetic maps each rational frame boundary to an exact integer millisecond before formatting.
|
|
24
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure The function only orders cues and assembles lines; identifier refusal, text escaping, language validation, frame-to-tick mapping and timestamp spelling each live in the helper that owns them, so the delivery validator compares against the same bytes the writer emits.
|
|
25
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The only fixed values are WebVTT syntax and the 1000-tick millisecond clock WebVTT timestamps require; nothing is special-cased per cue, and a malformed cue throws instead of being skipped.
|
|
26
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc states the byte-equality role, the header source, the cue order, the millisecond rounding, the span nesting, and every refusal.
|
|
27
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms For C cues of text length L the cost is an O(C log C) sort of a copied array plus O(L) escaping per cue; the copy keeps the caller's timeline unmodified, and the sort is needed because the order is part of the canonical bytes.
|
|
28
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each call serializes one timeline into a fresh string and coordinates no phases or consumers whose work it could share.
|
|
29
|
+
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources Only the sorted copy and the line array are held, both released on return; the output string, owned by the caller, grows linearly with cue count and text length.
|
|
30
|
+
*/
|
|
31
|
+
const canonicalProductionWebVtt = (timeline) => {
|
|
32
|
+
const frameRate = (0, engine_1.resolveProductionFrameRate)(timeline);
|
|
33
|
+
const cues = [...timeline.tracks.captions].sort((left, right) => left.startFrame - right.startFrame ||
|
|
34
|
+
left.endFrame - right.endFrame ||
|
|
35
|
+
(0, engine_1.compareCodeUnits)(left.id, right.id));
|
|
36
|
+
return [
|
|
37
|
+
`WEBVTT ${(0, serializeAutoMovieWebVttIdentifier_1.serializeAutoMovieWebVttIdentifier)(timeline.id)}`,
|
|
38
|
+
"",
|
|
39
|
+
...cues.flatMap((cue) => {
|
|
40
|
+
const interval = (0, engine_1.productionFrameIntervalToGridTicks)({
|
|
41
|
+
startFrame: cue.startFrame,
|
|
42
|
+
endFrame: cue.endFrame,
|
|
43
|
+
frameRate,
|
|
44
|
+
ticksPerSecond: 1_000,
|
|
45
|
+
rounding: "nearest",
|
|
46
|
+
});
|
|
47
|
+
const payload = (0, serializeAutoMovieWebVttCueText_1.serializeAutoMovieWebVttCueText)(cue.text);
|
|
48
|
+
return [
|
|
49
|
+
(0, serializeAutoMovieWebVttIdentifier_1.serializeAutoMovieWebVttIdentifier)(cue.id),
|
|
50
|
+
`${(0, webVttTime_1.webVttTime)(interval.start)} --> ${(0, webVttTime_1.webVttTime)(interval.end)}`,
|
|
51
|
+
`<lang ${(0, webVttCaptionLanguage_1.webVttCaptionLanguage)(cue.language)}>${cue.speaker === undefined
|
|
52
|
+
? payload
|
|
53
|
+
: `<v ${(0, serializeAutoMovieWebVttSingleLineText_1.serializeAutoMovieWebVttSingleLineText)(cue.speaker)}>${payload}</v>`}</lang>`,
|
|
54
|
+
"",
|
|
55
|
+
];
|
|
56
|
+
}),
|
|
57
|
+
].join("\n");
|
|
58
|
+
};
|
|
59
|
+
exports.canonicalProductionWebVtt = canonicalProductionWebVtt;
|
|
60
|
+
//# sourceMappingURL=canonicalProductionWebVtt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonicalProductionWebVtt.js","sourceRoot":"","sources":["../../src/caption/canonicalProductionWebVtt.ts"],"names":[],"mappings":";;;AAAA,8CAI2B;AAM3B,uFAAoF;AACpF,6FAA0F;AAC1F,qGAAkG;AAClG,mEAAgE;AAChE,6CAA0C;AAI1C;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,MAAM,yBAAyB,GAExB,CAAC,QAAgC,EAAU,EAAE;IACzD,MAAM,SAAS,GACb,IAAA,mCAA0B,EAAC,QAAQ,CAAC,CAAC;IACvC,MAAM,IAAI,GAAkB,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAC5D,CAAC,IAAiB,EAAE,KAAkB,EAAU,EAAE,CAChD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU;QAClC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ;QAC9B,IAAA,yBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,CACtC,CAAC;IACF,OAAO;QACL,UAAU,IAAA,uEAAkC,EAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;QAC3D,EAAE;QACF,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,GAAgB,EAAY,EAAE;YAC7C,MAAM,QAAQ,GACZ,IAAA,2CAAkC,EAAC;gBACjC,UAAU,EAAE,GAAG,CAAC,UAAU;gBAC1B,QAAQ,EAAE,GAAG,CAAC,QAAQ;gBACtB,SAAS;gBACT,cAAc,EAAE,KAAK;gBACrB,QAAQ,EAAE,SAAS;aACpB,CAAC,CAAC;YACL,MAAM,OAAO,GAAW,IAAA,iEAA+B,EAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAClE,OAAO;gBACL,IAAA,uEAAkC,EAAC,GAAG,CAAC,EAAE,CAAC;gBAC1C,GAAG,IAAA,uBAAU,EAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,IAAA,uBAAU,EAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;gBAC/D,SAAS,IAAA,6CAAqB,EAAC,GAAG,CAAC,QAAQ,CAAC,IAC1C,GAAG,CAAC,OAAO,KAAK,SAAS;oBACvB,CAAC,CAAC,OAAO;oBACT,CAAC,CAAC,MAAM,IAAA,+EAAsC,EAAC,GAAG,CAAC,OAAO,CAAC,IAAI,OAAO,MAC1E,SAAS;gBACT,EAAE;aACH,CAAC;QACJ,CAAC,CAAC;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC,CAAC;AApCW,QAAA,yBAAyB,GAAzB,yBAAyB,CAoCpC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalize one authored caption into the presentation shared by readability
|
|
3
|
+
* measurement and WebVTT delivery.
|
|
4
|
+
*
|
|
5
|
+
* CRLF and lone CR become LF, tabs stay intact, and every other C0 control and
|
|
6
|
+
* DEL becomes one space. Lines are never reflowed or trimmed, and empty lines
|
|
7
|
+
* stay empty here so readability counts the exact authored presentation; the
|
|
8
|
+
* cue serializer, not this function, makes an empty line survive WebVTT.
|
|
9
|
+
*
|
|
10
|
+
* @evidence contracts/development/implementation.md#principled-implementation Two global regular-expression replacements implement the mapping: the first folds both legacy line terminators into LF, and the second maps the remaining C0 controls and DEL one-for-one to a space, so line count and every printable code point are preserved.
|
|
11
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One function owns the presentation so the readability inspector, film assembly's blank-text check and the cue serializer all read the same text; it does no escaping, which belongs to the WebVTT serializers.
|
|
12
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The character classes are the controls WebVTT cue text cannot carry, a format rule rather than a measured case, and no caption or consumer is special-cased.
|
|
13
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc lists the exact newline, tab and control mappings, states that lines are not reflowed or trimmed, and names which layer preserves empty lines.
|
|
14
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Each replacement is one linear scan of the caption, so the cost is O(L) time and at most two new strings of length L.
|
|
15
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pure string mapping coordinates no phases; its callers each normalize the one caption they hold, and caching short captions would cost more than the scan.
|
|
16
|
+
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources The module retains only the compiled pattern for its lifetime; the global flag carries no state across calls because `String.prototype.replace` resets it.
|
|
17
|
+
*/
|
|
18
|
+
export declare const canonicalizeAutoMovieCaptionText: (value: string) => string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.canonicalizeAutoMovieCaptionText = void 0;
|
|
4
|
+
const PROHIBITED_CAPTION_CONTROLS = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/gu;
|
|
5
|
+
/**
|
|
6
|
+
* Normalize one authored caption into the presentation shared by readability
|
|
7
|
+
* measurement and WebVTT delivery.
|
|
8
|
+
*
|
|
9
|
+
* CRLF and lone CR become LF, tabs stay intact, and every other C0 control and
|
|
10
|
+
* DEL becomes one space. Lines are never reflowed or trimmed, and empty lines
|
|
11
|
+
* stay empty here so readability counts the exact authored presentation; the
|
|
12
|
+
* cue serializer, not this function, makes an empty line survive WebVTT.
|
|
13
|
+
*
|
|
14
|
+
* @evidence contracts/development/implementation.md#principled-implementation Two global regular-expression replacements implement the mapping: the first folds both legacy line terminators into LF, and the second maps the remaining C0 controls and DEL one-for-one to a space, so line count and every printable code point are preserved.
|
|
15
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One function owns the presentation so the readability inspector, film assembly's blank-text check and the cue serializer all read the same text; it does no escaping, which belongs to the WebVTT serializers.
|
|
16
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The character classes are the controls WebVTT cue text cannot carry, a format rule rather than a measured case, and no caption or consumer is special-cased.
|
|
17
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc lists the exact newline, tab and control mappings, states that lines are not reflowed or trimmed, and names which layer preserves empty lines.
|
|
18
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Each replacement is one linear scan of the caption, so the cost is O(L) time and at most two new strings of length L.
|
|
19
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pure string mapping coordinates no phases; its callers each normalize the one caption they hold, and caching short captions would cost more than the scan.
|
|
20
|
+
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources The module retains only the compiled pattern for its lifetime; the global flag carries no state across calls because `String.prototype.replace` resets it.
|
|
21
|
+
*/
|
|
22
|
+
const canonicalizeAutoMovieCaptionText = (value) => value.replace(/\r\n?/gu, "\n").replace(PROHIBITED_CAPTION_CONTROLS, " ");
|
|
23
|
+
exports.canonicalizeAutoMovieCaptionText = canonicalizeAutoMovieCaptionText;
|
|
24
|
+
//# sourceMappingURL=canonicalizeAutoMovieCaptionText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonicalizeAutoMovieCaptionText.js","sourceRoot":"","sources":["../../src/caption/canonicalizeAutoMovieCaptionText.ts"],"names":[],"mappings":";;;AAAA,MAAM,2BAA2B,GAC/B,kDAAkD,CAAC;AAErD;;;;;;;;;;;;;;;;GAgBG;AACI,MAAM,gCAAgC,GAA8B,CACzE,KAAa,EACL,EAAE,CACV,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,2BAA2B,EAAE,GAAG,CAAC,CAAC;AAH9D,QAAA,gCAAgC,GAAhC,gCAAgC,CAG8B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escape the three characters WebVTT reads as cue-text syntax: `&`, `<` and
|
|
3
|
+
* `>`.
|
|
4
|
+
*
|
|
5
|
+
* Cue payloads and single-line annotations share this escape, because a caption
|
|
6
|
+
* that escaped one but not the other would publish markup in one field and
|
|
7
|
+
* literal text in the other.
|
|
8
|
+
*
|
|
9
|
+
* @evidence contracts/development/implementation.md#principled-implementation WebVTT cue text defines the character references `&`, `<` and `>`, and escaping `&` first keeps the later replacements from being escaped twice, so the mapping is reversible.
|
|
10
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure A single shared escape is the only thing the cue-text and annotation serializers have in common, so it is its own function while their different line handling stays with each serializer.
|
|
11
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The escaped set is the WebVTT syntax set and nothing else; no input is special-cased.
|
|
12
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc names the exact escaped characters and why both serializers must share the escape.
|
|
13
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Three `replaceAll` passes are each linear in the text length; a single-pass replacer would save at most two scans of one caption line.
|
|
14
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pure per-string escape coordinates no phases, so there is no completed work to share between its callers.
|
|
15
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function returns a new string and keeps no state, handle or task.
|
|
16
|
+
*/
|
|
17
|
+
export declare const escapeWebVttText: (value: string) => string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.escapeWebVttText = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Escape the three characters WebVTT reads as cue-text syntax: `&`, `<` and
|
|
6
|
+
* `>`.
|
|
7
|
+
*
|
|
8
|
+
* Cue payloads and single-line annotations share this escape, because a caption
|
|
9
|
+
* that escaped one but not the other would publish markup in one field and
|
|
10
|
+
* literal text in the other.
|
|
11
|
+
*
|
|
12
|
+
* @evidence contracts/development/implementation.md#principled-implementation WebVTT cue text defines the character references `&`, `<` and `>`, and escaping `&` first keeps the later replacements from being escaped twice, so the mapping is reversible.
|
|
13
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure A single shared escape is the only thing the cue-text and annotation serializers have in common, so it is its own function while their different line handling stays with each serializer.
|
|
14
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The escaped set is the WebVTT syntax set and nothing else; no input is special-cased.
|
|
15
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc names the exact escaped characters and why both serializers must share the escape.
|
|
16
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Three `replaceAll` passes are each linear in the text length; a single-pass replacer would save at most two scans of one caption line.
|
|
17
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pure per-string escape coordinates no phases, so there is no completed work to share between its callers.
|
|
18
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function returns a new string and keeps no state, handle or task.
|
|
19
|
+
*/
|
|
20
|
+
const escapeWebVttText = (value) => value
|
|
21
|
+
.replaceAll("&", "&")
|
|
22
|
+
.replaceAll("<", "<")
|
|
23
|
+
.replaceAll(">", ">");
|
|
24
|
+
exports.escapeWebVttText = escapeWebVttText;
|
|
25
|
+
//# sourceMappingURL=escapeWebVttText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escapeWebVttText.js","sourceRoot":"","sources":["../../src/caption/escapeWebVttText.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;GAeG;AACI,MAAM,gBAAgB,GAA8B,CACzD,KAAa,EACL,EAAE,CACV,KAAK;KACF,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC;KACxB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC;KACvB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AANhB,QAAA,gBAAgB,GAAhB,gBAAgB,CAMA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./IAutoMovieBeatCaption";
|
|
2
|
+
export * from "./autoMovieCaptionLanguageComparisonKey";
|
|
3
|
+
export * from "./beatCaptions";
|
|
4
|
+
export * from "./canonicalProductionWebVtt";
|
|
5
|
+
export * from "./canonicalizeAutoMovieCaptionText";
|
|
6
|
+
export * from "./inspectAutoMovieCaptionReadabilityWithRuntime";
|
|
7
|
+
export * from "./isAutoMovieWebVttIdentifier";
|
|
8
|
+
export * from "./parseAutoMovieCaptionLanguage";
|
|
9
|
+
export * from "./serializeAutoMovieWebVttCueText";
|
|
10
|
+
export * from "./serializeAutoMovieWebVttIdentifier";
|
|
11
|
+
export * from "./serializeAutoMovieWebVttSingleLineText";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./IAutoMovieBeatCaption"), exports);
|
|
18
|
+
__exportStar(require("./autoMovieCaptionLanguageComparisonKey"), exports);
|
|
19
|
+
__exportStar(require("./beatCaptions"), exports);
|
|
20
|
+
__exportStar(require("./canonicalProductionWebVtt"), exports);
|
|
21
|
+
__exportStar(require("./canonicalizeAutoMovieCaptionText"), exports);
|
|
22
|
+
__exportStar(require("./inspectAutoMovieCaptionReadabilityWithRuntime"), exports);
|
|
23
|
+
__exportStar(require("./isAutoMovieWebVttIdentifier"), exports);
|
|
24
|
+
__exportStar(require("./parseAutoMovieCaptionLanguage"), exports);
|
|
25
|
+
__exportStar(require("./serializeAutoMovieWebVttCueText"), exports);
|
|
26
|
+
__exportStar(require("./serializeAutoMovieWebVttIdentifier"), exports);
|
|
27
|
+
__exportStar(require("./serializeAutoMovieWebVttSingleLineText"), exports);
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/caption/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,0EAAwD;AACxD,iDAA+B;AAC/B,8DAA4C;AAC5C,qEAAmD;AACnD,kFAAgE;AAChE,gEAA8C;AAC9C,kEAAgD;AAChD,oEAAkD;AAClD,uEAAqD;AACrD,2EAAyD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { IAutoMovieCaptionGraphemeSegmentationIdentity, IAutoMovieCaptionReadabilityProfile, IAutoMovieCaptionReadabilityReport, IAutoMovieFilmTimeline } from "@automovie/interface";
|
|
2
|
+
/** Runtime-owned grapheme segmentation behavior and its complete identity. */
|
|
3
|
+
interface IAutoMovieCaptionGraphemeRuntime {
|
|
4
|
+
/** Complete identity of the exact segmentation behavior below. */
|
|
5
|
+
identity: IAutoMovieCaptionGraphemeSegmentationIdentity;
|
|
6
|
+
/**
|
|
7
|
+
* Segment one canonical caption line into grapheme clusters; only the number
|
|
8
|
+
* of yielded items is read.
|
|
9
|
+
*/
|
|
10
|
+
segment(value: string): Iterable<unknown>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Measure caption readability through one injected, identity-bearing runtime
|
|
14
|
+
* and judge each cue against its language's profile.
|
|
15
|
+
*
|
|
16
|
+
* The grapheme runtime is injected because the host owns it: production binds
|
|
17
|
+
* Node's installed `Intl.Segmenter` and reports that exact identity. Each cue is
|
|
18
|
+
* measured on its canonical presentation: graphemes, lines, the longest line,
|
|
19
|
+
* duration, the gap since the previous cue of the same language identity in
|
|
20
|
+
* track order, and graphemes per second at `timeline.fps`. A cue whose language
|
|
21
|
+
* has no profile, or whose profile names a segmentation identity other than the
|
|
22
|
+
* runtime's, keeps its measurement with a `not-run` outcome instead of a
|
|
23
|
+
* verdict. Profiles are matched by ASCII case-insensitive language identity;
|
|
24
|
+
* design validation refuses two profiles for one identity, so none is shadowed.
|
|
25
|
+
* The track must be in start order with positive durations, as film assembly
|
|
26
|
+
* guarantees; a zero-length cue would report an infinite rate.
|
|
27
|
+
*
|
|
28
|
+
* @evidence contracts/development/implementation.md#principled-implementation Graphemes are counted by the injected segmenter rather than by code units, so a combining sequence or emoji counts as one, and the verdict compares each measurement to the profile's boundary with its declared inclusive or exclusive sense; the gap and rate formulas rely on film assembly's sorted, positive-duration cues.
|
|
29
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure Thresholds and identity matching live here, while the runtime binding lives in production's `inspectAutoMovieCaptionReadability`, so the render package stays free of Node globals and a test can inject a fixture runtime through the same seam.
|
|
30
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts An identity mismatch yields `not-run` instead of substituting the resident runtime, and a cue with an unparseable language gets no profile and no gap rather than a guessed language; no profile or cue is special-cased.
|
|
31
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc states why the runtime is injected, every measured quantity and its basis, both `not-run` conditions, how profiles match, and the ordering and duration premises with their failure effect.
|
|
32
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms For C cues, total text length L, profile/cue language length A and G yielded segmentation items, local work is O(C+L+A+G+P) for P profiles, including language parsing, normalization and streamed counts. The injected runtime owns segmentation cost and termination; an arbitrary iterable can yield unbounded items, so text length alone does not bound work.
|
|
33
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work One call measures one timeline once; the profile index is built per call because profiles arrive with each call and are not known to be equal across calls.
|
|
34
|
+
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources Call-local indexes hold at most P profiles and one prior end per distinct cue language; normalized lines and each runtime iterable live during measurement. Returned cue records share the runtime/profile segmentation identity objects and retain one outcome per cue. There is no cue/text quota, segmentation timeout or iterator cancellation; the runtime owns any resources hidden in its iterable.
|
|
35
|
+
*/
|
|
36
|
+
export declare const inspectAutoMovieCaptionReadabilityWithRuntime: (timeline: IAutoMovieFilmTimeline, profiles: readonly IAutoMovieCaptionReadabilityProfile[], runtime: IAutoMovieCaptionGraphemeRuntime) => IAutoMovieCaptionReadabilityReport;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inspectAutoMovieCaptionReadabilityWithRuntime = void 0;
|
|
4
|
+
const autoMovieCaptionLanguageComparisonKey_1 = require("./autoMovieCaptionLanguageComparisonKey");
|
|
5
|
+
const canonicalizeAutoMovieCaptionText_1 = require("./canonicalizeAutoMovieCaptionText");
|
|
6
|
+
/**
|
|
7
|
+
* Measure caption readability through one injected, identity-bearing runtime
|
|
8
|
+
* and judge each cue against its language's profile.
|
|
9
|
+
*
|
|
10
|
+
* The grapheme runtime is injected because the host owns it: production binds
|
|
11
|
+
* Node's installed `Intl.Segmenter` and reports that exact identity. Each cue is
|
|
12
|
+
* measured on its canonical presentation: graphemes, lines, the longest line,
|
|
13
|
+
* duration, the gap since the previous cue of the same language identity in
|
|
14
|
+
* track order, and graphemes per second at `timeline.fps`. A cue whose language
|
|
15
|
+
* has no profile, or whose profile names a segmentation identity other than the
|
|
16
|
+
* runtime's, keeps its measurement with a `not-run` outcome instead of a
|
|
17
|
+
* verdict. Profiles are matched by ASCII case-insensitive language identity;
|
|
18
|
+
* design validation refuses two profiles for one identity, so none is shadowed.
|
|
19
|
+
* The track must be in start order with positive durations, as film assembly
|
|
20
|
+
* guarantees; a zero-length cue would report an infinite rate.
|
|
21
|
+
*
|
|
22
|
+
* @evidence contracts/development/implementation.md#principled-implementation Graphemes are counted by the injected segmenter rather than by code units, so a combining sequence or emoji counts as one, and the verdict compares each measurement to the profile's boundary with its declared inclusive or exclusive sense; the gap and rate formulas rely on film assembly's sorted, positive-duration cues.
|
|
23
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure Thresholds and identity matching live here, while the runtime binding lives in production's `inspectAutoMovieCaptionReadability`, so the render package stays free of Node globals and a test can inject a fixture runtime through the same seam.
|
|
24
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts An identity mismatch yields `not-run` instead of substituting the resident runtime, and a cue with an unparseable language gets no profile and no gap rather than a guessed language; no profile or cue is special-cased.
|
|
25
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc states why the runtime is injected, every measured quantity and its basis, both `not-run` conditions, how profiles match, and the ordering and duration premises with their failure effect.
|
|
26
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms For C cues, total text length L, profile/cue language length A and G yielded segmentation items, local work is O(C+L+A+G+P) for P profiles, including language parsing, normalization and streamed counts. The injected runtime owns segmentation cost and termination; an arbitrary iterable can yield unbounded items, so text length alone does not bound work.
|
|
27
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work One call measures one timeline once; the profile index is built per call because profiles arrive with each call and are not known to be equal across calls.
|
|
28
|
+
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources Call-local indexes hold at most P profiles and one prior end per distinct cue language; normalized lines and each runtime iterable live during measurement. Returned cue records share the runtime/profile segmentation identity objects and retain one outcome per cue. There is no cue/text quota, segmentation timeout or iterator cancellation; the runtime owns any resources hidden in its iterable.
|
|
29
|
+
*/
|
|
30
|
+
const inspectAutoMovieCaptionReadabilityWithRuntime = (timeline, profiles, runtime) => {
|
|
31
|
+
const profilesByLanguage = new Map();
|
|
32
|
+
for (const profile of profiles) {
|
|
33
|
+
const languageIdentity = (0, autoMovieCaptionLanguageComparisonKey_1.autoMovieCaptionLanguageComparisonKey)(profile.language);
|
|
34
|
+
if (languageIdentity !== null)
|
|
35
|
+
profilesByLanguage.set(languageIdentity, profile);
|
|
36
|
+
}
|
|
37
|
+
const precedingEndByLanguage = new Map();
|
|
38
|
+
return {
|
|
39
|
+
version: 2,
|
|
40
|
+
cues: timeline.tracks.captions.map((cue) => {
|
|
41
|
+
const lines = (0, canonicalizeAutoMovieCaptionText_1.canonicalizeAutoMovieCaptionText)(cue.text).split("\n");
|
|
42
|
+
let graphemes = 0;
|
|
43
|
+
let maxLineGraphemes = 0;
|
|
44
|
+
for (const line of lines) {
|
|
45
|
+
const count = countItems(runtime.segment(line));
|
|
46
|
+
graphemes += count;
|
|
47
|
+
if (count > maxLineGraphemes)
|
|
48
|
+
maxLineGraphemes = count;
|
|
49
|
+
}
|
|
50
|
+
const durationFrames = cue.endFrame - cue.startFrame;
|
|
51
|
+
const languageIdentity = (0, autoMovieCaptionLanguageComparisonKey_1.autoMovieCaptionLanguageComparisonKey)(cue.language);
|
|
52
|
+
const precedingEnd = languageIdentity === null
|
|
53
|
+
? undefined
|
|
54
|
+
: precedingEndByLanguage.get(languageIdentity);
|
|
55
|
+
if (languageIdentity !== null)
|
|
56
|
+
precedingEndByLanguage.set(languageIdentity, cue.endFrame);
|
|
57
|
+
const measurement = {
|
|
58
|
+
cue: cue.id,
|
|
59
|
+
language: cue.language,
|
|
60
|
+
segmentation: runtime.identity,
|
|
61
|
+
graphemes,
|
|
62
|
+
lines: lines.length,
|
|
63
|
+
maxLineGraphemes,
|
|
64
|
+
durationFrames,
|
|
65
|
+
gapBeforeFrames: precedingEnd === undefined ? null : cue.startFrame - precedingEnd,
|
|
66
|
+
graphemesPerSecond: (graphemes * timeline.fps) / durationFrames,
|
|
67
|
+
};
|
|
68
|
+
return {
|
|
69
|
+
measurement,
|
|
70
|
+
outcome: captionReadabilityOutcome(measurement, languageIdentity === null
|
|
71
|
+
? undefined
|
|
72
|
+
: profilesByLanguage.get(languageIdentity), runtime.identity),
|
|
73
|
+
};
|
|
74
|
+
}),
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
exports.inspectAutoMovieCaptionReadabilityWithRuntime = inspectAutoMovieCaptionReadabilityWithRuntime;
|
|
78
|
+
/** Number of items an iterable yields, without materializing them. */
|
|
79
|
+
const countItems = (items) => {
|
|
80
|
+
let count = 0;
|
|
81
|
+
for (const _ of items)
|
|
82
|
+
count += 1;
|
|
83
|
+
return count;
|
|
84
|
+
};
|
|
85
|
+
const captionReadabilityOutcome = (measurement, profile, actualSegmentation) => {
|
|
86
|
+
if (profile === undefined)
|
|
87
|
+
return {
|
|
88
|
+
status: "not-run",
|
|
89
|
+
segmentation: null,
|
|
90
|
+
reason: "caption-readability-profile-not-declared",
|
|
91
|
+
};
|
|
92
|
+
if (sameCaptionGraphemeSegmentationIdentity(profile.segmentation, actualSegmentation) === false)
|
|
93
|
+
return {
|
|
94
|
+
status: "not-run",
|
|
95
|
+
segmentation: profile.segmentation,
|
|
96
|
+
reason: "caption-grapheme-segmentation-unsupported",
|
|
97
|
+
};
|
|
98
|
+
const breaches = [];
|
|
99
|
+
if (maximumBoundaryPassed(measurement.graphemesPerSecond, profile.maxGraphemesPerSecond) === false)
|
|
100
|
+
breaches.push("graphemes-per-second");
|
|
101
|
+
if (maximumBoundaryPassed(measurement.lines, profile.maxLinesPerCue) === false)
|
|
102
|
+
breaches.push("lines-per-cue");
|
|
103
|
+
if (maximumBoundaryPassed(measurement.maxLineGraphemes, profile.maxGraphemesPerLine) === false)
|
|
104
|
+
breaches.push("graphemes-per-line");
|
|
105
|
+
if (minimumBoundaryPassed(measurement.durationFrames, profile.minDurationFrames) === false)
|
|
106
|
+
breaches.push("duration-frames");
|
|
107
|
+
if (measurement.gapBeforeFrames !== null &&
|
|
108
|
+
minimumBoundaryPassed(measurement.gapBeforeFrames, profile.minGapFrames) ===
|
|
109
|
+
false)
|
|
110
|
+
breaches.push("gap-frames");
|
|
111
|
+
return {
|
|
112
|
+
status: "evaluated",
|
|
113
|
+
profile: profile.id,
|
|
114
|
+
segmentation: profile.segmentation,
|
|
115
|
+
passed: breaches.length === 0,
|
|
116
|
+
breaches,
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
const sameCaptionGraphemeSegmentationIdentity = (left, right) => left.algorithm === right.algorithm &&
|
|
120
|
+
left.version === right.version &&
|
|
121
|
+
left.granularity === right.granularity &&
|
|
122
|
+
left.locale.kind === right.locale.kind &&
|
|
123
|
+
(left.locale.kind === "locale-neutral" ||
|
|
124
|
+
(right.locale.kind === "requested-resolved" &&
|
|
125
|
+
left.locale.requested === right.locale.requested &&
|
|
126
|
+
left.locale.resolved === right.locale.resolved));
|
|
127
|
+
const maximumBoundaryPassed = (value, boundary) => boundary.inclusive ? value <= boundary.value : value < boundary.value;
|
|
128
|
+
const minimumBoundaryPassed = (value, boundary) => boundary.inclusive ? value >= boundary.value : value > boundary.value;
|
|
129
|
+
//# sourceMappingURL=inspectAutoMovieCaptionReadabilityWithRuntime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspectAutoMovieCaptionReadabilityWithRuntime.js","sourceRoot":"","sources":["../../src/caption/inspectAutoMovieCaptionReadabilityWithRuntime.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a string can be written verbatim as a WebVTT cue identifier or
|
|
3
|
+
* header text.
|
|
4
|
+
*
|
|
5
|
+
* WebVTT defines no escape for these lines, so a usable value is one or more
|
|
6
|
+
* characters with no CR, no LF, and no `-->`, which a parser would read as a
|
|
7
|
+
* line break or a cue timing line. An empty string is refused because an empty
|
|
8
|
+
* identifier line is a blank line, which drops the cue's id; header text shares
|
|
9
|
+
* the rule, which costs nothing because production design refuses a blank
|
|
10
|
+
* production id. Film assembly additionally refuses whitespace-only cue ids as
|
|
11
|
+
* a product rule.
|
|
12
|
+
*
|
|
13
|
+
* @evidence contracts/development/implementation.md#principled-implementation The predicate is the W3C WebVTT cue identifier production, one or more characters excluding line terminators and the substring `-->`, checked with a length test, one regular expression and one substring search; header text is held to the same production although WebVTT would accept it empty.
|
|
14
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure A pure predicate lets film assembly report a diagnostic while `serializeAutoMovieWebVttIdentifier` throws, both from the one rule.
|
|
15
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Every refused shape comes from the WebVTT grammar; the stricter blank-id rule stays in film assembly, which owns it, instead of being folded in here.
|
|
16
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc lists the refused shapes, why each breaks the file, and which stricter rule a caller adds.
|
|
17
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Both checks are linear scans of the identifier, O(L) with no allocation.
|
|
18
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A stateless predicate over one string has no completed work to share across calls.
|
|
19
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The predicate retains nothing and opens no handle or task.
|
|
20
|
+
*/
|
|
21
|
+
export declare const isAutoMovieWebVttIdentifier: (value: string) => boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isAutoMovieWebVttIdentifier = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Whether a string can be written verbatim as a WebVTT cue identifier or
|
|
6
|
+
* header text.
|
|
7
|
+
*
|
|
8
|
+
* WebVTT defines no escape for these lines, so a usable value is one or more
|
|
9
|
+
* characters with no CR, no LF, and no `-->`, which a parser would read as a
|
|
10
|
+
* line break or a cue timing line. An empty string is refused because an empty
|
|
11
|
+
* identifier line is a blank line, which drops the cue's id; header text shares
|
|
12
|
+
* the rule, which costs nothing because production design refuses a blank
|
|
13
|
+
* production id. Film assembly additionally refuses whitespace-only cue ids as
|
|
14
|
+
* a product rule.
|
|
15
|
+
*
|
|
16
|
+
* @evidence contracts/development/implementation.md#principled-implementation The predicate is the W3C WebVTT cue identifier production, one or more characters excluding line terminators and the substring `-->`, checked with a length test, one regular expression and one substring search; header text is held to the same production although WebVTT would accept it empty.
|
|
17
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure A pure predicate lets film assembly report a diagnostic while `serializeAutoMovieWebVttIdentifier` throws, both from the one rule.
|
|
18
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Every refused shape comes from the WebVTT grammar; the stricter blank-id rule stays in film assembly, which owns it, instead of being folded in here.
|
|
19
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc lists the refused shapes, why each breaks the file, and which stricter rule a caller adds.
|
|
20
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Both checks are linear scans of the identifier, O(L) with no allocation.
|
|
21
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A stateless predicate over one string has no completed work to share across calls.
|
|
22
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The predicate retains nothing and opens no handle or task.
|
|
23
|
+
*/
|
|
24
|
+
const isAutoMovieWebVttIdentifier = (value) => value.length > 0 &&
|
|
25
|
+
/[\r\n]/u.test(value) === false &&
|
|
26
|
+
value.includes("-->") === false;
|
|
27
|
+
exports.isAutoMovieWebVttIdentifier = isAutoMovieWebVttIdentifier;
|
|
28
|
+
//# sourceMappingURL=isAutoMovieWebVttIdentifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isAutoMovieWebVttIdentifier.js","sourceRoot":"","sources":["../../src/caption/isAutoMovieWebVttIdentifier.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACI,MAAM,2BAA2B,GAA+B,CACrE,KAAa,EACJ,EAAE,CACX,KAAK,CAAC,MAAM,GAAG,CAAC;IAChB,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK;IAC/B,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;AALrB,QAAA,2BAA2B,GAA3B,2BAA2B,CAKN"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parsed RFC 5646 caption-language identity.
|
|
3
|
+
*
|
|
4
|
+
* `display` retains the authored spelling. `comparisonKey` folds only ASCII
|
|
5
|
+
* case, as RFC 5646 comparison requires, without consulting a language
|
|
6
|
+
* registry or replacing a tag with a Preferred-Value.
|
|
7
|
+
*/
|
|
8
|
+
interface IAutoMovieCaptionLanguageIdentity {
|
|
9
|
+
/** Authored language tag preserved for display and serialization. */
|
|
10
|
+
display: string;
|
|
11
|
+
/** ASCII case-insensitive identity used by every caption consumer. */
|
|
12
|
+
comparisonKey: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Parse one RFC 5646 well-formed language tag without registry semantics, or
|
|
16
|
+
* return null for a malformed tag.
|
|
17
|
+
*
|
|
18
|
+
* Grandfathered tags are the 26 fixed productions RFC 5646 lists, matched
|
|
19
|
+
* case-insensitively. Every other tag is checked against its `langtag` and
|
|
20
|
+
* `privateuse` grammar, including the uniqueness requirements for variants and
|
|
21
|
+
* extension singletons. Well-formed is the whole admission rule: a tag is never
|
|
22
|
+
* looked up in the IANA registry, so a well-formed but unregistered subtag is
|
|
23
|
+
* accepted.
|
|
24
|
+
*
|
|
25
|
+
* @evidence contracts/development/implementation.md#principled-implementation The parser is a left-to-right recognizer of RFC 5646 section 2.1: after rejecting any character outside letters, digits and hyphens and any subtag outside one to eight characters, it consumes language, up to three extlangs, script, region, unique variants, unique extensions with at least one subtag each, and a private-use tail in grammar order, and accepts only when every subtag is consumed; greedy consumption is exact because the productions at each position differ by length or character class.
|
|
26
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One function owns the grammar for all caption consumers, returning both the authored spelling and the comparison key, so design validation, film assembly, readability and WebVTT serialization cannot disagree about a tag.
|
|
27
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The grandfathered set is the RFC's own fixed list, a contract-defined table, and no registry, Preferred-Value replacement or language inference is applied.
|
|
28
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc states the grandfathered rule, the grammar and uniqueness checks applied, the null result for a malformed tag, and that registry membership is not checked.
|
|
29
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms One pass over at most the tag's subtags with constant-time regular-expression tests per subtag makes the cost linear in the tag length; the two sets hold at most the variants and singletons present.
|
|
30
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pure parse of one short string coordinates no phases, and its callers parse each tag at most a few times per validation.
|
|
31
|
+
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources The subtag array and the two uniqueness sets are released on return; only the module-level grandfathered set and patterns persist, fixed in size.
|
|
32
|
+
*/
|
|
33
|
+
export declare const parseAutoMovieCaptionLanguage: (value: string) => IAutoMovieCaptionLanguageIdentity | null;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseAutoMovieCaptionLanguage = void 0;
|
|
4
|
+
const GRANDFATHERED_LANGUAGE_TAGS = new Set([
|
|
5
|
+
"art-lojban",
|
|
6
|
+
"cel-gaulish",
|
|
7
|
+
"en-gb-oed",
|
|
8
|
+
"i-ami",
|
|
9
|
+
"i-bnn",
|
|
10
|
+
"i-default",
|
|
11
|
+
"i-enochian",
|
|
12
|
+
"i-hak",
|
|
13
|
+
"i-klingon",
|
|
14
|
+
"i-lux",
|
|
15
|
+
"i-mingo",
|
|
16
|
+
"i-navajo",
|
|
17
|
+
"i-pwn",
|
|
18
|
+
"i-tao",
|
|
19
|
+
"i-tay",
|
|
20
|
+
"i-tsu",
|
|
21
|
+
"no-bok",
|
|
22
|
+
"no-nyn",
|
|
23
|
+
"sgn-be-fr",
|
|
24
|
+
"sgn-be-nl",
|
|
25
|
+
"sgn-ch-de",
|
|
26
|
+
"zh-guoyu",
|
|
27
|
+
"zh-hakka",
|
|
28
|
+
"zh-min",
|
|
29
|
+
"zh-min-nan",
|
|
30
|
+
"zh-xiang",
|
|
31
|
+
]);
|
|
32
|
+
const ALPHA = /^[A-Za-z]+$/u;
|
|
33
|
+
const ALPHANUMERIC = /^[A-Za-z0-9]+$/u;
|
|
34
|
+
const DIGIT = /^[0-9]+$/u;
|
|
35
|
+
/**
|
|
36
|
+
* Parse one RFC 5646 well-formed language tag without registry semantics, or
|
|
37
|
+
* return null for a malformed tag.
|
|
38
|
+
*
|
|
39
|
+
* Grandfathered tags are the 26 fixed productions RFC 5646 lists, matched
|
|
40
|
+
* case-insensitively. Every other tag is checked against its `langtag` and
|
|
41
|
+
* `privateuse` grammar, including the uniqueness requirements for variants and
|
|
42
|
+
* extension singletons. Well-formed is the whole admission rule: a tag is never
|
|
43
|
+
* looked up in the IANA registry, so a well-formed but unregistered subtag is
|
|
44
|
+
* accepted.
|
|
45
|
+
*
|
|
46
|
+
* @evidence contracts/development/implementation.md#principled-implementation The parser is a left-to-right recognizer of RFC 5646 section 2.1: after rejecting any character outside letters, digits and hyphens and any subtag outside one to eight characters, it consumes language, up to three extlangs, script, region, unique variants, unique extensions with at least one subtag each, and a private-use tail in grammar order, and accepts only when every subtag is consumed; greedy consumption is exact because the productions at each position differ by length or character class.
|
|
47
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One function owns the grammar for all caption consumers, returning both the authored spelling and the comparison key, so design validation, film assembly, readability and WebVTT serialization cannot disagree about a tag.
|
|
48
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The grandfathered set is the RFC's own fixed list, a contract-defined table, and no registry, Preferred-Value replacement or language inference is applied.
|
|
49
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc states the grandfathered rule, the grammar and uniqueness checks applied, the null result for a malformed tag, and that registry membership is not checked.
|
|
50
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms One pass over at most the tag's subtags with constant-time regular-expression tests per subtag makes the cost linear in the tag length; the two sets hold at most the variants and singletons present.
|
|
51
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pure parse of one short string coordinates no phases, and its callers parse each tag at most a few times per validation.
|
|
52
|
+
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources The subtag array and the two uniqueness sets are released on return; only the module-level grandfathered set and patterns persist, fixed in size.
|
|
53
|
+
*/
|
|
54
|
+
const parseAutoMovieCaptionLanguage = (value) => {
|
|
55
|
+
if (/^[A-Za-z0-9-]+$/u.test(value) === false)
|
|
56
|
+
return null;
|
|
57
|
+
const comparisonKey = value.toLowerCase();
|
|
58
|
+
if (GRANDFATHERED_LANGUAGE_TAGS.has(comparisonKey))
|
|
59
|
+
return { display: value, comparisonKey };
|
|
60
|
+
const subtags = value.split("-");
|
|
61
|
+
if (subtags.some((subtag) => subtag.length === 0 ||
|
|
62
|
+
subtag.length > 8 ||
|
|
63
|
+
ALPHANUMERIC.test(subtag) === false))
|
|
64
|
+
return null;
|
|
65
|
+
if (subtags[0].toLowerCase() === "x")
|
|
66
|
+
return subtags.length > 1 ? { display: value, comparisonKey } : null;
|
|
67
|
+
let index = 0;
|
|
68
|
+
const language = subtags[index++];
|
|
69
|
+
if (ALPHA.test(language) === false || language.length < 2)
|
|
70
|
+
return null;
|
|
71
|
+
if (language.length <= 3) {
|
|
72
|
+
for (let extlangCount = 0; extlangCount < 3 &&
|
|
73
|
+
index < subtags.length &&
|
|
74
|
+
subtags[index].length === 3 &&
|
|
75
|
+
ALPHA.test(subtags[index]); extlangCount += 1)
|
|
76
|
+
index += 1;
|
|
77
|
+
}
|
|
78
|
+
if (index < subtags.length &&
|
|
79
|
+
subtags[index].length === 4 &&
|
|
80
|
+
ALPHA.test(subtags[index]))
|
|
81
|
+
index += 1;
|
|
82
|
+
if (index < subtags.length &&
|
|
83
|
+
((subtags[index].length === 2 && ALPHA.test(subtags[index])) ||
|
|
84
|
+
(subtags[index].length === 3 && DIGIT.test(subtags[index]))))
|
|
85
|
+
index += 1;
|
|
86
|
+
const variants = new Set();
|
|
87
|
+
while (index < subtags.length && isVariant(subtags[index])) {
|
|
88
|
+
const variant = subtags[index].toLowerCase();
|
|
89
|
+
if (variants.has(variant))
|
|
90
|
+
return null;
|
|
91
|
+
variants.add(variant);
|
|
92
|
+
index += 1;
|
|
93
|
+
}
|
|
94
|
+
const singletons = new Set();
|
|
95
|
+
while (index < subtags.length && isExtensionSingleton(subtags[index])) {
|
|
96
|
+
const singleton = subtags[index].toLowerCase();
|
|
97
|
+
if (singletons.has(singleton))
|
|
98
|
+
return null;
|
|
99
|
+
singletons.add(singleton);
|
|
100
|
+
index += 1;
|
|
101
|
+
const firstExtensionSubtag = index;
|
|
102
|
+
while (index < subtags.length &&
|
|
103
|
+
subtags[index].length >= 2 &&
|
|
104
|
+
subtags[index].length <= 8)
|
|
105
|
+
index += 1;
|
|
106
|
+
if (index === firstExtensionSubtag)
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
if (index < subtags.length && subtags[index].toLowerCase() === "x") {
|
|
110
|
+
index += 1;
|
|
111
|
+
if (index === subtags.length)
|
|
112
|
+
return null;
|
|
113
|
+
index = subtags.length;
|
|
114
|
+
}
|
|
115
|
+
return index === subtags.length ? { display: value, comparisonKey } : null;
|
|
116
|
+
};
|
|
117
|
+
exports.parseAutoMovieCaptionLanguage = parseAutoMovieCaptionLanguage;
|
|
118
|
+
const isVariant = (value) => (value.length >= 5 && value.length <= 8) ||
|
|
119
|
+
(value.length === 4 && DIGIT.test(value[0]));
|
|
120
|
+
const isExtensionSingleton = (value) => value.length === 1 && /^[0-9A-WY-Za-wy-z]$/u.test(value);
|
|
121
|
+
//# sourceMappingURL=parseAutoMovieCaptionLanguage.js.map
|