@tscaps/engine 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -8
- package/dist/modules/document/CssVariable.d.ts +6 -0
- package/dist/modules/document/CssVariable.d.ts.map +1 -1
- package/dist/modules/document/CssVariable.js +6 -0
- package/dist/modules/document/CssVariable.js.map +1 -1
- package/dist/modules/document/Document.d.ts +3 -0
- package/dist/modules/document/Document.d.ts.map +1 -1
- package/dist/modules/document/Document.js +12 -1
- package/dist/modules/document/Document.js.map +1 -1
- package/dist/modules/document/DocumentEditor.d.ts +16 -4
- package/dist/modules/document/DocumentEditor.d.ts.map +1 -1
- package/dist/modules/document/DocumentEditor.js +14 -10
- package/dist/modules/document/DocumentEditor.js.map +1 -1
- package/dist/modules/document/Line.d.ts +6 -0
- package/dist/modules/document/Line.d.ts.map +1 -1
- package/dist/modules/document/Line.js +10 -0
- package/dist/modules/document/Line.js.map +1 -1
- package/dist/modules/document/Word.d.ts +8 -0
- package/dist/modules/document/Word.d.ts.map +1 -1
- package/dist/modules/document/Word.js +11 -1
- package/dist/modules/document/Word.js.map +1 -1
- package/dist/modules/pipeline/RenderPipelineBuilder.d.ts +1 -1
- package/dist/modules/pipeline/RenderPipelineBuilder.d.ts.map +1 -1
- package/dist/modules/pipeline/RenderPipelineBuilder.js +15 -5
- package/dist/modules/pipeline/RenderPipelineBuilder.js.map +1 -1
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.d.ts +18 -8
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.d.ts.map +1 -1
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js +27 -21
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js.map +1 -1
- package/dist/modules/rendering/SubtitleFrameRenderer.d.ts +41 -33
- package/dist/modules/rendering/SubtitleFrameRenderer.d.ts.map +1 -1
- package/dist/modules/rendering/index.d.ts +4 -0
- package/dist/modules/rendering/index.d.ts.map +1 -1
- package/dist/modules/rendering/index.js +2 -0
- package/dist/modules/rendering/index.js.map +1 -1
- package/dist/modules/rendering/subtitle/ActiveRenderSession.d.ts +13 -6
- package/dist/modules/rendering/subtitle/ActiveRenderSession.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/ActiveRenderSession.js +16 -9
- package/dist/modules/rendering/subtitle/ActiveRenderSession.js.map +1 -1
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.d.ts +5 -2
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.js +26 -8
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.js.map +1 -1
- package/dist/modules/rendering/subtitle/AnimationStateFingerprint.d.ts +20 -0
- package/dist/modules/rendering/subtitle/AnimationStateFingerprint.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/AnimationStateFingerprint.js +2 -0
- package/dist/modules/rendering/subtitle/AnimationStateFingerprint.js.map +1 -0
- package/dist/modules/rendering/subtitle/AssetGroupBuilder.d.ts +4 -0
- package/dist/modules/rendering/subtitle/AssetGroupBuilder.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/AssetGroupBuilder.js +8 -0
- package/dist/modules/rendering/subtitle/AssetGroupBuilder.js.map +1 -1
- package/dist/modules/rendering/subtitle/BatchPlanner.d.ts +50 -5
- package/dist/modules/rendering/subtitle/BatchPlanner.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/BatchPlanner.js +97 -15
- package/dist/modules/rendering/subtitle/BatchPlanner.js.map +1 -1
- package/dist/modules/rendering/subtitle/ElementWidthMeasurer.d.ts +56 -0
- package/dist/modules/rendering/subtitle/ElementWidthMeasurer.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/ElementWidthMeasurer.js +119 -0
- package/dist/modules/rendering/subtitle/ElementWidthMeasurer.js.map +1 -0
- package/dist/modules/rendering/subtitle/ElementWidths.d.ts +23 -0
- package/dist/modules/rendering/subtitle/ElementWidths.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/ElementWidths.js +29 -0
- package/dist/modules/rendering/subtitle/ElementWidths.js.map +1 -0
- package/dist/modules/rendering/subtitle/ImageDecodeSpriteSheetRasterProbe.d.ts +18 -0
- package/dist/modules/rendering/subtitle/ImageDecodeSpriteSheetRasterProbe.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/ImageDecodeSpriteSheetRasterProbe.js +42 -0
- package/dist/modules/rendering/subtitle/ImageDecodeSpriteSheetRasterProbe.js.map +1 -0
- package/dist/modules/rendering/subtitle/KeyframeScanAnimationStateFingerprint.d.ts +35 -0
- package/dist/modules/rendering/subtitle/KeyframeScanAnimationStateFingerprint.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/KeyframeScanAnimationStateFingerprint.js +64 -0
- package/dist/modules/rendering/subtitle/KeyframeScanAnimationStateFingerprint.js.map +1 -0
- package/dist/modules/rendering/subtitle/PreparedStyle.d.ts +2 -0
- package/dist/modules/rendering/subtitle/PreparedStyle.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/PreparedStyleFactory.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/PreparedStyleFactory.js +12 -1
- package/dist/modules/rendering/subtitle/PreparedStyleFactory.js.map +1 -1
- package/dist/modules/rendering/subtitle/SegmentAnchorVarsBuilder.d.ts +28 -0
- package/dist/modules/rendering/subtitle/SegmentAnchorVarsBuilder.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SegmentAnchorVarsBuilder.js +23 -0
- package/dist/modules/rendering/subtitle/SegmentAnchorVarsBuilder.js.map +1 -0
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.d.ts +3 -0
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.js +12 -3
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.js.map +1 -1
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.d.ts +7 -1
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.js +23 -5
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.js.map +1 -1
- package/dist/modules/rendering/subtitle/SpriteSheetProbeObserver.d.ts +29 -0
- package/dist/modules/rendering/subtitle/SpriteSheetProbeObserver.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SpriteSheetProbeObserver.js +2 -0
- package/dist/modules/rendering/subtitle/SpriteSheetProbeObserver.js.map +1 -0
- package/dist/modules/rendering/subtitle/SpriteSheetRasterProbe.d.ts +19 -0
- package/dist/modules/rendering/subtitle/SpriteSheetRasterProbe.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SpriteSheetRasterProbe.js +2 -0
- package/dist/modules/rendering/subtitle/SpriteSheetRasterProbe.js.map +1 -0
- package/dist/modules/rendering/subtitle/SpriteSheetSizeProbe.d.ts +31 -0
- package/dist/modules/rendering/subtitle/SpriteSheetSizeProbe.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SpriteSheetSizeProbe.js +89 -0
- package/dist/modules/rendering/subtitle/SpriteSheetSizeProbe.js.map +1 -0
- package/dist/modules/rendering/subtitle/SubtreeAnimationReading.d.ts +49 -0
- package/dist/modules/rendering/subtitle/SubtreeAnimationReading.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SubtreeAnimationReading.js +87 -0
- package/dist/modules/rendering/subtitle/SubtreeAnimationReading.js.map +1 -0
- package/dist/modules/rendering/subtitle/SubtreeAnimationSupport.d.ts +17 -0
- package/dist/modules/rendering/subtitle/SubtreeAnimationSupport.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SubtreeAnimationSupport.js +53 -0
- package/dist/modules/rendering/subtitle/SubtreeAnimationSupport.js.map +1 -0
- package/dist/modules/rendering/subtitle/SubtreeMountAnimationStateFingerprint.d.ts +62 -0
- package/dist/modules/rendering/subtitle/SubtreeMountAnimationStateFingerprint.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SubtreeMountAnimationStateFingerprint.js +153 -0
- package/dist/modules/rendering/subtitle/SubtreeMountAnimationStateFingerprint.js.map +1 -0
- package/dist/modules/rendering/subtitle/SvgFilterStateFingerprint.d.ts +47 -0
- package/dist/modules/rendering/subtitle/SvgFilterStateFingerprint.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/SvgFilterStateFingerprint.js +69 -0
- package/dist/modules/rendering/subtitle/SvgFilterStateFingerprint.js.map +1 -0
- package/dist/modules/rendering/subtitle/UnknownAnimationStateFingerprint.d.ts +9 -0
- package/dist/modules/rendering/subtitle/UnknownAnimationStateFingerprint.d.ts.map +1 -0
- package/dist/modules/rendering/subtitle/UnknownAnimationStateFingerprint.js +10 -0
- package/dist/modules/rendering/subtitle/UnknownAnimationStateFingerprint.js.map +1 -0
- package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.js +2 -0
- package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.js.map +1 -1
- package/dist/modules/rendering/types/ElementRenderOverrides.d.ts +2 -0
- package/dist/modules/rendering/types/ElementRenderOverrides.d.ts.map +1 -1
- package/dist/modules/rendering/types/ElementRenderOverrides.js +4 -0
- package/dist/modules/rendering/types/ElementRenderOverrides.js.map +1 -1
- package/dist/modules/splitting/BalancedLineSplitter.d.ts +9 -0
- package/dist/modules/splitting/BalancedLineSplitter.d.ts.map +1 -1
- package/dist/modules/splitting/BalancedLineSplitter.js +15 -3
- package/dist/modules/splitting/BalancedLineSplitter.js.map +1 -1
- package/dist/modules/splitting/BalancedPixelWidthLineSplitter.d.ts +1 -4
- package/dist/modules/splitting/BalancedPixelWidthLineSplitter.d.ts.map +1 -1
- package/dist/modules/splitting/BalancedPixelWidthLineSplitter.js +5 -7
- package/dist/modules/splitting/BalancedPixelWidthLineSplitter.js.map +1 -1
- package/dist/modules/splitting/DomProbeCanvasTextMeasurer.d.ts +16 -7
- package/dist/modules/splitting/DomProbeCanvasTextMeasurer.d.ts.map +1 -1
- package/dist/modules/splitting/DomProbeCanvasTextMeasurer.js +44 -33
- package/dist/modules/splitting/DomProbeCanvasTextMeasurer.js.map +1 -1
- package/dist/modules/splitting/TextMeasurer.d.ts +9 -4
- package/dist/modules/splitting/TextMeasurer.d.ts.map +1 -1
- package/dist/modules/svg-filter/SvgFilter.d.ts +9 -0
- package/dist/modules/svg-filter/SvgFilter.d.ts.map +1 -1
- package/dist/modules/svg-filter/SvgFilter.js +17 -0
- package/dist/modules/svg-filter/SvgFilter.js.map +1 -1
- package/dist/modules/svg-filter/SvgFilterDefinitions.d.ts +7 -0
- package/dist/modules/svg-filter/SvgFilterDefinitions.d.ts.map +1 -1
- package/dist/modules/svg-filter/SvgFilterDefinitions.js +17 -0
- package/dist/modules/svg-filter/SvgFilterDefinitions.js.map +1 -1
- package/dist/modules/tagging/RegexTagger.js +1 -2
- package/dist/modules/tagging/RegexTagger.js.map +1 -1
- package/dist/modules/tagging/SpanTagger.js +1 -2
- package/dist/modules/tagging/SpanTagger.js.map +1 -1
- package/dist/modules/tagging/StructureTagger.js +1 -2
- package/dist/modules/tagging/StructureTagger.js.map +1 -1
- package/dist/modules/tagging/WordlistTagger.js +1 -2
- package/dist/modules/tagging/WordlistTagger.js.map +1 -1
- package/dist/modules/transcription/AudioSegmentLayout.d.ts +23 -0
- package/dist/modules/transcription/AudioSegmentLayout.d.ts.map +1 -0
- package/dist/modules/transcription/AudioSegmentLayout.js +40 -0
- package/dist/modules/transcription/AudioSegmentLayout.js.map +1 -0
- package/dist/modules/transcription/FallbackAudioDecoder.d.ts +25 -0
- package/dist/modules/transcription/FallbackAudioDecoder.d.ts.map +1 -0
- package/dist/modules/transcription/FallbackAudioDecoder.js +46 -0
- package/dist/modules/transcription/FallbackAudioDecoder.js.map +1 -0
- package/dist/modules/transcription/MediaBunnyAudioOnlyRemuxer.d.ts +71 -0
- package/dist/modules/transcription/MediaBunnyAudioOnlyRemuxer.d.ts.map +1 -0
- package/dist/modules/transcription/MediaBunnyAudioOnlyRemuxer.js +145 -0
- package/dist/modules/transcription/MediaBunnyAudioOnlyRemuxer.js.map +1 -0
- package/dist/modules/transcription/WebAudioAudioDecoder.d.ts +46 -0
- package/dist/modules/transcription/WebAudioAudioDecoder.d.ts.map +1 -0
- package/dist/modules/transcription/WebAudioAudioDecoder.js +123 -0
- package/dist/modules/transcription/WebAudioAudioDecoder.js.map +1 -0
- package/dist/modules/transcription/index.d.ts +4 -0
- package/dist/modules/transcription/index.d.ts.map +1 -1
- package/dist/modules/transcription/index.js +3 -0
- package/dist/modules/transcription/index.js.map +1 -1
- package/dist/modules/video/RenderJob.d.ts +23 -0
- package/dist/modules/video/RenderJob.d.ts.map +1 -1
- package/dist/modules/video/index.d.ts +5 -3
- package/dist/modules/video/index.d.ts.map +1 -1
- package/dist/modules/video/index.js +2 -0
- package/dist/modules/video/index.js.map +1 -1
- package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.d.ts +33 -1
- package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.js +97 -20
- package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.js.map +1 -1
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.js +1 -0
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.js.map +1 -1
- package/dist/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.d.ts +20 -9
- package/dist/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.js +56 -14
- package/dist/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.js.map +1 -1
- package/dist/modules/video/mediabunny/caption/ComposedSubtitleLayerSource.d.ts +29 -10
- package/dist/modules/video/mediabunny/caption/ComposedSubtitleLayerSource.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/caption/ComposedSubtitleLayerSource.js +48 -17
- package/dist/modules/video/mediabunny/caption/ComposedSubtitleLayerSource.js.map +1 -1
- package/dist/modules/video/mediabunny/caption/SubtitleLayerSource.d.ts +28 -11
- package/dist/modules/video/mediabunny/caption/SubtitleLayerSource.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/caption/VideoBoundSubtitleLayerSource.d.ts +33 -12
- package/dist/modules/video/mediabunny/caption/VideoBoundSubtitleLayerSource.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/caption/VideoBoundSubtitleLayerSource.js +53 -18
- package/dist/modules/video/mediabunny/caption/VideoBoundSubtitleLayerSource.js.map +1 -1
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoder.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoder.js +7 -3
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoder.js.map +1 -1
- package/dist/modules/video/mediabunny/frame/BufferedVideoFrameSource.d.ts +45 -0
- package/dist/modules/video/mediabunny/frame/BufferedVideoFrameSource.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/BufferedVideoFrameSource.js +93 -0
- package/dist/modules/video/mediabunny/frame/BufferedVideoFrameSource.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/DefaultVideoFrameDecoderFactory.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/frame/DefaultVideoFrameDecoderFactory.js +3 -1
- package/dist/modules/video/mediabunny/frame/DefaultVideoFrameDecoderFactory.js.map +1 -1
- package/dist/modules/video/mediabunny/frame/RetainedVideoFrame.d.ts +26 -0
- package/dist/modules/video/mediabunny/frame/RetainedVideoFrame.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/RetainedVideoFrame.js +55 -0
- package/dist/modules/video/mediabunny/frame/RetainedVideoFrame.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoderFactory.d.ts +6 -1
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoderFactory.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoderSelectionFailedError.d.ts +14 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoderSelectionFailedError.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoderSelectionFailedError.js +14 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoderSelectionFailedError.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/WebCodecsOnlyVideoFrameDecoderFactory.d.ts +16 -0
- package/dist/modules/video/mediabunny/frame/WebCodecsOnlyVideoFrameDecoderFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/WebCodecsOnlyVideoFrameDecoderFactory.js +23 -0
- package/dist/modules/video/mediabunny/frame/WebCodecsOnlyVideoFrameDecoderFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.d.ts +9 -3
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.js +24 -7
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.js.map +1 -1
- package/dist/modules/video/mediabunny/painter/FramePainter.d.ts +35 -14
- package/dist/modules/video/mediabunny/painter/FramePainter.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/modules/rendering/subtitle/AbstractAnim.d.ts +0 -13
- package/dist/modules/rendering/subtitle/AbstractAnim.d.ts.map +0 -1
- package/dist/modules/rendering/subtitle/AbstractAnim.js +0 -2
- package/dist/modules/rendering/subtitle/AbstractAnim.js.map +0 -1
- package/dist/modules/rendering/subtitle/AnimationProbe.d.ts +0 -39
- package/dist/modules/rendering/subtitle/AnimationProbe.d.ts.map +0 -1
- package/dist/modules/rendering/subtitle/AnimationProbe.js +0 -203
- package/dist/modules/rendering/subtitle/AnimationProbe.js.map +0 -1
- package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.d.ts +0 -17
- package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.d.ts.map +0 -1
- package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.js +0 -58
- package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.js.map +0 -1
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts +0 -27
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts.map +0 -1
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js +0 -84
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js.map +0 -1
|
@@ -5,6 +5,8 @@ export { CaptionsOverlayFramePainterFactory } from '../video/mediabunny/painter/
|
|
|
5
5
|
export { RenderTimeMap } from '../video/RenderTimeMap';
|
|
6
6
|
export { DefaultCodecPolicy } from '../video/mediabunny/codec/DefaultCodecPolicy';
|
|
7
7
|
export { DefaultVideoFrameDecoderFactory } from '../video/mediabunny/frame/DefaultVideoFrameDecoderFactory';
|
|
8
|
+
export { WebCodecsOnlyVideoFrameDecoderFactory } from '../video/mediabunny/frame/WebCodecsOnlyVideoFrameDecoderFactory';
|
|
9
|
+
export { VideoFrameDecoderSelectionFailedError } from '../video/mediabunny/frame/VideoFrameDecoderSelectionFailedError';
|
|
8
10
|
export { WebCodecsVideoFrameDecoder } from '../video/mediabunny/frame/WebCodecsVideoFrameDecoder';
|
|
9
11
|
export { HtmlVideoElementVideoFrameDecoder } from '../video/mediabunny/frame/HtmlVideoElementVideoFrameDecoder';
|
|
10
12
|
export { MediaBunnyCanvasVideoTrackEncoder, } from '../video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoder';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/video/index.ts"],"names":[],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6BAA6B,EAAE,MAAM,gEAAgE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RenderTimeMap } from '../../video/RenderTimeMap';
|
|
2
|
-
import type { OutputFormat, RenderOutputChunk, RenderProgress, RenderQuality, AudioDiscardReason, FallbackDecoderInfo } from '../../video/RenderJob';
|
|
2
|
+
import type { OutputFormat, RenderOutputChunk, RenderProgress, RenderQuality, AudioDiscardReason, FallbackDecoderInfo, VideoFrameDecoderSelection } from '../../video/RenderJob';
|
|
3
3
|
import type { CodecPolicy } from '../../video/mediabunny/codec/CodecPolicy';
|
|
4
4
|
import type { VideoFrameDecoderFactory } from '../../video/mediabunny/frame/VideoFrameDecoderFactory';
|
|
5
5
|
import type { AudioTrackBridgeFactory } from '../../video/mediabunny/audio/AudioTrackBridgeFactory';
|
|
@@ -53,9 +53,17 @@ export interface MediaBunnyTranscodeRequest {
|
|
|
53
53
|
* the window's duration. Defaults to an empty map (nothing skipped).
|
|
54
54
|
*/
|
|
55
55
|
timeMap?: RenderTimeMap;
|
|
56
|
+
/**
|
|
57
|
+
* Abandons the run. Checked between frames, so it stops cleanly
|
|
58
|
+
* rather than mid-write; the partial output is discarded and cannot
|
|
59
|
+
* be resumed. Rejects with an `AbortError`, which callers should
|
|
60
|
+
* distinguish from a transcode failure by name.
|
|
61
|
+
*/
|
|
62
|
+
signal?: AbortSignal;
|
|
56
63
|
onProgress?: (progress: RenderProgress) => void;
|
|
57
64
|
onAudioDiscarded?: (reason: AudioDiscardReason) => void;
|
|
58
65
|
confirmFallbackDecoder?: (info: FallbackDecoderInfo) => Promise<boolean>;
|
|
66
|
+
onVideoFrameDecoderSelected?: (selection: VideoFrameDecoderSelection) => void;
|
|
59
67
|
}
|
|
60
68
|
export interface MediaBunnyTranscodeResult {
|
|
61
69
|
/** Encoded file in memory, or `null` when the request supplied `outputStream`. */
|
|
@@ -88,7 +96,31 @@ export declare class MediaBunnyTranscodeCoordinator {
|
|
|
88
96
|
private readonly outputTargetBuilder;
|
|
89
97
|
constructor(config: MediaBunnyTranscodeCoordinatorConfig);
|
|
90
98
|
execute(request: MediaBunnyTranscodeRequest): Promise<MediaBunnyTranscodeResult>;
|
|
99
|
+
/**
|
|
100
|
+
* Drives decode → paint → encode, handing the painter runs of frames
|
|
101
|
+
* as long as it asked for.
|
|
102
|
+
*
|
|
103
|
+
* Only one frame the decoder lent us is ever alive: holding several
|
|
104
|
+
* would back-pressure the WebCodecs frame pool into a stall. A run
|
|
105
|
+
* longer than one frame is therefore held as copies of our own, paid
|
|
106
|
+
* for in a full-frame draw and the pixels of every frame in the run.
|
|
107
|
+
*/
|
|
91
108
|
private runEncodeLoop;
|
|
109
|
+
/**
|
|
110
|
+
* The frame as the painter will receive it. A run of one is handed the
|
|
111
|
+
* decoder's own frame, which the run closes when it is done with it. A
|
|
112
|
+
* longer run outlives what the decoder will lend, so the pixels are
|
|
113
|
+
* copied and its frame handed straight back — whether or not the copy
|
|
114
|
+
* succeeds, since a frame the decoder never gets back stalls its pool.
|
|
115
|
+
*/
|
|
116
|
+
private toPaintRequest;
|
|
117
|
+
/**
|
|
118
|
+
* Paints a whole run, then encodes and pumps audio for each of its
|
|
119
|
+
* frames in order. Empties `group` on the way out, closing every
|
|
120
|
+
* frame it held. Returns the running output-frame count.
|
|
121
|
+
*/
|
|
122
|
+
private encodeGroup;
|
|
123
|
+
private closeGroup;
|
|
92
124
|
private toEncoderConfig;
|
|
93
125
|
private computeDuration;
|
|
94
126
|
private resolveOutputDimensions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaBunnyTranscodeCoordinator.d.ts","sourceRoot":"","sources":["../../../../src/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"MediaBunnyTranscodeCoordinator.d.ts","sourceRoot":"","sources":["../../../../src/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,0BAA0B,EAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,WAAW,EAAwB,MAAM,6CAA6C,CAAC;AACrG,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0DAA0D,CAAC;AAEzG,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAEvG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAEhG,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4DAA4D,CAAC;AAC3G,OAAO,KAAK,EAAE,YAAY,EAAqB,MAAM,gDAAgD,CAAC;AAItG,MAAM,WAAW,oCAAoC;IACnD,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,uBAAuB,EAAE,uBAAuB,CAAC;IACjD,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,IAAI,CAAC;IACb;;;;OAIG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;;OAGG;IACH,OAAO,EAAE,YAAY,CAAC;IACtB;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACrD,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,cAAc,CAAC,iBAAiB,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MJ,UAAU;IASxB,OAAO,CAAC,wBAAwB;IAShC,OAAO,CAAC,WAAW;CAepB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Input, BlobSource, ALL_FORMATS, } from 'mediabunny';
|
|
2
2
|
import { RenderTimeMap } from '../../video/RenderTimeMap';
|
|
3
|
+
import { RetainedVideoFrame } from '../../video/mediabunny/frame/RetainedVideoFrame';
|
|
3
4
|
/**
|
|
4
5
|
* Runs one mediabunny transcode: opens the source input, resolves the
|
|
5
6
|
* output dimensions / frame rate / duration, wires the encoder and the
|
|
@@ -64,6 +65,7 @@ export class MediaBunnyTranscodeCoordinator {
|
|
|
64
65
|
track: videoTrack,
|
|
65
66
|
source: request.source,
|
|
66
67
|
...(request.confirmFallbackDecoder ? { confirmFallback: request.confirmFallbackDecoder } : {}),
|
|
68
|
+
...(request.onVideoFrameDecoderSelected ? { onDecoderSelected: request.onVideoFrameDecoderSelected } : {}),
|
|
67
69
|
});
|
|
68
70
|
const sourceDuration = await this.computeDuration(videoTrack);
|
|
69
71
|
const outputDuration = Math.max(0, sourceDuration - timeMap.totalSkipDuration());
|
|
@@ -78,7 +80,11 @@ export class MediaBunnyTranscodeCoordinator {
|
|
|
78
80
|
audioBridge,
|
|
79
81
|
timeMap,
|
|
80
82
|
outputDuration,
|
|
83
|
+
totalFrames: Math.round(outputDuration * fps),
|
|
81
84
|
painter: request.painter,
|
|
85
|
+
width,
|
|
86
|
+
height,
|
|
87
|
+
signal: request.signal,
|
|
82
88
|
onProgress: request.onProgress,
|
|
83
89
|
});
|
|
84
90
|
await audioBridge.finish();
|
|
@@ -95,30 +101,46 @@ export class MediaBunnyTranscodeCoordinator {
|
|
|
95
101
|
}
|
|
96
102
|
return this.buildResult(target, request.outputFormat, width, height);
|
|
97
103
|
}
|
|
98
|
-
|
|
99
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Drives decode → paint → encode, handing the painter runs of frames
|
|
106
|
+
* as long as it asked for.
|
|
107
|
+
*
|
|
108
|
+
* Only one frame the decoder lent us is ever alive: holding several
|
|
109
|
+
* would back-pressure the WebCodecs frame pool into a stall. A run
|
|
110
|
+
* longer than one frame is therefore held as copies of our own, paid
|
|
111
|
+
* for in a full-frame draw and the pixels of every frame in the run.
|
|
112
|
+
*/
|
|
100
113
|
async runEncodeLoop(params) {
|
|
114
|
+
const lookAhead = Math.max(1, params.painter.lookAhead());
|
|
115
|
+
const group = [];
|
|
101
116
|
let decodedCount = 0;
|
|
102
117
|
let frameCount = 0;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
118
|
+
try {
|
|
119
|
+
for await (const frame of params.decoder.samples()) {
|
|
120
|
+
// Checked before the frame joins the group, so it is closed here
|
|
121
|
+
// rather than left to the `finally`.
|
|
122
|
+
if (params.signal?.aborted) {
|
|
123
|
+
frame.close();
|
|
124
|
+
throw new DOMException('The transcode was aborted.', 'AbortError');
|
|
125
|
+
}
|
|
126
|
+
decodedCount++;
|
|
127
|
+
if (frame.timestamp < 0 || params.timeMap.isSkipped(frame.timestamp)) {
|
|
128
|
+
frame.close();
|
|
109
129
|
continue;
|
|
110
|
-
const outputTimestamp = params.timeMap.toOutputTime(frame.timestamp);
|
|
111
|
-
const paintFrame = await params.painter.paint(frame, outputTimestamp);
|
|
112
|
-
await params.encoder.encode(outputTimestamp, frame.duration, paintFrame);
|
|
113
|
-
await params.audioBridge.pumpUntil(frame.timestamp);
|
|
114
|
-
frameCount++;
|
|
115
|
-
if (params.onProgress) {
|
|
116
|
-
params.onProgress(this.toProgress(outputTimestamp, params.outputDuration, frameCount));
|
|
117
130
|
}
|
|
131
|
+
group.push(this.toPaintRequest(frame, params, lookAhead));
|
|
132
|
+
if (group.length < lookAhead)
|
|
133
|
+
continue;
|
|
134
|
+
frameCount = await this.encodeGroup(group, params, frameCount);
|
|
118
135
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
136
|
+
// Whatever the last run was short of: the decoder ended before the
|
|
137
|
+
// painter's reach filled up, which is the normal way a render ends.
|
|
138
|
+
await this.encodeGroup(group, params, frameCount);
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
// A run abandoned half-gathered still holds frames nobody will
|
|
142
|
+
// encode: the decoder threw partway, or retaining one did.
|
|
143
|
+
this.closeGroup(group);
|
|
122
144
|
}
|
|
123
145
|
// Some decoders drop undecodable samples silently instead of erroring.
|
|
124
146
|
// Finalizing with zero decoded frames would emit an output whose video
|
|
@@ -127,6 +149,60 @@ export class MediaBunnyTranscodeCoordinator {
|
|
|
127
149
|
throw new Error('The video decoder produced no frames for this input.');
|
|
128
150
|
}
|
|
129
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* The frame as the painter will receive it. A run of one is handed the
|
|
154
|
+
* decoder's own frame, which the run closes when it is done with it. A
|
|
155
|
+
* longer run outlives what the decoder will lend, so the pixels are
|
|
156
|
+
* copied and its frame handed straight back — whether or not the copy
|
|
157
|
+
* succeeds, since a frame the decoder never gets back stalls its pool.
|
|
158
|
+
*/
|
|
159
|
+
toPaintRequest(frame, params, lookAhead) {
|
|
160
|
+
const outputTimestamp = params.timeMap.toOutputTime(frame.timestamp);
|
|
161
|
+
if (lookAhead === 1)
|
|
162
|
+
return { frame, outputTimestamp };
|
|
163
|
+
try {
|
|
164
|
+
return {
|
|
165
|
+
frame: RetainedVideoFrame.copyOf(frame, params.width, params.height),
|
|
166
|
+
outputTimestamp,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
finally {
|
|
170
|
+
frame.close();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Paints a whole run, then encodes and pumps audio for each of its
|
|
175
|
+
* frames in order. Empties `group` on the way out, closing every
|
|
176
|
+
* frame it held. Returns the running output-frame count.
|
|
177
|
+
*/
|
|
178
|
+
async encodeGroup(group, params, frameCount) {
|
|
179
|
+
if (group.length === 0)
|
|
180
|
+
return frameCount;
|
|
181
|
+
let counted = frameCount;
|
|
182
|
+
try {
|
|
183
|
+
const paints = await params.painter.paint(group);
|
|
184
|
+
if (paints.length !== group.length) {
|
|
185
|
+
throw new Error(`The painter returned ${paints.length} paint steps for a run of ${group.length} frames.`);
|
|
186
|
+
}
|
|
187
|
+
for (const [i, request] of group.entries()) {
|
|
188
|
+
await params.encoder.encode(request.outputTimestamp, request.frame.duration, paints[i]);
|
|
189
|
+
await params.audioBridge.pumpUntil(request.frame.timestamp);
|
|
190
|
+
counted++;
|
|
191
|
+
if (params.onProgress) {
|
|
192
|
+
params.onProgress(this.toProgress(params, request.outputTimestamp, counted));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
finally {
|
|
197
|
+
this.closeGroup(group);
|
|
198
|
+
}
|
|
199
|
+
return counted;
|
|
200
|
+
}
|
|
201
|
+
closeGroup(group) {
|
|
202
|
+
for (const request of group)
|
|
203
|
+
request.frame.close();
|
|
204
|
+
group.length = 0;
|
|
205
|
+
}
|
|
130
206
|
toEncoderConfig(resolution) {
|
|
131
207
|
const config = {
|
|
132
208
|
codec: resolution.codec,
|
|
@@ -172,9 +248,10 @@ export class MediaBunnyTranscodeCoordinator {
|
|
|
172
248
|
console.warn('Could not determine input frame rate; defaulting to 30 fps');
|
|
173
249
|
return 30;
|
|
174
250
|
}
|
|
175
|
-
toProgress(
|
|
251
|
+
toProgress(params, timestamp, frameCount) {
|
|
252
|
+
const duration = params.outputDuration;
|
|
176
253
|
const percent = duration > 0 ? Math.min(100, Math.round((timestamp / duration) * 100)) : 0;
|
|
177
|
-
return { percent, currentFrame: frameCount, totalFrames:
|
|
254
|
+
return { percent, currentFrame: frameCount, totalFrames: params.totalFrames };
|
|
178
255
|
}
|
|
179
256
|
async safeCancel(output) {
|
|
180
257
|
if (output.state === 'finalized' || output.state === 'canceled')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaBunnyTranscodeCoordinator.js","sourceRoot":"","sources":["../../../../src/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,UAAU,EACV,WAAW,GAIZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"MediaBunnyTranscodeCoordinator.js","sourceRoot":"","sources":["../../../../src/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,UAAU,EACV,WAAW,GAIZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAoB7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAoFxF;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,8BAA8B;IAExB,wBAAwB,CAA2B;IACnD,wBAAwB,CAA2B;IACnD,uBAAuB,CAA0B;IACjD,mBAAmB,CAAsB;IAE1D,YAAY,MAA4C;QACtD,IAAI,CAAC,wBAAwB,GAAG,MAAM,CAAC,wBAAwB,CAAC;QAChE,IAAI,CAAC,wBAAwB,GAAG,MAAM,CAAC,wBAAwB,CAAC;QAChE,IAAI,CAAC,uBAAuB,GAAG,MAAM,CAAC,uBAAuB,CAAC;QAC9D,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;IACxD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAmC;QAC/C,IAAI,CAAC,wBAAwB,EAAE,CAAC;QAEhC,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC1F,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,oBAAoB,EAAE,CAAC;QACtD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAA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Ac,CAAqC;gBAExD,MAAM,EAAE,6BAA6B;IAM3C,MAAM,CACV,GAAG,EAAE,SAAS,EACd,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,GAC9C,OAAO,CAAC,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"MediaBunnyVideoRenderer.d.ts","sourceRoot":"","sources":["../../../../src/modules/video/mediabunny/MediaBunnyVideoRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAExF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,0DAA0D,CAAC;AAC/G,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,sEAAsE,CAAC;AAE/H,MAAM,WAAW,6BAA6B;IAC5C,WAAW,EAAE,8BAA8B,CAAC;IAC5C,WAAW,EAAE,WAAW,CAAC;IACzB,cAAc,EAAE,kCAAkC,CAAC;CACpD;AAED;;;;;;;;;;GAUG;AACH,qBAAa,uBAAwB,YAAW,aAAa;IAE3D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiC;IAC7D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;IAC1C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAqC;gBAExD,MAAM,EAAE,6BAA6B;IAM3C,MAAM,CACV,GAAG,EAAE,SAAS,EACd,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,GAC9C,OAAO,CAAC,YAAY,CAAC;CAmBzB"}
|
|
@@ -34,6 +34,7 @@ export class MediaBunnyVideoRenderer {
|
|
|
34
34
|
...(onProgress ? { onProgress } : {}),
|
|
35
35
|
...(job.onAudioDiscarded ? { onAudioDiscarded: job.onAudioDiscarded } : {}),
|
|
36
36
|
...(job.confirmFallbackDecoder ? { confirmFallbackDecoder: job.confirmFallbackDecoder } : {}),
|
|
37
|
+
...(job.onVideoFrameDecoderSelected ? { onVideoFrameDecoderSelected: job.onVideoFrameDecoderSelected } : {}),
|
|
37
38
|
});
|
|
38
39
|
return { blob: result.blob, mimeType: result.mimeType };
|
|
39
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaBunnyVideoRenderer.js","sourceRoot":"","sources":["../../../../src/modules/video/mediabunny/MediaBunnyVideoRenderer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAW7D;;;;;;;;;;GAUG;AACH,MAAM,OAAO,uBAAuB;IAEjB,WAAW,CAAiC;IAC5C,WAAW,CAAc;IACzB,cAAc,CAAqC;IAEpE,YAAY,MAAqC;QAC/C,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;QACtC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;QACtC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,MAAM,CACV,GAAc,EACd,UAA+C;QAE/C,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC;QAC5G,MAAM,OAAO,GAAG,IAAI,aAAa,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;QACxD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;YAC5C,MAAM,EAAE,GAAG,CAAC,KAAK;YACjB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,OAAO;YACP,OAAO;YACP,GAAG,CAAC,GAAG,CAAC,gBAAgB,CA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AAG,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3E,GAAG,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,sBAAsB,EAAE,GAAG,CAAC,sBAAsB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7F,GAAG,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC,CAAC,EAAE,2BAA2B,EAAE,GAAG,CAAC,2BAA2B,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC7G,CAAC,CAAC;QACH,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC1D,CAAC;CACF"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import type { Document } from '../../../document/Document';
|
|
2
2
|
import type { SubtitleFrame, SubtitleFrameRenderer, SubtitleStyle } from '../../../rendering/SubtitleFrameRenderer';
|
|
3
|
-
import type {
|
|
4
|
-
import type { SubtitleLayerSource } from '../../../video/mediabunny/caption/SubtitleLayerSource';
|
|
3
|
+
import type { SubtitleLayerRequest, SubtitleLayerSource } from '../../../video/mediabunny/caption/SubtitleLayerSource';
|
|
5
4
|
/**
|
|
6
|
-
* `SubtitleLayerSource` that renders ahead in chunks
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* `SubtitleLayerSource` that renders ahead in chunks, amortizing the
|
|
6
|
+
* fixed cost of a batch fetch across many video frames. The decoded
|
|
7
|
+
* video frame carried by each request is ignored.
|
|
8
|
+
*
|
|
9
|
+
* A chunk is as long as the renderer's batch reaches, which is decided
|
|
10
|
+
* by how many distinct pictures the captions need rather than by a
|
|
11
|
+
* frame count: a caption that holds still is one picture, however many
|
|
12
|
+
* frames sit on it. So the source offers a whole look-ahead of ticks
|
|
13
|
+
* and advances by what came back.
|
|
10
14
|
*
|
|
11
15
|
* Picks the right strategy for sections whose stylesheets are
|
|
12
16
|
* independent of the underlying video pixels.
|
|
13
17
|
*
|
|
14
|
-
* Times handed to `
|
|
18
|
+
* Times handed to `framesFor` are expected to land on a caption tick
|
|
15
19
|
* (a multiple of the `captionInterval` supplied at `open`); the
|
|
16
20
|
* source rounds to absorb the FP roundtrip but does not snap from
|
|
17
21
|
* arbitrary timestamps.
|
|
@@ -19,13 +23,20 @@ import type { SubtitleLayerSource } from '../../../video/mediabunny/caption/Subt
|
|
|
19
23
|
export declare class BatchedSubtitleLayerSource implements SubtitleLayerSource {
|
|
20
24
|
private readonly subtitleRenderer;
|
|
21
25
|
private captionInterval;
|
|
22
|
-
private
|
|
26
|
+
private lookAheadTicks;
|
|
23
27
|
private currentChunkFirstIdx;
|
|
24
28
|
private currentChunkFrames;
|
|
25
29
|
private opened;
|
|
26
30
|
constructor(subtitleRenderer: SubtitleFrameRenderer);
|
|
27
31
|
open(doc: Document, styles: Readonly<Record<string, SubtitleStyle>>, width: number, height: number, captionInterval: number): Promise<void>;
|
|
28
|
-
|
|
32
|
+
/**
|
|
33
|
+
* One, because the look-ahead this source lives on is its own: it
|
|
34
|
+
* reaches forward in document time, which needs no video frame and
|
|
35
|
+
* therefore nothing gathered by the caller.
|
|
36
|
+
*/
|
|
37
|
+
lookAhead(): number;
|
|
38
|
+
framesFor(requests: ReadonlyArray<SubtitleLayerRequest>): Promise<Array<SubtitleFrame | null>>;
|
|
39
|
+
private frameAt;
|
|
29
40
|
close(): void;
|
|
30
41
|
private loadNextChunk;
|
|
31
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BatchedSubtitleLayerSource.d.ts","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,aAAa,EACd,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"BatchedSubtitleLayerSource.d.ts","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,aAAa,EACd,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,uDAAuD,CAAC;AAkB/D;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,0BAA2B,YAAW,mBAAmB;IAQxD,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IAN7C,OAAO,CAAC,eAAe,CAAK;IAC5B,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,oBAAoB,CAAK;IACjC,OAAO,CAAC,kBAAkB,CAA2C;IACrE,OAAO,CAAC,MAAM,CAAS;gBAEM,gBAAgB,EAAE,qBAAqB;IAE9D,IAAI,CACR,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,EAC/C,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC;IAiBhB;;;;OAIG;IACH,SAAS,IAAI,MAAM;IAIb,SAAS,CAAC,QAAQ,EAAE,aAAa,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;YAQtF,OAAO;IASrB,KAAK,IAAI,IAAI;YAMC,aAAa;CAc5B"}
|
|
@@ -1,13 +1,33 @@
|
|
|
1
|
+
// How much video one chunk may cover. The batch usually ends long
|
|
2
|
+
// before this, at the first tick whose picture its sheet cannot hold;
|
|
3
|
+
// what this decides is the other end, where the captions hold so still
|
|
4
|
+
// that the sheet never fills. There a longer reach is strictly better
|
|
5
|
+
// value — a caption still for 25 s spans three sheets at 10 and one at
|
|
6
|
+
// 30 — so this is a ceiling on the saving, and it is a judgement rather
|
|
7
|
+
// than a measurement: long enough that a caption rarely outlives it,
|
|
8
|
+
// short enough that one step stays a slice a caller can wait for, since
|
|
9
|
+
// planning and rendering block until the chunk is done and the frames it
|
|
10
|
+
// hands back are held until the next one.
|
|
11
|
+
//
|
|
12
|
+
// Bounded whatever the video: caption ticks are capped at 30/s, so a
|
|
13
|
+
// chunk never exceeds 300 of them, and a longer video only means more
|
|
14
|
+
// chunks.
|
|
15
|
+
const MAX_CHUNK_SECONDS = 10;
|
|
1
16
|
/**
|
|
2
|
-
* `SubtitleLayerSource` that renders ahead in chunks
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
17
|
+
* `SubtitleLayerSource` that renders ahead in chunks, amortizing the
|
|
18
|
+
* fixed cost of a batch fetch across many video frames. The decoded
|
|
19
|
+
* video frame carried by each request is ignored.
|
|
20
|
+
*
|
|
21
|
+
* A chunk is as long as the renderer's batch reaches, which is decided
|
|
22
|
+
* by how many distinct pictures the captions need rather than by a
|
|
23
|
+
* frame count: a caption that holds still is one picture, however many
|
|
24
|
+
* frames sit on it. So the source offers a whole look-ahead of ticks
|
|
25
|
+
* and advances by what came back.
|
|
6
26
|
*
|
|
7
27
|
* Picks the right strategy for sections whose stylesheets are
|
|
8
28
|
* independent of the underlying video pixels.
|
|
9
29
|
*
|
|
10
|
-
* Times handed to `
|
|
30
|
+
* Times handed to `framesFor` are expected to land on a caption tick
|
|
11
31
|
* (a multiple of the `captionInterval` supplied at `open`); the
|
|
12
32
|
* source rounds to absorb the FP roundtrip but does not snap from
|
|
13
33
|
* arbitrary timestamps.
|
|
@@ -15,7 +35,7 @@
|
|
|
15
35
|
export class BatchedSubtitleLayerSource {
|
|
16
36
|
subtitleRenderer;
|
|
17
37
|
captionInterval = 0;
|
|
18
|
-
|
|
38
|
+
lookAheadTicks = 0;
|
|
19
39
|
currentChunkFirstIdx = 0;
|
|
20
40
|
currentChunkFrames = [];
|
|
21
41
|
opened = false;
|
|
@@ -25,18 +45,36 @@ export class BatchedSubtitleLayerSource {
|
|
|
25
45
|
async open(doc, styles, width, height, captionInterval) {
|
|
26
46
|
await this.subtitleRenderer.open(doc, styles, width, height);
|
|
27
47
|
this.captionInterval = captionInterval;
|
|
28
|
-
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
|
|
48
|
+
// Never below the pictures a batch can hold: offering fewer ticks
|
|
49
|
+
// than that would cut a batch the renderer had room to fill.
|
|
50
|
+
this.lookAheadTicks = Math.max(await this.subtitleRenderer.getMaxTilesPerBatch(), Math.ceil(MAX_CHUNK_SECONDS / captionInterval));
|
|
51
|
+
// An empty resident chunk starting at 0: the first `frameAt`
|
|
52
|
+
// call's while-condition fires one `loadNextChunk`, which leaves
|
|
53
|
+
// it where it starts and fills it.
|
|
54
|
+
this.currentChunkFirstIdx = 0;
|
|
32
55
|
this.currentChunkFrames = [];
|
|
33
56
|
this.opened = true;
|
|
34
57
|
}
|
|
35
|
-
|
|
58
|
+
/**
|
|
59
|
+
* One, because the look-ahead this source lives on is its own: it
|
|
60
|
+
* reaches forward in document time, which needs no video frame and
|
|
61
|
+
* therefore nothing gathered by the caller.
|
|
62
|
+
*/
|
|
63
|
+
lookAhead() {
|
|
64
|
+
return 1;
|
|
65
|
+
}
|
|
66
|
+
async framesFor(requests) {
|
|
67
|
+
const frames = [];
|
|
68
|
+
for (const request of requests) {
|
|
69
|
+
frames.push(await this.frameAt(request.time));
|
|
70
|
+
}
|
|
71
|
+
return frames;
|
|
72
|
+
}
|
|
73
|
+
async frameAt(time) {
|
|
36
74
|
if (!this.opened)
|
|
37
75
|
return null;
|
|
38
76
|
const captionIdx = Math.round(time / this.captionInterval);
|
|
39
|
-
while (captionIdx >= this.currentChunkFirstIdx + this.
|
|
77
|
+
while (captionIdx >= this.currentChunkFirstIdx + this.currentChunkFrames.length) {
|
|
40
78
|
await this.loadNextChunk();
|
|
41
79
|
}
|
|
42
80
|
return this.currentChunkFrames[captionIdx - this.currentChunkFirstIdx] ?? null;
|
|
@@ -47,14 +85,18 @@ export class BatchedSubtitleLayerSource {
|
|
|
47
85
|
this.opened = false;
|
|
48
86
|
}
|
|
49
87
|
async loadNextChunk() {
|
|
50
|
-
this.currentChunkFirstIdx += this.
|
|
88
|
+
this.currentChunkFirstIdx += this.currentChunkFrames.length;
|
|
51
89
|
const timestamps = [];
|
|
52
|
-
for (let i = 0; i < this.
|
|
90
|
+
for (let i = 0; i < this.lookAheadTicks; i++) {
|
|
53
91
|
// Each timestamp is freshly computed from its absolute index
|
|
54
92
|
// to avoid floating-point accumulation drift across long videos.
|
|
55
93
|
timestamps.push((this.currentChunkFirstIdx + i) * this.captionInterval);
|
|
56
94
|
}
|
|
57
95
|
this.currentChunkFrames = await this.subtitleRenderer.getFrames(timestamps);
|
|
96
|
+
if (this.currentChunkFrames.length === 0) {
|
|
97
|
+
// Nothing to advance by: `frameAt` would ask again forever.
|
|
98
|
+
throw new Error('Subtitle renderer returned no frames for a non-empty batch.');
|
|
99
|
+
}
|
|
58
100
|
}
|
|
59
101
|
}
|
|
60
102
|
//# sourceMappingURL=BatchedSubtitleLayerSource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BatchedSubtitleLayerSource.js","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BatchedSubtitleLayerSource.js","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.ts"],"names":[],"mappings":"AAWA,kEAAkE;AAClE,sEAAsE;AACtE,uEAAuE;AACvE,sEAAsE;AACtE,uEAAuE;AACvE,wEAAwE;AACxE,qEAAqE;AACrE,wEAAwE;AACxE,yEAAyE;AACzE,0CAA0C;AAC1C,EAAE;AACF,qEAAqE;AACrE,s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;YACzC,4DAA4D;YAC5D,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;QACjF,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,25 +1,44 @@
|
|
|
1
1
|
import type { Document } from '../../../document/Document';
|
|
2
2
|
import type { SubtitleFrame, SubtitleStyle } from '../../../rendering/SubtitleFrameRenderer';
|
|
3
|
-
import type {
|
|
4
|
-
import type { SubtitleLayerSource } from '../../../video/mediabunny/caption/SubtitleLayerSource';
|
|
3
|
+
import type { SubtitleLayerRequest, SubtitleLayerSource } from '../../../video/mediabunny/caption/SubtitleLayerSource';
|
|
5
4
|
/**
|
|
6
|
-
* Composes two `SubtitleLayerSource`s, routing each Section to one
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `frameAt` call to the nearest caption tick and merges the rasters
|
|
10
|
-
* produced by sub-sources with active sections into a single frame.
|
|
5
|
+
* Composes two `SubtitleLayerSource`s, routing each Section to one of
|
|
6
|
+
* them by whether its style declares `rendering.videoFrame.required`,
|
|
7
|
+
* and merging what they paint into one raster per request.
|
|
11
8
|
*
|
|
12
|
-
*
|
|
9
|
+
* The two halves are handed **different times for the same request**,
|
|
10
|
+
* and that difference is the reason this class exists:
|
|
11
|
+
*
|
|
12
|
+
* - the batched half is given the request snapped to a caption tick,
|
|
13
|
+
* which is what lets the frames that resolve to one picture share a
|
|
14
|
+
* tile;
|
|
15
|
+
* - the video-bound half is given the frame's own time, because it
|
|
16
|
+
* bakes the pixels under the caption into its picture, and those
|
|
17
|
+
* differ at every frame the decoder hands over.
|
|
18
|
+
*
|
|
19
|
+
* Snapping both would tie a whole run of frames to one backdrop
|
|
20
|
+
* wherever the video runs faster than the tick rate, leaving the
|
|
21
|
+
* caption sitting on pixels the video has already moved past.
|
|
22
|
+
*
|
|
23
|
+
* `framesFor` expects monotonically advancing times.
|
|
13
24
|
*/
|
|
14
25
|
export declare class ComposedSubtitleLayerSource implements SubtitleLayerSource {
|
|
15
26
|
private readonly batchedSource;
|
|
16
27
|
private readonly videoBoundSource;
|
|
17
28
|
private captionInterval;
|
|
18
29
|
private captionIdx;
|
|
19
|
-
private
|
|
30
|
+
private openedBatched;
|
|
31
|
+
private openedVideoBound;
|
|
20
32
|
constructor(batchedSource: SubtitleLayerSource, videoBoundSource: SubtitleLayerSource);
|
|
21
33
|
open(doc: Document, styles: Readonly<Record<string, SubtitleStyle>>, width: number, height: number, captionInterval: number): Promise<void>;
|
|
22
|
-
|
|
34
|
+
/**
|
|
35
|
+
* The largest either open half asks for, so a run gathered for this
|
|
36
|
+
* composite is long enough to serve the hungriest of them. The other
|
|
37
|
+
* is handed the same run and is free to ignore its length.
|
|
38
|
+
*/
|
|
39
|
+
lookAhead(): number;
|
|
40
|
+
framesFor(requests: ReadonlyArray<SubtitleLayerRequest>): Promise<Array<SubtitleFrame | null>>;
|
|
41
|
+
private snapToCaptionTick;
|
|
23
42
|
close(): void;
|
|
24
43
|
private partitionStyles;
|
|
25
44
|
private advanceCaptionIdxToTime;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComposedSubtitleLayerSource.d.ts","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/caption/ComposedSubtitleLayerSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACd,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ComposedSubtitleLayerSource.d.ts","sourceRoot":"","sources":["../../../../../src/modules/video/mediabunny/caption/ComposedSubtitleLayerSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACd,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,uDAAuD,CAAC;AAa/D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,2BAA4B,YAAW,mBAAmB;IAQnE,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IAPnC,OAAO,CAAC,eAAe,CAAK;IAC5B,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,aAAa,CAAoC;IACzD,OAAO,CAAC,gBAAgB,CAAoC;gBAGzC,aAAa,EAAE,mBAAmB,EAClC,gBAAgB,EAAE,mBAAmB;IAGlD,IAAI,CACR,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,EAC/C,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC;IAchB;;;;OAIG;IACH,SAAS,IAAI,MAAM;IAQb,SAAS,CAAC,QAAQ,EAAE,aAAa,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAcpG,OAAO,CAAC,iBAAiB;IAKzB,KAAK,IAAI,IAAI;IAOb,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,uBAAuB;CAOhC"}
|