@remotion/studio 4.0.527 → 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.
Files changed (258) hide show
  1. package/dist/components/AgentPrompt.js +1 -2
  2. package/dist/components/AudioWaveform.d.ts +1 -0
  3. package/dist/components/AudioWaveform.js +10 -14
  4. package/dist/components/CodeFrame.js +1 -1
  5. package/dist/components/ColorPicker/checker.d.ts +1 -1
  6. package/dist/components/CurrentAsset.js +3 -2
  7. package/dist/components/EditorRuler/Ruler.js +6 -3
  8. package/dist/components/EffectPickerModal.js +69 -43
  9. package/dist/components/ElementInstallConfirmation.js +3 -3
  10. package/dist/components/ElementLibrariesSettings.d.ts +2 -0
  11. package/dist/components/ElementLibrariesSettings.js +200 -0
  12. package/dist/components/InitialCompositionLoader.js +3 -1
  13. package/dist/components/InspectorOpenInEditor.js +13 -0
  14. package/dist/components/InspectorPanel/AlignmentControls.js +28 -9
  15. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +1 -1
  16. package/dist/components/InspectorPanel/EasingInspector.js +6 -2
  17. package/dist/components/InspectorPanel/ElementLibraryButton.js +1 -1
  18. package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +1 -1
  19. package/dist/components/InspectorPanel/KeyframeInspector.js +28 -24
  20. package/dist/components/InspectorPanel/MultiSequenceNumberField.js +1 -1
  21. package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -1
  22. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +30 -2
  23. package/dist/components/InspectorPanel/SequenceWrapAction.d.ts +8 -0
  24. package/dist/components/InspectorPanel/SequenceWrapAction.js +151 -0
  25. package/dist/components/InspectorPanel/easing-inspector-selection.d.ts +2 -1
  26. package/dist/components/InspectorPanel/easing-inspector-selection.js +4 -3
  27. package/dist/components/InspectorPanel/keyframe-inspector-frame.d.ts +2 -1
  28. package/dist/components/InspectorPanel/keyframe-inspector-frame.js +2 -2
  29. package/dist/components/InspectorSequenceSection.d.ts +1 -0
  30. package/dist/components/InspectorSequenceSection.js +7 -5
  31. package/dist/components/KeyboardShortcutsSettings.js +1 -1
  32. package/dist/components/Menu/styles.d.ts +2 -2
  33. package/dist/components/Modals.js +7 -6
  34. package/dist/components/ModelManager.js +10 -9
  35. package/dist/components/NewComposition/CancelButton.js +10 -4
  36. package/dist/components/NewComposition/InputDragger.d.ts +3 -1
  37. package/dist/components/NewComposition/InputDragger.js +28 -9
  38. package/dist/components/NewComposition/NewComposition.js +7 -6
  39. package/dist/components/NewComposition/RemInput.d.ts +1 -1
  40. package/dist/components/NewComposition/menu-typeahead.js +1 -1
  41. package/dist/components/Preview.js +3 -2
  42. package/dist/components/RenderModal/SchemaEditor/create-zod-values.js +1 -2
  43. package/dist/components/RenderModal/WebRenderModalPicture.js +1 -2
  44. package/dist/components/RenderQueue/CaptionQueueItem.js +14 -5
  45. package/dist/components/RenderQueue/CaptionQueueProcessor.js +30 -7
  46. package/dist/components/RenderQueue/QueueJobError.d.ts +8 -0
  47. package/dist/components/RenderQueue/QueueJobError.js +24 -0
  48. package/dist/components/RenderQueue/QueueJobErrorModal.d.ts +8 -0
  49. package/dist/components/RenderQueue/QueueJobErrorModal.js +63 -0
  50. package/dist/components/RenderQueue/RenderQueueItemCancelButton.d.ts +3 -1
  51. package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +11 -4
  52. package/dist/components/RenderQueue/RenderQueueRepeat.d.ts +3 -1
  53. package/dist/components/RenderQueue/RenderQueueRepeat.js +20 -3
  54. package/dist/components/RenderQueue/VideoMattingQueueItem.js +24 -27
  55. package/dist/components/RenderQueue/VideoMattingQueueProcessor.js +68 -28
  56. package/dist/components/RenderQueue/caption-job-types.d.ts +3 -1
  57. package/dist/components/RenderQueue/context.d.ts +4 -0
  58. package/dist/components/RenderQueue/context.js +58 -8
  59. package/dist/components/RenderQueue/index.js +2 -3
  60. package/dist/components/RenderQueue/load-model-for-job.d.ts +2 -1
  61. package/dist/components/RenderQueue/load-model-for-job.js +5 -1
  62. package/dist/components/RenderQueue/video-matting-job-types.d.ts +13 -6
  63. package/dist/components/SelectedOutlineCropControls.js +2 -1
  64. package/dist/components/SelectedOutlineEditingHandles.js +9 -2
  65. package/dist/components/SelectedOutlineElement.js +9 -3
  66. package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -4
  67. package/dist/components/SelectedOutlineKeyboardControls.js +4 -22
  68. package/dist/components/SelectedOutlineOverlay.js +152 -106
  69. package/dist/components/SelectedOutlinePathPoints.d.ts +8 -0
  70. package/dist/components/SelectedOutlinePathPoints.js +433 -0
  71. package/dist/components/SelectedOutlinePolygon.js +21 -46
  72. package/dist/components/SelectedOutlineRenderer.d.ts +3 -5
  73. package/dist/components/SelectedOutlineRenderer.js +32 -136
  74. package/dist/components/SelectedOutlineTransformOriginHandle.js +3 -2
  75. package/dist/components/SelectedOutlineUvControls.js +12 -7
  76. package/dist/components/SettingsModal.js +30 -3
  77. package/dist/components/SettingsModalFooter.d.ts +1 -0
  78. package/dist/components/SettingsModalFooter.js +7 -3
  79. package/dist/components/ShowOutlinesProvider.js +1 -1
  80. package/dist/components/SkillsSettings.d.ts +0 -1
  81. package/dist/components/SkillsSettings.js +13 -14
  82. package/dist/components/Splitter/SplitterElement.js +1 -2
  83. package/dist/components/TimeValue.js +1 -1
  84. package/dist/components/Timeline/LoopedTimelineIndicators.d.ts +1 -0
  85. package/dist/components/Timeline/LoopedTimelineIndicators.js +7 -6
  86. package/dist/components/Timeline/TimelineArrayField.js +1 -1
  87. package/dist/components/Timeline/TimelineClipboardKeybindings.js +0 -1
  88. package/dist/components/Timeline/TimelineColorField.js +1 -1
  89. package/dist/components/Timeline/TimelineDragHandler.js +1 -1
  90. package/dist/components/Timeline/TimelineEffectPropItem.d.ts +1 -0
  91. package/dist/components/Timeline/TimelineEffectPropItem.js +12 -5
  92. package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -0
  93. package/dist/components/Timeline/TimelineExpandedRow.js +5 -4
  94. package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -0
  95. package/dist/components/Timeline/TimelineExpandedSection.js +2 -2
  96. package/dist/components/Timeline/TimelineExpandedTrackKeyframes.d.ts +1 -0
  97. package/dist/components/Timeline/TimelineExpandedTrackKeyframes.js +3 -1
  98. package/dist/components/Timeline/TimelineFontFamilyField.js +12 -12
  99. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -0
  100. package/dist/components/Timeline/TimelineKeyframeControls.js +39 -28
  101. package/dist/components/Timeline/TimelineLayerChildren.js +1 -1
  102. package/dist/components/Timeline/TimelineList.js +1 -1
  103. package/dist/components/Timeline/TimelineNumberField.js +2 -4
  104. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
  105. package/dist/components/Timeline/TimelineSelection.d.ts +9 -9
  106. package/dist/components/Timeline/TimelineSelection.js +16 -9
  107. package/dist/components/Timeline/TimelineSequence.d.ts +3 -1
  108. package/dist/components/Timeline/TimelineSequence.js +39 -21
  109. package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
  110. package/dist/components/Timeline/TimelineSequenceItem.js +18 -8
  111. package/dist/components/Timeline/TimelineSequencePropItem.d.ts +3 -0
  112. package/dist/components/Timeline/TimelineSequencePropItem.js +262 -25
  113. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +11 -13
  114. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +98 -77
  115. package/dist/components/Timeline/TimelineTextContentField.js +27 -4
  116. package/dist/components/Timeline/TimelineTimeIndicators.js +10 -5
  117. package/dist/components/Timeline/TimelineTrack.js +1 -1
  118. package/dist/components/Timeline/TimelineTrimTooltip.d.ts +11 -0
  119. package/dist/components/Timeline/TimelineTrimTooltip.js +41 -0
  120. package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -0
  121. package/dist/components/Timeline/TimelineVideoInfo.js +13 -10
  122. package/dist/components/Timeline/delete-selected-keyframe.js +22 -8
  123. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +1 -5
  124. package/dist/components/Timeline/delete-selected-timeline-item.js +7 -93
  125. package/dist/components/Timeline/get-animation-item-selection-for-frame.d.ts +2 -1
  126. package/dist/components/Timeline/get-animation-item-selection-for-frame.js +7 -5
  127. package/dist/components/Timeline/get-keyframed-sequence-drag-targets.d.ts +23 -0
  128. package/dist/components/Timeline/get-keyframed-sequence-drag-targets.js +57 -0
  129. package/dist/components/Timeline/get-node-keyframes.d.ts +2 -1
  130. package/dist/components/Timeline/get-node-keyframes.js +6 -4
  131. package/dist/components/Timeline/get-playback-rate-keyframe-changes.d.ts +21 -0
  132. package/dist/components/Timeline/get-playback-rate-keyframe-changes.js +142 -0
  133. package/dist/components/Timeline/get-timeline-keyframes.d.ts +15 -2
  134. package/dist/components/Timeline/get-timeline-keyframes.js +44 -6
  135. package/dist/components/Timeline/keyframe-clipboard.js +17 -3
  136. package/dist/components/Timeline/split-selected-timeline-item.js +4 -1
  137. package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
  138. package/dist/components/Timeline/timeline-field-row-layout.js +1 -0
  139. package/dist/components/Timeline/use-delete-timeline-items.js +17 -11
  140. package/dist/components/Timeline/use-expanded-track-keyframe-rows.d.ts +2 -1
  141. package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +3 -1
  142. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +7 -3
  143. package/dist/components/Timeline/use-timeline-keyframe-drag.js +28 -19
  144. package/dist/components/Transcription/Models.js +1 -1
  145. package/dist/components/Transcription/TranscriptionModal.js +3 -1
  146. package/dist/components/Transcription/resample-media-to-16-khz.d.ts +2 -1
  147. package/dist/components/Transcription/resample-media-to-16-khz.js +20 -2
  148. package/dist/components/UpdatesSettings.js +2 -0
  149. package/dist/components/VideoMatting/Models.js +1 -1
  150. package/dist/components/VideoMatting/VideoMattingModal.js +30 -47
  151. package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.js +1 -1
  152. package/dist/components/WebMcp.js +22 -40
  153. package/dist/components/composition-drop-preview.js +1 -0
  154. package/dist/components/effect-drag-and-drop.d.ts +13 -5
  155. package/dist/components/effect-drag-and-drop.js +19 -4
  156. package/dist/components/get-open-in-menu-items.d.ts +2 -1
  157. package/dist/components/get-open-in-menu-items.js +17 -1
  158. package/dist/components/selected-outline-drag.d.ts +1 -6
  159. package/dist/components/selected-outline-drag.js +22 -6
  160. package/dist/components/selected-outline-geometry.d.ts +2 -18
  161. package/dist/components/selected-outline-measurement.d.ts +23 -41
  162. package/dist/components/selected-outline-measurement.js +14 -252
  163. package/dist/components/selected-outline-order.d.ts +4 -11
  164. package/dist/components/selected-outline-order.js +2 -254
  165. package/dist/components/selected-outline-snap.d.ts +1 -1
  166. package/dist/components/selected-outline-snap.js +2 -1
  167. package/dist/components/selected-outline-types.d.ts +18 -28
  168. package/dist/components/selected-outline-uv.d.ts +4 -4
  169. package/dist/components/selected-outline-uv.js +6 -111
  170. package/dist/components/sequence-props-api.js +0 -10
  171. package/dist/components/use-selected-outline-control-target.js +12 -21
  172. package/dist/components/wrap-jsx-node-api.d.ts +2 -0
  173. package/dist/components/wrap-jsx-node-api.js +13 -0
  174. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +45 -2
  175. package/dist/error-overlay/remotion-overlay/StackFrame.js +32 -3
  176. package/dist/esm/{CaptionQueueProcessor-npa6szn1.mjs → CaptionQueueProcessor-nr7hjcga.mjs} +63 -17
  177. package/dist/esm/LazyModels-ajkn7fs3.mjs +12 -0
  178. package/dist/esm/LazyModels-g1g7cf4e.mjs +12 -0
  179. package/dist/esm/{TranscriptionModal-79m5wgcj.mjs → TranscriptionModal-e18bzbkb.mjs} +15 -15
  180. package/dist/esm/{VideoMattingModal-31pew0xj.mjs → VideoMattingModal-5bz2s4rs.mjs} +47 -65
  181. package/dist/esm/{VideoMattingQueueProcessor-t1hgm2rm.mjs → VideoMattingQueueProcessor-4tkj0f4k.mjs} +69 -26
  182. package/dist/esm/{index-v4tr1bft.mjs → index-09txs1bj.mjs} +5 -0
  183. package/dist/esm/{index-n5gmcvhz.mjs → index-5ycb9e9q.mjs} +2 -4
  184. package/dist/esm/{index-5t2dwxsk.mjs → index-890dd9b3.mjs} +259 -21
  185. package/dist/esm/{index-ac5550e7.mjs → index-8nt6a0mw.mjs} +3 -3
  186. package/dist/esm/{index-614tdz2q.mjs → index-9q9w8v9p.mjs} +3 -3
  187. package/dist/esm/{index-s7qa3xbw.mjs → index-c2wabcdt.mjs} +6 -6
  188. package/dist/esm/{index-r1gr3j3a.mjs → index-dfy1t576.mjs} +50 -1
  189. package/dist/esm/{index-21hxsfaa.mjs → index-dh3zk2hv.mjs} +6 -25
  190. package/dist/esm/{index-4zen9prq.mjs → index-dpyss74p.mjs} +6563 -5485
  191. package/dist/esm/{index-9x6e1dq0.mjs → index-hqxc6tzp.mjs} +40 -6
  192. package/dist/esm/{index-9xxg6218.mjs → index-qve7mdfp.mjs} +19 -1
  193. package/dist/esm/{index-e855w59j.mjs → index-s6qya2gg.mjs} +3 -5
  194. package/dist/esm/index-t7tbt980.mjs +103 -0
  195. package/dist/esm/{index-r0ejh5sy.mjs → index-t7xnxdf8.mjs} +44 -26
  196. package/dist/esm/index-wqc43mw0.mjs +158 -0
  197. package/dist/esm/{index-ppspzgn9.mjs → index-x6r9bn12.mjs} +4026 -4761
  198. package/dist/esm/{index-vxwg66ar.mjs → index-xac20sv4.mjs} +44 -57
  199. package/dist/esm/index.mjs +4 -5
  200. package/dist/esm/internals.mjs +13 -13
  201. package/dist/esm/previewEntry.mjs +18 -15
  202. package/dist/esm/renderEntry.mjs +5 -1
  203. package/dist/helpers/calculate-timeline.d.ts +5 -1
  204. package/dist/helpers/calculate-timeline.js +1 -1
  205. package/dist/helpers/checkerboard-background.d.ts +2 -2
  206. package/dist/helpers/colors.d.ts +132 -112
  207. package/dist/helpers/colors.js +117 -95
  208. package/dist/helpers/create-folder-tree.js +2 -1
  209. package/dist/helpers/editor-guide-selection.d.ts +1 -1
  210. package/dist/helpers/editor-ruler.js +23 -12
  211. package/dist/helpers/get-connected-compositions.d.ts +6 -1
  212. package/dist/helpers/get-connected-compositions.js +1 -1
  213. package/dist/helpers/get-sequence-double-click-action.js +1 -1
  214. package/dist/helpers/get-sequence-visible-range.d.ts +1 -1
  215. package/dist/helpers/get-sequence-visible-range.js +2 -5
  216. package/dist/helpers/get-timeline-nestedness.d.ts +1 -1
  217. package/dist/helpers/get-timeline-nestedness.js +1 -1
  218. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +1 -1
  219. package/dist/helpers/get-timeline-sequence-sort-key.js +1 -1
  220. package/dist/helpers/hoverable.js +4 -4
  221. package/dist/helpers/inject-css.js +5 -7
  222. package/dist/helpers/prism-vsc-dark-plus.d.ts +1 -1
  223. package/dist/helpers/prism-vsc-dark-plus.js +52 -51
  224. package/dist/helpers/resolve-studio-color.d.ts +1 -0
  225. package/dist/helpers/resolve-studio-color.js +11 -0
  226. package/dist/helpers/studio-css-variables.d.ts +1 -0
  227. package/dist/helpers/studio-css-variables.js +105 -0
  228. package/dist/helpers/studio-pixel-ratio.d.ts +1 -0
  229. package/dist/helpers/studio-pixel-ratio.js +7 -0
  230. package/dist/helpers/timeline-node-path-key.d.ts +1 -1
  231. package/dist/helpers/timeline-node-path-key.js +2 -2
  232. package/dist/helpers/use-runtime-values.js +2 -28
  233. package/dist/hot-middleware-client/client.js +5 -3
  234. package/dist/icons/align-center-horizontal.js +2 -1
  235. package/dist/icons/align-left.js +2 -1
  236. package/dist/icons/align-right.js +2 -1
  237. package/dist/icons/{separation.d.ts → background-removal.d.ts} +1 -1
  238. package/dist/icons/background-removal.js +9 -0
  239. package/dist/icons/wrap.d.ts +4 -0
  240. package/dist/icons/wrap.js +10 -0
  241. package/dist/previewEntry.js +2 -0
  242. package/dist/renderEntry.js +2 -0
  243. package/dist/state/modals.d.ts +15 -1
  244. package/dist/state/timeline-sequence-hover.d.ts +6 -16
  245. package/dist/state/timeline-sequence-hover.js +6 -67
  246. package/package.json +20 -19
  247. package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.d.ts +0 -15
  248. package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.js +0 -31
  249. package/dist/esm/LazyModels-nh3c8h9p.mjs +0 -12
  250. package/dist/esm/LazyModels-rr5v8h5y.mjs +0 -12
  251. package/dist/esm/index-cw0pnpg5.mjs +0 -50
  252. package/dist/esm/index-k426ye99.mjs +0 -139
  253. package/dist/helpers/get-box-quads-polyfill-internals.d.ts +0 -82
  254. package/dist/helpers/get-box-quads-polyfill-internals.js +0 -2403
  255. package/dist/helpers/get-box-quads-ponyfill.d.ts +0 -10
  256. package/dist/helpers/get-box-quads-ponyfill.js +0 -23
  257. package/dist/icons/separation.js +0 -7
  258. /package/dist/esm/{resolve-composition-component-location-qrp05g62.mjs → resolve-composition-component-location-2hgf6g0a.mjs} +0 -0
