@remotion/studio 4.0.522 → 4.0.524

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.
Files changed (259) hide show
  1. package/dist/api/install-package.js +4 -2
  2. package/dist/components/ActionTooltip.d.ts +9 -0
  3. package/dist/components/ActionTooltip.js +143 -0
  4. package/dist/components/AssetAudioVolume.d.ts +5 -0
  5. package/dist/components/AssetAudioVolume.js +33 -0
  6. package/dist/components/Canvas.js +8 -8
  7. package/dist/components/CaptionInspector.js +74 -20
  8. package/dist/components/CheckboardToggle.js +9 -10
  9. package/dist/components/Checkbox.d.ts +1 -0
  10. package/dist/components/Checkbox.js +2 -2
  11. package/dist/components/CompositionContextButton.js +4 -1
  12. package/dist/components/CompositionSelectorItem.js +2 -2
  13. package/dist/components/ConfigureLicenseModal.js +1 -1
  14. package/dist/components/CurrentAsset.js +40 -6
  15. package/dist/components/EditorContexts.js +3 -1
  16. package/dist/components/ElementInstallConfirmation.js +254 -137
  17. package/dist/components/FixComputedValueModal.js +38 -8
  18. package/dist/components/FullscreenToggle.js +8 -10
  19. package/dist/components/GlobalKeybindings.js +107 -49
  20. package/dist/components/InspectorPanel/MultiSequenceField.d.ts +12 -0
  21. package/dist/components/InspectorPanel/MultiSequenceField.js +131 -0
  22. package/dist/components/InspectorPanel/MultiSequenceInspector.d.ts +8 -0
  23. package/dist/components/InspectorPanel/MultiSequenceInspector.js +102 -0
  24. package/dist/components/InspectorPanel/MultiSequenceNumberField.d.ts +9 -0
  25. package/dist/components/InspectorPanel/MultiSequenceNumberField.js +88 -0
  26. package/dist/components/InspectorPanel.js +4 -0
  27. package/dist/components/InspectorSequenceSection.js +69 -6
  28. package/dist/components/InstallPackage.js +4 -5
  29. package/dist/components/KeyboardShortcutsSettings.js +212 -33
  30. package/dist/components/LazySyntaxHighlightedSource.d.ts +4 -0
  31. package/dist/components/LazySyntaxHighlightedSource.js +43 -0
  32. package/dist/components/LoopToggle.js +8 -2
  33. package/dist/components/MenuToolbar.js +11 -7
  34. package/dist/components/ModalContainer.d.ts +1 -0
  35. package/dist/components/ModalContainer.js +2 -2
  36. package/dist/components/Modals.js +3 -1
  37. package/dist/components/ModelManager.d.ts +16 -0
  38. package/dist/components/ModelManager.js +200 -0
  39. package/dist/components/ModelsSettings.d.ts +2 -0
  40. package/dist/components/ModelsSettings.js +133 -0
  41. package/dist/components/MuteToggle.d.ts +1 -0
  42. package/dist/components/MuteToggle.js +16 -6
  43. package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
  44. package/dist/components/NewComposition/DismissableModal.js +2 -2
  45. package/dist/components/NewComposition/InputDragger.d.ts +2 -2
  46. package/dist/components/NewComposition/InputDragger.js +6 -6
  47. package/dist/components/NewComposition/NewComposition.d.ts +1 -0
  48. package/dist/components/NewComposition/NewComposition.js +5 -4
  49. package/dist/components/NewComposition/NewFolder.js +9 -8
  50. package/dist/components/NewComposition/RenameComposition.js +3 -2
  51. package/dist/components/NewComposition/RenameFolder.js +15 -10
  52. package/dist/components/NewComposition/SlugPreview.d.ts +7 -0
  53. package/dist/components/NewComposition/SlugPreview.js +18 -0
  54. package/dist/components/OptionalPackageModal.d.ts +11 -0
  55. package/dist/components/OptionalPackageModal.js +155 -0
  56. package/dist/components/OutlineToggle.js +16 -10
  57. package/dist/components/PlayPause.js +11 -9
  58. package/dist/components/PlaybackKeyboardShortcutsManager.d.ts +2 -0
  59. package/dist/components/PlaybackKeyboardShortcutsManager.js +39 -7
  60. package/dist/components/PlaybackRateSelector.js +2 -2
  61. package/dist/components/PreviewToolbar.js +1 -1
  62. package/dist/components/PreviewToolbarOverflowButton.js +19 -4
  63. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +5 -2
  64. package/dist/components/RadioButton.d.ts +1 -0
  65. package/dist/components/RadioButton.js +2 -2
  66. package/dist/components/RenderButton.js +5 -1
  67. package/dist/components/RenderModal/NumberSetting.d.ts +6 -1
  68. package/dist/components/RenderModal/NumberSetting.js +2 -2
  69. package/dist/components/RenderModal/RenderModalBasic.js +1 -1
  70. package/dist/components/RenderModal/RenderModalOutputName.d.ts +3 -1
  71. package/dist/components/RenderModal/RenderModalOutputName.js +4 -4
  72. package/dist/components/RenderModal/SeparateAudioOption.js +1 -1
  73. package/dist/components/RenderModal/WebRenderModalBasic.js +1 -1
  74. package/dist/components/RenderQueue/CaptionQueueItem.d.ts +6 -0
  75. package/dist/components/RenderQueue/CaptionQueueItem.js +130 -0
  76. package/dist/components/RenderQueue/CaptionQueueProcessor.d.ts +1 -0
  77. package/dist/components/RenderQueue/CaptionQueueProcessor.js +110 -0
  78. package/dist/components/RenderQueue/CaptionQueueProcessorLoader.d.ts +2 -0
  79. package/dist/components/RenderQueue/CaptionQueueProcessorLoader.js +54 -0
  80. package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +2 -1
  81. package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -1
  82. package/dist/components/RenderQueue/RenderQueueItem.js +3 -3
  83. package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +2 -1
  84. package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +2 -1
  85. package/dist/components/RenderQueue/RenderQueueRemoveItem.js +2 -1
  86. package/dist/components/RenderQueue/RenderQueueRepeat.js +2 -1
  87. package/dist/components/RenderQueue/VideoMattingQueueItem.d.ts +6 -0
  88. package/dist/components/RenderQueue/VideoMattingQueueItem.js +130 -0
  89. package/dist/components/RenderQueue/VideoMattingQueueProcessor.d.ts +1 -0
  90. package/dist/components/RenderQueue/VideoMattingQueueProcessor.js +105 -0
  91. package/dist/components/RenderQueue/VideoMattingQueueProcessorLoader.d.ts +2 -0
  92. package/dist/components/RenderQueue/VideoMattingQueueProcessorLoader.js +54 -0
  93. package/dist/components/RenderQueue/caption-job-types.d.ts +47 -0
  94. package/dist/components/RenderQueue/caption-job-types.js +7 -0
  95. package/dist/components/RenderQueue/context.d.ts +16 -0
  96. package/dist/components/RenderQueue/context.js +224 -11
  97. package/dist/components/RenderQueue/index.js +34 -10
  98. package/dist/components/RenderQueue/item-style.d.ts +1 -0
  99. package/dist/components/RenderQueue/item-style.js +2 -1
  100. package/dist/components/RenderQueue/load-model-for-job.d.ts +11 -0
  101. package/dist/components/RenderQueue/load-model-for-job.js +14 -0
  102. package/dist/components/RenderQueue/video-matting-job-types.d.ts +38 -0
  103. package/dist/components/RenderQueue/video-matting-job-types.js +5 -0
  104. package/dist/components/RendersTab.js +4 -4
  105. package/dist/components/RulersAndGuidesToggle.js +7 -1
  106. package/dist/components/SegmentedControl.d.ts +2 -2
  107. package/dist/components/SegmentedControl.js +38 -13
  108. package/dist/components/SelectedOutlinePolygon.js +8 -2
  109. package/dist/components/SettingsButton.d.ts +4 -0
  110. package/dist/components/SettingsButton.js +51 -0
  111. package/dist/components/SettingsModal.d.ts +1 -1
  112. package/dist/components/SettingsModal.js +3 -1
  113. package/dist/components/ShowOutlinesProvider.js +12 -0
  114. package/dist/components/SidebarCollapserControls.js +17 -21
  115. package/dist/components/SizeSelector.js +12 -4
  116. package/dist/components/SkillsSettings.js +2 -3
  117. package/dist/components/SnappingToggle.js +9 -8
  118. package/dist/components/StudioSettings.js +32 -18
  119. package/dist/components/SyntaxHighlightedSource.d.ts +5 -0
  120. package/dist/components/SyntaxHighlightedSource.js +78 -0
  121. package/dist/components/Tabs/vertical.d.ts +1 -0
  122. package/dist/components/Tabs/vertical.js +2 -2
  123. package/dist/components/TimeValue.js +2 -3
  124. package/dist/components/Timeline/SequencePropsObserver.js +4 -0
  125. package/dist/components/Timeline/Timeline.js +49 -81
  126. package/dist/components/Timeline/TimelineClipboardKeybindings.js +2 -4
  127. package/dist/components/Timeline/TimelineDeleteKeybindings.js +3 -18
  128. package/dist/components/Timeline/TimelineDragHandler.js +2 -2
  129. package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +1 -0
  130. package/dist/components/Timeline/TimelineLayerChildren.js +12 -9
  131. package/dist/components/Timeline/TimelineRowChrome.js +11 -3
  132. package/dist/components/Timeline/TimelineSchemaField.js +8 -4
  133. package/dist/components/Timeline/TimelineSelection.d.ts +2 -0
  134. package/dist/components/Timeline/TimelineSelection.js +55 -2
  135. package/dist/components/Timeline/TimelineSequence.js +75 -17
  136. package/dist/components/Timeline/TimelineSequenceItem.d.ts +0 -1
  137. package/dist/components/Timeline/TimelineSequenceItem.js +208 -111
  138. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +23 -3
  139. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +73 -25
  140. package/dist/components/Timeline/TimelineTimeIndicators.js +1 -0
  141. package/dist/components/Timeline/TimelineZoomControls.js +2 -1
  142. package/dist/components/Timeline/timeline-field-display-utils.js +8 -5
  143. package/dist/components/Timeline/use-asset-timeline-context-menu.d.ts +2 -0
  144. package/dist/components/Timeline/use-asset-timeline-context-menu.js +52 -0
  145. package/dist/components/TimelineCombobox.d.ts +1 -0
  146. package/dist/components/TimelineCombobox.js +8 -4
  147. package/dist/components/TimelineInOutToggle.js +14 -18
  148. package/dist/components/Transcription/LazyModels.d.ts +1 -0
  149. package/dist/components/Transcription/LazyModels.js +5 -0
  150. package/dist/components/Transcription/Models.d.ts +6 -0
  151. package/dist/components/Transcription/Models.js +18 -0
  152. package/dist/components/Transcription/TranscriptionModal.d.ts +3 -0
  153. package/dist/components/Transcription/TranscriptionModal.js +428 -0
  154. package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.d.ts +5 -0
  155. package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.js +48 -0
  156. package/dist/components/Transcription/caption-output-name.d.ts +2 -0
  157. package/dist/components/Transcription/caption-output-name.js +10 -0
  158. package/dist/components/Transcription/resample-media-to-16-khz.d.ts +6 -0
  159. package/dist/components/Transcription/resample-media-to-16-khz.js +82 -0
  160. package/dist/components/Transcription/whisper-languages.d.ts +2 -0
  161. package/dist/components/Transcription/whisper-languages.js +104 -0
  162. package/dist/components/Transcription/whisper-webgpu-capability.d.ts +2 -0
  163. package/dist/components/Transcription/whisper-webgpu-capability.js +7 -0
  164. package/dist/components/UndoRedoButtons.js +13 -38
  165. package/dist/components/UpdatesSettings.js +8 -12
  166. package/dist/components/VideoMatting/LazyModels.d.ts +1 -0
  167. package/dist/components/VideoMatting/LazyModels.js +5 -0
  168. package/dist/components/VideoMatting/Models.d.ts +6 -0
  169. package/dist/components/VideoMatting/Models.js +18 -0
  170. package/dist/components/VideoMatting/VideoMattingModal.d.ts +3 -0
  171. package/dist/components/VideoMatting/VideoMattingModal.js +207 -0
  172. package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.d.ts +5 -0
  173. package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.js +46 -0
  174. package/dist/components/VideoMatting/video-matting-capability.d.ts +2 -0
  175. package/dist/components/VideoMatting/video-matting-capability.js +7 -0
  176. package/dist/components/WebMcp.js +439 -22
  177. package/dist/components/handle-drop.js +3 -2
  178. package/dist/components/import-assets.d.ts +3 -2
  179. package/dist/components/import-assets.js +5 -9
  180. package/dist/components/keyboard-shortcuts.d.ts +17 -1
  181. package/dist/components/keyboard-shortcuts.js +191 -89
  182. package/dist/components/public-output-name.d.ts +5 -0
  183. package/dist/components/public-output-name.js +60 -0
  184. package/dist/components/use-model-cache-status.d.ts +7 -0
  185. package/dist/components/use-model-cache-status.js +35 -0
  186. package/dist/error-overlay/remotion-overlay/CodeFrame.js +29 -18
  187. package/dist/esm/CaptionQueueProcessor-k0yrm3dj.mjs +211 -0
  188. package/dist/esm/LazyModels-hc33szyn.mjs +11 -0
  189. package/dist/esm/LazyModels-sg40rjw6.mjs +11 -0
  190. package/dist/esm/SyntaxHighlightedSource-3xks91rz.mjs +1236 -0
  191. package/dist/esm/TranscriptionModal-3ctnxpt6.mjs +1011 -0
  192. package/dist/esm/VideoMattingModal-b0r7e60n.mjs +374 -0
  193. package/dist/esm/VideoMattingQueueProcessor-t1hgm2rm.mjs +109 -0
  194. package/dist/esm/index-1b9skrrd.mjs +142 -0
  195. package/dist/esm/index-2j3d1g81.mjs +261 -0
  196. package/dist/esm/index-5zrb1ft4.mjs +39 -0
  197. package/dist/esm/index-7tt71e8n.mjs +36 -0
  198. package/dist/esm/index-9qtvmwtx.mjs +1366 -0
  199. package/dist/esm/index-9x6e1dq0.mjs +428 -0
  200. package/dist/esm/index-c37kme2v.mjs +46209 -0
  201. package/dist/esm/index-cw0pnpg5.mjs +50 -0
  202. package/dist/esm/index-e3zwf3e7.mjs +36 -0
  203. package/dist/esm/index-er3mh6em.mjs +54688 -0
  204. package/dist/esm/{chunk-je0h1bgt.js → index-k426ye99.mjs} +4 -1
  205. package/dist/esm/index-q2epbw93.mjs +423 -0
  206. package/dist/esm/index-q5xv20xx.mjs +41 -0
  207. package/dist/esm/{chunk-6jf1natv.js → index-rcv7qkt5.mjs} +18 -1
  208. package/dist/esm/index-v4tr1bft.mjs +20 -0
  209. package/dist/esm/index-wbmp5srk.mjs +35 -0
  210. package/dist/esm/index-yfrysr5f.mjs +1154 -0
  211. package/dist/esm/index.mjs +45 -933
  212. package/dist/esm/internals.mjs +13 -114393
  213. package/dist/esm/previewEntry.mjs +387 -115050
  214. package/dist/esm/renderEntry.mjs +5 -5
  215. package/dist/esm/{chunk-m0jqdbkr.js → resolve-composition-component-location-bt2d6qxq.mjs} +1 -1
  216. package/dist/helpers/colors.d.ts +1 -0
  217. package/dist/helpers/colors.js +4 -3
  218. package/dist/helpers/drag-aware-double-click.d.ts +2 -1
  219. package/dist/helpers/drag-aware-double-click.js +12 -1
  220. package/dist/helpers/get-asset-metadata.d.ts +1 -0
  221. package/dist/helpers/get-asset-metadata.js +4 -0
  222. package/dist/helpers/hoverable.js +8 -0
  223. package/dist/helpers/inject-css.js +2 -0
  224. package/dist/helpers/optional-package-dependencies.d.ts +3 -0
  225. package/dist/helpers/optional-package-dependencies.js +24 -0
  226. package/dist/helpers/pointer-session.d.ts +6 -0
  227. package/dist/helpers/pointer-session.js +36 -14
  228. package/dist/helpers/prism-vsc-dark-plus.d.ts +1 -0
  229. package/dist/helpers/prism-vsc-dark-plus.js +305 -0
  230. package/dist/helpers/sequence-node-path-mutations.js +11 -0
  231. package/dist/helpers/slugify-name.d.ts +1 -0
  232. package/dist/helpers/slugify-name.js +14 -0
  233. package/dist/helpers/studio-runtime-config.d.ts +1 -0
  234. package/dist/helpers/studio-runtime-config.js +6 -1
  235. package/dist/helpers/use-create-composition.d.ts +1 -0
  236. package/dist/helpers/use-create-composition.js +12 -7
  237. package/dist/helpers/use-keybinding.d.ts +9 -3
  238. package/dist/helpers/use-keybinding.js +8 -9
  239. package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -0
  240. package/dist/helpers/use-keyboard-shortcut-label.js +15 -0
  241. package/dist/helpers/use-menu-structure.js +59 -14
  242. package/dist/helpers/use-rename-composition.d.ts +1 -0
  243. package/dist/helpers/use-rename-composition.js +11 -5
  244. package/dist/icons/input-props.d.ts +1 -1
  245. package/dist/icons/input-props.js +2 -2
  246. package/dist/icons/models.d.ts +4 -0
  247. package/dist/icons/models.js +7 -0
  248. package/dist/icons/separation.d.ts +4 -0
  249. package/dist/icons/separation.js +7 -0
  250. package/dist/icons/skills.js +1 -1
  251. package/dist/icons/transcription.d.ts +4 -0
  252. package/dist/icons/transcription.js +7 -0
  253. package/dist/icons/upload.js +1 -1
  254. package/dist/renderEntry.js +2 -2
  255. package/dist/state/modals.d.ts +14 -2
  256. package/package.json +35 -21
  257. package/dist/components/UpdateCheck.d.ts +0 -1
  258. package/dist/components/UpdateCheck.js +0 -79
  259. package/dist/esm/chunk-3netyjd9.js +0 -99793
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VideoMattingQueueItem = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const colors_1 = require("../../helpers/colors");
7
+ const url_state_1 = require("../../helpers/url-state");
8
+ const ellipsis_1 = require("../../icons/ellipsis");
9
+ const ActionTooltip_1 = require("../ActionTooltip");
10
+ const InlineAction_1 = require("../InlineAction");
11
+ const InlineDropdown_1 = require("../InlineDropdown");
12
+ const layout_1 = require("../layout");
13
+ const use_select_asset_1 = require("../use-select-asset");
14
+ const CircularProgress_1 = require("./CircularProgress");
15
+ const context_1 = require("./context");
16
+ const item_style_1 = require("./item-style");
17
+ const SuccessIcon_1 = require("./SuccessIcon");
18
+ const container = {
19
+ borderRadius: 4,
20
+ display: 'flex',
21
+ marginBottom: 1,
22
+ marginLeft: 4,
23
+ padding: 12,
24
+ paddingBottom: 10,
25
+ paddingRight: 4,
26
+ width: 'calc(100% - 4px)',
27
+ };
28
+ const title = { fontSize: 13, lineHeight: 1 };
29
+ const right = {
30
+ display: 'flex',
31
+ flex: 1,
32
+ flexDirection: 'column',
33
+ overflow: 'hidden',
34
+ };
35
+ const subtitle = {
36
+ ...item_style_1.renderQueueItemSubtitleStyle,
37
+ cursor: 'default',
38
+ };
39
+ const subtitles = {
40
+ display: 'flex',
41
+ flexDirection: 'column',
42
+ overflow: 'hidden',
43
+ };
44
+ const statusIcon = {
45
+ height: CircularProgress_1.RENDER_STATUS_INDICATOR_SIZE,
46
+ width: CircularProgress_1.RENDER_STATUS_INDICATOR_SIZE,
47
+ };
48
+ const removeIcon = { color: colors_1.CURRENT_COLOR, height: 16 };
49
+ const ellipsisIconStyle = {
50
+ style: { height: 12 },
51
+ };
52
+ const Status = ({ job }) => {
53
+ if (job.status === 'running') {
54
+ return (jsx_runtime_1.jsx("div", { style: statusIcon, role: "progressbar", "aria-label": "Video matting progress", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": Math.round(job.progress.value * 100), "aria-valuetext": job.progress.message, children: jsx_runtime_1.jsx(CircularProgress_1.CircularProgress, { progress: Math.max(0.07, job.progress.value) }) }));
55
+ }
56
+ if (job.status === 'done')
57
+ return jsx_runtime_1.jsx(SuccessIcon_1.SuccessIcon, {});
58
+ if (job.status === 'failed')
59
+ return (jsx_runtime_1.jsx("svg", { style: statusIcon, viewBox: "0 0 512 512", children: jsx_runtime_1.jsx("path", { fill: colors_1.FAIL_COLOR, d: "M0 160V352L160 512H352L512 352V160L352 0H160L0 160zm353.9 32-64 64 64 64L320 353.9l-64-64-64 64L158.1 320l64-64-64-64L192 158.1l64 64 64-64z" }) }));
60
+ return (jsx_runtime_1.jsx("svg", { style: statusIcon, viewBox: "0 0 512 512", children: jsx_runtime_1.jsx("path", { fill: colors_1.LIGHT_TEXT, d: "M256 512C114.6 512 0 397.4 0 256S114.6 0 256 0s256 114.6 256 256-114.6 256-256 256zM232 120v136c0 8 4 15.5 10.7 20l96 64 26.6-39.9-85.3-56.9V120z" }) }));
61
+ };
62
+ const VideoMattingQueueItem = ({ job, selected }) => {
63
+ const [hovered, setHovered] = (0, react_1.useState)(false);
64
+ const { removeVideoMattingJob } = (0, react_1.useContext)(context_1.RenderQueueContext);
65
+ const selectAsset = (0, use_select_asset_1.useSelectAsset)();
66
+ const done = job.status === 'done';
67
+ const style = (0, react_1.useMemo)(() => ({
68
+ ...container,
69
+ backgroundColor: (0, colors_1.getBackgroundFromHoverState)({
70
+ hovered: done && hovered,
71
+ selected,
72
+ }),
73
+ userSelect: 'none',
74
+ }), [done, hovered, selected]);
75
+ const messages = job.status === 'idle'
76
+ ? ['Queued for video matting']
77
+ : job.status === 'running'
78
+ ? [job.progress.message, job.progress.detail].filter((message) => message !== null)
79
+ : job.status === 'failed'
80
+ ? [job.error.message]
81
+ : [job.baseOutName, job.foregroundOutName];
82
+ const tooltip = messages.join('\n');
83
+ const revealAsset = (0, react_1.useCallback)((assetName) => {
84
+ selectAsset(assetName);
85
+ (0, url_state_1.pushUrl)(`/assets/${assetName}`);
86
+ }, [selectAsset]);
87
+ const onClick = (0, react_1.useCallback)(() => {
88
+ if (!done)
89
+ return;
90
+ revealAsset(job.foregroundOutName);
91
+ }, [done, job.foregroundOutName, revealAsset]);
92
+ const revealItems = (0, react_1.useMemo)(() => {
93
+ return [
94
+ {
95
+ disabled: false,
96
+ id: 'reveal-foreground',
97
+ keyHint: null,
98
+ label: 'Reveal foreground',
99
+ leftItem: null,
100
+ onClick: () => revealAsset(job.foregroundOutName),
101
+ quickSwitcherLabel: null,
102
+ subMenu: null,
103
+ type: 'item',
104
+ value: 'reveal-foreground',
105
+ },
106
+ {
107
+ disabled: false,
108
+ id: 'reveal-background',
109
+ keyHint: null,
110
+ label: 'Reveal background',
111
+ leftItem: null,
112
+ onClick: () => revealAsset(job.baseOutName),
113
+ quickSwitcherLabel: null,
114
+ subMenu: null,
115
+ type: 'item',
116
+ value: 'reveal-background',
117
+ },
118
+ ];
119
+ }, [job.baseOutName, job.foregroundOutName, revealAsset]);
120
+ const onRemove = (0, react_1.useCallback)((event) => {
121
+ event.stopPropagation();
122
+ removeVideoMattingJob(job.id);
123
+ }, [job.id, removeVideoMattingJob]);
124
+ const renderRemove = (0, react_1.useCallback)((color) => (jsx_runtime_1.jsx("svg", { style: removeIcon, viewBox: "0 0 320 512", children: jsx_runtime_1.jsx("path", { fill: color, d: "M310.6 150.6 205.3 256l105.3 105.4-45.3 45.3L160 301.3 54.6 406.6 9.4 361.4 114.7 256 9.4 150.6l45.2-45.2L160 210.7l105.3-105.3z" }) })), []);
125
+ return (jsx_runtime_1.jsxs(layout_1.Row, { "data-render-queue-item": job.id, style: style, align: "center", onClick: onClick, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), children: [
126
+ jsx_runtime_1.jsx(Status, { job: job }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsxs("div", { style: right, children: [
127
+ jsx_runtime_1.jsx("div", { style: title, children: job.displayName }), jsx_runtime_1.jsx("div", { style: subtitles, title: tooltip, children: messages.map((message) => (jsx_runtime_1.jsx("span", { style: subtitle, children: message }, message))) })
128
+ ] }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), done ? (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "Reveal video layer", shortcut: null, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { renderAction: (color) => (jsx_runtime_1.jsx(ellipsis_1.EllipsisIcon, { fill: color, svgProps: ellipsisIconStyle })), "aria-label": "Reveal video layer", values: revealItems, variant: null }) })) : null, job.status === 'running' ? null : (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "Clear", shortcut: null, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { renderAction: renderRemove, onClick: onRemove, "aria-label": "Clear", variant: null }) }))] }));
129
+ };
130
+ exports.VideoMattingQueueItem = VideoMattingQueueItem;
@@ -0,0 +1 @@
1
+ export declare const VideoMattingQueueProcessor: React.FC;
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VideoMattingQueueProcessor = void 0;
4
+ const video_matting_1 = require("@remotion/video-matting");
5
+ const react_1 = require("react");
6
+ const write_static_file_1 = require("../../api/write-static-file");
7
+ const context_1 = require("./context");
8
+ const load_model_for_job_1 = require("./load-model-for-job");
9
+ const VideoMattingQueueProcessor = () => {
10
+ const { markVideoMattingJobDone, markVideoMattingJobFailed, setProcessVideoMattingJobCallback, updateVideoMattingJobProgress, } = (0, react_1.useContext)(context_1.RenderQueueContext);
11
+ const processJob = (0, react_1.useCallback)(async (job) => {
12
+ let outputs = null;
13
+ let processingError = null;
14
+ try {
15
+ updateVideoMattingJobProgress(job.id, {
16
+ detail: null,
17
+ message: 'Checking WebGPU support...',
18
+ value: 0,
19
+ });
20
+ const support = await (0, video_matting_1.canUseVideoMatting)({ model: job.model });
21
+ if (!support.supported) {
22
+ throw new Error(support.detailedReason);
23
+ }
24
+ await (0, load_model_for_job_1.loadModelForJob)({
25
+ model: job.model,
26
+ progressStart: 0,
27
+ progressSpan: 0.2,
28
+ isModelCached: (model) => (0, video_matting_1.isVideoMattingModelCached)({ model }),
29
+ loadModel: (model, onProgress) => (0, video_matting_1.loadVideoMattingModel)({
30
+ model,
31
+ onProgress: (progress) => onProgress(progress.progress),
32
+ }),
33
+ updateProgress: (progress) => updateVideoMattingJobProgress(job.id, {
34
+ ...progress,
35
+ detail: null,
36
+ }),
37
+ });
38
+ outputs = await (0, video_matting_1.separateVideoLayers)({
39
+ src: job.src,
40
+ model: job.model,
41
+ audio: job.audio,
42
+ videoBitrate: job.videoBitrate,
43
+ onProgress: (progress) => {
44
+ var _a;
45
+ updateVideoMattingJobProgress(job.id, {
46
+ detail: progress.stage === 'finalizing'
47
+ ? `Processed ${progress.processedFrames} ${progress.processedFrames === 1 ? 'frame' : 'frames'}`
48
+ : `Processed ${progress.processedFrames} ${progress.processedFrames === 1 ? 'frame' : 'frames'} · ${Math.round(progress.progress * 100)}%`,
49
+ message: progress.stage === 'finalizing'
50
+ ? 'Finalizing video layers...'
51
+ : 'Separating foreground...',
52
+ value: 0.2 + ((_a = progress.progress) !== null && _a !== void 0 ? _a : 1) * 0.65,
53
+ });
54
+ },
55
+ });
56
+ updateVideoMattingJobProgress(job.id, {
57
+ detail: null,
58
+ message: 'Saving video layers...',
59
+ value: 0.88,
60
+ });
61
+ const [base, foreground] = await Promise.all([
62
+ outputs.base.getBlob(),
63
+ outputs.foreground.getBlob(),
64
+ ]);
65
+ await Promise.all([
66
+ base
67
+ .arrayBuffer()
68
+ .then((contents) => (0, write_static_file_1.writeStaticFile)({ contents, filePath: job.baseOutName })),
69
+ foreground
70
+ .arrayBuffer()
71
+ .then((contents) => (0, write_static_file_1.writeStaticFile)({ contents, filePath: job.foregroundOutName })),
72
+ ]);
73
+ }
74
+ catch (error) {
75
+ processingError =
76
+ error instanceof Error ? error : new Error(String(error));
77
+ }
78
+ 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
+ await (0, video_matting_1.disposeVideoMattingModel)({ model: job.model });
84
+ }
85
+ catch (_a) {
86
+ // Cleanup errors must not hide successfully written outputs.
87
+ }
88
+ if (processingError) {
89
+ markVideoMattingJobFailed(job.id, processingError);
90
+ }
91
+ else {
92
+ markVideoMattingJobDone(job.id);
93
+ }
94
+ }, [
95
+ markVideoMattingJobDone,
96
+ markVideoMattingJobFailed,
97
+ updateVideoMattingJobProgress,
98
+ ]);
99
+ (0, react_1.useEffect)(() => {
100
+ setProcessVideoMattingJobCallback(processJob);
101
+ return () => setProcessVideoMattingJobCallback(null);
102
+ }, [processJob, setProcessVideoMattingJobCallback]);
103
+ return null;
104
+ };
105
+ exports.VideoMattingQueueProcessor = VideoMattingQueueProcessor;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const VideoMattingQueueProcessorLoader: React.FC;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.VideoMattingQueueProcessorLoader = void 0;
37
+ const jsx_runtime_1 = require("react/jsx-runtime");
38
+ const react_1 = __importStar(require("react"));
39
+ const OptionalPackageModal_1 = require("../OptionalPackageModal");
40
+ const video_matting_capability_1 = require("../VideoMatting/video-matting-capability");
41
+ const context_1 = require("./context");
42
+ const LazyProcessor = react_1.default.lazy(async () => {
43
+ const { VideoMattingQueueProcessor } = await Promise.resolve().then(() => __importStar(require('./VideoMattingQueueProcessor')));
44
+ return { default: VideoMattingQueueProcessor };
45
+ });
46
+ const VideoMattingQueueProcessorLoader = () => {
47
+ const installed = (0, OptionalPackageModal_1.useOptionalPackageInstalled)(video_matting_capability_1.VIDEO_MATTING_PACKAGE);
48
+ const { videoMattingJobs } = (0, react_1.useContext)(context_1.RenderQueueContext);
49
+ if (!installed || videoMattingJobs.length === 0) {
50
+ return null;
51
+ }
52
+ return (jsx_runtime_1.jsx(react_1.Suspense, { fallback: null, children: jsx_runtime_1.jsx(LazyProcessor, {}) }));
53
+ };
54
+ exports.VideoMattingQueueProcessorLoader = VideoMattingQueueProcessorLoader;
@@ -0,0 +1,47 @@
1
+ import type { WhisperWebGpuModel, WhisperWebGpuTask } from '@remotion/whisper-webgpu';
2
+ export type CaptionJobProgress = {
3
+ message: string;
4
+ value: number;
5
+ };
6
+ type CaptionJobStatus = {
7
+ status: 'idle';
8
+ } | {
9
+ status: 'running';
10
+ progress: CaptionJobProgress;
11
+ } | {
12
+ status: 'done';
13
+ captionCount: number;
14
+ } | {
15
+ status: 'failed';
16
+ error: {
17
+ message: string;
18
+ stack: string | undefined;
19
+ };
20
+ };
21
+ export type AddCaptionJobParams = {
22
+ src: string;
23
+ displayName: string;
24
+ audioStreamIndex: number | null;
25
+ requestInit: Omit<RequestInit, 'signal'> | null;
26
+ outName: string;
27
+ model: WhisperWebGpuModel;
28
+ language: string | null;
29
+ task: WhisperWebGpuTask;
30
+ chunkLengthInSeconds: number;
31
+ strideLengthInSeconds: number;
32
+ forceFullSequences: boolean;
33
+ doSample: boolean;
34
+ temperature: number;
35
+ topK: number;
36
+ repetitionPenalty: number;
37
+ noRepeatNgramSize: number;
38
+ };
39
+ export type CaptionJob = AddCaptionJobParams & {
40
+ id: string;
41
+ type: 'caption';
42
+ startedAt: number;
43
+ } & CaptionJobStatus;
44
+ export declare const isCaptionJob: (job: {
45
+ type: string;
46
+ }) => job is CaptionJob;
47
+ export {};
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isCaptionJob = void 0;
4
+ const isCaptionJob = (job) => {
5
+ return job.type === 'caption';
6
+ };
7
+ exports.isCaptionJob = isCaptionJob;
@@ -1,7 +1,9 @@
1
1
  import type { CompletedClientRender, RenderJob } from '@remotion/studio-shared';
