@tscaps/engine 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -10
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/bidi/BidiAnalyzer.d.ts +23 -0
- package/dist/modules/bidi/BidiAnalyzer.d.ts.map +1 -0
- package/dist/modules/bidi/BidiAnalyzer.js +2 -0
- package/dist/modules/bidi/BidiAnalyzer.js.map +1 -0
- package/dist/modules/bidi/BidiCharacterClassifier.d.ts +13 -0
- package/dist/modules/bidi/BidiCharacterClassifier.d.ts.map +1 -0
- package/dist/modules/bidi/BidiCharacterClassifier.js +2 -0
- package/dist/modules/bidi/BidiCharacterClassifier.js.map +1 -0
- package/dist/modules/bidi/BidiJsAnalyzer.d.ts +14 -0
- package/dist/modules/bidi/BidiJsAnalyzer.d.ts.map +1 -0
- package/dist/modules/bidi/BidiJsAnalyzer.js +19 -0
- package/dist/modules/bidi/BidiJsAnalyzer.js.map +1 -0
- package/dist/modules/bidi/BidiJsCharacterClassifier.d.ts +8 -0
- package/dist/modules/bidi/BidiJsCharacterClassifier.d.ts.map +1 -0
- package/dist/modules/bidi/BidiJsCharacterClassifier.js +19 -0
- package/dist/modules/bidi/BidiJsCharacterClassifier.js.map +1 -0
- package/dist/modules/bidi/CursiveScriptDetector.d.ts +12 -0
- package/dist/modules/bidi/CursiveScriptDetector.d.ts.map +1 -0
- package/dist/modules/bidi/CursiveScriptDetector.js +20 -0
- package/dist/modules/bidi/CursiveScriptDetector.js.map +1 -0
- package/dist/modules/bidi/HorizontalSide.d.ts +18 -0
- package/dist/modules/bidi/HorizontalSide.d.ts.map +1 -0
- package/dist/modules/bidi/HorizontalSide.js +3 -0
- package/dist/modules/bidi/HorizontalSide.js.map +1 -0
- package/dist/modules/bidi/HorizontalSideResolver.d.ts +21 -0
- package/dist/modules/bidi/HorizontalSideResolver.d.ts.map +1 -0
- package/dist/modules/bidi/HorizontalSideResolver.js +27 -0
- package/dist/modules/bidi/HorizontalSideResolver.js.map +1 -0
- package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.d.ts +24 -0
- package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.d.ts.map +1 -0
- package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.js +34 -0
- package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.js.map +1 -0
- package/dist/modules/bidi/TextDirection.d.ts +9 -0
- package/dist/modules/bidi/TextDirection.d.ts.map +1 -0
- package/dist/modules/bidi/TextDirection.js +2 -0
- package/dist/modules/bidi/TextDirection.js.map +1 -0
- package/dist/modules/bidi/TextDirectionDetector.d.ts +12 -0
- package/dist/modules/bidi/TextDirectionDetector.d.ts.map +1 -0
- package/dist/modules/bidi/TextDirectionDetector.js +2 -0
- package/dist/modules/bidi/TextDirectionDetector.js.map +1 -0
- package/dist/modules/bidi/WordFragment.d.ts +34 -0
- package/dist/modules/bidi/WordFragment.d.ts.map +1 -0
- package/dist/modules/bidi/WordFragment.js +2 -0
- package/dist/modules/bidi/WordFragment.js.map +1 -0
- package/dist/modules/bidi/WordFragmenter.d.ts +43 -0
- package/dist/modules/bidi/WordFragmenter.d.ts.map +1 -0
- package/dist/modules/bidi/WordFragmenter.js +112 -0
- package/dist/modules/bidi/WordFragmenter.js.map +1 -0
- package/dist/modules/bidi/index.d.ts +14 -0
- package/dist/modules/bidi/index.d.ts.map +1 -0
- package/dist/modules/bidi/index.js +8 -0
- package/dist/modules/bidi/index.js.map +1 -0
- package/dist/modules/css/CssBlockSealer.d.ts +30 -0
- package/dist/modules/css/CssBlockSealer.d.ts.map +1 -0
- package/dist/modules/css/CssBlockSealer.js +64 -0
- package/dist/modules/css/CssBlockSealer.js.map +1 -0
- package/dist/modules/css/CssCustomPropertyDefinitionScanner.d.ts +13 -0
- package/dist/modules/css/CssCustomPropertyDefinitionScanner.d.ts.map +1 -0
- package/dist/modules/css/CssCustomPropertyDefinitionScanner.js +24 -0
- package/dist/modules/css/CssCustomPropertyDefinitionScanner.js.map +1 -0
- package/dist/modules/css/CssFilterReferenceScanner.d.ts +15 -0
- package/dist/modules/css/CssFilterReferenceScanner.d.ts.map +1 -0
- package/dist/modules/css/CssFilterReferenceScanner.js +22 -0
- package/dist/modules/css/CssFilterReferenceScanner.js.map +1 -0
- package/dist/modules/css/CssFragmentParser.d.ts +53 -0
- package/dist/modules/css/CssFragmentParser.d.ts.map +1 -0
- package/dist/modules/css/CssFragmentParser.js +127 -0
- package/dist/modules/css/CssFragmentParser.js.map +1 -0
- package/dist/modules/css/CssKeyframeNamespacer.d.ts +21 -0
- package/dist/modules/css/CssKeyframeNamespacer.d.ts.map +1 -0
- package/dist/modules/css/CssKeyframeNamespacer.js +48 -0
- package/dist/modules/css/CssKeyframeNamespacer.js.map +1 -0
- package/dist/modules/css/CssKeyframesScanner.d.ts +29 -0
- package/dist/modules/css/CssKeyframesScanner.d.ts.map +1 -0
- package/dist/modules/css/CssKeyframesScanner.js +102 -0
- package/dist/modules/css/CssKeyframesScanner.js.map +1 -0
- package/dist/modules/css/CssLayer.d.ts +20 -0
- package/dist/modules/css/CssLayer.d.ts.map +1 -0
- package/dist/modules/css/CssLayer.js +21 -0
- package/dist/modules/css/CssLayer.js.map +1 -0
- package/dist/modules/css/CssScoper.d.ts +31 -2
- package/dist/modules/css/CssScoper.d.ts.map +1 -1
- package/dist/modules/css/CssScoper.js +168 -79
- package/dist/modules/css/CssScoper.js.map +1 -1
- package/dist/modules/css/CssSelectorClassScanner.d.ts +25 -0
- package/dist/modules/css/CssSelectorClassScanner.d.ts.map +1 -0
- package/dist/modules/css/CssSelectorClassScanner.js +91 -0
- package/dist/modules/css/CssSelectorClassScanner.js.map +1 -0
- package/dist/modules/css/CssVarReferenceScanner.d.ts +16 -0
- package/dist/modules/css/CssVarReferenceScanner.d.ts.map +1 -0
- package/dist/modules/css/CssVarReferenceScanner.js +27 -0
- package/dist/modules/css/CssVarReferenceScanner.js.map +1 -0
- package/dist/modules/css/index.d.ts +9 -0
- package/dist/modules/css/index.d.ts.map +1 -1
- package/dist/modules/css/index.js +9 -0
- package/dist/modules/css/index.js.map +1 -1
- package/dist/modules/document/CssClass.d.ts +20 -0
- package/dist/modules/document/CssClass.d.ts.map +1 -0
- package/dist/modules/document/CssClass.js +21 -0
- package/dist/modules/document/CssClass.js.map +1 -0
- package/dist/modules/document/CssVariable.d.ts +21 -6
- package/dist/modules/document/CssVariable.d.ts.map +1 -1
- package/dist/modules/document/CssVariable.js +27 -5
- package/dist/modules/document/CssVariable.js.map +1 -1
- package/dist/modules/document/DataAttribute.d.ts +26 -0
- package/dist/modules/document/DataAttribute.d.ts.map +1 -0
- package/dist/modules/document/DataAttribute.js +27 -0
- package/dist/modules/document/DataAttribute.js.map +1 -0
- package/dist/modules/document/Decoration.d.ts +42 -0
- package/dist/modules/document/Decoration.d.ts.map +1 -0
- package/dist/modules/document/Decoration.js +52 -0
- package/dist/modules/document/Decoration.js.map +1 -0
- package/dist/modules/document/Document.d.ts.map +1 -1
- package/dist/modules/document/Document.js +0 -3
- package/dist/modules/document/Document.js.map +1 -1
- package/dist/modules/document/DocumentEditor.d.ts +51 -9
- package/dist/modules/document/DocumentEditor.d.ts.map +1 -1
- package/dist/modules/document/DocumentEditor.js +118 -26
- package/dist/modules/document/DocumentEditor.js.map +1 -1
- package/dist/modules/document/DocumentNodeId.d.ts +23 -0
- package/dist/modules/document/DocumentNodeId.d.ts.map +1 -0
- package/dist/modules/document/DocumentNodeId.js +31 -0
- package/dist/modules/document/DocumentNodeId.js.map +1 -0
- package/dist/modules/document/Line.d.ts +10 -7
- package/dist/modules/document/Line.d.ts.map +1 -1
- package/dist/modules/document/Line.js +13 -25
- package/dist/modules/document/Line.js.map +1 -1
- package/dist/modules/document/Section.d.ts +1 -8
- package/dist/modules/document/Section.d.ts.map +1 -1
- package/dist/modules/document/Section.js +4 -35
- package/dist/modules/document/Section.js.map +1 -1
- package/dist/modules/document/Segment.d.ts +24 -14
- package/dist/modules/document/Segment.d.ts.map +1 -1
- package/dist/modules/document/Segment.js +41 -23
- package/dist/modules/document/Segment.js.map +1 -1
- package/dist/modules/document/Word.d.ts +21 -8
- package/dist/modules/document/Word.d.ts.map +1 -1
- package/dist/modules/document/Word.js +34 -35
- package/dist/modules/document/Word.js.map +1 -1
- package/dist/modules/document/index.d.ts +5 -2
- package/dist/modules/document/index.d.ts.map +1 -1
- package/dist/modules/document/index.js +4 -1
- package/dist/modules/document/index.js.map +1 -1
- package/dist/modules/effect/CarryQuotesEffect.d.ts +1 -7
- package/dist/modules/effect/CarryQuotesEffect.d.ts.map +1 -1
- package/dist/modules/effect/CarryQuotesEffect.js +17 -30
- package/dist/modules/effect/CarryQuotesEffect.js.map +1 -1
- package/dist/modules/effect/GapFreeEffect.d.ts +15 -0
- package/dist/modules/effect/GapFreeEffect.d.ts.map +1 -1
- package/dist/modules/effect/GapFreeEffect.js +29 -4
- package/dist/modules/effect/GapFreeEffect.js.map +1 -1
- package/dist/modules/effect/RemovePunctuationEffect.d.ts +10 -2
- package/dist/modules/effect/RemovePunctuationEffect.d.ts.map +1 -1
- package/dist/modules/effect/RemovePunctuationEffect.js +26 -6
- package/dist/modules/effect/RemovePunctuationEffect.js.map +1 -1
- package/dist/modules/effect/SmartLowercaseEffect.d.ts +7 -6
- package/dist/modules/effect/SmartLowercaseEffect.d.ts.map +1 -1
- package/dist/modules/effect/SmartLowercaseEffect.js +11 -7
- package/dist/modules/effect/SmartLowercaseEffect.js.map +1 -1
- package/dist/modules/pipeline/RenderPipelineBuilder.d.ts +3 -3
- package/dist/modules/pipeline/RenderPipelineBuilder.d.ts.map +1 -1
- package/dist/modules/pipeline/RenderPipelineBuilder.js +13 -8
- package/dist/modules/pipeline/RenderPipelineBuilder.js.map +1 -1
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.d.ts +19 -25
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.d.ts.map +1 -1
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js +43 -717
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js.map +1 -1
- package/dist/modules/rendering/HorizontalPlacementResolver.d.ts +27 -0
- package/dist/modules/rendering/HorizontalPlacementResolver.d.ts.map +1 -0
- package/dist/modules/rendering/HorizontalPlacementResolver.js +31 -0
- package/dist/modules/rendering/HorizontalPlacementResolver.js.map +1 -0
- package/dist/modules/rendering/SubtitleFrameRenderer.d.ts +10 -5
- package/dist/modules/rendering/SubtitleFrameRenderer.d.ts.map +1 -1
- package/dist/modules/rendering/index.d.ts +16 -8
- package/dist/modules/rendering/index.d.ts.map +1 -1
- package/dist/modules/rendering/index.js +8 -2
- package/dist/modules/rendering/index.js.map +1 -1
- package/dist/modules/rendering/styles/BaselineCssComposer.d.ts +41 -0
- package/dist/modules/rendering/styles/BaselineCssComposer.d.ts.map +1 -0
- package/dist/modules/rendering/styles/BaselineCssComposer.js +64 -0
- package/dist/modules/rendering/styles/BaselineCssComposer.js.map +1 -0
- package/dist/modules/rendering/styles/DecorationContainerBaselineCss.d.ts +7 -0
- package/dist/modules/rendering/styles/DecorationContainerBaselineCss.d.ts.map +1 -0
- package/dist/modules/rendering/styles/DecorationContainerBaselineCss.js +35 -0
- package/dist/modules/rendering/styles/DecorationContainerBaselineCss.js.map +1 -0
- package/dist/modules/rendering/styles/FrozenFrameCss.d.ts +28 -0
- package/dist/modules/rendering/styles/FrozenFrameCss.d.ts.map +1 -0
- package/dist/modules/rendering/styles/FrozenFrameCss.js +28 -0
- package/dist/modules/rendering/styles/FrozenFrameCss.js.map +1 -0
- package/dist/modules/rendering/styles/InlineStyleEmitter.d.ts +20 -0
- package/dist/modules/rendering/styles/InlineStyleEmitter.d.ts.map +1 -0
- package/dist/modules/rendering/styles/InlineStyleEmitter.js +44 -0
- package/dist/modules/rendering/styles/InlineStyleEmitter.js.map +1 -0
- package/dist/modules/rendering/styles/SegmentPaddingCssRuleBuilder.d.ts +15 -0
- package/dist/modules/rendering/styles/SegmentPaddingCssRuleBuilder.d.ts.map +1 -0
- package/dist/modules/rendering/styles/SegmentPaddingCssRuleBuilder.js +33 -0
- package/dist/modules/rendering/styles/SegmentPaddingCssRuleBuilder.js.map +1 -0
- package/dist/modules/rendering/{VideoFrameLayerClass.d.ts → styles/VideoFrameLayerBaselineCss.d.ts} +3 -10
- package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.d.ts.map +1 -0
- package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.js +15 -0
- package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.js.map +1 -0
- package/dist/modules/rendering/subtitle/AbstractAnim.d.ts +13 -0
- package/dist/modules/rendering/subtitle/AbstractAnim.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/AbstractAnim.js +2 -0
- package/dist/modules/rendering/subtitle/AbstractAnim.js.map +1 -0
- package/dist/modules/rendering/subtitle/ActiveRenderSession.d.ts +20 -0
- package/dist/modules/rendering/subtitle/ActiveRenderSession.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/ActiveRenderSession.js +31 -0
- package/dist/modules/rendering/subtitle/ActiveRenderSession.js.map +1 -0
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.d.ts +21 -0
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.js +46 -0
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.js.map +1 -0
- package/dist/modules/rendering/subtitle/AnimationProbe.d.ts +39 -0
- package/dist/modules/rendering/subtitle/AnimationProbe.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/AnimationProbe.js +203 -0
- package/dist/modules/rendering/subtitle/AnimationProbe.js.map +1 -0
- package/dist/modules/rendering/subtitle/AssetGroupBuilder.d.ts +15 -0
- package/dist/modules/rendering/subtitle/AssetGroupBuilder.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/AssetGroupBuilder.js +26 -0
- package/dist/modules/rendering/subtitle/AssetGroupBuilder.js.map +1 -0
- package/dist/modules/rendering/subtitle/BatchPlan.d.ts +32 -0
- package/dist/modules/rendering/subtitle/BatchPlan.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/BatchPlan.js +2 -0
- package/dist/modules/rendering/subtitle/BatchPlan.js.map +1 -0
- package/dist/modules/rendering/subtitle/BatchPlanner.d.ts +32 -0
- package/dist/modules/rendering/subtitle/BatchPlanner.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/BatchPlanner.js +93 -0
- package/dist/modules/rendering/subtitle/BatchPlanner.js.map +1 -0
- package/dist/modules/rendering/subtitle/PreparedStyle.d.ts +36 -0
- package/dist/modules/rendering/subtitle/PreparedStyle.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/PreparedStyle.js +2 -0
- package/dist/modules/rendering/subtitle/PreparedStyle.js.map +1 -0
- package/dist/modules/rendering/subtitle/PreparedStyleFactory.d.ts +31 -0
- package/dist/modules/rendering/subtitle/PreparedStyleFactory.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/PreparedStyleFactory.js +91 -0
- package/dist/modules/rendering/subtitle/PreparedStyleFactory.js.map +1 -0
- package/dist/modules/rendering/subtitle/SegmentPaintRegionCache.d.ts +13 -0
- package/dist/modules/rendering/subtitle/SegmentPaintRegionCache.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SegmentPaintRegionCache.js +24 -0
- package/dist/modules/rendering/subtitle/SegmentPaintRegionCache.js.map +1 -0
- package/dist/modules/rendering/{SegmentPaintRegionResolver.d.ts → subtitle/SegmentPaintRegionResolver.d.ts} +1 -1
- package/dist/modules/rendering/subtitle/SegmentPaintRegionResolver.d.ts.map +1 -0
- package/dist/modules/rendering/{SegmentPaintRegionResolver.js → subtitle/SegmentPaintRegionResolver.js} +7 -4
- package/dist/modules/rendering/subtitle/SegmentPaintRegionResolver.js.map +1 -0
- package/dist/modules/rendering/subtitle/SegmentSubtreeDecomposer.d.ts +45 -0
- package/dist/modules/rendering/subtitle/SegmentSubtreeDecomposer.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SegmentSubtreeDecomposer.js +50 -0
- package/dist/modules/rendering/subtitle/SegmentSubtreeDecomposer.js.map +1 -0
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.d.ts +108 -0
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.js +246 -0
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.js.map +1 -0
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.d.ts +40 -0
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.js +132 -0
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.js.map +1 -0
- package/dist/modules/rendering/subtitle/SpriteSheetCompositor.d.ts +48 -0
- package/dist/modules/rendering/subtitle/SpriteSheetCompositor.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SpriteSheetCompositor.js +143 -0
- package/dist/modules/rendering/subtitle/SpriteSheetCompositor.js.map +1 -0
- package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.d.ts +17 -0
- package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.js +58 -0
- package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.js.map +1 -0
- package/dist/modules/rendering/subtitle/SvgFilterMaterializer.d.ts +20 -0
- package/dist/modules/rendering/subtitle/SvgFilterMaterializer.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SvgFilterMaterializer.js +30 -0
- package/dist/modules/rendering/subtitle/SvgFilterMaterializer.js.map +1 -0
- package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.d.ts +42 -0
- package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.js +121 -0
- package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.js.map +1 -0
- package/dist/modules/rendering/types/AlignmentConfig.d.ts +33 -0
- package/dist/modules/rendering/types/AlignmentConfig.d.ts.map +1 -0
- package/dist/modules/rendering/types/AlignmentConfig.js +3 -0
- package/dist/modules/rendering/types/AlignmentConfig.js.map +1 -0
- package/dist/modules/rendering/types/BoxEdges.d.ts.map +1 -0
- package/dist/modules/rendering/types/BoxEdges.js.map +1 -0
- package/dist/modules/rendering/types/DecorationPlacementSide.d.ts +8 -0
- package/dist/modules/rendering/types/DecorationPlacementSide.d.ts.map +1 -0
- package/dist/modules/rendering/types/DecorationPlacementSide.js +2 -0
- package/dist/modules/rendering/types/DecorationPlacementSide.js.map +1 -0
- package/dist/modules/rendering/types/ElementRenderOverrides.d.ts +23 -0
- package/dist/modules/rendering/types/ElementRenderOverrides.d.ts.map +1 -0
- package/dist/modules/rendering/types/ElementRenderOverrides.js +52 -0
- package/dist/modules/rendering/types/ElementRenderOverrides.js.map +1 -0
- package/dist/modules/rendering/types/InlineStyleMap.d.ts.map +1 -0
- package/dist/modules/rendering/types/InlineStyleMap.js.map +1 -0
- package/dist/modules/rendering/{RenderingConfig.d.ts → types/RenderingConfig.d.ts} +8 -1
- package/dist/modules/rendering/types/RenderingConfig.d.ts.map +1 -0
- package/dist/modules/rendering/types/RenderingConfig.js.map +1 -0
- package/dist/modules/rendering/types/ScopedRenderOverride.d.ts +24 -0
- package/dist/modules/rendering/types/ScopedRenderOverride.d.ts.map +1 -0
- package/dist/modules/rendering/types/ScopedRenderOverride.js.map +1 -0
- package/dist/modules/rendering/types/VideoFrameSource.d.ts.map +1 -0
- package/dist/modules/rendering/types/VideoFrameSource.js.map +1 -0
- package/dist/modules/splitting/BoundaryScoreLimitByCharsSegmentSplitter.d.ts +33 -0
- package/dist/modules/splitting/BoundaryScoreLimitByCharsSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/BoundaryScoreLimitByCharsSegmentSplitter.js +100 -0
- package/dist/modules/splitting/BoundaryScoreLimitByCharsSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/FixedTailLineSplitter.d.ts +29 -0
- package/dist/modules/splitting/FixedTailLineSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/FixedTailLineSplitter.js +43 -0
- package/dist/modules/splitting/FixedTailLineSplitter.js.map +1 -0
- package/dist/modules/splitting/index.d.ts +4 -0
- package/dist/modules/splitting/index.d.ts.map +1 -1
- package/dist/modules/splitting/index.js +2 -0
- package/dist/modules/splitting/index.js.map +1 -1
- package/dist/modules/subtitle-file/AssSubtitleFileSerializer.d.ts +53 -0
- package/dist/modules/subtitle-file/AssSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/AssSubtitleFileSerializer.js +133 -0
- package/dist/modules/subtitle-file/AssSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.d.ts +20 -0
- package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.js +31 -0
- package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.d.ts +21 -0
- package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.js +33 -0
- package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleCue.d.ts +18 -0
- package/dist/modules/subtitle-file/SubtitleCue.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleCue.js +20 -0
- package/dist/modules/subtitle-file/SubtitleCue.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleCueBuilder.d.ts +38 -0
- package/dist/modules/subtitle-file/SubtitleCueBuilder.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleCueBuilder.js +106 -0
- package/dist/modules/subtitle-file/SubtitleCueBuilder.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleFileJob.d.ts +17 -0
- package/dist/modules/subtitle-file/SubtitleFileJob.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleFileJob.js +2 -0
- package/dist/modules/subtitle-file/SubtitleFileJob.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleFileSerializer.d.ts +36 -0
- package/dist/modules/subtitle-file/SubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleFileSerializer.js +44 -0
- package/dist/modules/subtitle-file/SubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleGranularity.d.ts +11 -0
- package/dist/modules/subtitle-file/SubtitleGranularity.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleGranularity.js +2 -0
- package/dist/modules/subtitle-file/SubtitleGranularity.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleRow.d.ts +11 -0
- package/dist/modules/subtitle-file/SubtitleRow.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleRow.js +14 -0
- package/dist/modules/subtitle-file/SubtitleRow.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleToken.d.ts +13 -0
- package/dist/modules/subtitle-file/SubtitleToken.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleToken.js +15 -0
- package/dist/modules/subtitle-file/SubtitleToken.js.map +1 -0
- package/dist/modules/subtitle-file/TextSubtitleFileSerializer.d.ts +19 -0
- package/dist/modules/subtitle-file/TextSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/TextSubtitleFileSerializer.js +24 -0
- package/dist/modules/subtitle-file/TextSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/Timecode.d.ts +20 -0
- package/dist/modules/subtitle-file/Timecode.d.ts.map +1 -0
- package/dist/modules/subtitle-file/Timecode.js +32 -0
- package/dist/modules/subtitle-file/Timecode.js.map +1 -0
- package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.d.ts +22 -0
- package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.js +57 -0
- package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/VttSubtitleFileSerializer.d.ts +21 -0
- package/dist/modules/subtitle-file/VttSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/VttSubtitleFileSerializer.js +39 -0
- package/dist/modules/subtitle-file/VttSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/index.d.ts +10 -0
- package/dist/modules/subtitle-file/index.d.ts.map +1 -0
- package/dist/modules/subtitle-file/index.js +8 -0
- package/dist/modules/subtitle-file/index.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilter.d.ts +8 -1
- package/dist/modules/svg-filter/SvgFilter.d.ts.map +1 -1
- package/dist/modules/svg-filter/SvgFilter.js +9 -1
- package/dist/modules/svg-filter/SvgFilter.js.map +1 -1
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts +1 -0
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts.map +1 -1
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js +9 -1
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js.map +1 -1
- package/dist/modules/svg-filter/SvgFilterDefsRenderer.d.ts +44 -0
- package/dist/modules/svg-filter/SvgFilterDefsRenderer.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterDefsRenderer.js +47 -0
- package/dist/modules/svg-filter/SvgFilterDefsRenderer.js.map +1 -0
- package/dist/modules/svg-filter/index.d.ts +2 -0
- package/dist/modules/svg-filter/index.d.ts.map +1 -1
- package/dist/modules/svg-filter/index.js +1 -0
- package/dist/modules/svg-filter/index.js.map +1 -1
- package/dist/modules/tagging/PauseTagger.d.ts +24 -0
- package/dist/modules/tagging/PauseTagger.d.ts.map +1 -0
- package/dist/modules/tagging/PauseTagger.js +42 -0
- package/dist/modules/tagging/PauseTagger.js.map +1 -0
- package/dist/modules/tagging/RegexTagger.js +1 -1
- package/dist/modules/tagging/RegexTagger.js.map +1 -1
- package/dist/modules/tagging/SpanTagger.js +1 -1
- package/dist/modules/tagging/SpanTagger.js.map +1 -1
- package/dist/modules/tagging/StructureTagger.d.ts +1 -2
- package/dist/modules/tagging/StructureTagger.d.ts.map +1 -1
- package/dist/modules/tagging/StructureTagger.js +12 -11
- package/dist/modules/tagging/StructureTagger.js.map +1 -1
- package/dist/modules/tagging/WordlistTagger.js +1 -1
- package/dist/modules/tagging/WordlistTagger.js.map +1 -1
- package/dist/modules/tagging/index.d.ts +2 -0
- package/dist/modules/tagging/index.d.ts.map +1 -1
- package/dist/modules/tagging/index.js +1 -0
- package/dist/modules/tagging/index.js.map +1 -1
- package/dist/modules/tags/AndTagCondition.d.ts +10 -0
- package/dist/modules/tags/AndTagCondition.d.ts.map +1 -0
- package/dist/modules/tags/AndTagCondition.js +14 -0
- package/dist/modules/tags/AndTagCondition.js.map +1 -0
- package/dist/modules/tags/HasTagCondition.d.ts +10 -0
- package/dist/modules/tags/HasTagCondition.d.ts.map +1 -0
- package/dist/modules/tags/HasTagCondition.js +18 -0
- package/dist/modules/tags/HasTagCondition.js.map +1 -0
- package/dist/modules/tags/NotTagCondition.d.ts +10 -0
- package/dist/modules/tags/NotTagCondition.d.ts.map +1 -0
- package/dist/modules/tags/NotTagCondition.js +14 -0
- package/dist/modules/tags/NotTagCondition.js.map +1 -0
- package/dist/modules/tags/OrTagCondition.d.ts +10 -0
- package/dist/modules/tags/OrTagCondition.d.ts.map +1 -0
- package/dist/modules/tags/OrTagCondition.js +14 -0
- package/dist/modules/tags/OrTagCondition.js.map +1 -0
- package/dist/modules/{document/Tag.d.ts → tags/StructureTag.d.ts} +4 -10
- package/dist/modules/tags/StructureTag.d.ts.map +1 -0
- package/dist/modules/{document/Tag.js → tags/StructureTag.js} +4 -19
- package/dist/modules/tags/StructureTag.js.map +1 -0
- package/dist/modules/tags/Tag.d.ts +8 -0
- package/dist/modules/tags/Tag.d.ts.map +1 -0
- package/dist/modules/tags/Tag.js +16 -0
- package/dist/modules/tags/Tag.js.map +1 -0
- package/dist/modules/tags/TagCondition.d.ts +12 -0
- package/dist/modules/tags/TagCondition.d.ts.map +1 -0
- package/dist/modules/tags/TagCondition.js +2 -0
- package/dist/modules/tags/TagCondition.js.map +1 -0
- package/dist/modules/tags/TagConditionParser.d.ts +21 -0
- package/dist/modules/tags/TagConditionParser.d.ts.map +1 -0
- package/dist/modules/tags/TagConditionParser.js +75 -0
- package/dist/modules/tags/TagConditionParser.js.map +1 -0
- package/dist/modules/tags/index.d.ts +9 -0
- package/dist/modules/tags/index.d.ts.map +1 -0
- package/dist/modules/tags/index.js +8 -0
- package/dist/modules/tags/index.js.map +1 -0
- package/dist/modules/transcription/AudioDecoder.d.ts +9 -4
- package/dist/modules/transcription/AudioDecoder.d.ts.map +1 -1
- package/dist/modules/transcription/BatchedMonoResampler.d.ts +45 -0
- package/dist/modules/transcription/BatchedMonoResampler.d.ts.map +1 -0
- package/dist/modules/transcription/BatchedMonoResampler.js +116 -0
- package/dist/modules/transcription/BatchedMonoResampler.js.map +1 -0
- package/dist/modules/transcription/CacheStorageModelFileCache.d.ts +38 -0
- package/dist/modules/transcription/CacheStorageModelFileCache.d.ts.map +1 -0
- package/dist/modules/transcription/CacheStorageModelFileCache.js +86 -0
- package/dist/modules/transcription/CacheStorageModelFileCache.js.map +1 -0
- package/dist/modules/transcription/CueDocumentBuilder.d.ts +40 -0
- package/dist/modules/transcription/CueDocumentBuilder.d.ts.map +1 -0
- package/dist/modules/transcription/CueDocumentBuilder.js +77 -0
- package/dist/modules/transcription/CueDocumentBuilder.js.map +1 -0
- package/dist/modules/transcription/CueParseResult.d.ts +16 -0
- package/dist/modules/transcription/CueParseResult.d.ts.map +1 -0
- package/dist/modules/transcription/CueParseResult.js +2 -0
- package/dist/modules/transcription/CueParseResult.js.map +1 -0
- package/dist/modules/transcription/CueTextTokenizer.d.ts +10 -0
- package/dist/modules/transcription/CueTextTokenizer.d.ts.map +1 -0
- package/dist/modules/transcription/CueTextTokenizer.js +21 -0
- package/dist/modules/transcription/CueTextTokenizer.js.map +1 -0
- package/dist/modules/transcription/CueTimecodeReader.d.ts +19 -0
- package/dist/modules/transcription/CueTimecodeReader.d.ts.map +1 -0
- package/dist/modules/transcription/CueTimecodeReader.js +45 -0
- package/dist/modules/transcription/CueTimecodeReader.js.map +1 -0
- package/dist/modules/transcription/CueWordReader.d.ts +12 -0
- package/dist/modules/transcription/CueWordReader.d.ts.map +1 -0
- package/dist/modules/transcription/CueWordReader.js +2 -0
- package/dist/modules/transcription/CueWordReader.js.map +1 -0
- package/dist/modules/transcription/EstimatedCueWordReader.d.ts +16 -0
- package/dist/modules/transcription/EstimatedCueWordReader.d.ts.map +1 -0
- package/dist/modules/transcription/EstimatedCueWordReader.js +17 -0
- package/dist/modules/transcription/EstimatedCueWordReader.js.map +1 -0
- package/dist/modules/transcription/LogitsProcessorListFactory.d.ts +43 -0
- package/dist/modules/transcription/LogitsProcessorListFactory.d.ts.map +1 -0
- package/dist/modules/transcription/LogitsProcessorListFactory.js +72 -0
- package/dist/modules/transcription/LogitsProcessorListFactory.js.map +1 -0
- package/dist/modules/transcription/MediaBunnyAudioDecoder.d.ts +27 -0
- package/dist/modules/transcription/MediaBunnyAudioDecoder.d.ts.map +1 -0
- package/dist/modules/transcription/MediaBunnyAudioDecoder.js +76 -0
- package/dist/modules/transcription/MediaBunnyAudioDecoder.js.map +1 -0
- package/dist/modules/transcription/ModelFileCache.d.ts +20 -0
- package/dist/modules/transcription/ModelFileCache.d.ts.map +1 -0
- package/dist/modules/transcription/ModelFileCache.js +2 -0
- package/dist/modules/transcription/ModelFileCache.js.map +1 -0
- package/dist/modules/transcription/ModelFileCacheUnavailableError.d.ts +18 -0
- package/dist/modules/transcription/ModelFileCacheUnavailableError.d.ts.map +1 -0
- package/dist/modules/transcription/ModelFileCacheUnavailableError.js +18 -0
- package/dist/modules/transcription/ModelFileCacheUnavailableError.js.map +1 -0
- package/dist/modules/transcription/SrtTranscriber.d.ts +24 -15
- package/dist/modules/transcription/SrtTranscriber.d.ts.map +1 -1
- package/dist/modules/transcription/SrtTranscriber.js +32 -90
- package/dist/modules/transcription/SrtTranscriber.js.map +1 -1
- package/dist/modules/transcription/SubtitleFileUnreadableError.d.ts +22 -0
- package/dist/modules/transcription/SubtitleFileUnreadableError.d.ts.map +1 -0
- package/dist/modules/transcription/SubtitleFileUnreadableError.js +22 -0
- package/dist/modules/transcription/SubtitleFileUnreadableError.js.map +1 -0
- package/dist/modules/transcription/TimestampedCueWordReader.d.ts +27 -0
- package/dist/modules/transcription/TimestampedCueWordReader.d.ts.map +1 -0
- package/dist/modules/transcription/TimestampedCueWordReader.js +52 -0
- package/dist/modules/transcription/TimestampedCueWordReader.js.map +1 -0
- package/dist/modules/transcription/Transcriber.d.ts +13 -0
- package/dist/modules/transcription/Transcriber.d.ts.map +1 -1
- package/dist/modules/transcription/TransformersRuntime.d.ts +50 -0
- package/dist/modules/transcription/TransformersRuntime.d.ts.map +1 -0
- package/dist/modules/transcription/TransformersRuntime.js +79 -0
- package/dist/modules/transcription/TransformersRuntime.js.map +1 -0
- package/dist/modules/transcription/VttTranscriber.d.ts +46 -0
- package/dist/modules/transcription/VttTranscriber.d.ts.map +1 -0
- package/dist/modules/transcription/VttTranscriber.js +80 -0
- package/dist/modules/transcription/VttTranscriber.js.map +1 -0
- package/dist/modules/transcription/WhisperChunkStitcher.d.ts +51 -0
- package/dist/modules/transcription/WhisperChunkStitcher.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperChunkStitcher.js +101 -0
- package/dist/modules/transcription/WhisperChunkStitcher.js.map +1 -0
- package/dist/modules/transcription/WhisperDeviceUnavailableError.d.ts +16 -0
- package/dist/modules/transcription/WhisperDeviceUnavailableError.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperDeviceUnavailableError.js +16 -0
- package/dist/modules/transcription/WhisperDeviceUnavailableError.js.map +1 -0
- package/dist/modules/transcription/WhisperInferenceFailedError.d.ts +16 -0
- package/dist/modules/transcription/WhisperInferenceFailedError.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperInferenceFailedError.js +16 -0
- package/dist/modules/transcription/WhisperInferenceFailedError.js.map +1 -0
- package/dist/modules/transcription/WhisperInferenceProgressTracker.d.ts +61 -0
- package/dist/modules/transcription/WhisperInferenceProgressTracker.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperInferenceProgressTracker.js +102 -0
- package/dist/modules/transcription/WhisperInferenceProgressTracker.js.map +1 -0
- package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.d.ts +38 -0
- package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.js +94 -0
- package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.js.map +1 -0
- package/dist/modules/transcription/WhisperModelLoadFailedError.d.ts +15 -0
- package/dist/modules/transcription/WhisperModelLoadFailedError.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperModelLoadFailedError.js +15 -0
- package/dist/modules/transcription/WhisperModelLoadFailedError.js.map +1 -0
- package/dist/modules/transcription/WhisperTranscriber.d.ts +106 -7
- package/dist/modules/transcription/WhisperTranscriber.d.ts.map +1 -1
- package/dist/modules/transcription/WhisperTranscriber.js +312 -25
- package/dist/modules/transcription/WhisperTranscriber.js.map +1 -1
- package/dist/modules/transcription/WhisperWindowCoverage.d.ts +79 -0
- package/dist/modules/transcription/WhisperWindowCoverage.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperWindowCoverage.js +129 -0
- package/dist/modules/transcription/WhisperWindowCoverage.js.map +1 -0
- package/dist/modules/transcription/WordTimingEstimator.d.ts +14 -0
- package/dist/modules/transcription/WordTimingEstimator.d.ts.map +1 -0
- package/dist/modules/transcription/WordTimingEstimator.js +33 -0
- package/dist/modules/transcription/WordTimingEstimator.js.map +1 -0
- package/dist/modules/transcription/index.d.ts +9 -2
- package/dist/modules/transcription/index.d.ts.map +1 -1
- package/dist/modules/transcription/index.js +6 -1
- package/dist/modules/transcription/index.js.map +1 -1
- package/dist/modules/video/RenderJob.d.ts +17 -0
- package/dist/modules/video/RenderJob.d.ts.map +1 -1
- package/dist/modules/video/RenderTimeMap.d.ts +50 -0
- package/dist/modules/video/RenderTimeMap.d.ts.map +1 -0
- package/dist/modules/video/RenderTimeMap.js +90 -0
- package/dist/modules/video/RenderTimeMap.js.map +1 -0
- package/dist/modules/video/index.d.ts +8 -1
- package/dist/modules/video/index.d.ts.map +1 -1
- package/dist/modules/video/index.js +4 -0
- package/dist/modules/video/index.js.map +1 -1
- package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.d.ts +102 -0
- package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.js +207 -0
- package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.js.map +1 -0
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.d.ts +12 -52
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.js +25 -190
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.js.map +1 -1
- package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.d.ts +7 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.js +2 -2
- package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.js.map +1 -1
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.d.ts +2 -0
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.js +8 -2
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.js.map +1 -1
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.d.ts +3 -0
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.js +9 -2
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.js.map +1 -1
- package/dist/modules/video/mediabunny/codec/CodecPolicy.d.ts +7 -0
- package/dist/modules/video/mediabunny/codec/CodecPolicy.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts +4 -2
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js +33 -23
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js.map +1 -1
- package/dist/modules/video/mediabunny/frame/FrameCompositor.d.ts +9 -2
- package/dist/modules/video/mediabunny/frame/FrameCompositor.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.d.ts +5 -2
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.js +8 -2
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.js.map +1 -1
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.d.ts +35 -0
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.js +69 -0
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.js.map +1 -0
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainterFactory.d.ts +23 -0
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainterFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainterFactory.js +23 -0
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainterFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/painter/FramePainter.d.ts +46 -0
- package/dist/modules/video/mediabunny/painter/FramePainter.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/painter/FramePainter.js +2 -0
- package/dist/modules/video/mediabunny/painter/FramePainter.js.map +1 -0
- package/dist/modules/video/mediabunny/painter/TopLayerSource.d.ts +24 -0
- package/dist/modules/video/mediabunny/painter/TopLayerSource.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/painter/TopLayerSource.js +2 -0
- package/dist/modules/video/mediabunny/painter/TopLayerSource.js.map +1 -0
- package/package.json +13 -10
- package/dist/modules/document/Tag.d.ts.map +0 -1
- package/dist/modules/document/Tag.js.map +0 -1
- package/dist/modules/rendering/AlignmentConfig.d.ts +0 -21
- package/dist/modules/rendering/AlignmentConfig.d.ts.map +0 -1
- package/dist/modules/rendering/AlignmentConfig.js +0 -2
- package/dist/modules/rendering/AlignmentConfig.js.map +0 -1
- package/dist/modules/rendering/BoxEdges.d.ts.map +0 -1
- package/dist/modules/rendering/BoxEdges.js.map +0 -1
- package/dist/modules/rendering/ElementRenderOverrides.d.ts +0 -15
- package/dist/modules/rendering/ElementRenderOverrides.d.ts.map +0 -1
- package/dist/modules/rendering/ElementRenderOverrides.js +0 -24
- package/dist/modules/rendering/ElementRenderOverrides.js.map +0 -1
- package/dist/modules/rendering/InlineStyleMap.d.ts.map +0 -1
- package/dist/modules/rendering/InlineStyleMap.js.map +0 -1
- package/dist/modules/rendering/RenderingConfig.d.ts.map +0 -1
- package/dist/modules/rendering/RenderingConfig.js.map +0 -1
- package/dist/modules/rendering/ScopedRenderOverride.d.ts +0 -19
- package/dist/modules/rendering/ScopedRenderOverride.d.ts.map +0 -1
- package/dist/modules/rendering/ScopedRenderOverride.js.map +0 -1
- package/dist/modules/rendering/SegmentPaintRegionResolver.d.ts.map +0 -1
- package/dist/modules/rendering/SegmentPaintRegionResolver.js.map +0 -1
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.d.ts +0 -58
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.d.ts.map +0 -1
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.js +0 -132
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.js.map +0 -1
- package/dist/modules/rendering/VideoFrameLayerClass.d.ts.map +0 -1
- package/dist/modules/rendering/VideoFrameLayerClass.js +0 -21
- package/dist/modules/rendering/VideoFrameLayerClass.js.map +0 -1
- package/dist/modules/rendering/VideoFrameSource.d.ts.map +0 -1
- package/dist/modules/rendering/VideoFrameSource.js.map +0 -1
- package/dist/modules/transcription/BrowserAudioDecoder.d.ts +0 -13
- package/dist/modules/transcription/BrowserAudioDecoder.d.ts.map +0 -1
- package/dist/modules/transcription/BrowserAudioDecoder.js +0 -34
- package/dist/modules/transcription/BrowserAudioDecoder.js.map +0 -1
- /package/dist/modules/rendering/{BoxEdges.d.ts → types/BoxEdges.d.ts} +0 -0
- /package/dist/modules/rendering/{BoxEdges.js → types/BoxEdges.js} +0 -0
- /package/dist/modules/rendering/{InlineStyleMap.d.ts → types/InlineStyleMap.d.ts} +0 -0
- /package/dist/modules/rendering/{InlineStyleMap.js → types/InlineStyleMap.js} +0 -0
- /package/dist/modules/rendering/{RenderingConfig.js → types/RenderingConfig.js} +0 -0
- /package/dist/modules/rendering/{ScopedRenderOverride.js → types/ScopedRenderOverride.js} +0 -0
- /package/dist/modules/rendering/{VideoFrameSource.d.ts → types/VideoFrameSource.d.ts} +0 -0
- /package/dist/modules/rendering/{VideoFrameSource.js → types/VideoFrameSource.js} +0 -0
|
@@ -41,12 +41,18 @@ export class PassthroughAudioTrackBridge {
|
|
|
41
41
|
// discarded — the output writer rejects negative timestamps.
|
|
42
42
|
if (packet.timestamp < 0)
|
|
43
43
|
return;
|
|
44
|
+
const timeMap = this.config.timeMap;
|
|
45
|
+
if (timeMap.isSkipped(packet.timestamp))
|
|
46
|
+
return;
|
|
47
|
+
const outputPacket = timeMap.isEmpty()
|
|
48
|
+
? packet
|
|
49
|
+
: packet.clone({ timestamp: timeMap.toOutputTime(packet.timestamp) });
|
|
44
50
|
if (this.firstPacketPending && this.decoderConfig) {
|
|
45
|
-
await this.source.add(
|
|
51
|
+
await this.source.add(outputPacket, { decoderConfig: this.decoderConfig });
|
|
46
52
|
this.firstPacketPending = false;
|
|
47
53
|
return;
|
|
48
54
|
}
|
|
49
|
-
await this.source.add(
|
|
55
|
+
await this.source.add(outputPacket);
|
|
50
56
|
}
|
|
51
57
|
}
|
|
52
58
|
//# sourceMappingURL=PassthroughAudioTrackBridge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PassthroughAudioTrackBridge.js","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,iBAAiB,GAKlB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"PassthroughAudioTrackBridge.js","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,iBAAiB,GAKlB,MAAM,YAAY,CAAC;AAUpB;;;;;;;GAOG;AACH,MAAM,OAAO,2BAA2B;IAQT;IANZ,MAAM,CAA2B;IACjC,IAAI,CAAoB;IACjC,UAAU,GAAyB,IAAI,CAAC;IACxC,aAAa,GAA8B,IAAI,CAAC;IAChD,kBAAkB,GAAG,IAAI,CAAC;IAElC,YAA6B,MAAyC;QAAzC,WAAM,GAAN,MAAM,CAAmC;QACpE,IAAI,CAAC,MAAM,GAAG,IAAI,wBAAwB,CAAC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AChD,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,EAAE;YACpC,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACxE,IAAI,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YAClD,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;YAC3E,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;YAChC,OAAO;QACT,CAAC;QACD,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type AudioCodec, type InputAudioTrack, type Output } from 'mediabunny';
|
|
2
2
|
import type { AudioTrackBridge } from '../../../video/mediabunny/audio/AudioTrackBridge';
|
|
3
|
+
import type { RenderTimeMap } from '../../../video/RenderTimeMap';
|
|
3
4
|
export interface TranscodeAudioTrackBridgeConfig {
|
|
4
5
|
inputTrack: InputAudioTrack;
|
|
5
6
|
/** Target codec to encode into. Must be supported by the output container. */
|
|
6
7
|
codec: AudioCodec;
|
|
8
|
+
timeMap: RenderTimeMap;
|
|
7
9
|
}
|
|
8
10
|
/**
|
|
9
11
|
* Decodes the input audio track and re-encodes it into the requested
|
|
@@ -13,6 +15,7 @@ export interface TranscodeAudioTrackBridgeConfig {
|
|
|
13
15
|
export declare class TranscodeAudioTrackBridge implements AudioTrackBridge {
|
|
14
16
|
private readonly source;
|
|
15
17
|
private readonly sink;
|
|
18
|
+
private readonly timeMap;
|
|
16
19
|
private iterator;
|
|
17
20
|
private nextSample;
|
|
18
21
|
constructor(config: TranscodeAudioTrackBridgeConfig);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranscodeAudioTrackBridge.d.ts","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,UAAU,EAEf,KAAK,eAAe,EACpB,KAAK,MAAM,EACZ,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;
|
|
1
|
+
{"version":3,"file":"TranscodeAudioTrackBridge.d.ts","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,UAAU,EAEf,KAAK,eAAe,EACpB,KAAK,MAAM,EACZ,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AACzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,WAAW,+BAA+B;IAC9C,UAAU,EAAE,eAAe,CAAC;IAC5B,8EAA8E;IAC9E,KAAK,EAAE,UAAU,CAAC;IAClB,OAAO,EAAE,aAAa,CAAC;CACxB;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,YAAW,gBAAgB;IAEhE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAC3C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAkB;IACvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAA2C;IAC3D,OAAO,CAAC,UAAU,CAA4B;gBAElC,MAAM,EAAE,+BAA+B;IAM7C,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMvC,SAAS,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOhD,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;YAOf,IAAI;YAeJ,OAAO;CAKtB"}
|
|
@@ -7,11 +7,13 @@ import { AudioSampleSink, AudioSampleSource, QUALITY_HIGH, } from 'mediabunny';
|
|
|
7
7
|
export class TranscodeAudioTrackBridge {
|
|
8
8
|
source;
|
|
9
9
|
sink;
|
|
10
|
+
timeMap;
|
|
10
11
|
iterator = null;
|
|
11
12
|
nextSample = null;
|
|
12
13
|
constructor(config) {
|
|
13
14
|
this.source = new AudioSampleSource({ codec: config.codec, bitrate: QUALITY_HIGH });
|
|
14
15
|
this.sink = new AudioSampleSink(config.inputTrack);
|
|
16
|
+
this.timeMap = config.timeMap;
|
|
15
17
|
}
|
|
16
18
|
async attachTo(output) {
|
|
17
19
|
output.addAudioTrack(this.source);
|
|
@@ -34,9 +36,14 @@ export class TranscodeAudioTrackBridge {
|
|
|
34
36
|
try {
|
|
35
37
|
// Samples before t=0 (container offsets) are discarded because the
|
|
36
38
|
// muxer rejects negative timestamps.
|
|
37
|
-
if (sample.timestamp
|
|
38
|
-
|
|
39
|
+
if (sample.timestamp < 0)
|
|
40
|
+
return;
|
|
41
|
+
if (this.timeMap.isSkipped(sample.timestamp))
|
|
42
|
+
return;
|
|
43
|
+
if (!this.timeMap.isEmpty()) {
|
|
44
|
+
sample.setTimestamp(this.timeMap.toOutputTime(sample.timestamp));
|
|
39
45
|
}
|
|
46
|
+
await this.source.add(sample);
|
|
40
47
|
}
|
|
41
48
|
finally {
|
|
42
49
|
sample.close();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranscodeAudioTrackBridge.js","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,YAAY,GAKb,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"TranscodeAudioTrackBridge.js","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eA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U,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACzC,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,IAAI,CAAC,MAAmB;QACpC,IAAI,CAAC;YACH,mEAAmE;YACnE,qCAAqC;YACrC,IAAI,MAAM,CAAC,SAAS,GAAG,CAAC;gBAAE,OAAO;YACjC,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC;gBAAE,OAAO;YACrD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;gBAC5B,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;YACnE,CAAC;YACD,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAChC,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,OAAO;QACnB,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,OAAO,IAAI,CAAC;QAChC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnD,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -20,6 +20,13 @@ export interface VideoCodecResolution {
|
|
|
20
20
|
latencyMode: 'quality' | 'realtime';
|
|
21
21
|
/** Optional hint about the content being encoded, e.g. `'text'` for high-contrast overlays. */
|
|
22
22
|
contentHint?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Distance, in seconds, between forced key frames. When omitted, the
|
|
25
|
+
* encoder picks its default cadence. A short interval trades file
|
|
26
|
+
* size for random-access granularity — useful for outputs that will
|
|
27
|
+
* be scrubbed heavily (e.g. preview proxies).
|
|
28
|
+
*/
|
|
29
|
+
keyFrameInterval?: number;
|
|
23
30
|
}
|
|
24
31
|
/**
|
|
25
32
|
* Resolves codec, bitrate and encoder knobs for a render.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodecPolicy.d.ts","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/codec/CodecPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,MAAM,WAAW,2BAA2B;IAC1C,mDAAmD;IACnD,eAAe,EAAE,UAAU,EAAE,CAAC;IAC9B,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,GAAG,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,OAAO,EAAE,aAAa,GAAG,SAAS,CAAC;CACpC;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,UAAU,CAAC;IAClB,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,UAAU,GAAG,UAAU,CAAC;IACrC,WAAW,EAAE,SAAS,GAAG,UAAU,CAAC;IACpC,+FAA+F;IAC/F,WAAW,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"CodecPolicy.d.ts","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/codec/CodecPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,MAAM,WAAW,2BAA2B;IAC1C,mDAAmD;IACnD,eAAe,EAAE,UAAU,EAAE,CAAC;IAC9B,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,GAAG,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,OAAO,EAAE,aAAa,GAAG,SAAS,CAAC;CACpC;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,UAAU,CAAC;IAClB,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,UAAU,GAAG,UAAU,CAAC;IACrC,WAAW,EAAE,SAAS,GAAG,UAAU,CAAC;IACpC,+FAA+F;IAC/F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,YAAY,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACnF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { VideoFrameSource, VideoFrameRegion } from '../../../rendering/VideoFrameSource';
|
|
1
|
+
import type { VideoFrameSource, VideoFrameRegion } from '../../../rendering/types/VideoFrameSource';
|
|
2
2
|
import type { DecodedVideoFrame } from '../../../video/mediabunny/frame/VideoFrameDecoder';
|
|
3
3
|
/**
|
|
4
4
|
* Single-slot `VideoFrameSource`. {@link setCurrent} stores one
|
|
@@ -19,7 +19,9 @@ export declare class CurrentFrameVideoSource implements VideoFrameSource {
|
|
|
19
19
|
setCurrent(timestamp: number, frame: DecodedVideoFrame): void;
|
|
20
20
|
getFrameAt(timeSeconds: number, jpegQuality: number, region?: VideoFrameRegion): Promise<string>;
|
|
21
21
|
private encode;
|
|
22
|
+
private cropTo;
|
|
23
|
+
private encodeJpeg;
|
|
24
|
+
private createCanvas;
|
|
22
25
|
private clipToCanvas;
|
|
23
|
-
private blobToDataUrl;
|
|
24
26
|
}
|
|
25
27
|
//# sourceMappingURL=CurrentFrameVideoSource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrentFrameVideoSource.d.ts","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/frame/CurrentFrameVideoSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CurrentFrameVideoSource.d.ts","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/frame/CurrentFrameVideoSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AACpG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AAG3F;;;;;GAKG;AACH,qBAAa,uBAAwB,YAAW,gBAAgB;IAI9D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAAQ;IAErD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAC3C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA2B;IAC/C,OAAO,CAAC,gBAAgB,CAAuB;gBAEnC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IASzC;;;OAGG;IACH,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,IAAI;IAOvD,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC;IAatG,OAAO,CAAC,MAAM;IAQd,OAAO,CAAC,MAAM;IA4Bd,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,YAAY;CAOrB"}
|
|
@@ -13,10 +13,10 @@ export class CurrentFrameVideoSource {
|
|
|
13
13
|
ctx;
|
|
14
14
|
currentTimestamp = null;
|
|
15
15
|
constructor(width, height) {
|
|
16
|
-
this.canvas =
|
|
16
|
+
this.canvas = this.createCanvas(width, height);
|
|
17
17
|
const ctx = this.canvas.getContext('2d');
|
|
18
18
|
if (!ctx) {
|
|
19
|
-
throw new Error('
|
|
19
|
+
throw new Error('Canvas 2D context is not available in this environment.');
|
|
20
20
|
}
|
|
21
21
|
this.ctx = ctx;
|
|
22
22
|
}
|
|
@@ -36,24 +36,42 @@ export class CurrentFrameVideoSource {
|
|
|
36
36
|
throw new Error(`CurrentFrameVideoSource: requested timestamp ${timeSeconds}, ` +
|
|
37
37
|
`but the current slot holds ${this.currentTimestamp}.`);
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
return profiler.time('CurrentFrameVideoSource.blobToDataUrl', () => this.blobToDataUrl(blob));
|
|
39
|
+
return profiler.time('CurrentFrameVideoSource.encode', () => this.encode(region, jpegQuality));
|
|
41
40
|
}
|
|
42
41
|
encode(region, jpegQuality) {
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
const clipped = region ? this.clipToCanvas(region) : null;
|
|
43
|
+
if (!clipped || clipped.width === 0 || clipped.height === 0) {
|
|
44
|
+
return this.encodeJpeg(this.canvas, jpegQuality);
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
const cropCtx = cropCanvas.getContext('2d');
|
|
46
|
+
return this.encodeJpeg(this.cropTo(clipped), jpegQuality);
|
|
47
|
+
}
|
|
48
|
+
cropTo(clipped) {
|
|
49
|
+
const cropCanvas = this.createCanvas(clipped.width, clipped.height);
|
|
50
|
+
const cropCtx = profiler.time('CurrentFrameVideoSource.cropCanvasContext', () => cropCanvas.getContext('2d'));
|
|
52
51
|
if (!cropCtx) {
|
|
53
|
-
throw new Error('
|
|
52
|
+
throw new Error('Canvas 2D context is not available for cropping.');
|
|
54
53
|
}
|
|
55
|
-
cropCtx.drawImage(this.canvas, clipped.x, clipped.y, clipped.width, clipped.height, 0, 0, clipped.width, clipped.height);
|
|
56
|
-
return cropCanvas
|
|
54
|
+
profiler.time('CurrentFrameVideoSource.cropDraw', () => cropCtx.drawImage(this.canvas, clipped.x, clipped.y, clipped.width, clipped.height, 0, 0, clipped.width, clipped.height));
|
|
55
|
+
return cropCanvas;
|
|
56
|
+
}
|
|
57
|
+
// Chosen for predictability over raw speed. `toDataURL` encodes inline;
|
|
58
|
+
// `OffscreenCanvas.convertToBlob` defers to the browser's async image
|
|
59
|
+
// scheduler, which was measured taking ~1s per call instead of the usual
|
|
60
|
+
// few ms, under a load that could not be pinned down or reproduced.
|
|
61
|
+
// Output is byte-identical between the two on Chrome and Firefox, and the
|
|
62
|
+
// async overhead is per-call rather than per-pixel, so the two only differ
|
|
63
|
+
// meaningfully at small crop sizes. The tradeoff accepted here is that
|
|
64
|
+
// encoding inline blocks the main thread for the whole encode, and that a
|
|
65
|
+
// DOM canvas rules out ever running this step in a Worker.
|
|
66
|
+
// Benchmarked in experiments/jpeg-encode-apis/.
|
|
67
|
+
encodeJpeg(canvas, jpegQuality) {
|
|
68
|
+
return profiler.time('CurrentFrameVideoSource.encodeJpeg', () => canvas.toDataURL('image/jpeg', jpegQuality));
|
|
69
|
+
}
|
|
70
|
+
createCanvas(width, height) {
|
|
71
|
+
const canvas = document.createElement('canvas');
|
|
72
|
+
canvas.width = width;
|
|
73
|
+
canvas.height = height;
|
|
74
|
+
return canvas;
|
|
57
75
|
}
|
|
58
76
|
clipToCanvas(region) {
|
|
59
77
|
const x = Math.max(0, Math.floor(region.x));
|
|
@@ -62,13 +80,5 @@ export class CurrentFrameVideoSource {
|
|
|
62
80
|
const bottom = Math.min(this.canvas.height, Math.ceil(region.y + region.height));
|
|
63
81
|
return { x, y, width: Math.max(0, right - x), height: Math.max(0, bottom - y) };
|
|
64
82
|
}
|
|
65
|
-
blobToDataUrl(blob) {
|
|
66
|
-
return new Promise((resolve, reject) => {
|
|
67
|
-
const reader = new FileReader();
|
|
68
|
-
reader.onload = () => resolve(reader.result);
|
|
69
|
-
reader.onerror = () => reject(reader.error ?? new Error('FileReader failed to encode the frame.'));
|
|
70
|
-
reader.readAsDataURL(blob);
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
83
|
}
|
|
74
84
|
//# sourceMappingURL=CurrentFrameVideoSource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrentFrameVideoSource.js","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/frame/CurrentFrameVideoSource.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,OAAO,uBAAuB;IAElC,mEAAmE;IACnE,0CAA0C;IAClC,MAAM,CAAU,qBAAqB,GAAG,IAAI,CAAC;IAEpC,MAAM,
|
|
1
|
+
{"version":3,"file":"CurrentFrameVideoSource.js","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/frame/CurrentFrameVideoSource.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,OAAO,uBAAuB;IAElC,mEAAmE;IACnE,0CAA0C;IAClC,MAAM,CAAU,qBAAqB,GAAG,IAAI,CAAC;IAEpC,MAAM,CAAoB;IAC1B,GAAG,CAA2B;IACvC,gBAAgB,GAAkB,IAAI,CAAC;IAE/C,YAAY,KAAa,EAAE,MAAc;QACvC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAC/C,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;QAC7E,CAAC;QACD,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED;;;OAGG;IACH,UAAU,CAAC,SAAiB,EAAE,KAAwB;QACpD,IAAI,CAAC,gBAAgB,GAAG,SAA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AO,MAAM,CAAC;IAChB,CAAC;IAEO,YAAY,CAAC,MAAwB;QAC3C,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5C,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC9E,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QACjF,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;IAClF,CAAC"}
|
|
@@ -4,8 +4,9 @@ import type { OverlayFrame } from '../../../rendering/OverlayFrameRenderer';
|
|
|
4
4
|
/**
|
|
5
5
|
* The inputs the compositor needs to produce one output frame: the
|
|
6
6
|
* decoded source frame, the per-timestamp caption layer, the
|
|
7
|
-
* frame-invariant overlay,
|
|
8
|
-
* the compositor's call, not
|
|
7
|
+
* frame-invariant overlay, an optional top actor-cutout layer, and
|
|
8
|
+
* the target dimensions. Layer order is the compositor's call, not
|
|
9
|
+
* the request's.
|
|
9
10
|
*/
|
|
10
11
|
export interface FrameCompositionRequest {
|
|
11
12
|
/** Decoded source frame for this output frame. */
|
|
@@ -14,6 +15,12 @@ export interface FrameCompositionRequest {
|
|
|
14
15
|
readonly captions: SubtitleFrame | null;
|
|
15
16
|
/** Frame-invariant decoration. `null` when no overlay was supplied. */
|
|
16
17
|
readonly overlay: OverlayFrame | null;
|
|
18
|
+
/**
|
|
19
|
+
* Per-timestamp top layer painted after the captions — used by
|
|
20
|
+
* effects that must occlude the captions (e.g. text-behind-actor).
|
|
21
|
+
* `null` when no top layer applies to this frame.
|
|
22
|
+
*/
|
|
23
|
+
readonly topLayer: OverlayFrame | null;
|
|
17
24
|
/** Width in pixels of the composition target. */
|
|
18
25
|
readonly width: number;
|
|
19
26
|
/** Height in pixels of the composition target. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrameCompositor.d.ts","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/frame/FrameCompositor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAE5E
|
|
1
|
+
{"version":3,"file":"FrameCompositor.d.ts","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/frame/FrameCompositor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,kDAAkD;IAClD,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;IAClC,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IACxC,uEAAuE;IACvE,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC;IACtC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;IACvC,iDAAiD;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kDAAkD;IAClD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,CACL,MAAM,EAAE,iCAAiC,GAAG,wBAAwB,EACpE,OAAO,EAAE,uBAAuB,GAC/B,IAAI,CAAC;CACT"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { FrameCompositionRequest, FrameCompositor } from '../../../video/mediabunny/frame/FrameCompositor';
|
|
2
2
|
/**
|
|
3
3
|
* Paints the source frame at the base, then the frame-invariant
|
|
4
|
-
* overlay on top of it, then the per-timestamp subtitle layer
|
|
5
|
-
*
|
|
4
|
+
* overlay on top of it, then the per-timestamp subtitle layer, then
|
|
5
|
+
* the optional top layer used by effects that need to occlude the
|
|
6
|
+
* captions (e.g. text-behind-actor). Captions stay readable through
|
|
7
|
+
* any overlay decoration; the top layer, when supplied, paints on top
|
|
8
|
+
* of the captions.
|
|
6
9
|
*/
|
|
7
10
|
export declare class LayeredFrameCompositor implements FrameCompositor {
|
|
8
11
|
compose(target: OffscreenCanvasRenderingContext2D | CanvasRenderingContext2D, request: FrameCompositionRequest): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayeredFrameCompositor.d.ts","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/frame/LayeredFrameCompositor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,eAAe,EAChB,MAAM,iDAAiD,CAAC;AAEzD
|
|
1
|
+
{"version":3,"file":"LayeredFrameCompositor.d.ts","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/frame/LayeredFrameCompositor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,eAAe,EAChB,MAAM,iDAAiD,CAAC;AAEzD;;;;;;;GAOG;AACH,qBAAa,sBAAuB,YAAW,eAAe;IAE5D,OAAO,CACL,MAAM,EAAE,iCAAiC,GAAG,wBAAwB,EACpE,OAAO,EAAE,uBAAuB,GAC/B,IAAI;CAYR"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Paints the source frame at the base, then the frame-invariant
|
|
3
|
-
* overlay on top of it, then the per-timestamp subtitle layer
|
|
4
|
-
*
|
|
3
|
+
* overlay on top of it, then the per-timestamp subtitle layer, then
|
|
4
|
+
* the optional top layer used by effects that need to occlude the
|
|
5
|
+
* captions (e.g. text-behind-actor). Captions stay readable through
|
|
6
|
+
* any overlay decoration; the top layer, when supplied, paints on top
|
|
7
|
+
* of the captions.
|
|
5
8
|
*/
|
|
6
9
|
export class LayeredFrameCompositor {
|
|
7
10
|
compose(target, request) {
|
|
@@ -12,6 +15,9 @@ export class LayeredFrameCompositor {
|
|
|
12
15
|
if (request.captions) {
|
|
13
16
|
request.captions.draw(target, 0, 0, request.width, request.height);
|
|
14
17
|
}
|
|
18
|
+
if (request.topLayer) {
|
|
19
|
+
request.topLayer.draw(target, 0, 0, request.width, request.height);
|
|
20
|
+
}
|
|
15
21
|
}
|
|
16
22
|
}
|
|
17
23
|
//# sourceMappingURL=LayeredFrameCompositor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayeredFrameCompositor.js","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/frame/LayeredFrameCompositor.ts"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"LayeredFrameCompositor.js","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/frame/LayeredFrameCompositor.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,MAAM,OAAO,sBAAsB;IAEjC,OAAO,CACL,MAAoE,EACpE,OAAgC;QAEhC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAChE,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACpE,CAAC;QACD,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YACrB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACrE,CAAC;QACD,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YACrB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Document } from '../../../document/Document';
|
|
2
|
+
import type { OverlayFrameRenderer } from '../../../rendering/OverlayFrameRenderer';
|
|
3
|
+
import type { SubtitleStyle } from '../../../rendering/SubtitleFrameRenderer';
|
|
4
|
+
import type { DecodedVideoFrame } from '../../../video/mediabunny/frame/VideoFrameDecoder';
|
|
5
|
+
import type { FrameCompositor } from '../../../video/mediabunny/frame/FrameCompositor';
|
|
6
|
+
import type { SubtitleLayerSource } from '../../../video/mediabunny/caption/SubtitleLayerSource';
|
|
7
|
+
import type { TopLayerSource } from '../../../video/mediabunny/painter/TopLayerSource';
|
|
8
|
+
import type { PaintFrame } from '../../../video/mediabunny/encoder/VideoTrackEncoder';
|
|
9
|
+
import type { FramePainter } from '../../../video/mediabunny/painter/FramePainter';
|
|
10
|
+
/**
|
|
11
|
+
* Paints each output frame as the source frame composited with a
|
|
12
|
+
* per-timestamp caption raster and a frame-invariant overlay. The
|
|
13
|
+
* caption strategy (batched, video-frame-bound, mixed) lives entirely
|
|
14
|
+
* behind the {@link SubtitleLayerSource} injected in the constructor.
|
|
15
|
+
*
|
|
16
|
+
* Single-use: one open/close cycle per instance. Build a fresh one for
|
|
17
|
+
* each transcode run through the factory.
|
|
18
|
+
*/
|
|
19
|
+
export declare class CaptionsOverlayFramePainter implements FramePainter {
|
|
20
|
+
private readonly subtitleLayer;
|
|
21
|
+
private readonly overlayRenderer;
|
|
22
|
+
private readonly frameCompositor;
|
|
23
|
+
private readonly document;
|
|
24
|
+
private readonly styles;
|
|
25
|
+
private readonly overlayHtml;
|
|
26
|
+
private readonly topLayer;
|
|
27
|
+
private width;
|
|
28
|
+
private height;
|
|
29
|
+
private overlay;
|
|
30
|
+
constructor(subtitleLayer: SubtitleLayerSource, overlayRenderer: OverlayFrameRenderer, frameCompositor: FrameCompositor, document: Document, styles: Readonly<Record<string, SubtitleStyle>>, overlayHtml: string | undefined, topLayer: TopLayerSource | null);
|
|
31
|
+
begin(width: number, height: number, fps: number): Promise<void>;
|
|
32
|
+
paint(frame: DecodedVideoFrame, _outputTimestamp: number): Promise<PaintFrame>;
|
|
33
|
+
end(): void;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=CaptionsOverlayFramePainter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaptionsOverlayFramePainter.d.ts","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAgB,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAClG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,KAAK,EAAE,i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
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Caption ticks step at the source's frame rate up to this cap. Past
|
|
3
|
+
* it, per-letter or per-word animations gain nothing from extra renders
|
|
4
|
+
* (the eye doesn't resolve sub-30fps differences in caption motion) and
|
|
5
|
+
* the per-batch subtitle decode dominates the render budget.
|
|
6
|
+
*/
|
|
7
|
+
const CAPTION_FPS_CAP = 30;
|
|
8
|
+
/**
|
|
9
|
+
* Paints each output frame as the source frame composited with a
|
|
10
|
+
* per-timestamp caption raster and a frame-invariant overlay. The
|
|
11
|
+
* caption strategy (batched, video-frame-bound, mixed) lives entirely
|
|
12
|
+
* behind the {@link SubtitleLayerSource} injected in the constructor.
|
|
13
|
+
*
|
|
14
|
+
* Single-use: one open/close cycle per instance. Build a fresh one for
|
|
15
|
+
* each transcode run through the factory.
|
|
16
|
+
*/
|
|
17
|
+
export class CaptionsOverlayFramePainter {
|
|
18
|
+
subtitleLayer;
|
|
19
|
+
overlayRenderer;
|
|
20
|
+
frameCompositor;
|
|
21
|
+
document;
|
|
22
|
+
styles;
|
|
23
|
+
overlayHtml;
|
|
24
|
+
topLayer;
|
|
25
|
+
width = 0;
|
|
26
|
+
height = 0;
|
|
27
|
+
overlay = null;
|
|
28
|
+
constructor(subtitleLayer, overlayRenderer, frameCompositor, document, styles, overlayHtml, topLayer) {
|
|
29
|
+
this.subtitleLayer = subtitleLayer;
|
|
30
|
+
this.overlayRenderer = overlayRenderer;
|
|
31
|
+
this.frameCompositor = frameCompositor;
|
|
32
|
+
this.document = document;
|
|
33
|
+
this.styles = styles;
|
|
34
|
+
this.overlayHtml = overlayHtml;
|
|
35
|
+
this.topLayer = topLayer;
|
|
36
|
+
}
|
|
37
|
+
async begin(width, height, fps) {
|
|
38
|
+
this.width = width;
|
|
39
|
+
this.height = height;
|
|
40
|
+
const captionInterval = 1 / Math.min(fps, CAPTION_FPS_CAP);
|
|
41
|
+
await this.subtitleLayer.open(this.document, this.styles, width, height, captionInterval);
|
|
42
|
+
if (this.overlayHtml !== undefined) {
|
|
43
|
+
this.overlay = await this.overlayRenderer.render(this.overlayHtml, width, height);
|
|
44
|
+
}
|
|
45
|
+
if (this.topLayer !== null) {
|
|
46
|
+
await this.topLayer.open(width, height);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async paint(frame, _outputTimestamp) {
|
|
50
|
+
const captions = await this.subtitleLayer.frameAt(frame.timestamp, frame);
|
|
51
|
+
const topLayer = this.topLayer === null ? null : await this.topLayer.frameAt(frame.timestamp, frame);
|
|
52
|
+
return (ctx) => {
|
|
53
|
+
this.frameCompositor.compose(ctx, {
|
|
54
|
+
frame,
|
|
55
|
+
captions,
|
|
56
|
+
overlay: this.overlay,
|
|
57
|
+
topLayer,
|
|
58
|
+
width: this.width,
|
|
59
|
+
height: this.height,
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
end() {
|
|
64
|
+
this.subtitleLayer.close();
|
|
65
|
+
this.topLayer?.close();
|
|
66
|
+
this.overlay = null;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=CaptionsOverlayFramePainter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaptionsOverlayFramePainter.js","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.ts"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B;;;;;;;;GAQG;AACH,MAAM,OAAO,2BAA2B;IAOnB;IACA;IACA;IACA;IACA;IACA;IACA;IAXX,KAAK,GAAG,CAAC,CAAC;IACV,MAAM,GAAG,CAAC,CAAC;IACX,OAAO,GAAwB,IAAI,CAAC;IAE5C,YACmB,aAAkC,EAClC,eAAqC,EACrC,eAAgC,EAChC,QAAkB,EAClB,MAA+C,EAC/C,WAA+B,EAC/B,QAA+B;QAN/B,kBAAa,GAAb,aAAa,CAAqB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,OAAO,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QACrG,OAAO,CAAC,GAAG,EAAE,EAAE;YACb,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE;gBAChC,KAAK;gBACL,QAAQ;gBACR,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,QAAQ;gBACR,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;QACL,CAAC,CAAC;IACJ,CAAC;IAED,GAAG;QACD,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Document } from '../../../document/Document';
|
|
2
|
+
import type { OverlayFrameRenderer } from '../../../rendering/OverlayFrameRenderer';
|
|
3
|
+
import type { SubtitleStyle } from '../../../rendering/SubtitleFrameRenderer';
|
|
4
|
+
import type { FrameCompositor } from '../../../video/mediabunny/frame/FrameCompositor';
|
|
5
|
+
import type { SubtitleLayerSource } from '../../../video/mediabunny/caption/SubtitleLayerSource';
|
|
6
|
+
import type { TopLayerSource } from '../../../video/mediabunny/painter/TopLayerSource';
|
|
7
|
+
import { CaptionsOverlayFramePainter } from '../../../video/mediabunny/painter/CaptionsOverlayFramePainter';
|
|
8
|
+
/**
|
|
9
|
+
* Builds a fresh {@link CaptionsOverlayFramePainter} bound to a
|
|
10
|
+
* specific document, style set, (optional) overlay HTML, and an
|
|
11
|
+
* (optional) top-layer source. The factory owns the shared,
|
|
12
|
+
* engine-wide dependencies (subtitle source, overlay renderer,
|
|
13
|
+
* compositor); each call to {@link create} returns a single-use
|
|
14
|
+
* painter for one transcode run.
|
|
15
|
+
*/
|
|
16
|
+
export declare class CaptionsOverlayFramePainterFactory {
|
|
17
|
+
private readonly subtitleLayer;
|
|
18
|
+
private readonly overlayRenderer;
|
|
19
|
+
private readonly frameCompositor;
|
|
20
|
+
constructor(subtitleLayer: SubtitleLayerSource, overlayRenderer: OverlayFrameRenderer, frameCompositor: FrameCompositor);
|
|
21
|
+
create(document: Document, styles: Readonly<Record<string, SubtitleStyle>>, overlayHtml: string | undefined, topLayer?: TopLayerSource | null): CaptionsOverlayFramePainter;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=CaptionsOverlayFramePainterFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaptionsOverlayFramePainterFactory.d.ts","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/painter/CaptionsOverlayFramePainterFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AACvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AACjG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AACvF,OAAO,EAAE,2BAA2B,EAAE,MAAM,+DAA+D,CAAC;AAE5G;;;;;;;GAOG;AACH,qBAAa,kCAAkC;IAG3C,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAFf,aAAa,EAAE,mBAAmB,EAClC,eAAe,EAAE,oBAAoB,EACrC,eAAe,EAAE,eAAe;IAGnD,MAAM,CACJ,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,EAC/C,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,QAAQ,GAAE,cAAc,GAAG,IAAW,GACrC,2BAA2B;CAW/B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CaptionsOverlayFramePainter } from '../../../video/mediabunny/painter/CaptionsOverlayFramePainter';
|
|
2
|
+
/**
|
|
3
|
+
* Builds a fresh {@link CaptionsOverlayFramePainter} bound to a
|
|
4
|
+
* specific document, style set, (optional) overlay HTML, and an
|
|
5
|
+
* (optional) top-layer source. The factory owns the shared,
|
|
6
|
+
* engine-wide dependencies (subtitle source, overlay renderer,
|
|
7
|
+
* compositor); each call to {@link create} returns a single-use
|
|
8
|
+
* painter for one transcode run.
|
|
9
|
+
*/
|
|
10
|
+
export class CaptionsOverlayFramePainterFactory {
|
|
11
|
+
subtitleLayer;
|
|
12
|
+
overlayRenderer;
|
|
13
|
+
frameCompositor;
|
|
14
|
+
constructor(subtitleLayer, overlayRenderer, frameCompositor) {
|
|
15
|
+
this.subtitleLayer = subtitleLayer;
|
|
16
|
+
this.overlayRenderer = overlayRenderer;
|
|
17
|
+
this.frameCompositor = frameCompositor;
|
|
18
|
+
}
|
|
19
|
+
create(document, styles, overlayHtml, topLayer = null) {
|
|
20
|
+
return new CaptionsOverlayFramePainter(this.subtitleLayer, this.overlayRenderer, this.frameCompositor, document, styles, overlayHtml, topLayer);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=CaptionsOverlayFramePainterFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaptionsOverlayFramePainterFactory.js","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/painter/CaptionsOverlayFramePainterFactory.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+DAA+D,CAAC;AAE5G;;;;;;;GAOG;AACH,MAAM,OAAO,kCAAkC;IAG1B;IACA;IACA;IAHnB,YACmB,aAAkC,EAClC,eAAqC,EACrC,eAAgC;QAFhC,kBAAa,GAAb,aAAa,CAAqB;QAClC,oBAAe,GAAf,eAAe,CAAsB;QACrC,oBAAe,GAAf,eAAe,CAAiB;IAChD,CAAC;IAEJ,MAAM,CACJ,QAAkB,EAClB,MAA+C,EAC/C,WAA+B,EAC/B,WAAkC,IAAI;QAEtC,OAAO,IAAI,2BAA2B,CACpC,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,eAAe,EACpB,IAAI,CAAC,eAAe,EACpB,QAAQ,EACR,MAAM,EACN,WAAW,EACX,QAAQ,CACT,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { DecodedVideoFrame } from '../../../video/mediabunny/frame/VideoFrameDecoder';
|
|
2
|
+
import type { PaintFrame } from '../../../video/mediabunny/encoder/VideoTrackEncoder';
|
|
3
|
+
/**
|
|
4
|
+
* Owns the pixel work for a single transcode run: what to draw into
|
|
5
|
+
* every output frame's canvas. The transcode coordinator owns the
|
|
6
|
+
* encode loop and decides *when* each frame runs; the painter decides
|
|
7
|
+
* *what* the frame looks like.
|
|
8
|
+
*
|
|
9
|
+
* Lifecycle is per-run: {@link begin} once at the start with the
|
|
10
|
+
* resolved output dimensions and source frame rate, {@link paint} for
|
|
11
|
+
* each decoded frame in monotonically advancing source-time order, and
|
|
12
|
+
* {@link end} once at the end (called on both success and failure).
|
|
13
|
+
* Instances are single-use unless the concrete class documents
|
|
14
|
+
* otherwise.
|
|
15
|
+
*
|
|
16
|
+
* The two-step {@link paint} contract exists because
|
|
17
|
+
* {@link VideoTrackEncoder.encode} takes a synchronous paint callback:
|
|
18
|
+
* any per-frame work that has to be awaited (e.g. rasterizing a
|
|
19
|
+
* caption layer) happens inside {@link paint}, and the returned
|
|
20
|
+
* closure runs synchronously against the encoder's canvas.
|
|
21
|
+
*/
|
|
22
|
+
export interface FramePainter {
|
|
23
|
+
/**
|
|
24
|
+
* Opens per-run resources (e.g. caption source, overlay raster) for
|
|
25
|
+
* a run at the given output pixel dimensions. `fps` is the source
|
|
26
|
+
* frame rate the coordinator resolved — implementations may cap or
|
|
27
|
+
* quantize it as they see fit.
|
|
28
|
+
*/
|
|
29
|
+
begin(width: number, height: number, fps: number): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Resolves any per-frame state asynchronously and returns the
|
|
32
|
+
* synchronous paint step the encoder will run. `outputTimestamp` is
|
|
33
|
+
* the frame's presentation time on the output timeline (already
|
|
34
|
+
* mapped through any skip ranges by the caller); `frame.timestamp`
|
|
35
|
+
* carries the source-timeline time and stays authoritative for any
|
|
36
|
+
* lookup against source-aligned data (captions, per-source overlays).
|
|
37
|
+
*/
|
|
38
|
+
paint(frame: DecodedVideoFrame, outputTimestamp: number): Promise<PaintFrame>;
|
|
39
|
+
/**
|
|
40
|
+
* Releases the per-run resources opened by {@link begin}. Called on
|
|
41
|
+
* both success and failure paths of the enclosing run. Idempotent:
|
|
42
|
+
* safe to call before or after {@link begin} succeeds.
|
|
43
|
+
*/
|
|
44
|
+
end(): void;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=FramePainter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FramePainter.d.ts","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/painter/FramePainter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AAC3F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qDAAqD,CAAC;AAEtF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjE;;;;;;;OAOG;IACH,KAAK,CAAC,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAE9E;;;;OAIG;IACH,GAAG,IAAI,IAAI,CAAC;CACb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FramePainter.js","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/painter/FramePainter.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { OverlayFrame } from '../../../rendering/OverlayFrameRenderer';
|
|
2
|
+
import type { DecodedVideoFrame } from '../../../video/mediabunny/frame/VideoFrameDecoder';
|
|
3
|
+
/**
|
|
4
|
+
* Produces one on-top raster per video frame — the layer the
|
|
5
|
+
* compositor paints above the caption layer. Consumers use it to
|
|
6
|
+
* occlude the captions with an effect (a person cutout, a
|
|
7
|
+
* frame-locked decoration) whose pixels depend on the source frame.
|
|
8
|
+
*
|
|
9
|
+
* Lifecycle mirrors {@link SubtitleLayerSource}: {@link open} prepares
|
|
10
|
+
* the source for a render at the given output dimensions,
|
|
11
|
+
* {@link frameAt} services each video frame in monotonically advancing
|
|
12
|
+
* `time` order, and {@link close} releases resources. Open/close pairs
|
|
13
|
+
* may repeat against the same instance, but a source cannot serve two
|
|
14
|
+
* renders concurrently.
|
|
15
|
+
*
|
|
16
|
+
* `frameAt` returns `null` when this frame has no on-top layer to
|
|
17
|
+
* paint; the compositor then skips the layer entirely for that frame.
|
|
18
|
+
*/
|
|
19
|
+
export interface TopLayerSource {
|
|
20
|
+
open(width: number, height: number): Promise<void>;
|
|
21
|
+
frameAt(time: number, videoFrame: DecodedVideoFrame): Promise<OverlayFrame | null>;
|
|
22
|
+
close(): void;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=TopLayerSource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TopLayerSource.d.ts","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/painter/TopLayerSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AAE3F;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IAEnF,KAAK,IAAI,IAAI,CAAC;CACf"}
|