@@ -1,22 +1,20 @@
1
1
  import {
2
2
  loadModelForJob
3
- } from "./index-v4tr1bft.mjs";
3
+ } from "./index-09txs1bj.mjs";
4
4
  import {
5
5
  installRequiredPackages
6
- } from "./index-21hxsfaa.mjs";
6
+ } from "./index-dh3zk2hv.mjs";
7
7
  import {
8
8
  RenderQueueContext
9
- } from "./index-9x6e1dq0.mjs";
10
- import {
11
- callApi
12
- } from "./index-r1gr3j3a.mjs";
9
+ } from "./index-hqxc6tzp.mjs";
13
10
  import {
11
+ callApi,
14
12
  getBrowserStudioOperations,
15
13
  writeStaticFile
16
- } from "./index-cw0pnpg5.mjs";
17
- import"./index-9xxg6218.mjs";
14
+ } from "./index-dfy1t576.mjs";
15
+ import"./index-qve7mdfp.mjs";
18
16
  import"./index-5zrb1ft4.mjs";
19
- import"./index-k426ye99.mjs";
17
+ import"./index-wqc43mw0.mjs";
20
18
  import"./index-rcv7qkt5.mjs";
21
19
 
22
20
  // src/components/RenderQueue/CaptionQueueProcessor.tsx