2
2
  import React from 'react';
3
+ import type { AddCaptionJobParams, CaptionJob, CaptionJobProgress } from './caption-job-types';
3
4
  import { type AddClientStillJobParams, type AddClientVideoJobParams, type CompositionRef } from './client-render-queue';
4
5
  import type { ClientRenderJob, ClientRenderJobProgress, GetBlobCallback } from './client-side-render-types';
6
+ import type { AddVideoMattingJobParams, VideoMattingJob, VideoMattingJobProgress } from './video-matting-job-types';
5
7
  declare global {
6
8
  interface Window {
7
9
  remotion_initialRenderQueue: RenderJob[] | null;
@@ -14,6 +16,8 @@ type RenderQueueContextType = {
14
16
  jobs: AnyRenderJob[];
15
17
  serverJobs: RenderJob[];
16
18
  clientJobs: ClientRenderJob[];
19
+ captionJobs: CaptionJob[];
20
+ videoMattingJobs: VideoMattingJob[];
17
21
  addClientStillJob: (params: AddClientStillJobParams, compositionRef: CompositionRef) => string;
18
22
  addClientVideoJob: (params: AddClientVideoJobParams, compositionRef: CompositionRef) => string;
19
23
  updateClientJobProgress: (jobId: string, progress: ClientRenderJobProgress) => void;
@@ -24,6 +28,18 @@ type RenderQueueContextType = {
24
28
  removeClientJob: (jobId: string) => void;
25
29
  cancelClientJob: (jobId: string) => void;
26
30
  setProcessJobCallback: (callback: ((job: ClientRenderJob) => Promise<void>) | null) => void;
31
+ addCaptionJob: (params: AddCaptionJobParams) => string;
32
+ updateCaptionJobProgress: (jobId: string, progress: CaptionJobProgress) => void;
33
+ markCaptionJobDone: (jobId: string, captionCount: number) => void;
34
+ markCaptionJobFailed: (jobId: string, error: Error) => void;
35
+ removeCaptionJob: (jobId: string) => void;
36
+ setProcessCaptionJobCallback: (callback: ((job: CaptionJob) => Promise<void>) | null) => void;
37
+ addVideoMattingJob: (params: AddVideoMattingJobParams) => string;
38
+ updateVideoMattingJobProgress: (jobId: string, progress: VideoMattingJobProgress) => void;
39
+ markVideoMattingJobDone: (jobId: string) => void;
40
+ markVideoMattingJobFailed: (jobId: string, error: Error) => void;
41
+ removeVideoMattingJob: (jobId: string) => void;
42
+ setProcessVideoMattingJobCallback: (callback: ((job: VideoMattingJob) => Promise<void>) | null) => void;
27
43
  getAbortController: (jobId: string) => AbortController;
28
44
  getCompositionForJob: (jobId: string) => CompositionRef | undefined;
29
45
  };