@remotion/studio 4.0.526 → 4.0.528
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/dist/components/AgentPrompt.js +1 -2
- package/dist/components/AudioWaveform.d.ts +1 -0
- package/dist/components/AudioWaveform.js +10 -14
- package/dist/components/Canvas.js +88 -26
- package/dist/components/CanvasCaptureDropHandler.js +63 -0
- package/dist/components/CanvasOrLoading.js +10 -2
- package/dist/components/CodeFrame.js +1 -1
- package/dist/components/ColorPicker/checker.d.ts +1 -1
- package/dist/components/CompositionSelectorItem.js +1 -0
- package/dist/components/CurrentAsset.js +4 -2
- package/dist/components/EditorRuler/Ruler.js +6 -3
- package/dist/components/EffectPickerModal.js +69 -43
- package/dist/components/ElementInstallConfirmation.js +3 -3
- package/dist/components/ElementLibrariesSettings.d.ts +2 -0
- package/dist/components/ElementLibrariesSettings.js +200 -0
- package/dist/components/InitialCompositionLoader.js +4 -2
- package/dist/components/InlineDropdown.js +26 -2
- package/dist/components/InlineEditableTitle.js +1 -0
- package/dist/components/InspectorOpenInEditor.js +13 -0
- package/dist/components/InspectorPanel/AlignmentControls.js +28 -9
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +2 -1
- package/dist/components/InspectorPanel/CompositionInspector.js +3 -3
- package/dist/components/InspectorPanel/CompositionMetadata.js +4 -0
- package/dist/components/InspectorPanel/EasingInspector.js +6 -2
- package/dist/components/InspectorPanel/ElementLibraryButton.js +2 -1
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +1 -1
- package/dist/components/InspectorPanel/KeyframeInspector.js +28 -24
- package/dist/components/InspectorPanel/MultiSequenceInspector.js +32 -1
- package/dist/components/InspectorPanel/MultiSequenceNumberField.js +1 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +70 -2
- package/dist/components/InspectorPanel/SequenceWrapAction.d.ts +8 -0
- package/dist/components/InspectorPanel/SequenceWrapAction.js +151 -0
- package/dist/components/InspectorPanel/common.js +1 -0
- package/dist/components/InspectorPanel/easing-inspector-selection.d.ts +2 -1
- package/dist/components/InspectorPanel/easing-inspector-selection.js +4 -3
- package/dist/components/InspectorPanel/keyframe-inspector-frame.d.ts +2 -1
- package/dist/components/InspectorPanel/keyframe-inspector-frame.js +2 -2
- package/dist/components/InspectorPanel/styles.js +2 -0
- package/dist/components/InspectorPanel/use-composition-actions.js +1 -0
- package/dist/components/InspectorSequenceSection.d.ts +1 -0
- package/dist/components/InspectorSequenceSection.js +7 -5
- package/dist/components/InspectorSourceLocation.js +3 -0
- package/dist/components/KeyboardShortcutsSettings.js +1 -1
- package/dist/components/Menu/styles.d.ts +2 -2
- package/dist/components/MenuBuildIndicator.js +1 -0
- package/dist/components/Modals.js +7 -6
- package/dist/components/ModelManager.js +10 -9
- package/dist/components/NewComposition/CancelButton.js +11 -5
- package/dist/components/NewComposition/InputDragger.d.ts +3 -1
- package/dist/components/NewComposition/InputDragger.js +28 -9
- package/dist/components/NewComposition/NewComposition.js +7 -6
- package/dist/components/NewComposition/RemInput.d.ts +1 -1
- package/dist/components/NewComposition/menu-typeahead.js +1 -1
- package/dist/components/Preview.js +4 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +1 -0
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -0
- package/dist/components/RadioButton.js +1 -0
- package/dist/components/RenderModal/DataEditor.js +4 -1
- package/dist/components/RenderModal/SchemaEditor/create-zod-values.js +1 -2
- package/dist/components/RenderModal/WebRenderModalPicture.js +1 -2
- package/dist/components/RenderQueue/CaptionQueueItem.js +19 -7
- package/dist/components/RenderQueue/CaptionQueueProcessor.js +65 -15
- package/dist/components/RenderQueue/QueueJobError.d.ts +8 -0
- package/dist/components/RenderQueue/QueueJobError.js +24 -0
- package/dist/components/RenderQueue/QueueJobErrorModal.d.ts +8 -0
- package/dist/components/RenderQueue/QueueJobErrorModal.js +63 -0
- package/dist/components/RenderQueue/RenderQueueItemCancelButton.d.ts +3 -1
- package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +11 -4
- package/dist/components/RenderQueue/RenderQueueRepeat.d.ts +3 -1
- package/dist/components/RenderQueue/RenderQueueRepeat.js +20 -3
- package/dist/components/RenderQueue/VideoMattingQueueItem.js +25 -27
- package/dist/components/RenderQueue/VideoMattingQueueProcessor.js +68 -28
- package/dist/components/RenderQueue/caption-job-types.d.ts +9 -1
- package/dist/components/RenderQueue/context.d.ts +4 -0
- package/dist/components/RenderQueue/context.js +58 -8
- package/dist/components/RenderQueue/index.js +3 -3
- package/dist/components/RenderQueue/load-model-for-job.d.ts +2 -1
- package/dist/components/RenderQueue/load-model-for-job.js +5 -1
- package/dist/components/RenderQueue/video-matting-job-types.d.ts +13 -6
- package/dist/components/RendersTab.js +2 -0
- package/dist/components/SelectedOutlineCropControls.js +2 -1
- package/dist/components/SelectedOutlineEditingHandles.js +9 -2
- package/dist/components/SelectedOutlineElement.js +9 -3
- package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -4
- package/dist/components/SelectedOutlineKeyboardControls.js +4 -22
- package/dist/components/SelectedOutlineOverlay.js +152 -106
- package/dist/components/SelectedOutlinePathPoints.d.ts +8 -0
- package/dist/components/SelectedOutlinePathPoints.js +433 -0
- package/dist/components/SelectedOutlinePolygon.js +21 -46
- package/dist/components/SelectedOutlineRenderer.d.ts +3 -5
- package/dist/components/SelectedOutlineRenderer.js +32 -136
- package/dist/components/SelectedOutlineSnapIndicators.d.ts +6 -0
- package/dist/components/SelectedOutlineSnapIndicators.js +16 -12
- package/dist/components/SelectedOutlineTransformOriginHandle.js +3 -2
- package/dist/components/SelectedOutlineUvControls.js +12 -7
- package/dist/components/SequencePropsSubscriptionProvider.d.ts +3 -0
- package/dist/components/SequencePropsSubscriptionProvider.js +8 -6
- package/dist/components/SettingsModal.js +30 -3
- package/dist/components/SettingsModalFooter.d.ts +1 -0
- package/dist/components/SettingsModalFooter.js +7 -3
- package/dist/components/ShowOutlinesProvider.js +1 -1
- package/dist/components/SkillsSettings.d.ts +0 -1
- package/dist/components/SkillsSettings.js +13 -14
- package/dist/components/Splitter/SplitterElement.js +1 -2
- package/dist/components/TimeValue.js +1 -1
- package/dist/components/Timeline/LoopedTimelineIndicators.d.ts +1 -0
- package/dist/components/Timeline/LoopedTimelineIndicators.js +7 -6
- package/dist/components/Timeline/TimelineArrayField.js +1 -1
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +0 -1
- package/dist/components/Timeline/TimelineColorField.js +1 -1
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +6 -9
- package/dist/components/Timeline/TimelineDragHandler.js +1 -1
- package/dist/components/Timeline/TimelineEffectItem.js +1 -0
- package/dist/components/Timeline/TimelineEffectPropItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineEffectPropItem.js +12 -5
- package/dist/components/Timeline/TimelineExpandArrowButton.js +1 -0
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedRow.js +6 -4
- package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedSection.js +2 -2
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.js +3 -1
- package/dist/components/Timeline/TimelineFieldLabel.js +1 -0
- package/dist/components/Timeline/TimelineFontFamilyField.js +12 -12
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -0
- package/dist/components/Timeline/TimelineKeyframeControls.js +40 -28
- package/dist/components/Timeline/TimelineLayerChildren.js +1 -1
- package/dist/components/Timeline/TimelineList.js +1 -1
- package/dist/components/Timeline/TimelineNumberField.js +2 -4
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
- package/dist/components/Timeline/TimelineSelection.d.ts +9 -9
- package/dist/components/Timeline/TimelineSelection.js +16 -9
- package/dist/components/Timeline/TimelineSequence.d.ts +3 -1
- package/dist/components/Timeline/TimelineSequence.js +65 -21
- package/dist/components/Timeline/TimelineSequenceFrame.js +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.js +46 -8
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +3 -0
- package/dist/components/Timeline/TimelineSequencePropItem.js +262 -25
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +11 -13
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +98 -77
- package/dist/components/Timeline/TimelineTextContentField.js +27 -4
- package/dist/components/Timeline/TimelineTimeIndicators.js +10 -5
- package/dist/components/Timeline/TimelineTrack.js +1 -1
- package/dist/components/Timeline/TimelineTrimTooltip.d.ts +11 -0
- package/dist/components/Timeline/TimelineTrimTooltip.js +41 -0
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -0
- package/dist/components/Timeline/TimelineVideoInfo.js +13 -10
- package/dist/components/Timeline/TimelineViewport.d.ts +1 -0
- package/dist/components/Timeline/TimelineViewport.js +10 -1
- package/dist/components/Timeline/delete-selected-keyframe.js +22 -8
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +1 -5
- package/dist/components/Timeline/delete-selected-timeline-item.js +9 -95
- package/dist/components/Timeline/get-animation-item-selection-for-frame.d.ts +2 -1
- package/dist/components/Timeline/get-animation-item-selection-for-frame.js +7 -5
- package/dist/components/Timeline/get-keyframed-sequence-drag-targets.d.ts +23 -0
- package/dist/components/Timeline/get-keyframed-sequence-drag-targets.js +57 -0
- package/dist/components/Timeline/get-node-keyframes.d.ts +2 -1
- package/dist/components/Timeline/get-node-keyframes.js +6 -4
- package/dist/components/Timeline/get-playback-rate-keyframe-changes.d.ts +21 -0
- package/dist/components/Timeline/get-playback-rate-keyframe-changes.js +142 -0
- package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +3 -1
- package/dist/components/Timeline/get-sequence-context-menu-items.js +13 -1
- package/dist/components/Timeline/get-timeline-keyframes.d.ts +15 -2
- package/dist/components/Timeline/get-timeline-keyframes.js +44 -6
- package/dist/components/Timeline/keyframe-clipboard.js +17 -3
- package/dist/components/Timeline/split-selected-timeline-item.d.ts +13 -10
- package/dist/components/Timeline/split-selected-timeline-item.js +61 -35
- package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
- package/dist/components/Timeline/timeline-field-row-layout.js +1 -0
- package/dist/components/Timeline/use-delete-timeline-items.js +17 -11
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.d.ts +2 -1
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +3 -1
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +7 -3
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +28 -19
- package/dist/components/TimelineCombobox.js +1 -0
- package/dist/components/Transcription/Models.js +1 -1
- package/dist/components/Transcription/TranscriptionModal.js +18 -11
- package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.js +1 -1
- package/dist/components/Transcription/resample-media-to-16-khz.d.ts +2 -1
- package/dist/components/Transcription/resample-media-to-16-khz.js +20 -2
- package/dist/components/UpdatesSettings.js +2 -0
- package/dist/components/VideoMatting/Models.js +1 -1
- package/dist/components/VideoMatting/VideoMattingModal.js +30 -47
- package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.js +1 -1
- package/dist/components/WebMcp.js +23 -40
- package/dist/components/composition-drop-preview.d.ts +9 -2
- package/dist/components/composition-drop-preview.js +8 -4
- package/dist/components/composition-menu-items.js +4 -4
- package/dist/components/delete-jsx-nodes-api.d.ts +2 -0
- package/dist/components/{delete-jsx-node-api.js → delete-jsx-nodes-api.js} +5 -5
- package/dist/components/effect-drag-and-drop.d.ts +13 -5
- package/dist/components/effect-drag-and-drop.js +19 -4
- package/dist/components/get-open-in-menu-items.d.ts +2 -1
- package/dist/components/get-open-in-menu-items.js +24 -8
- package/dist/components/keyboard-shortcuts.d.ts +4 -4
- package/dist/components/keyboard-shortcuts.js +3 -1
- package/dist/components/public-output-name.d.ts +1 -0
- package/dist/components/public-output-name.js +7 -3
- package/dist/components/selected-outline-drag.d.ts +1 -6
- package/dist/components/selected-outline-drag.js +22 -6
- package/dist/components/selected-outline-geometry.d.ts +2 -18
- package/dist/components/selected-outline-measurement.d.ts +23 -41
- package/dist/components/selected-outline-measurement.js +14 -252
- package/dist/components/selected-outline-order.d.ts +4 -11
- package/dist/components/selected-outline-order.js +2 -254
- package/dist/components/selected-outline-snap.d.ts +1 -1
- package/dist/components/selected-outline-snap.js +2 -1
- package/dist/components/selected-outline-types.d.ts +18 -28
- package/dist/components/selected-outline-uv.d.ts +4 -4
- package/dist/components/selected-outline-uv.js +6 -111
- package/dist/components/sequence-props-api.js +0 -10
- package/dist/components/use-selected-outline-control-target.js +12 -21
- package/dist/components/wrap-jsx-node-api.d.ts +2 -0
- package/dist/components/wrap-jsx-node-api.js +13 -0
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +45 -2
- package/dist/error-overlay/remotion-overlay/StackFrame.js +32 -3
- package/dist/esm/{CaptionQueueProcessor-k0yrm3dj.mjs → CaptionQueueProcessor-nr7hjcga.mjs} +96 -19
- package/dist/esm/LazyModels-ajkn7fs3.mjs +12 -0
- package/dist/esm/LazyModels-g1g7cf4e.mjs +12 -0
- package/dist/esm/{TranscriptionModal-ymnx1c7m.mjs → TranscriptionModal-e18bzbkb.mjs} +30 -22
- package/dist/esm/{VideoMattingModal-05vpczks.mjs → VideoMattingModal-5bz2s4rs.mjs} +47 -62
- package/dist/esm/{VideoMattingQueueProcessor-t1hgm2rm.mjs → VideoMattingQueueProcessor-4tkj0f4k.mjs} +69 -26
- package/dist/esm/{index-v4tr1bft.mjs → index-09txs1bj.mjs} +5 -0
- package/dist/esm/{index-4dsz9035.mjs → index-5ycb9e9q.mjs} +2 -4
- package/dist/esm/index-890dd9b3.mjs +768 -0
- package/dist/esm/{index-5bfxbpca.mjs → index-8nt6a0mw.mjs} +3 -3
- package/dist/esm/{index-5gd8k9yv.mjs → index-9q9w8v9p.mjs} +3 -3
- package/dist/esm/{index-x40wwfmt.mjs → index-c2wabcdt.mjs} +8 -6
- package/dist/esm/index-dfy1t576.mjs +129 -0
- package/dist/esm/index-dh3zk2hv.mjs +220 -0
- package/dist/esm/{index-0gewwxse.mjs → index-dpyss74p.mjs} +6179 -5011
- package/dist/esm/{index-9x6e1dq0.mjs → index-hqxc6tzp.mjs} +40 -6
- package/dist/esm/{index-cdy8v54v.mjs → index-qve7mdfp.mjs} +36 -539
- package/dist/esm/{index-eb5txqp6.mjs → index-s6qya2gg.mjs} +8 -88
- package/dist/esm/index-t7tbt980.mjs +103 -0
- package/dist/esm/{index-g7k2dvar.mjs → index-t7xnxdf8.mjs} +44 -26
- package/dist/esm/index-wqc43mw0.mjs +158 -0
- package/dist/esm/{index-bs39wngg.mjs → index-x6r9bn12.mjs} +5623 -6218
- package/dist/esm/{index-f97r9e2g.mjs → index-xac20sv4.mjs} +46 -57
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/internals.mjs +13 -10
- package/dist/esm/previewEntry.mjs +18 -12
- package/dist/esm/renderEntry.mjs +5 -1
- package/dist/esm/{resolve-composition-component-location-bt2d6qxq.mjs → resolve-composition-component-location-2hgf6g0a.mjs} +1 -1
- package/dist/helpers/calculate-timeline.d.ts +5 -1
- package/dist/helpers/calculate-timeline.js +1 -1
- package/dist/helpers/checkerboard-background.d.ts +2 -2
- package/dist/helpers/colors.d.ts +132 -112
- package/dist/helpers/colors.js +117 -95
- package/dist/helpers/copy-text.js +1 -16
- package/dist/helpers/create-folder-tree.js +2 -1
- package/dist/helpers/editor-guide-selection.d.ts +1 -1
- package/dist/helpers/editor-ruler.js +23 -12
- package/dist/helpers/get-connected-compositions.d.ts +6 -1
- package/dist/helpers/get-connected-compositions.js +1 -1
- package/dist/helpers/get-sequence-double-click-action.js +1 -1
- package/dist/helpers/get-sequence-visible-range.d.ts +1 -1
- package/dist/helpers/get-sequence-visible-range.js +2 -5
- package/dist/helpers/get-timeline-nestedness.d.ts +1 -1
- package/dist/helpers/get-timeline-nestedness.js +1 -1
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +1 -1
- package/dist/helpers/get-timeline-sequence-sort-key.js +1 -1
- package/dist/helpers/hoverable.js +6 -5
- package/dist/helpers/inject-css.js +5 -7
- package/dist/helpers/open-in-editor.js +1 -1
- package/dist/helpers/prism-vsc-dark-plus.d.ts +1 -1
- package/dist/helpers/prism-vsc-dark-plus.js +52 -51
- package/dist/helpers/resolve-studio-color.d.ts +1 -0
- package/dist/helpers/resolve-studio-color.js +11 -0
- package/dist/helpers/studio-css-variables.d.ts +1 -0
- package/dist/helpers/studio-css-variables.js +105 -0
- package/dist/helpers/studio-pixel-ratio.d.ts +1 -0
- package/dist/helpers/studio-pixel-ratio.js +7 -0
- package/dist/helpers/studio-runtime-config.d.ts +1 -1
- package/dist/helpers/timeline-node-path-key.d.ts +1 -1
- package/dist/helpers/timeline-node-path-key.js +2 -2
- package/dist/helpers/use-keybinding.d.ts +1 -1
- package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -2
- package/dist/helpers/use-menu-structure.js +15 -9
- package/dist/helpers/use-runtime-values.js +2 -28
- package/dist/hot-middleware-client/client.js +5 -3
- package/dist/icons/align-center-horizontal.js +2 -1
- package/dist/icons/align-left.js +2 -1
- package/dist/icons/align-right.js +2 -1
- package/dist/icons/{separation.d.ts → background-removal.d.ts} +1 -1
- package/dist/icons/background-removal.js +9 -0
- package/dist/icons/wrap.d.ts +4 -0
- package/dist/icons/wrap.js +10 -0
- package/dist/previewEntry.js +2 -0
- package/dist/renderEntry.js +2 -0
- package/dist/state/modals.d.ts +20 -1
- package/dist/state/timeline-sequence-hover.d.ts +6 -16
- package/dist/state/timeline-sequence-hover.js +6 -67
- package/dist/state/timeline-zoom.js +4 -0
- package/package.json +20 -19
- package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.d.ts +0 -15
- package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.js +0 -31
- package/dist/components/delete-jsx-node-api.d.ts +0 -2
- package/dist/esm/LazyModels-mtggyjye.mjs +0 -11
- package/dist/esm/LazyModels-nk7py0zt.mjs +0 -11
- package/dist/esm/index-cw0pnpg5.mjs +0 -50
- package/dist/esm/index-k426ye99.mjs +0 -139
- package/dist/helpers/get-box-quads-polyfill-internals.d.ts +0 -82
- package/dist/helpers/get-box-quads-polyfill-internals.js +0 -2403
- package/dist/helpers/get-box-quads-ponyfill.d.ts +0 -10
- package/dist/helpers/get-box-quads-ponyfill.js +0 -23
- package/dist/icons/separation.js +0 -7
|
@@ -4,41 +4,51 @@ exports.VideoMattingQueueProcessor = void 0;
|
|
|
4
4
|
const video_matting_1 = require("@remotion/video-matting");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const write_static_file_1 = require("../../api/write-static-file");
|
|
7
|
+
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
8
|
+
const call_api_1 = require("../call-api");
|
|
7
9
|
const context_1 = require("./context");
|
|
8
10
|
const load_model_for_job_1 = require("./load-model-for-job");
|
|
9
11
|
const VideoMattingQueueProcessor = () => {
|
|
10
|
-
const { markVideoMattingJobDone, markVideoMattingJobFailed, setProcessVideoMattingJobCallback, updateVideoMattingJobProgress, } = (0, react_1.useContext)(context_1.RenderQueueContext);
|
|
12
|
+
const { markVideoMattingJobDone, markVideoMattingJobFailed, markVideoMattingJobCancelled, markVideoMattingJobSaving, getAbortController, setProcessVideoMattingJobCallback, updateVideoMattingJobProgress, } = (0, react_1.useContext)(context_1.RenderQueueContext);
|
|
11
13
|
const processJob = (0, react_1.useCallback)(async (job) => {
|
|
12
|
-
|
|
14
|
+
const { signal } = getAbortController(job.id);
|
|
15
|
+
let output = null;
|
|
13
16
|
let processingError = null;
|
|
14
17
|
try {
|
|
18
|
+
signal.throwIfAborted();
|
|
15
19
|
updateVideoMattingJobProgress(job.id, {
|
|
16
20
|
detail: null,
|
|
17
21
|
message: 'Checking WebGPU support...',
|
|
18
22
|
value: 0,
|
|
19
23
|
});
|
|
20
24
|
const support = await (0, video_matting_1.canUseVideoMatting)({ model: job.model });
|
|
25
|
+
signal.throwIfAborted();
|
|
21
26
|
if (!support.supported) {
|
|
22
27
|
throw new Error(support.detailedReason);
|
|
23
28
|
}
|
|
24
29
|
await (0, load_model_for_job_1.loadModelForJob)({
|
|
30
|
+
signal,
|
|
25
31
|
model: job.model,
|
|
26
32
|
progressStart: 0,
|
|
27
33
|
progressSpan: 0.2,
|
|
28
34
|
isModelCached: (model) => (0, video_matting_1.isVideoMattingModelCached)({ model }),
|
|
29
|
-
loadModel: (model, onProgress) =>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
loadModel: async (model, onProgress) => {
|
|
36
|
+
await (0, video_matting_1.downloadVideoMattingModel)({
|
|
37
|
+
signal,
|
|
38
|
+
model,
|
|
39
|
+
onProgress: (progress) => onProgress(progress.progress),
|
|
40
|
+
});
|
|
41
|
+
await (0, video_matting_1.loadVideoMattingModel)({ model, signal });
|
|
42
|
+
},
|
|
33
43
|
updateProgress: (progress) => updateVideoMattingJobProgress(job.id, {
|
|
34
44
|
...progress,
|
|
35
45
|
detail: null,
|
|
36
46
|
}),
|
|
37
47
|
});
|
|
38
|
-
|
|
48
|
+
const mattingOptions = {
|
|
49
|
+
signal,
|
|
39
50
|
src: job.src,
|
|
40
51
|
model: job.model,
|
|
41
|
-
audio: job.audio,
|
|
42
52
|
videoBitrate: job.videoBitrate,
|
|
43
53
|
onProgress: (progress) => {
|
|
44
54
|
var _a;
|
|
@@ -47,51 +57,81 @@ const VideoMattingQueueProcessor = () => {
|
|
|
47
57
|
? `Processed ${progress.processedFrames} ${progress.processedFrames === 1 ? 'frame' : 'frames'}`
|
|
48
58
|
: `Processed ${progress.processedFrames} ${progress.processedFrames === 1 ? 'frame' : 'frames'} · ${Math.round(progress.progress * 100)}%`,
|
|
49
59
|
message: progress.stage === 'finalizing'
|
|
50
|
-
? 'Finalizing video
|
|
51
|
-
: '
|
|
60
|
+
? 'Finalizing video...'
|
|
61
|
+
: 'Removing background...',
|
|
52
62
|
value: 0.2 + ((_a = progress.progress) !== null && _a !== void 0 ? _a : 1) * 0.65,
|
|
53
63
|
});
|
|
54
64
|
},
|
|
65
|
+
};
|
|
66
|
+
output = await video_matting_1.VideoMattingInternals.removeVideoBackground({
|
|
67
|
+
...mattingOptions,
|
|
68
|
+
audio: job.audio,
|
|
55
69
|
});
|
|
70
|
+
if (output === null) {
|
|
71
|
+
throw new Error('Video matting produced no output.');
|
|
72
|
+
}
|
|
73
|
+
signal.throwIfAborted();
|
|
56
74
|
updateVideoMattingJobProgress(job.id, {
|
|
57
75
|
detail: null,
|
|
58
|
-
message: 'Saving video
|
|
76
|
+
message: 'Saving video...',
|
|
59
77
|
value: 0.88,
|
|
60
78
|
});
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
79
|
+
const video = await output.video.getBlob();
|
|
80
|
+
signal.throwIfAborted();
|
|
81
|
+
markVideoMattingJobSaving(job.id);
|
|
82
|
+
await video
|
|
83
|
+
.arrayBuffer()
|
|
84
|
+
.then((contents) => (0, write_static_file_1.writeStaticFile)({ contents, filePath: job.outName }));
|
|
85
|
+
if (job.target !== null) {
|
|
86
|
+
updateVideoMattingJobProgress(job.id, {
|
|
87
|
+
detail: null,
|
|
88
|
+
message: 'Replacing video source...',
|
|
89
|
+
value: 0.97,
|
|
90
|
+
});
|
|
91
|
+
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
92
|
+
const request = {
|
|
93
|
+
fileName: job.target.fileName,
|
|
94
|
+
nodePath: job.target.nodePath.nodePath,
|
|
95
|
+
src: job.outName,
|
|
96
|
+
};
|
|
97
|
+
const replaceSource = browserStudioOperations === null || browserStudioOperations === void 0 ? void 0 : browserStudioOperations.replaceVideoSource;
|
|
98
|
+
if (browserStudioOperations && !replaceSource) {
|
|
99
|
+
throw new Error('Browser Studio cannot replace the video source.');
|
|
100
|
+
}
|
|
101
|
+
const response = replaceSource
|
|
102
|
+
? await replaceSource(request)
|
|
103
|
+
: await (0, call_api_1.callApi)('/api/replace-video-source', request);
|
|
104
|
+
if (!response.success) {
|
|
105
|
+
throw new Error(response.reason);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
73
108
|
}
|
|
74
109
|
catch (error) {
|
|
75
110
|
processingError =
|
|
76
111
|
error instanceof Error ? error : new Error(String(error));
|
|
77
112
|
}
|
|
113
|
+
if (output) {
|
|
114
|
+
await Promise.allSettled([output.video.dispose()]);
|
|
115
|
+
}
|
|
78
116
|
try {
|
|
79
|
-
await Promise.all([
|
|
80
|
-
outputs === null || outputs === void 0 ? void 0 : outputs.base.dispose(),
|
|
81
|
-
outputs === null || outputs === void 0 ? void 0 : outputs.foreground.dispose(),
|
|
82
|
-
]);
|
|
83
117
|
await (0, video_matting_1.disposeVideoMattingModel)({ model: job.model });
|
|
84
118
|
}
|
|
85
119
|
catch (_a) {
|
|
86
120
|
// Cleanup errors must not hide successfully written outputs.
|
|
87
121
|
}
|
|
88
|
-
if (
|
|
122
|
+
if (signal.aborted) {
|
|
123
|
+
markVideoMattingJobCancelled(job.id);
|
|
124
|
+
}
|
|
125
|
+
else if (processingError) {
|
|
89
126
|
markVideoMattingJobFailed(job.id, processingError);
|
|
90
127
|
}
|
|
91
128
|
else {
|
|
92
129
|
markVideoMattingJobDone(job.id);
|
|
93
130
|
}
|
|
94
131
|
}, [
|
|
132
|
+
getAbortController,
|
|
133
|
+
markVideoMattingJobCancelled,
|
|
134
|
+
markVideoMattingJobSaving,
|
|
95
135
|
markVideoMattingJobDone,
|
|
96
136
|
markVideoMattingJobFailed,
|
|
97
137
|
updateVideoMattingJobProgress,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { WhisperWebGpuModel, WhisperWebGpuTask } from '@remotion/whisper-webgpu';
|
|
2
|
+
import type { SequencePropsSubscriptionKey } from 'remotion';
|
|
2
3
|
export type CaptionJobProgress = {
|
|
3
4
|
message: string;
|
|
4
5
|
value: number;
|
|
@@ -6,7 +7,9 @@ export type CaptionJobProgress = {
|
|
|
6
7
|
type CaptionJobStatus = {
|
|
7
8
|
status: 'idle';
|
|
8
9
|
} | {
|
|
9
|
-
status: '
|
|
10
|
+
status: 'cancelled';
|
|
11
|
+
} | {
|
|
12
|
+
status: 'running' | 'saving';
|
|
10
13
|
progress: CaptionJobProgress;
|
|
11
14
|
} | {
|
|
12
15
|
status: 'done';
|
|
@@ -24,6 +27,11 @@ export type AddCaptionJobParams = {
|
|
|
24
27
|
audioStreamIndex: number | null;
|
|
25
28
|
requestInit: Omit<RequestInit, 'signal'> | null;
|
|
26
29
|
outName: string;
|
|
30
|
+
target: {
|
|
31
|
+
fileName: string;
|
|
32
|
+
nodePath: SequencePropsSubscriptionKey;
|
|
33
|
+
durationInFrames: number | null;
|
|
34
|
+
} | null;
|
|
27
35
|
model: WhisperWebGpuModel;
|
|
28
36
|
language: string | null;
|
|
29
37
|
task: WhisperWebGpuTask;
|
|
@@ -32,12 +32,16 @@ type RenderQueueContextType = {
|
|
|
32
32
|
updateCaptionJobProgress: (jobId: string, progress: CaptionJobProgress) => void;
|
|
33
33
|
markCaptionJobDone: (jobId: string, captionCount: number) => void;
|
|
34
34
|
markCaptionJobFailed: (jobId: string, error: Error) => void;
|
|
35
|
+
markCaptionJobCancelled: (jobId: string) => void;
|
|
36
|
+
markCaptionJobSaving: (jobId: string) => void;
|
|
35
37
|
removeCaptionJob: (jobId: string) => void;
|
|
36
38
|
setProcessCaptionJobCallback: (callback: ((job: CaptionJob) => Promise<void>) | null) => void;
|
|
37
39
|
addVideoMattingJob: (params: AddVideoMattingJobParams) => string;
|
|
38
40
|
updateVideoMattingJobProgress: (jobId: string, progress: VideoMattingJobProgress) => void;
|
|
39
41
|
markVideoMattingJobDone: (jobId: string) => void;
|
|
40
42
|
markVideoMattingJobFailed: (jobId: string, error: Error) => void;
|
|
43
|
+
markVideoMattingJobCancelled: (jobId: string) => void;
|
|
44
|
+
markVideoMattingJobSaving: (jobId: string) => void;
|
|
41
45
|
removeVideoMattingJob: (jobId: string) => void;
|
|
42
46
|
setProcessVideoMattingJobCallback: (callback: ((job: VideoMattingJob) => Promise<void>) | null) => void;
|
|
43
47
|
getAbortController: (jobId: string) => AbortController;
|
|
@@ -68,12 +68,16 @@ exports.RenderQueueContext = react_1.default.createContext({
|
|
|
68
68
|
updateCaptionJobProgress: noop,
|
|
69
69
|
markCaptionJobDone: noop,
|
|
70
70
|
markCaptionJobFailed: noop,
|
|
71
|
+
markCaptionJobCancelled: noop,
|
|
72
|
+
markCaptionJobSaving: noop,
|
|
71
73
|
removeCaptionJob: noop,
|
|
72
74
|
setProcessCaptionJobCallback: noop,
|
|
73
75
|
addVideoMattingJob: noopString,
|
|
74
76
|
updateVideoMattingJobProgress: noop,
|
|
75
77
|
markVideoMattingJobDone: noop,
|
|
76
78
|
markVideoMattingJobFailed: noop,
|
|
79
|
+
markVideoMattingJobCancelled: noop,
|
|
80
|
+
markVideoMattingJobSaving: noop,
|
|
77
81
|
removeVideoMattingJob: noop,
|
|
78
82
|
setProcessVideoMattingJobCallback: noop,
|
|
79
83
|
getAbortController: () => new AbortController(),
|
|
@@ -89,8 +93,12 @@ const RenderQueueContextProvider = ({ children }) => {
|
|
|
89
93
|
const hasActiveLocalJob = clientJobs.some((job) => job.status === 'idle' ||
|
|
90
94
|
job.status === 'running' ||
|
|
91
95
|
job.status === 'saving') ||
|
|
92
|
-
captionJobs.some((job) => job.status === 'idle' ||
|
|
93
|
-
|
|
96
|
+
captionJobs.some((job) => job.status === 'idle' ||
|
|
97
|
+
job.status === 'running' ||
|
|
98
|
+
job.status === 'saving') ||
|
|
99
|
+
videoMattingJobs.some((job) => job.status === 'idle' ||
|
|
100
|
+
job.status === 'running' ||
|
|
101
|
+
job.status === 'saving');
|
|
94
102
|
const [currentlyProcessing, setCurrentlyProcessing] = (0, react_1.useState)(null);
|
|
95
103
|
const lastLocalJobStartedAt = (0, react_1.useRef)(clientJobs.reduce((latest, job) => Math.max(latest, job.startedAt), 0));
|
|
96
104
|
const processJobCallbackRef = (0, react_1.useRef)(null);
|
|
@@ -154,7 +162,9 @@ const RenderQueueContextProvider = ({ children }) => {
|
|
|
154
162
|
status: 'running',
|
|
155
163
|
progress: {
|
|
156
164
|
detail: null,
|
|
157
|
-
message: '
|
|
165
|
+
message: 'outName' in job
|
|
166
|
+
? 'Starting background removal...'
|
|
167
|
+
: 'Starting video matting...',
|
|
158
168
|
value: 0,
|
|
159
169
|
},
|
|
160
170
|
}
|
|
@@ -283,17 +293,20 @@ const RenderQueueContextProvider = ({ children }) => {
|
|
|
283
293
|
return id;
|
|
284
294
|
}, [getLocalJobStartedAt]);
|
|
285
295
|
const updateCaptionJobProgress = (0, react_1.useCallback)((jobId, progress) => {
|
|
286
|
-
setCaptionJobs((prev) => prev.map((job) => job.id === jobId
|
|
287
|
-
|
|
296
|
+
setCaptionJobs((prev) => prev.map((job) => job.id === jobId &&
|
|
297
|
+
(job.status === 'running' || job.status === 'saving')
|
|
298
|
+
? { ...job, progress }
|
|
288
299
|
: job));
|
|
289
300
|
}, []);
|
|
290
301
|
const markCaptionJobDone = (0, react_1.useCallback)((jobId, captionCount) => {
|
|
302
|
+
(0, client_render_queue_1.deleteAbortController)(jobId);
|
|
291
303
|
setCaptionJobs((prev) => prev.map((job) => job.id === jobId
|
|
292
304
|
? { ...job, status: 'done', captionCount }
|
|
293
305
|
: job));
|
|
294
306
|
setCurrentlyProcessing((current) => (current === jobId ? null : current));
|
|
295
307
|
}, []);
|
|
296
308
|
const markCaptionJobFailed = (0, react_1.useCallback)((jobId, error) => {
|
|
309
|
+
(0, client_render_queue_1.deleteAbortController)(jobId);
|
|
297
310
|
setCaptionJobs((prev) => prev.map((job) => job.id === jobId
|
|
298
311
|
? {
|
|
299
312
|
...job,
|
|
@@ -303,12 +316,24 @@ const RenderQueueContextProvider = ({ children }) => {
|
|
|
303
316
|
: job));
|
|
304
317
|
setCurrentlyProcessing((current) => (current === jobId ? null : current));
|
|
305
318
|
}, []);
|
|
319
|
+
const markCaptionJobCancelled = (0, react_1.useCallback)((jobId) => {
|
|
320
|
+
(0, client_render_queue_1.deleteAbortController)(jobId);
|
|
321
|
+
setCaptionJobs((prev) => prev.map((job) => job.id === jobId ? { ...job, status: 'cancelled' } : job));
|
|
322
|
+
setCurrentlyProcessing((current) => (current === jobId ? null : current));
|
|
323
|
+
}, []);
|
|
324
|
+
const markCaptionJobSaving = (0, react_1.useCallback)((jobId) => {
|
|
325
|
+
setCaptionJobs((prev) => prev.map((job) => job.id === jobId && job.status === 'running'
|
|
326
|
+
? { ...job, status: 'saving' }
|
|
327
|
+
: job));
|
|
328
|
+
}, []);
|
|
306
329
|
const removeCaptionJob = (0, react_1.useCallback)((jobId) => {
|
|
307
330
|
setCaptionJobs((prev) => {
|
|
308
331
|
const jobToRemove = prev.find((job) => job.id === jobId);
|
|
309
|
-
if ((jobToRemove === null || jobToRemove === void 0 ? void 0 : jobToRemove.status) === 'running'
|
|
332
|
+
if ((jobToRemove === null || jobToRemove === void 0 ? void 0 : jobToRemove.status) === 'running' ||
|
|
333
|
+
(jobToRemove === null || jobToRemove === void 0 ? void 0 : jobToRemove.status) === 'saving') {
|
|
310
334
|
return prev;
|
|
311
335
|
}
|
|
336
|
+
(0, client_render_queue_1.deleteAbortController)(jobId);
|
|
312
337
|
return prev.filter((job) => job.id !== jobId);
|
|
313
338
|
});
|
|
314
339
|
}, []);
|
|
@@ -333,13 +358,18 @@ const RenderQueueContextProvider = ({ children }) => {
|
|
|
333
358
|
return id;
|
|
334
359
|
}, [getLocalJobStartedAt]);
|
|
335
360
|
const updateVideoMattingJobProgress = (0, react_1.useCallback)((jobId, progress) => {
|
|
336
|
-
setVideoMattingJobs((prev) => prev.map((job) => job.id === jobId
|
|
361
|
+
setVideoMattingJobs((prev) => prev.map((job) => job.id === jobId &&
|
|
362
|
+
(job.status === 'running' || job.status === 'saving')
|
|
363
|
+
? { ...job, progress }
|
|
364
|
+
: job));
|
|
337
365
|
}, []);
|
|
338
366
|
const markVideoMattingJobDone = (0, react_1.useCallback)((jobId) => {
|
|
367
|
+
(0, client_render_queue_1.deleteAbortController)(jobId);
|
|
339
368
|
setVideoMattingJobs((prev) => prev.map((job) => (job.id === jobId ? { ...job, status: 'done' } : job)));
|
|
340
369
|
setCurrentlyProcessing((current) => (current === jobId ? null : current));
|
|
341
370
|
}, []);
|
|
342
371
|
const markVideoMattingJobFailed = (0, react_1.useCallback)((jobId, error) => {
|
|
372
|
+
(0, client_render_queue_1.deleteAbortController)(jobId);
|
|
343
373
|
setVideoMattingJobs((prev) => prev.map((job) => job.id === jobId
|
|
344
374
|
? {
|
|
345
375
|
...job,
|
|
@@ -349,12 +379,24 @@ const RenderQueueContextProvider = ({ children }) => {
|
|
|
349
379
|
: job));
|
|
350
380
|
setCurrentlyProcessing((current) => (current === jobId ? null : current));
|
|
351
381
|
}, []);
|
|
382
|
+
const markVideoMattingJobCancelled = (0, react_1.useCallback)((jobId) => {
|
|
383
|
+
(0, client_render_queue_1.deleteAbortController)(jobId);
|
|
384
|
+
setVideoMattingJobs((prev) => prev.map((job) => job.id === jobId ? { ...job, status: 'cancelled' } : job));
|
|
385
|
+
setCurrentlyProcessing((current) => (current === jobId ? null : current));
|
|
386
|
+
}, []);
|
|
387
|
+
const markVideoMattingJobSaving = (0, react_1.useCallback)((jobId) => {
|
|
388
|
+
setVideoMattingJobs((prev) => prev.map((job) => job.id === jobId && job.status === 'running'
|
|
389
|
+
? { ...job, status: 'saving' }
|
|
390
|
+
: job));
|
|
391
|
+
}, []);
|
|
352
392
|
const removeVideoMattingJob = (0, react_1.useCallback)((jobId) => {
|
|
353
393
|
setVideoMattingJobs((prev) => {
|
|
354
394
|
const jobToRemove = prev.find((job) => job.id === jobId);
|
|
355
|
-
if ((jobToRemove === null || jobToRemove === void 0 ? void 0 : jobToRemove.status) === 'running'
|
|
395
|
+
if ((jobToRemove === null || jobToRemove === void 0 ? void 0 : jobToRemove.status) === 'running' ||
|
|
396
|
+
(jobToRemove === null || jobToRemove === void 0 ? void 0 : jobToRemove.status) === 'saving') {
|
|
356
397
|
return prev;
|
|
357
398
|
}
|
|
399
|
+
(0, client_render_queue_1.deleteAbortController)(jobId);
|
|
358
400
|
return prev.filter((job) => job.id !== jobId);
|
|
359
401
|
});
|
|
360
402
|
}, []);
|
|
@@ -408,12 +450,16 @@ const RenderQueueContextProvider = ({ children }) => {
|
|
|
408
450
|
updateCaptionJobProgress,
|
|
409
451
|
markCaptionJobDone,
|
|
410
452
|
markCaptionJobFailed,
|
|
453
|
+
markCaptionJobCancelled,
|
|
454
|
+
markCaptionJobSaving,
|
|
411
455
|
removeCaptionJob,
|
|
412
456
|
setProcessCaptionJobCallback,
|
|
413
457
|
addVideoMattingJob,
|
|
414
458
|
updateVideoMattingJobProgress,
|
|
415
459
|
markVideoMattingJobDone,
|
|
416
460
|
markVideoMattingJobFailed,
|
|
461
|
+
markVideoMattingJobCancelled,
|
|
462
|
+
markVideoMattingJobSaving,
|
|
417
463
|
removeVideoMattingJob,
|
|
418
464
|
setProcessVideoMattingJobCallback,
|
|
419
465
|
getAbortController: client_render_queue_1.getAbortController,
|
|
@@ -438,12 +484,16 @@ const RenderQueueContextProvider = ({ children }) => {
|
|
|
438
484
|
updateCaptionJobProgress,
|
|
439
485
|
markCaptionJobDone,
|
|
440
486
|
markCaptionJobFailed,
|
|
487
|
+
markCaptionJobCancelled,
|
|
488
|
+
markCaptionJobSaving,
|
|
441
489
|
removeCaptionJob,
|
|
442
490
|
setProcessCaptionJobCallback,
|
|
443
491
|
addVideoMattingJob,
|
|
444
492
|
updateVideoMattingJobProgress,
|
|
445
493
|
markVideoMattingJobDone,
|
|
446
494
|
markVideoMattingJobFailed,
|
|
495
|
+
markVideoMattingJobCancelled,
|
|
496
|
+
markVideoMattingJobSaving,
|
|
447
497
|
removeVideoMattingJob,
|
|
448
498
|
setProcessVideoMattingJobCallback,
|
|
449
499
|
]);
|
|
@@ -108,14 +108,14 @@ const RenderQueue = () => {
|
|
|
108
108
|
for (let i = 0; i < allJobs.length; i++) {
|
|
109
109
|
const job = allJobs[i];
|
|
110
110
|
if ((0, caption_job_types_1.isCaptionJob)(job) &&
|
|
111
|
+
job.target === null &&
|
|
111
112
|
job.status === 'done' &&
|
|
112
113
|
canvasContent.asset === job.outName) {
|
|
113
114
|
return i;
|
|
114
115
|
}
|
|
115
116
|
if ((0, video_matting_job_types_1.isVideoMattingJob)(job) &&
|
|
116
117
|
job.status === 'done' &&
|
|
117
|
-
|
|
118
|
-
canvasContent.asset === job.foregroundOutName)) {
|
|
118
|
+
canvasContent.asset === job.outName) {
|
|
119
119
|
return i;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
@@ -124,7 +124,7 @@ const RenderQueue = () => {
|
|
|
124
124
|
}, [allJobs, canvasContent]);
|
|
125
125
|
if (jobCount === 0) {
|
|
126
126
|
return (jsx_runtime_1.jsxs("div", { style: explainer, children: [
|
|
127
|
-
jsx_runtime_1.jsx(layout_1.Spacing, { y: 5 }), jsx_runtime_1.jsx("div", { style: errorExplanation, children: "Renders, transcriptions and
|
|
127
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 5 }), jsx_runtime_1.jsx("div", { style: errorExplanation, children: "Renders, transcriptions and background removal jobs will show up here." }), jsx_runtime_1.jsx(layout_1.Spacing, { y: 2, block: true })
|
|
128
128
|
] }));
|
|
129
129
|
}
|
|
130
130
|
return (jsx_runtime_1.jsx("div", { ref: divRef, style: renderQueue, className: ['css-reset', is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME].join(' '), children: allJobs.map((job, index) => {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export declare const loadModelForJob: <Model extends string>({ isModelCached, loadModel, model, progressSpan, progressStart, updateProgress, }: {
|
|
1
|
+
export declare const loadModelForJob: <Model extends string>({ isModelCached, loadModel, model, signal, progressSpan, progressStart, updateProgress, }: {
|
|
2
2
|
isModelCached: (model: Model) => Promise<boolean>;
|
|
3
3
|
loadModel: (model: Model, onProgress: (progress: number | null) => void) => Promise<unknown>;
|
|
4
4
|
model: Model;
|
|
5
|
+
signal: AbortSignal;
|
|
5
6
|
progressSpan: number;
|
|
6
7
|
progressStart: number;
|
|
7
8
|
updateProgress: (progress: {
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadModelForJob = void 0;
|
|
4
|
-
const loadModelForJob = async ({ isModelCached, loadModel, model, progressSpan, progressStart, updateProgress, }) => {
|
|
4
|
+
const loadModelForJob = async ({ isModelCached, loadModel, model, signal, progressSpan, progressStart, updateProgress, }) => {
|
|
5
|
+
signal.throwIfAborted();
|
|
5
6
|
const cached = await isModelCached(model);
|
|
7
|
+
signal.throwIfAborted();
|
|
6
8
|
await loadModel(model, (progress) => {
|
|
9
|
+
signal.throwIfAborted();
|
|
7
10
|
const percentage = progress === null ? '' : ` ${Math.round(progress * 100)}%`;
|
|
8
11
|
updateProgress({
|
|
9
12
|
message: `${cached ? 'Loading' : 'Downloading'} ${model}${percentage}`,
|
|
10
13
|
value: progressStart + (progress !== null && progress !== void 0 ? progress : 0) * progressSpan,
|
|
11
14
|
});
|
|
12
15
|
});
|
|
16
|
+
signal.throwIfAborted();
|
|
13
17
|
};
|
|
14
18
|
exports.loadModelForJob = loadModelForJob;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { VideoMattingBitrate, VideoMattingModel } from '@remotion/video-matting';
|
|
2
|
+
import type { SequencePropsSubscriptionKey } from 'remotion';
|
|
2
3
|
export type VideoMattingJobProgress = {
|
|
3
4
|
detail: string | null;
|
|
4
5
|
message: string;
|
|
@@ -7,7 +8,9 @@ export type VideoMattingJobProgress = {
|
|
|
7
8
|
type VideoMattingJobStatus = {
|
|
8
9
|
status: 'idle';
|
|
9
10
|
} | {
|
|
10
|
-
status: '
|
|
11
|
+
status: 'cancelled';
|
|
12
|
+
} | {
|
|
13
|
+
status: 'running' | 'saving';
|
|
11
14
|
progress: VideoMattingJobProgress;
|
|
12
15
|
} | {
|
|
13
16
|
status: 'done';
|
|
@@ -18,15 +21,19 @@ type VideoMattingJobStatus = {
|
|
|
18
21
|
stack: string | undefined;
|
|
19
22
|
};
|
|
20
23
|
};
|
|
21
|
-
|
|
24
|
+
type VideoMattingJobCommon = {
|
|
22
25
|
src: string;
|
|
23
26
|
displayName: string;
|
|
24
|
-
baseOutName: string;
|
|
25
|
-
foregroundOutName: string;
|
|
26
27
|
model: VideoMattingModel;
|
|
27
|
-
audio: VideoLayerAudio;
|
|
28
28
|
videoBitrate: VideoMattingBitrate;
|
|
29
|
+
outName: string;
|
|
30
|
+
audio: 'keep' | 'none';
|
|
31
|
+
target: {
|
|
32
|
+
fileName: string;
|
|
33
|
+
nodePath: SequencePropsSubscriptionKey;
|
|
34
|
+
} | null;
|
|
29
35
|
};
|
|
36
|
+
export type AddVideoMattingJobParams = VideoMattingJobCommon;
|
|
30
37
|
export type VideoMattingJob = AddVideoMattingJobParams & {
|
|
31
38
|
id: string;
|
|
32
39
|
type: 'video-matting';
|
|
@@ -15,6 +15,7 @@ const row = {
|
|
|
15
15
|
alignItems: 'center',
|
|
16
16
|
flex: 1,
|
|
17
17
|
userSelect: 'none',
|
|
18
|
+
WebkitUserSelect: 'none',
|
|
18
19
|
};
|
|
19
20
|
const badge = {
|
|
20
21
|
height: 16,
|
|
@@ -25,6 +26,7 @@ const badge = {
|
|
|
25
26
|
justifyContent: 'center',
|
|
26
27
|
alignItems: 'center',
|
|
27
28
|
userSelect: 'none',
|
|
29
|
+
WebkitUserSelect: 'none',
|
|
28
30
|
};
|
|
29
31
|
const RendersTab = ({ selected, onClick }) => {
|
|
30
32
|
const { jobs, captionJobs } = (0, react_1.useContext)(context_1.RenderQueueContext);
|
|
@@ -47,6 +47,7 @@ const selected_outline_types_1 = require("./selected-outline-types");
|
|
|
47
47
|
const selected_outline_uv_1 = require("./selected-outline-uv");
|
|
48
48
|
const call_add_keyframe_1 = require("./Timeline/call-add-keyframe");
|
|
49
49
|
const focus_inspector_field_1 = require("./Timeline/focus-inspector-field");
|
|
50
|
+
const get_timeline_keyframes_1 = require("./Timeline/get-timeline-keyframes");
|
|
50
51
|
const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
|
|
51
52
|
const CROP_HANDLE_THICKNESS = 5;
|
|
52
53
|
const CROP_HANDLE_LENGTH = 20;
|
|
@@ -223,7 +224,7 @@ const CropHandle = ({ handle, outline, onDraggingChange, target }) => {
|
|
|
223
224
|
setDragOverrides(cropDrag.nodePath, fieldKey, field.propStatus.status === 'keyframed'
|
|
224
225
|
? remotion_1.Internals.makeKeyframedDragOverride({
|
|
225
226
|
status: field.propStatus,
|
|
226
|
-
frame: cropDrag.sourceFrame,
|
|
227
|
+
frame: (0, get_timeline_keyframes_1.resolveKeyframeSourceFrame)(cropDrag.sourceFrame, field.propStatus),
|
|
227
228
|
value,
|
|
228
229
|
})
|
|
229
230
|
: remotion_1.Internals.makeStaticDragOverride(value));
|
|
@@ -47,18 +47,25 @@ const SelectedOutlineEditingHandles = ({ dragging, getAllRotationDragTargets, ge
|
|
|
47
47
|
layoutTarget,
|
|
48
48
|
});
|
|
49
49
|
const controlLayout = (0, react_1.useMemo)(() => (0, selected_outline_control_layout_1.getSelectedOutlineControlLayout)(outline.points), [outline.points]);
|
|
50
|
+
// Scale and rotation handles are placed on the bounding box of the element.
|
|
51
|
+
// For path outlines the rendered geometry follows the SVG path, so
|
|
52
|
+
// bounding-box handles would sit off the shape and misrepresent the
|
|
53
|
+
// transform. Translate and crop still apply to the element as a whole.
|
|
54
|
+
const showTransformHandles = outline.path === null;
|
|
50
55
|
const onContextMenuOpen = react_1.default.useCallback(() => {
|
|
51
56
|
var _a;
|
|
52
57
|
var _b;
|
|
53
58
|
return (_b = (_a = getContextMenuOpenByKey(outline.key)) === null || _a === void 0 ? void 0 : _a()) !== null && _b !== void 0 ? _b : false;
|
|
54
59
|
}, [getContextMenuOpenByKey, outline.key]);
|
|
55
60
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
56
|
-
jsx_runtime_1.jsx(SelectedOutlineCropControls_1.SelectedOutlineCropControls, { outline: outline, onDraggingChange: onDraggingChange, target: controlTarget }),
|
|
61
|
+
jsx_runtime_1.jsx(SelectedOutlineCropControls_1.SelectedOutlineCropControls, { outline: outline, onDraggingChange: onDraggingChange, target: controlTarget }), showTransformHandles &&
|
|
62
|
+
(controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.cropDrag) === null &&
|
|
57
63
|
((layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.containsSelection) || hovered)
|
|
58
64
|
? controlLayout.scaleEdges.map((edge) => (jsx_runtime_1.jsx(SelectedOutlineScaleEdgeLine_1.SelectedOutlineScaleEdgeLine, { getAllScaleDragTargets: getAllScaleDragTargets, dragging: dragging, edge: edge, hitWidth: edge === 'top' || edge === 'bottom'
|
|
59
65
|
? controlLayout.scaleHitWidth.horizontal
|
|
60
66
|
: controlLayout.scaleHitWidth.vertical, outline: outline, onContextMenuOpen: onContextMenuOpen, onContextMenuOpenChange: onContextMenuOpenChange, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSelect: onSelect, target: controlTarget }, edge)))
|
|
61
|
-
: null,
|
|
67
|
+
: null, showTransformHandles &&
|
|
68
|
+
(controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.cropDrag) === null &&
|
|
62
69
|
((layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.containsSelection) || hovered)
|
|
63
70
|
? controlLayout.rotationCorners.map(({ corner, point }) => (jsx_runtime_1.jsx(SelectedOutlineRotationCornerHandle_1.SelectedOutlineRotationCornerHandle, { getAllRotationDragTargets: getAllRotationDragTargets, corner: corner, dragging: dragging, handlePoint: point, outline: outline, onContextMenuOpen: onContextMenuOpen, onContextMenuOpenChange: onContextMenuOpenChange, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSelect: onSelect, radius: controlLayout.rotationHandleRadius, target: controlTarget }, corner)))
|
|
64
71
|
: null] }));
|
|
@@ -77,6 +77,7 @@ const SelectedOutlineElementUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
77
77
|
const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
|
|
78
78
|
const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
79
79
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
80
|
+
const { selectItems } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
80
81
|
const { setManuallyEnabled } = (0, react_1.useContext)(transform_3d_mode_1.Transform3DModeStateContext);
|
|
81
82
|
const { controlTarget, getLayoutTarget, getTarget, hovered, onHoverChange } = (0, use_selected_outline_control_target_1.useSelectedOutlineControlTarget)({
|
|
82
83
|
getLatestTargetByKey,
|
|
@@ -171,7 +172,7 @@ const SelectedOutlineElementUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
171
172
|
!sourceEditDisabled &&
|
|
172
173
|
previewServerState.type === 'connected';
|
|
173
174
|
const canCrop = contextMenuTarget.canCrop && !sourceEditDisabled;
|
|
174
|
-
const canRotate = !sourceEditDisabled;
|
|
175
|
+
const canRotate = !sourceEditDisabled && outline.path === null;
|
|
175
176
|
const outlineElement = (_b = (_a = contextMenuTarget.sequence.refForOutline) === null || _a === void 0 ? void 0 : _a.current) !== null && _b !== void 0 ? _b : null;
|
|
176
177
|
return (0, get_sequence_context_menu_items_1.getSequenceContextMenuItems)({
|
|
177
178
|
assetLinkInfo,
|
|
@@ -269,7 +270,8 @@ const SelectedOutlineElementUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
269
270
|
type: 'add-effect',
|
|
270
271
|
clientId: previewServerState.clientId,
|
|
271
272
|
fileName: nodePath.absolutePath,
|
|
272
|
-
|
|
273
|
+
nodePathInfo: contextMenuTarget.nodePathInfo,
|
|
274
|
+
selectItems,
|
|
273
275
|
});
|
|
274
276
|
},
|
|
275
277
|
quickSwitcherLabel: null,
|
|
@@ -348,8 +350,10 @@ const SelectedOutlineElementUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
348
350
|
resolveOriginalLocation,
|
|
349
351
|
setManuallyEnabled,
|
|
350
352
|
selectAsset,
|
|
353
|
+
selectItems,
|
|
351
354
|
setSelectedModal,
|
|
352
355
|
setPropStatuses,
|
|
356
|
+
outline.path,
|
|
353
357
|
]);
|
|
354
358
|
(0, react_1.useLayoutEffect)(() => {
|
|
355
359
|
registerContextMenuOpen(outline.key, onContextMenuOpen);
|
|
@@ -359,6 +363,8 @@ const SelectedOutlineElementUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
359
363
|
}, [onContextMenuOpen, outline.key, registerContextMenuOpen]);
|
|
360
364
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
361
365
|
jsx_runtime_1.jsx(SelectedOutlinePolygon_1.SelectedOutlinePolygon, { compositionHeight: compositionHeight, compositionWidth: compositionWidth, containsSelection: (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.containsSelection) === true, directlySelected: (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.selected) === true, dragging: dragging, getAllDragOutlines: getAllDragOutlines, getAllDragTargets: getAllDragTargets, getLayoutTarget: getLayoutTarget, getTarget: getTarget, hasTarget: layoutTarget !== undefined, hovered: hovered, outline: outline, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSnapPointsChange: onSnapPointsChange, onSelect: onSelect, onDoubleClickTarget: onDoubleClickTarget, scale: scale, showSelectedOutline: (_a = layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.showSelectedOutline) !== null && _a !== void 0 ? _a : false, translateWithCommandKey: (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.selectedForRotation) === true &&
|
|
362
|
-
Boolean(controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.rotationDrag) }), (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.selectedForRotation) &&
|
|
366
|
+
Boolean(controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.rotationDrag) }), (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.selectedForRotation) &&
|
|
367
|
+
(controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.rotationDrag) &&
|
|
368
|
+
outline.path === null ? (jsx_runtime_1.jsx(SelectedOutlineCanvasRotation_1.SelectedOutlineCanvasRotation, { getLatestTargetByKey: getLatestTargetByKey, layoutTarget: layoutTarget, onDraggingChange: onDraggingChange, outline: outline, transform3DMode: controlTarget.rotationDrag.transform3DMode })) : null] }));
|
|
363
369
|
};
|
|
364
370
|
exports.SelectedOutlineElement = react_1.default.memo(SelectedOutlineElementUnmemoized);
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type
|
|
3
|
-
import { type SelectedOutlineTarget } from './selected-outline-types';
|
|
2
|
+
import { type SelectedOutlineDragTarget } from './selected-outline-types';
|
|
4
3
|
export declare const SelectedOutlineKeyboardControls: React.FC<{
|
|
5
|
-
readonly
|
|
6
|
-
readonly getSelectableOutlines: () => ReturnType<typeof getSequencesWithSelectableOutlines>;
|
|
4
|
+
readonly getAllDragTargets: () => readonly SelectedOutlineDragTarget[];
|
|
7
5
|
}>;
|