@@ -24,6 +22,7 @@ import {
24
22
  canUseWhisperWebGpu,
25
23
  clearStaleModels,
26
24
  disposeWhisperModel,
25
+ downloadWhisperModel,
27
26
  isWhisperModelCached,
28
27
  loadWhisperModel,
29
28
  toCaptions,
@@ -46,13 +45,24 @@ var resampleMediaTo16Khz = async ({
46
45
  src,
47
46
  audioStreamIndex,
48
47
  requestInit,
49
- onProgress
48
+ onProgress,
49
+ signal
50
50
  }) => {
51
+ signal.throwIfAborted();
51
52
  const input = new Input({
52
53
  formats: ALL_FORMATS,
53
54
  source: new UrlSource(src, requestInit === null ? {} : { requestInit })
54
55
  });
55
56
  const waveformChunks = [];
57
+ let conversion = null;
58
+ let cancellation = null;
59
+ const onAbort = () => {
60
+ cancellation = conversion?.cancel().catch(() => {
61
+ return;
62
+ }) ?? null;
63
+ input.dispose();
64
+ };
65
+ signal.addEventListener("abort", onAbort, { once: true });
56
66
  try {
57
67
  onProgress(0);
58
68
  const audioTracks = await input.getAudioTracks();
@@ -68,7 +78,8 @@ var resampleMediaTo16Khz = async ({
68
78
  format: new WavOutputFormat,
69
79
  target: new NullTarget
70
80
  });
71
- const conversion = await Conversion.init({
81
+ signal.throwIfAborted();
82
+ conversion = await Conversion.init({
72
83
  input,
73
84
  output,
74
85
  tracks: "all",
@@ -82,6 +93,7 @@ var resampleMediaTo16Khz = async ({
82
93
  forceTranscode: true,
83
94
  numberOfChannels: 1,
84
95
  process: (sample) => {
96
+ signal.throwIfAborted();
85
97
  const floats = new Float32Array(sample.allocationSize({ format: "f32", planeIndex: 0 }) / Float32Array.BYTES_PER_ELEMENT);
86
98
  sample.copyTo(floats, { format: "f32", planeIndex: 0 });
87
99
  waveformChunks.push({
@@ -95,13 +107,22 @@ var resampleMediaTo16Khz = async ({
95
107
  };
96
108
  }
97
109
  });
110
+ signal.throwIfAborted();
98
111
  if (!conversion.isValid) {
99
112
  throw new Error("The audio track cannot be decoded in this browser. Try converting the media to WAV first.");
100
113
  }
101
114
  conversion.onProgress = (progress) => onProgress(progress);
102
115
  await conversion.execute();
116
+ signal.throwIfAborted();
103
117
  onProgress(1);
104
118
  } finally {
119
+ signal.removeEventListener("abort", onAbort);
120
+ await cancellation;
121
+ if (signal.aborted && conversion && cancellation === null) {
122
+ await conversion.cancel().catch(() => {
123
+ return;
124
+ });
125
+ }
105
126
  input.dispose();
106
127
  }
107
128
  const waveformLength = waveformChunks.reduce((maximum, chunk) => Math.max(maximum, chunk.startFrame + chunk.waveform.length), 0);
@@ -123,17 +144,23 @@ var CaptionQueueProcessor = () => {
123
144
  updateCaptionJobProgress,
124
145
  markCaptionJobDone,
125
146
  markCaptionJobFailed,
147
+ markCaptionJobCancelled,
148
+ markCaptionJobSaving,
149
+ getAbortController,
126
150
  setProcessCaptionJobCallback
127
151
  } = useContext(RenderQueueContext);
128
152
  const processJob = useCallback(async (job) => {
153
+ const { signal } = getAbortController(job.id);
129
154
  let captionCount = null;
130
155
  let processingError = null;
131
156
  try {
157
+ signal.throwIfAborted();
132
158
  updateCaptionJobProgress(job.id, {
133
159
  message: "Checking WebGPU support...",
134
160
  value: 0
135
161
  });
136
162
  const support = await canUseWhisperWebGpu();
163
+ signal.throwIfAborted();
137
164
  if (!support.supported) {
138
165
  throw new Error(support.detailedReason);
139
166
  }
@@ -142,15 +169,21 @@ var CaptionQueueProcessor = () => {
142
169
  value: 0.02
143
170
  });
144
171
  await clearStaleModels();
172
+ signal.throwIfAborted();
145
173
  await loadModelForJob({
174
+ signal,
146
175
  model: job.model,
147
176
  progressStart: 0.03,
148
177
  progressSpan: 0.27,
149
178
  isModelCached: (model) => isWhisperModelCached({ model }),
150
- loadModel: (model, onProgress) => loadWhisperModel({
151
- model,
152
- onProgress: (progress) => onProgress(progress.progress)
153
- }),
179
+ loadModel: async (model, onProgress) => {
180
+ await downloadWhisperModel({
181
+ signal,
182
+ model,
183
+ onProgress: (progress) => onProgress(progress.progress)
184
+ });
185
+ await loadWhisperModel({ model, signal });
186
+ },
154
187
  updateProgress: (progress) => updateCaptionJobProgress(job.id, progress)
155
188
  });
156
189
  updateCaptionJobProgress(job.id, {
@@ -158,6 +191,7 @@ var CaptionQueueProcessor = () => {
158
191
  value: 0.3
159
192
  });
160
193
  const channelWaveform = await resampleMediaTo16Khz({
194
+ signal,
161
195
  src: job.src,
162
196
  audioStreamIndex: job.audioStreamIndex,
163
197
  requestInit: job.requestInit,
@@ -173,6 +207,7 @@ var CaptionQueueProcessor = () => {
173
207
  value: 0.5
174
208
  });
175
209
  const transcription = await transcribe({
210
+ signal,
176
211
  channelWaveform,
177
212
  model: job.model,
178
213
  task: job.task,
@@ -189,6 +224,8 @@ var CaptionQueueProcessor = () => {
189
224
  const { captions } = toCaptions({
190
225
  whisperWebGpuOutput: transcription
191
226
  });
227
+ signal.throwIfAborted();
228
+ markCaptionJobSaving(job.id);
192
229
  if (job.target === null) {
193
230
  updateCaptionJobProgress(job.id, {
194
231
  message: `Saving ${job.outName}...`,
@@ -225,12 +262,21 @@ var CaptionQueueProcessor = () => {
225
262
  try {
226
263
  await disposeWhisperModel({ model: job.model });
227
264
  } catch {}
228
- if (processingError) {
265
+ if (signal.aborted) {
266
+ markCaptionJobCancelled(job.id);
267
+ } else if (processingError) {
229
268
  markCaptionJobFailed(job.id, processingError);
230
269
  } else {
231
270
  markCaptionJobDone(job.id, captionCount ?? 0);
232
271
  }
233
- }, [markCaptionJobDone, markCaptionJobFailed, updateCaptionJobProgress]);
272
+ }, [
273
+ getAbortController,
274
+ markCaptionJobCancelled,
275
+ markCaptionJobDone,
276
+ markCaptionJobFailed,
277
+ markCaptionJobSaving,
278
+ updateCaptionJobProgress
279
+ ]);
234
280
  useEffect(() => {
235
281
  setProcessCaptionJobCallback(processJob);
236
282
  return () => setProcessCaptionJobCallback(null);
@@ -0,0 +1,12 @@
1
+ import {
2
+ Models
3
+ } from "./index-9q9w8v9p.mjs";
4
+ import"./index-t7xnxdf8.mjs";
5
+ import"./index-890dd9b3.mjs";
6
+ import"./index-qve7mdfp.mjs";
7
+ import"./index-5zrb1ft4.mjs";
8
+ import"./index-wqc43mw0.mjs";
9
+ import"./index-rcv7qkt5.mjs";
10
+ export {
11
+ Models as default
12
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ Models
3
+ } from "./index-8nt6a0mw.mjs";
4
+ import"./index-t7xnxdf8.mjs";
5
+ import"./index-890dd9b3.mjs";
6
+ import"./index-qve7mdfp.mjs";
7
+ import"./index-5zrb1ft4.mjs";
8
+ import"./index-wqc43mw0.mjs";
9
+ import"./index-rcv7qkt5.mjs";
10
+ export {
11
+ Models as default
12
+ };
@@ -2,11 +2,10 @@ import {
2
2
  useModelCacheStatus
3
3
  } from "./index-7tt71e8n.mjs";
4
4
  import {
5
- GearIcon,
6
5
  NumberSetting,
7
6
  getDefaultCaptionOutputName,
8
7
  validateCaptionOutputName
9
- } from "./index-vxwg66ar.mjs";
8
+ } from "./index-xac20sv4.mjs";
10
9
  import {
11
10
  Button,
12
11
  Checkbox,
@@ -14,9 +13,9 @@ import {
14
13
  Combobox,
15
14
  DismissableModal,
16
15
  ExpandedFolderIconSolid,
16
+ GearIcon,
17
17
  InfoBubble,
18
18
  ModalHeader,
19
- ModelsIcon,
20
19
  RemotionInput,
21
20
  RenderModalHr,
22
21
  SetSelectedModalContext,
@@ -31,26 +30,27 @@ import {
31
30
  persistSelectedOptionsSidebarPanel,
32
31
  rightRow,
33
32
  useStaticFiles
34
- } from "./index-ppspzgn9.mjs";
33
+ } from "./index-x6r9bn12.mjs";
35
34
  import {
36
35
  showNotification
37
- } from "./index-21hxsfaa.mjs";
36
+ } from "./index-dh3zk2hv.mjs";
38
37
  import {
39
38
  RenderQueueContext
40
- } from "./index-9x6e1dq0.mjs";
39
+ } from "./index-hqxc6tzp.mjs";
41
40
  import {
42
41
  openInFileExplorer
43
- } from "./index-e855w59j.mjs";
44
- import"./index-r1gr3j3a.mjs";
42
+ } from "./index-s6qya2gg.mjs";
45
43
  import {
46
44
  getBrowserStudioOperations
47
- } from "./index-cw0pnpg5.mjs";
45
+ } from "./index-dfy1t576.mjs";
46
+ import"./index-t7tbt980.mjs";
48
47
  import {
49
48
  Models
50
- } from "./index-614tdz2q.mjs";
51
- import"./index-r0ejh5sy.mjs";
49
+ } from "./index-9q9w8v9p.mjs";
50
+ import"./index-t7xnxdf8.mjs";
52
51
  import {
53
52
  InlineAction,
53
+ ModelsIcon,
54
54
  Spacing,
55
55
  VERTICAL_SCROLLBAR_CLASSNAME,
56
56
  ValidationMessage,
@@ -64,14 +64,14 @@ import {
64
64
  leftSidebar,
65
65
  optionsPanel,
66
66
  outerModalStyle
67
- } from "./index-5t2dwxsk.mjs";
68
- import"./index-9xxg6218.mjs";
67
+ } from "./index-890dd9b3.mjs";
68
+ import"./index-qve7mdfp.mjs";
69
69
  import"./index-5zrb1ft4.mjs";
70
70
  import {
71
71
  BLUE_DISABLED,
72
72
  LIGHT_TEXT,
73
73
  WHITE
74
- } from "./index-k426ye99.mjs";
74
+ } from "./index-wqc43mw0.mjs";
75
75
  import"./index-rcv7qkt5.mjs";
76
76
 
77
77
  // src/components/Transcription/TranscriptionModal.tsx
@@ -816,7 +816,7 @@ var TranscriptionModal = ({
816
816
  };
817
817
  }, []);
818
818
  const normalizedOutName = outName.normalize("NFC").toLowerCase();
819
- const queuedOutputExists = captionJobs.some((job) => job.target === null && (job.status === "idle" || job.status === "running") && job.outName.normalize("NFC").toLowerCase() === normalizedOutName);
819
+ const queuedOutputExists = captionJobs.some((job) => job.target === null && (job.status === "idle" || job.status === "running" || job.status === "saving") && job.outName.normalize("NFC").toLowerCase() === normalizedOutName);
820
820
  const outputValidationMessage = target === null ? validateCaptionOutputName(outName) ?? (queuedOutputExists ? "Another caption job is already using this output file" : null) : null;
821
821
  const exists = staticFiles.some((file) => file.name.normalize("NFC").toLowerCase() === normalizedOutName);
822
822
  const chunkValidationMessage = strideLengthInSeconds * 2 >= chunkLengthInSeconds ? "Stride length must be less than half of chunk length" : null;
@@ -3,16 +3,15 @@ import {
3
3
  } from "./index-7tt71e8n.mjs";
4
4
  import {
5
5
  RenderModalOutputName
6
- } from "./index-s7qa3xbw.mjs";
6
+ } from "./index-c2wabcdt.mjs";
7
7
  import {
8
8
  Button,
9
9
  Checkmark,
10
10
  Combobox,
11
11
  DismissableModal,
12
+ GearIcon,
12
13
  ModalHeader,
13
- ModelsIcon,
14
14
  RenderModalHr,
15
- SeparationIcon,
16
15
  SetSelectedModalContext,
17
16
  SidebarContext,
18
17
  VerticalTab,
@@ -25,19 +24,20 @@ import {
25
24
  rightRow,
26
25
  useStaticFiles,
27
26
  validatePublicOutputName
28
- } from "./index-ppspzgn9.mjs";
29
- import"./index-21hxsfaa.mjs";
27
+ } from "./index-x6r9bn12.mjs";
28
+ import"./index-dh3zk2hv.mjs";
30
29
  import {
31
30
  RenderQueueContext
32
- } from "./index-9x6e1dq0.mjs";
33
- import"./index-e855w59j.mjs";
34
- import"./index-r1gr3j3a.mjs";
35
- import"./index-cw0pnpg5.mjs";
31
+ } from "./index-hqxc6tzp.mjs";
32
+ import"./index-s6qya2gg.mjs";
33
+ import"./index-dfy1t576.mjs";
34
+ import"./index-t7tbt980.mjs";
36
35
  import {
37
36
  Models
38
- } from "./index-ac5550e7.mjs";
39
- import"./index-r0ejh5sy.mjs";
37
+ } from "./index-8nt6a0mw.mjs";
38
+ import"./index-t7xnxdf8.mjs";
40
39
  import {
40
+ ModelsIcon,
41
41
  VERTICAL_SCROLLBAR_CLASSNAME,
42
42
  ValidationMessage,
43
43
  buttonStyle,
@@ -50,12 +50,12 @@ import {
50
50
  leftSidebar,
51
51
  optionsPanel,
52
52
  outerModalStyle
53
- } from "./index-5t2dwxsk.mjs";
54
- import"./index-9xxg6218.mjs";
53
+ } from "./index-890dd9b3.mjs";
54
+ import"./index-qve7mdfp.mjs";
55
55
  import"./index-5zrb1ft4.mjs";
56
56
  import {
57
57
  BLUE_DISABLED
58
- } from "./index-k426ye99.mjs";
58
+ } from "./index-wqc43mw0.mjs";
59
59
  import"./index-rcv7qkt5.mjs";
60
60
 
61
61
  // src/components/VideoMatting/VideoMattingModal.tsx
@@ -111,9 +111,10 @@ var makeOptions = ({
111
111
  }));
112
112
  var VideoMattingModal = ({
113
113
  displayName,
114
- src
114
+ src,
115
+ target
115
116
  }) => {
116
- const [tab, setTab] = useState("separate");
117
+ const [tab, setTab] = useState("remove");
117
118
  const isModelCached = useCallback((selectedModel) => isVideoMattingModelCached({ model: selectedModel }), []);
118
119
  const cachedModels = useModelCacheStatus({
119
120
  isModelCached,
@@ -121,10 +122,9 @@ var VideoMattingModal = ({
121
122
  refreshKey: tab
122
123
  });
123
124
  const baseName = useMemo(() => getDefaultOutputBaseName(src, displayName, "video"), [displayName, src]);
124
- const [baseOutName, setBaseOutName] = useState(`${baseName}-base.webm`);
125
- const [foregroundOutName, setForegroundOutName] = useState(`${baseName}-foreground.webm`);
126
- const [model, setModel] = useState("ben2-base");
127
- const [audio, setAudio] = useState("base");
125
+ const [outName, setOutName] = useState(`${baseName}-no-background.webm`);
126
+ const [model, setModel] = useState("modnet");
127
+ const [audio, setAudio] = useState("keep");
128
128
  const [videoBitrate, setVideoBitrate] = useState("very-high");
129
129
  const [support, setSupport] = useState({ type: "checking" });
130
130
  const staticFiles = useStaticFiles();
@@ -143,18 +143,11 @@ var VideoMattingModal = ({
143
143
  cancelled = true;
144
144
  };
145
145
  }, [model]);
146
- const normalizedBase = baseOutName.normalize("NFC").toLowerCase();
147
- const normalizedForeground = foregroundOutName.normalize("NFC").toLowerCase();
148
- const duplicateOutput = normalizedBase === normalizedForeground;
149
- const queuedOutputs = new Set(videoMattingJobs.filter((job) => job.status === "idle" || job.status === "running").flatMap((job) => [job.baseOutName, job.foregroundOutName]).map((name) => name.normalize("NFC").toLowerCase()));
150
- const baseError = validatePublicOutputName({ extension: ".webm", outName: baseOutName }) ?? (duplicateOutput ? "Base and foreground outputs must be different" : queuedOutputs.has(normalizedBase) ? "Another video matting job is using this output file" : null);
151
- const foregroundError = validatePublicOutputName({
152
- extension: ".webm",
153
- outName: foregroundOutName
154
- }) ?? (duplicateOutput ? "Base and foreground outputs must be different" : queuedOutputs.has(normalizedForeground) ? "Another video matting job is using this output file" : null);
155
- const baseExists = staticFiles.some((file) => file.name.normalize("NFC").toLowerCase() === normalizedBase);
156
- const foregroundExists = staticFiles.some((file) => file.name.normalize("NFC").toLowerCase() === normalizedForeground);
157
- const canSubmit = support.type === "supported" && baseError === null && foregroundError === null;
146
+ const normalizedOutput = outName.normalize("NFC").toLowerCase();
147
+ const queuedOutputs = new Set(videoMattingJobs.filter((job) => job.status === "idle" || job.status === "running" || job.status === "saving").map((job) => job.outName).map((name) => name.normalize("NFC").toLowerCase()));
148
+ const outputError = validatePublicOutputName({ extension: ".webm", outName }) ?? (queuedOutputs.has(normalizedOutput) ? "Another background removal job is using this output file" : null);
149
+ const outputExists = staticFiles.some((file) => file.name.normalize("NFC").toLowerCase() === normalizedOutput);
150
+ const canSubmit = support.type === "supported" && outputError === null;
158
151
  const modelOptions = useMemo(() => makeOptions({
159
152
  items: MODELS.map((item) => ({
160
153
  id: item.name,
@@ -165,9 +158,7 @@ var VideoMattingModal = ({
165
158
  }), [cachedModels, model]);
166
159
  const audioOptions = useMemo(() => makeOptions({
167
160
  items: [
168
- { id: "base", label: "Background layer" },
169
- { id: "foreground", label: "Foreground layer" },
170
- { id: "both", label: "Both layers" },
161
+ { id: "keep", label: "Keep original audio" },
171
162
  { id: "none", label: "No audio" }
172
163
  ],
173
164
  selected: audio,
@@ -187,11 +178,11 @@ var VideoMattingModal = ({
187
178
  addVideoMattingJob({
188
179
  src,
189
180
  displayName,
190
- baseOutName,
191
- foregroundOutName,
181
+ outName,
192
182
  model,
193
183
  audio,
194
- videoBitrate
184
+ videoBitrate,
185
+ target
195
186
  });
196
187
  setSidebarCollapsedState({ left: null, right: "expanded" });
197
188
  persistSelectedOptionsSidebarPanel("renders");
@@ -200,23 +191,24 @@ var VideoMattingModal = ({
200
191
  }, [
201
192
  addVideoMattingJob,
202
193
  audio,
203
- baseOutName,
204
194
  canSubmit,
205
195
  displayName,
206
- foregroundOutName,
196
+ outName,
207
197
  model,
208
198
  setSelectedModal,
209
199
  setSidebarCollapsedState,
210
200
  src,
201
+ target,
211
202
  videoBitrate
212
203
  ]);
204
+ const title = `Remove background from ${displayName}`;
213
205
  return /* @__PURE__ */ jsx(DismissableModal, {
214
- ariaLabel: `Track matting ${displayName}`,
206
+ ariaLabel: title,
215
207
  children: /* @__PURE__ */ jsxs("div", {
216
208
  style: modalStyle,
217
209
  children: [
218
210
  /* @__PURE__ */ jsx(ModalHeader, {
219
- title: `Track matting ${displayName}`
211
+ title
220
212
  }),
221
213
  /* @__PURE__ */ jsxs("div", {
222
214
  style: container,
@@ -232,7 +224,7 @@ var VideoMattingModal = ({
232
224
  ...buttonStyle,
233
225
  backgroundColor: canSubmit ? buttonStyle.backgroundColor : BLUE_DISABLED
234
226
  },
235
- children: "Separate"
227
+ children: "Remove background"
236
228
  })
237
229
  ]
238
230
  }),
@@ -244,17 +236,17 @@ var VideoMattingModal = ({
244
236
  children: [
245
237
  /* @__PURE__ */ jsx(VerticalTab, {
246
238
  autoFocus: true,
247
- onClick: () => setTab("separate"),
239
+ onClick: () => setTab("remove"),
248
240
  renderIcon: (color) => /* @__PURE__ */ jsx("div", {
249
241
  style: iconContainer,
250
- children: /* @__PURE__ */ jsx(SeparationIcon, {
242
+ children: /* @__PURE__ */ jsx(GearIcon, {
251
243
  color,
252
244
  style: icon
253
245
  })
254
246
  }),
255
- selected: tab === "separate",
247
+ selected: tab === "remove",
256
248
  style: horizontalTab,
257
- children: "Separate"
249
+ children: "General"
258
250
  }),
259
251
  /* @__PURE__ */ jsx(VerticalTab, {
260
252
  onClick: () => setTab("models"),
@@ -272,28 +264,18 @@ var VideoMattingModal = ({
272
264
  ]
273
265
  }),
274
266
  /* @__PURE__ */ jsxs("div", {
275
- style: tab === "separate" ? panelStyle : hiddenPanel,
267
+ style: tab === "remove" ? panelStyle : hiddenPanel,
276
268
  className: VERTICAL_SCROLLBAR_CLASSNAME,
277
269
  children: [
278
270
  /* @__PURE__ */ jsx(RenderModalOutputName, {
279
- ariaLabel: "Base video output file",
280
- existingOutputPath: window.remotion_publicFolderExists ? `${window.remotion_publicFolderExists}/${baseOutName}` : null,
281
- existence: baseExists,
282
- inputStyle: input,
283
- label: "Base output in public/",
284
- onValueChange: (event) => setBaseOutName(event.target.value),
285
- outName: baseOutName,
286
- validationMessage: baseError
287
- }),
288
- /* @__PURE__ */ jsx(RenderModalOutputName, {
289
- ariaLabel: "Foreground video output file",
290
- existingOutputPath: window.remotion_publicFolderExists ? `${window.remotion_publicFolderExists}/${foregroundOutName}` : null,
291
- existence: foregroundExists,
271
+ ariaLabel: "Video output file",
272
+ existingOutputPath: window.remotion_publicFolderExists ? `${window.remotion_publicFolderExists}/${outName}` : null,
273
+ existence: outputExists,
292
274
  inputStyle: input,
293
- label: "Foreground output in public/",
294
- onValueChange: (event) => setForegroundOutName(event.target.value),
295
- outName: foregroundOutName,
296
- validationMessage: foregroundError
275
+ label: "Output in public/",
276
+ onValueChange: (event) => setOutName(event.target.value),
277
+ outName,
278
+ validationMessage: outputError
297
279
  }),
298
280
  /* @__PURE__ */ jsx(RenderModalHr, {}),
299
281
  /* @__PURE__ */ jsxs("div", {