@remotion/renderer 4.0.496 → 4.0.498

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/client.d.ts CHANGED
@@ -632,10 +632,7 @@ export declare const BrowserSafeApis: {
632
632
  getValue: ({ commandLine }: {
633
633
  commandLine: Record<string, unknown>;
634
634
  }) => {
635
- value: "angle" | "angle-egl" | "egl" | "swangle" | "swiftshader" | "vulkan";
636
- source: string;
637
- } | {
638
- value: null;
635
+ value: "angle" | "angle-egl" | "egl" | "swangle" | "swiftshader" | "vulkan" | null;
639
636
  source: string;
640
637
  };
641
638
  setConfig: (value: "angle" | "angle-egl" | "egl" | "swangle" | "swiftshader" | "vulkan" | null) => void;
@@ -1,5 +1,5 @@
1
1
  // src/client.ts
2
- import { NoReactInternals as NoReactInternals4 } from "remotion/no-react";
2
+ import { NoReactInternals as NoReactInternals5 } from "remotion/no-react";
3
3
 
4
4
  // src/browser/TimeoutSettings.ts
5
5
  var DEFAULT_TIMEOUT = 30000;
@@ -2062,6 +2062,7 @@ var framesOption = {
2062
2062
  };
2063
2063
 
2064
2064
  // src/options/gl.tsx
2065
+ import { NoReactInternals as NoReactInternals2 } from "remotion/no-react";
2065
2066
  import { jsx as jsx31, jsxs as jsxs22, Fragment as Fragment31 } from "react/jsx-runtime";
2066
2067
  var validOpenGlRenderers = [
2067
2068
  "swangle",
@@ -2071,7 +2072,10 @@ var validOpenGlRenderers = [
2071
2072
  "vulkan",
2072
2073
  "angle-egl"
2073
2074
  ];
2074
- var DEFAULT_OPENGL_RENDERER = null;
2075
+ var getDefaultOpenGlRenderer = (enableV5BreakingChanges) => {
2076
+ return enableV5BreakingChanges ? "angle" : null;
2077
+ };
2078
+ var DEFAULT_OPENGL_RENDERER = getDefaultOpenGlRenderer(NoReactInternals2.ENABLE_V5_BREAKING_CHANGES);
2075
2079
  var openGlRenderer = DEFAULT_OPENGL_RENDERER;
2076
2080
  var AngleChangelog = () => {
2077
2081
  return /* @__PURE__ */ jsxs22("details", {
@@ -2105,7 +2109,16 @@ var AngleChangelog = () => {
2105
2109
  }),
2106
2110
  ", however it turns out to have a small memory leak that could crash long Remotion renders."
2107
2111
  ]
2108
- })
2112
+ }),
2113
+ NoReactInternals2.ENABLE_V5_BREAKING_CHANGES ? /* @__PURE__ */ jsxs22("li", {
2114
+ children: [
2115
+ "From Remotion v5.0, the default is ",
2116
+ /* @__PURE__ */ jsx31("code", {
2117
+ children: "angle"
2118
+ }),
2119
+ ". If no compatible GPU is available, Chromium automatically falls back to SwiftShader."
2120
+ ]
2121
+ }) : null
2109
2122
  ]
2110
2123
  })
2111
2124
  ]
@@ -2179,11 +2192,13 @@ var glOption = {
2179
2192
  }),
2180
2193
  /* @__PURE__ */ jsxs22("p", {
2181
2194
  children: [
2182
- "The default is ",
2195
+ "The default is",
2196
+ " ",
2183
2197
  /* @__PURE__ */ jsx31("code", {
2184
- children: "null"
2198
+ children: DEFAULT_OPENGL_RENDERER === null ? "null" : `"${DEFAULT_OPENGL_RENDERER}"`
2185
2199
  }),
2186
- ", letting Chrome decide, except on Lambda where the default is ",
2200
+ DEFAULT_OPENGL_RENDERER === null ? ", letting Chrome decide" : ", with automatic fallback to SwiftShader if no compatible GPU is available",
2201
+ ", except on Lambda where the default is ",
2187
2202
  /* @__PURE__ */ jsx31("code", {
2188
2203
  children: '"swangle"'
2189
2204
  })
@@ -2331,16 +2346,14 @@ var headlessOption = {
2331
2346
  cliFlag: cliFlag37,
2332
2347
  description: () => /* @__PURE__ */ jsxs24(Fragment33, {
2333
2348
  children: [
2334
- "Deprecated - will be removed in 5.0.0. With the migration to",
2349
+ "If disabled, the render will open an actual Chrome window where you can see the render happen. This requires",
2335
2350
  " ",
2336
2351
  /* @__PURE__ */ jsx33("a", {
2337
2352
  href: "/docs/miscellaneous/chrome-headless-shell",
2338
- children: "Chrome Headless Shell"
2353
+ children: "Chrome for Testing"
2339
2354
  }),
2340
- ", this option is not functional anymore.",
2341
- /* @__PURE__ */ jsx33("br", {}),
2342
- /* @__PURE__ */ jsx33("br", {}),
2343
- " If disabled, the render will open an actual Chrome window where you can see the render happen. The default is headless mode."
2355
+ " ",
2356
+ "or a custom Chrome or Chromium executable. Chrome Headless Shell always runs headlessly. The default is headless mode."
2344
2357
  ]
2345
2358
  }),
2346
2359
  ssrName: "headless",
@@ -3301,10 +3314,10 @@ var outDirOption = {
3301
3314
  };
3302
3315
 
3303
3316
  // src/validate.ts
3304
- import { NoReactInternals as NoReactInternals2 } from "remotion/no-react";
3305
- var validateFps = NoReactInternals2.validateFps;
3306
- var validateDimension = NoReactInternals2.validateDimension;
3307
- var validateDurationInFrames = NoReactInternals2.validateDurationInFrames;
3317
+ import { NoReactInternals as NoReactInternals3 } from "remotion/no-react";
3318
+ var validateFps = NoReactInternals3.validateFps;
3319
+ var validateDimension = NoReactInternals3.validateDimension;
3320
+ var validateDurationInFrames = NoReactInternals3.validateDurationInFrames;
3308
3321
 
3309
3322
  // src/options/override-duration.tsx
3310
3323
  import { jsx as jsx54, Fragment as Fragment54 } from "react/jsx-runtime";
@@ -4023,17 +4036,13 @@ var publicPathOption = {
4023
4036
  children: [
4024
4037
  "The path of the URL where the bundle is going to be hosted. By default it is ",
4025
4038
  /* @__PURE__ */ jsx68("code", {
4026
- children: "/"
4039
+ children: "./"
4027
4040
  }),
4028
- ", meaning that the bundle is going to be hosted at the root of the domain (e.g. ",
4029
- /* @__PURE__ */ jsx68("code", {
4030
- children: "https://localhost:3000/"
4031
- }),
4032
- "). If you are deploying to a subdirectory (e.g. ",
4041
+ ", making the bundle relocatable. Set an absolute path such as ",
4033
4042
  /* @__PURE__ */ jsx68("code", {
4034
4043
  children: "/sites/my-site/"
4035
4044
  }),
4036
- "), you should set this to the subdirectory."
4045
+ " to host the bundle at a fixed location."
4037
4046
  ]
4038
4047
  });
4039
4048
  },
@@ -4272,12 +4281,12 @@ var scaleOption = {
4272
4281
  };
4273
4282
 
4274
4283
  // src/options/still-frame.tsx
4275
- import { NoReactInternals as NoReactInternals3 } from "remotion/no-react";
4284
+ import { NoReactInternals as NoReactInternals4 } from "remotion/no-react";
4276
4285
  import { jsx as jsx74, jsxs as jsxs51, Fragment as Fragment74 } from "react/jsx-runtime";
4277
4286
  var cliFlag78 = "frame";
4278
4287
  var currentFrame = null;
4279
4288
  var validate3 = (frame) => {
4280
- NoReactInternals3.validateFrame({
4289
+ NoReactInternals4.validateFrame({
4281
4290
  frame,
4282
4291
  durationInFrames: Infinity,
4283
4292
  allowFloats: false
@@ -5443,7 +5452,7 @@ var BrowserSafeApis = {
5443
5452
  validAudioCodecs,
5444
5453
  getDefaultCrfForCodec,
5445
5454
  getValidCrfRanges,
5446
- proResProfileOptions: NoReactInternals4.proResProfileOptions,
5455
+ proResProfileOptions: NoReactInternals5.proResProfileOptions,
5447
5456
  x264PresetOptions,
5448
5457
  hardwareAccelerationOptions,
5449
5458
  validPixelFormats,
@@ -5429,7 +5429,7 @@ var validateFrameRange = (frameRange) => {
5429
5429
  };
5430
5430
 
5431
5431
  // src/get-compositions.ts
5432
- import { NoReactInternals as NoReactInternals8 } from "remotion/no-react";
5432
+ import { NoReactInternals as NoReactInternals10 } from "remotion/no-react";
5433
5433
 
5434
5434
  // src/to-megabytes.ts
5435
5435
  function toMegabytes(bytes) {
@@ -5474,6 +5474,7 @@ var defaultOnLog = ({ logLevel, tag, previewString }) => {
5474
5474
  import fs11 from "node:fs";
5475
5475
  import os6 from "node:os";
5476
5476
  import path10 from "node:path";
5477
+ import { NoReactInternals as NoReactInternals7 } from "remotion/no-react";
5477
5478
 
5478
5479
  // src/browser/Launcher.ts
5479
5480
  var launchChrome = async ({
@@ -6995,6 +6996,7 @@ var getIdealVideoThreadsFlag = (logLevel) => {
6995
6996
  };
6996
6997
 
6997
6998
  // src/options/gl.tsx
6999
+ import { NoReactInternals as NoReactInternals6 } from "remotion/no-react";
6998
7000
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
6999
7001
  var validOpenGlRenderers = [
7000
7002
  "swangle",
@@ -7004,7 +7006,10 @@ var validOpenGlRenderers = [
7004
7006
  "vulkan",
7005
7007
  "angle-egl"
7006
7008
  ];
7007
- var DEFAULT_OPENGL_RENDERER = null;
7009
+ var getDefaultOpenGlRenderer = (enableV5BreakingChanges) => {
7010
+ return enableV5BreakingChanges ? "angle" : null;
7011
+ };
7012
+ var DEFAULT_OPENGL_RENDERER = getDefaultOpenGlRenderer(NoReactInternals6.ENABLE_V5_BREAKING_CHANGES);
7008
7013
  var validateOpenGlRenderer = (option) => {
7009
7014
  if (option === null) {
7010
7015
  return null;
@@ -7017,7 +7022,7 @@ var validateOpenGlRenderer = (option) => {
7017
7022
 
7018
7023
  // src/open-browser.ts
7019
7024
  var featuresToEnable = (option) => {
7020
- const renderer = option ?? DEFAULT_OPENGL_RENDERER;
7025
+ const renderer = option === undefined ? getDefaultOpenGlRenderer(NoReactInternals7.ENABLE_V5_BREAKING_CHANGES) : option;
7021
7026
  const enableAlways = [
7022
7027
  "NetworkService",
7023
7028
  "NetworkServiceInProcess",
@@ -7031,8 +7036,8 @@ var featuresToEnable = (option) => {
7031
7036
  }
7032
7037
  return enableAlways;
7033
7038
  };
7034
- var getOpenGlRenderer = (option) => {
7035
- const renderer = option ?? DEFAULT_OPENGL_RENDERER;
7039
+ var getOpenGlRenderer = (option, enableV5BreakingChanges = NoReactInternals7.ENABLE_V5_BREAKING_CHANGES) => {
7040
+ const renderer = option === undefined ? getDefaultOpenGlRenderer(enableV5BreakingChanges) : option;
7036
7041
  validateOpenGlRenderer(renderer);
7037
7042
  if (renderer === "swangle") {
7038
7043
  return ["--use-gl=angle", "--use-angle=swiftshader"];
@@ -7053,6 +7058,12 @@ var getOpenGlRenderer = (option) => {
7053
7058
  if (renderer === null) {
7054
7059
  return [];
7055
7060
  }
7061
+ if (renderer === "angle" && enableV5BreakingChanges) {
7062
+ return [
7063
+ "--use-gl=angle",
7064
+ "--enable-unsafe-swiftshader"
7065
+ ];
7066
+ }
7056
7067
  return [`--use-gl=${renderer}`];
7057
7068
  };
7058
7069
  var internalOpenBrowser = async ({
@@ -7084,7 +7095,7 @@ var internalOpenBrowser = async ({
7084
7095
  indent,
7085
7096
  chromeMode
7086
7097
  });
7087
- const customGlRenderer = getOpenGlRenderer(chromiumOptions.gl ?? null);
7098
+ const customGlRenderer = getOpenGlRenderer(chromiumOptions.gl);
7088
7099
  const enableMultiProcessOnLinux = chromiumOptions.enableMultiProcessOnLinux ?? true;
7089
7100
  Log.verbose({ indent, logLevel, tag: "openBrowser()" }, `Opening browser: gl = ${chromiumOptions.gl}, executable = ${executablePath}, enableMultiProcessOnLinux = ${enableMultiProcessOnLinux}`);
7090
7101
  if (chromiumOptions.userAgent) {
@@ -7264,7 +7275,7 @@ var DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS = 2;
7264
7275
  // src/prepare-server.ts
7265
7276
  import { existsSync as existsSync4 } from "node:fs";
7266
7277
  import path20 from "node:path";
7267
- import { NoReactInternals as NoReactInternals7 } from "remotion/no-react";
7278
+ import { NoReactInternals as NoReactInternals9 } from "remotion/no-react";
7268
7279
 
7269
7280
  // src/assets/download-and-map-assets-to-file.ts
7270
7281
  import fs12 from "node:fs";
@@ -17190,7 +17201,7 @@ var cleanDownloadMap = (downloadMap) => {
17190
17201
 
17191
17202
  // src/get-bundle-url-from-serve-url.ts
17192
17203
  import path17 from "path";
17193
- import { NoReactInternals as NoReactInternals6 } from "remotion/no-react";
17204
+ import { NoReactInternals as NoReactInternals8 } from "remotion/no-react";
17194
17205
  var map = (webpackBundleOrServeUrl, suffix) => {
17195
17206
  if (isServeUrl(webpackBundleOrServeUrl)) {
17196
17207
  const parsed = new URL(webpackBundleOrServeUrl);
@@ -17205,7 +17216,7 @@ var map = (webpackBundleOrServeUrl, suffix) => {
17205
17216
  return url;
17206
17217
  };
17207
17218
  var getBundleMapUrlFromServeUrl = (serveUrl) => {
17208
- return map(serveUrl, NoReactInternals6.bundleMapName);
17219
+ return map(serveUrl, NoReactInternals8.bundleMapName);
17209
17220
  };
17210
17221
 
17211
17222
  // src/normalize-serve-url.ts
@@ -17861,7 +17872,7 @@ var prepareServer = async ({
17861
17872
  throw new Error(`Tried to serve the Webpack bundle on a HTTP server, but the file ${indexFile} does not exist. Is this a valid path to a Webpack bundle?`);
17862
17873
  }
17863
17874
  let localSourceMap = null;
17864
- getSourceMapFromLocalFile(path20.join(webpackConfigOrServeUrl, NoReactInternals7.bundleName)).then((s) => {
17875
+ getSourceMapFromLocalFile(path20.join(webpackConfigOrServeUrl, NoReactInternals9.bundleName)).then((s) => {
17865
17876
  localSourceMap = s;
17866
17877
  }).catch((err) => {
17867
17878
  Log.verbose({ indent, logLevel }, "Could not fetch sourcemap for ", webpackConfigOrServeUrl, err);
@@ -18605,6 +18616,19 @@ var wrapWithErrorHandling = (fn) => {
18605
18616
  };
18606
18617
 
18607
18618
  // src/get-compositions.ts
18619
+ var convertGetCompositionsArgumentsToOptions = (args) => {
18620
+ if (args.length === 0) {
18621
+ throw new Error("No serve URL or webpack bundle directory was passed to getCompositions().");
18622
+ }
18623
+ const firstArg = args[0];
18624
+ if (typeof firstArg === "string") {
18625
+ return {
18626
+ ...args[1] ?? {},
18627
+ serveUrl: firstArg
18628
+ };
18629
+ }
18630
+ return firstArg;
18631
+ };
18608
18632
  var innerGetCompositions = async ({
18609
18633
  envVariables,
18610
18634
  serializedInputPropsWithCustomSchema,
@@ -18688,8 +18712,8 @@ var innerGetCompositions = async ({
18688
18712
  height,
18689
18713
  fps,
18690
18714
  durationInFrames,
18691
- props: NoReactInternals8.deserializeJSONWithSpecialTypes(r.serializedResolvedPropsWithCustomSchema),
18692
- defaultProps: NoReactInternals8.deserializeJSONWithSpecialTypes(r.serializedDefaultPropsWithCustomSchema),
18715
+ props: NoReactInternals10.deserializeJSONWithSpecialTypes(r.serializedResolvedPropsWithCustomSchema),
18716
+ defaultProps: NoReactInternals10.deserializeJSONWithSpecialTypes(r.serializedDefaultPropsWithCustomSchema),
18693
18717
  defaultCodec,
18694
18718
  defaultOutName,
18695
18719
  defaultVideoImageFormat,
@@ -18790,8 +18814,9 @@ var internalGetCompositionsRaw = async ({
18790
18814
  });
18791
18815
  };
18792
18816
  var internalGetCompositions = wrapWithErrorHandling(internalGetCompositionsRaw);
18793
- var getCompositions = (serveUrlOrWebpackUrl, config) => {
18794
- if (!serveUrlOrWebpackUrl) {
18817
+ var getCompositions = (...args) => {
18818
+ const options2 = convertGetCompositionsArgumentsToOptions(args);
18819
+ if (typeof options2?.serveUrl !== "string" || !options2.serveUrl) {
18795
18820
  throw new Error("No serve URL or webpack bundle directory was passed to getCompositions().");
18796
18821
  }
18797
18822
  const {
@@ -18809,15 +18834,16 @@ var getCompositions = (serveUrlOrWebpackUrl, config) => {
18809
18834
  offthreadVideoCacheSizeInBytes,
18810
18835
  chromeMode,
18811
18836
  offthreadVideoThreads,
18812
- mediaCacheSizeInBytes
18813
- } = config ?? {};
18837
+ mediaCacheSizeInBytes,
18838
+ serveUrl
18839
+ } = options2;
18814
18840
  const indent = false;
18815
18841
  const logLevel = passedLogLevel ?? "info";
18816
18842
  return internalGetCompositions({
18817
18843
  browserExecutable: browserExecutable ?? null,
18818
18844
  chromiumOptions: chromiumOptions ?? {},
18819
18845
  envVariables: envVariables ?? {},
18820
- serializedInputPropsWithCustomSchema: NoReactInternals8.serializeJSONWithSpecialTypes({
18846
+ serializedInputPropsWithCustomSchema: NoReactInternals10.serializeJSONWithSpecialTypes({
18821
18847
  data: inputProps ?? {},
18822
18848
  indent: undefined,
18823
18849
  staticBase: null
@@ -18826,7 +18852,7 @@ var getCompositions = (serveUrlOrWebpackUrl, config) => {
18826
18852
  onBrowserLog: onBrowserLog ?? null,
18827
18853
  port: port ?? null,
18828
18854
  puppeteerInstance: puppeteerInstance ?? undefined,
18829
- serveUrlOrWebpackUrl,
18855
+ serveUrlOrWebpackUrl: serveUrl,
18830
18856
  server: undefined,
18831
18857
  timeoutInMilliseconds: timeoutInMilliseconds ?? DEFAULT_TIMEOUT,
18832
18858
  logLevel,
@@ -19194,7 +19220,7 @@ var validateSelectedPixelFormatAndCodecCombination = (pixelFormat, codec) => {
19194
19220
  // src/render-frames.ts
19195
19221
  import fs16 from "node:fs";
19196
19222
  import path22 from "node:path";
19197
- import { NoReactInternals as NoReactInternals12 } from "remotion/no-react";
19223
+ import { NoReactInternals as NoReactInternals14 } from "remotion/no-react";
19198
19224
 
19199
19225
  // src/cycle-browser-tabs.ts
19200
19226
  var cycleBrowserTabs = ({
@@ -20017,10 +20043,10 @@ class Pool {
20017
20043
  }
20018
20044
 
20019
20045
  // src/render-frame-and-retry-target-close.ts
20020
- import { NoReactInternals as NoReactInternals10 } from "remotion/no-react";
20046
+ import { NoReactInternals as NoReactInternals12 } from "remotion/no-react";
20021
20047
 
20022
20048
  // src/is-delay-render-error-with-retry.ts
20023
- import { NoReactInternals as NoReactInternals9 } from "remotion/no-react";
20049
+ import { NoReactInternals as NoReactInternals11 } from "remotion/no-react";
20024
20050
  var getRetriesLeftFromError = (error) => {
20025
20051
  if (!error) {
20026
20052
  throw new Error("Expected stack");
@@ -20029,15 +20055,15 @@ var getRetriesLeftFromError = (error) => {
20029
20055
  if (!stack) {
20030
20056
  throw new Error("Expected stack: " + JSON.stringify(error));
20031
20057
  }
20032
- const beforeIndex = stack.indexOf(NoReactInternals9.DELAY_RENDER_ATTEMPT_TOKEN);
20058
+ const beforeIndex = stack.indexOf(NoReactInternals11.DELAY_RENDER_ATTEMPT_TOKEN);
20033
20059
  if (beforeIndex === -1) {
20034
20060
  throw new Error("Expected to find attempt token in stack");
20035
20061
  }
20036
- const afterIndex = stack.indexOf(NoReactInternals9.DELAY_RENDER_RETRY_TOKEN);
20062
+ const afterIndex = stack.indexOf(NoReactInternals11.DELAY_RENDER_RETRY_TOKEN);
20037
20063
  if (afterIndex === -1) {
20038
20064
  throw new Error("Expected to find retry token in stack");
20039
20065
  }
20040
- const inbetween = stack.substring(beforeIndex + NoReactInternals9.DELAY_RENDER_ATTEMPT_TOKEN.length, afterIndex);
20066
+ const inbetween = stack.substring(beforeIndex + NoReactInternals11.DELAY_RENDER_ATTEMPT_TOKEN.length, afterIndex);
20041
20067
  const parsed = Number(inbetween);
20042
20068
  if (Number.isNaN(parsed)) {
20043
20069
  throw new Error(`Expected to find a number in the stack ${stack}`);
@@ -20602,7 +20628,7 @@ var renderFrameAndRetryTargetClose = async ({
20602
20628
  currentPool.release(freePage);
20603
20629
  } catch (err) {
20604
20630
  const isTargetClosedError = isTargetClosedErr(err);
20605
- const shouldRetryError = err.stack?.includes(NoReactInternals10.DELAY_RENDER_RETRY_TOKEN);
20631
+ const shouldRetryError = err.stack?.includes(NoReactInternals12.DELAY_RENDER_RETRY_TOKEN);
20606
20632
  const flakyNetworkError = isFlakyNetworkError(err);
20607
20633
  if (isUserCancelledRender(err) && !shouldRetryError) {
20608
20634
  throw err;
@@ -20754,10 +20780,10 @@ var handleBrowserCrash = (instance, logLevel, indent) => {
20754
20780
  };
20755
20781
 
20756
20782
  // src/validate.ts
20757
- import { NoReactInternals as NoReactInternals11 } from "remotion/no-react";
20758
- var validateFps = NoReactInternals11.validateFps;
20759
- var validateDimension = NoReactInternals11.validateDimension;
20760
- var validateDurationInFrames = NoReactInternals11.validateDurationInFrames;
20783
+ import { NoReactInternals as NoReactInternals13 } from "remotion/no-react";
20784
+ var validateFps = NoReactInternals13.validateFps;
20785
+ var validateDimension = NoReactInternals13.validateDimension;
20786
+ var validateDurationInFrames = NoReactInternals13.validateDurationInFrames;
20761
20787
 
20762
20788
  // src/validate-scale.ts
20763
20789
  var validateScale = (scale) => {
@@ -21223,12 +21249,12 @@ var renderFrames = (options2) => {
21223
21249
  indent,
21224
21250
  jpegQuality: jpegQuality ?? DEFAULT_JPEG_QUALITY,
21225
21251
  onDownload: onDownload ?? null,
21226
- serializedInputPropsWithCustomSchema: NoReactInternals12.serializeJSONWithSpecialTypes({
21252
+ serializedInputPropsWithCustomSchema: NoReactInternals14.serializeJSONWithSpecialTypes({
21227
21253
  indent: undefined,
21228
21254
  staticBase: null,
21229
21255
  data: inputProps ?? {}
21230
21256
  }).serializedString,
21231
- serializedResolvedPropsWithCustomSchema: NoReactInternals12.serializeJSONWithSpecialTypes({
21257
+ serializedResolvedPropsWithCustomSchema: NoReactInternals14.serializeJSONWithSpecialTypes({
21232
21258
  indent: undefined,
21233
21259
  staticBase: null,
21234
21260
  data: composition.props
@@ -21267,7 +21293,7 @@ import fs18 from "node:fs";
21267
21293
  import os9 from "node:os";
21268
21294
  import path28 from "node:path";
21269
21295
  import { LicensingInternals } from "@remotion/licensing";
21270
- import { NoReactInternals as NoReactInternals15 } from "remotion/no-react";
21296
+ import { NoReactInternals as NoReactInternals17 } from "remotion/no-react";
21271
21297
 
21272
21298
  // src/crf.ts
21273
21299
  var defaultCrfMap = {
@@ -21474,12 +21500,12 @@ var ensureFramesInOrder = (framesToRender) => {
21474
21500
  };
21475
21501
 
21476
21502
  // src/options/color-space.tsx
21477
- import { NoReactInternals as NoReactInternals13 } from "remotion/no-react";
21503
+ import { NoReactInternals as NoReactInternals15 } from "remotion/no-react";
21478
21504
  import { jsx as jsx4, jsxs as jsxs4, Fragment as Fragment4 } from "react/jsx-runtime";
21479
21505
  var validV4ColorSpaces = ["default", "bt601", "bt709", "bt2020-ncl"];
21480
21506
  var validV5ColorSpaces = ["bt601", "bt709", "bt2020-ncl"];
21481
- var validColorSpaces = NoReactInternals13.ENABLE_V5_BREAKING_CHANGES ? validV5ColorSpaces : validV4ColorSpaces;
21482
- var DEFAULT_COLOR_SPACE = NoReactInternals13.ENABLE_V5_BREAKING_CHANGES ? "bt709" : "default";
21507
+ var validColorSpaces = NoReactInternals15.ENABLE_V5_BREAKING_CHANGES ? validV5ColorSpaces : validV4ColorSpaces;
21508
+ var DEFAULT_COLOR_SPACE = NoReactInternals15.ENABLE_V5_BREAKING_CHANGES ? "bt709" : "default";
21483
21509
 
21484
21510
  // src/options/gop-size.tsx
21485
21511
  import { jsx as jsx5, jsxs as jsxs5, Fragment as Fragment5 } from "react/jsx-runtime";
@@ -22019,7 +22045,7 @@ var shouldUseParallelEncoding = ({
22019
22045
  };
22020
22046
 
22021
22047
  // src/prores-profile.ts
22022
- import { NoReactInternals as NoReactInternals14 } from "remotion/no-react";
22048
+ import { NoReactInternals as NoReactInternals16 } from "remotion/no-react";
22023
22049
  var validateSelectedCodecAndProResCombination = ({
22024
22050
  codec,
22025
22051
  proResProfile
@@ -22027,8 +22053,8 @@ var validateSelectedCodecAndProResCombination = ({
22027
22053
  if (typeof proResProfile !== "undefined" && codec !== "prores") {
22028
22054
  throw new TypeError(`You have set a ProRes profile but the codec is "${codec}". Set the codec to "prores" or remove the ProRes profile.`);
22029
22055
  }
22030
- if (proResProfile !== undefined && !NoReactInternals14.proResProfileOptions.includes(proResProfile)) {
22031
- throw new TypeError(`The ProRes profile "${proResProfile}" is not valid. Valid options are ${NoReactInternals14.proResProfileOptions.map((p) => `"${p}"`).join(", ")}`);
22056
+ if (proResProfile !== undefined && !NoReactInternals16.proResProfileOptions.includes(proResProfile)) {
22057
+ throw new TypeError(`The ProRes profile "${proResProfile}" is not valid. Valid options are ${NoReactInternals16.proResProfileOptions.map((p) => `"${p}"`).join(", ")}`);
22032
22058
  }
22033
22059
  };
22034
22060
 
@@ -24130,7 +24156,7 @@ var renderMedia = ({
24130
24156
  ffmpegOverride: ffmpegOverride ?? undefined,
24131
24157
  frameRange: frameRange ?? null,
24132
24158
  imageFormat: imageFormat ?? null,
24133
- serializedInputPropsWithCustomSchema: NoReactInternals15.serializeJSONWithSpecialTypes({
24159
+ serializedInputPropsWithCustomSchema: NoReactInternals17.serializeJSONWithSpecialTypes({
24134
24160
  indent: undefined,
24135
24161
  staticBase: null,
24136
24162
  data: inputProps ?? {}
@@ -24165,7 +24191,7 @@ var renderMedia = ({
24165
24191
  return;
24166
24192
  },
24167
24193
  server: undefined,
24168
- serializedResolvedPropsWithCustomSchema: NoReactInternals15.serializeJSONWithSpecialTypes({
24194
+ serializedResolvedPropsWithCustomSchema: NoReactInternals17.serializeJSONWithSpecialTypes({
24169
24195
  indent: undefined,
24170
24196
  staticBase: null,
24171
24197
  data: composition.props ?? {}
@@ -24199,7 +24225,7 @@ var renderMedia = ({
24199
24225
  import fs19, { statSync as statSync2 } from "node:fs";
24200
24226
  import path29 from "node:path";
24201
24227
  import { LicensingInternals as LicensingInternals2 } from "@remotion/licensing";
24202
- import { NoReactInternals as NoReactInternals16 } from "remotion/no-react";
24228
+ import { NoReactInternals as NoReactInternals18 } from "remotion/no-react";
24203
24229
  var innerRenderStill = async ({
24204
24230
  composition,
24205
24231
  imageFormat = DEFAULT_STILL_IMAGE_FORMAT,
@@ -24237,7 +24263,7 @@ var innerRenderStill = async ({
24237
24263
  allowFloats: false
24238
24264
  });
24239
24265
  validateStillImageFormat(imageFormat);
24240
- NoReactInternals16.validateFrame({
24266
+ NoReactInternals18.validateFrame({
24241
24267
  frame,
24242
24268
  durationInFrames: composition.durationInFrames,
24243
24269
  allowFloats: false
@@ -24530,7 +24556,7 @@ var renderStill = (options2) => {
24530
24556
  frame: frame ?? 0,
24531
24557
  imageFormat: imageFormat ?? DEFAULT_STILL_IMAGE_FORMAT,
24532
24558
  indent,
24533
- serializedInputPropsWithCustomSchema: NoReactInternals16.serializeJSONWithSpecialTypes({
24559
+ serializedInputPropsWithCustomSchema: NoReactInternals18.serializeJSONWithSpecialTypes({
24534
24560
  staticBase: null,
24535
24561
  indent: undefined,
24536
24562
  data: inputProps ?? {}
@@ -24547,7 +24573,7 @@ var renderStill = (options2) => {
24547
24573
  serveUrl,
24548
24574
  timeoutInMilliseconds: timeoutInMilliseconds ?? DEFAULT_TIMEOUT,
24549
24575
  logLevel,
24550
- serializedResolvedPropsWithCustomSchema: NoReactInternals16.serializeJSONWithSpecialTypes({
24576
+ serializedResolvedPropsWithCustomSchema: NoReactInternals18.serializeJSONWithSpecialTypes({
24551
24577
  indent: undefined,
24552
24578
  staticBase: null,
24553
24579
  data: composition.props ?? {}
@@ -24570,7 +24596,7 @@ var renderStill = (options2) => {
24570
24596
  };
24571
24597
 
24572
24598
  // src/select-composition.ts
24573
- import { NoReactInternals as NoReactInternals17 } from "remotion/no-react";
24599
+ import { NoReactInternals as NoReactInternals19 } from "remotion/no-react";
24574
24600
  var innerSelectComposition = async ({
24575
24601
  page,
24576
24602
  serializedInputPropsWithCustomSchema,
@@ -24664,8 +24690,8 @@ var innerSelectComposition = async ({
24664
24690
  height,
24665
24691
  fps,
24666
24692
  durationInFrames,
24667
- props: NoReactInternals17.deserializeJSONWithSpecialTypes(res.serializedResolvedPropsWithCustomSchema),
24668
- defaultProps: NoReactInternals17.deserializeJSONWithSpecialTypes(res.serializedDefaultPropsWithCustomSchema),
24693
+ props: NoReactInternals19.deserializeJSONWithSpecialTypes(res.serializedResolvedPropsWithCustomSchema),
24694
+ defaultProps: NoReactInternals19.deserializeJSONWithSpecialTypes(res.serializedDefaultPropsWithCustomSchema),
24669
24695
  defaultCodec,
24670
24696
  defaultOutName,
24671
24697
  defaultVideoImageFormat,
@@ -24805,7 +24831,7 @@ var selectComposition = async (options2) => {
24805
24831
  browserExecutable: browserExecutable ?? null,
24806
24832
  chromiumOptions: chromiumOptions ?? {},
24807
24833
  envVariables: envVariables ?? {},
24808
- serializedInputPropsWithCustomSchema: NoReactInternals17.serializeJSONWithSpecialTypes({
24834
+ serializedInputPropsWithCustomSchema: NoReactInternals19.serializeJSONWithSpecialTypes({
24809
24835
  indent: undefined,
24810
24836
  staticBase: null,
24811
24837
  data: inputProps ?? {}
@@ -25240,12 +25266,25 @@ var extractAudio = async (options2) => {
25240
25266
  binariesDirectory: options2.binariesDirectory ?? null,
25241
25267
  extraThreads: 0
25242
25268
  });
25243
- await compositor.executeCommand("ExtractAudio", {
25244
- input_path: options2.videoSource,
25245
- output_path: options2.audioOutput
25246
- });
25247
- await compositor.finishCommands();
25248
- await compositor.waitForDone();
25269
+ let executeError;
25270
+ try {
25271
+ await compositor.executeCommand("ExtractAudio", {
25272
+ input_path: options2.videoSource,
25273
+ output_path: options2.audioOutput
25274
+ });
25275
+ } catch (error) {
25276
+ executeError = error;
25277
+ }
25278
+ try {
25279
+ await compositor.shutDownOrKill();
25280
+ } catch (shutdownError) {
25281
+ if (!executeError) {
25282
+ throw shutdownError;
25283
+ }
25284
+ }
25285
+ if (executeError) {
25286
+ throw executeError;
25287
+ }
25249
25288
  };
25250
25289
  // src/get-silent-parts.ts
25251
25290
  var getSilentParts = async ({
@@ -25316,7 +25355,11 @@ var getAudibleParts = ({
25316
25355
  };
25317
25356
  // src/get-video-metadata.ts
25318
25357
  import { resolve as resolve2 } from "node:path";
25358
+ import { NoReactInternals as NoReactInternals20 } from "remotion/no-react";
25319
25359
  var getVideoMetadata = async (videoSource, options2) => {
25360
+ if (NoReactInternals20.ENABLE_V5_BREAKING_CHANGES) {
25361
+ throw new Error("getVideoMetadata() has been removed in Remotion 5. Use Mediabunny instead: https://www.remotion.dev/docs/mediabunny/metadata");
25362
+ }
25320
25363
  const compositor = startLongRunningCompositor({
25321
25364
  maximumFrameCacheItemsInBytes: null,
25322
25365
  logLevel: options2?.logLevel ?? "info",
@@ -15,11 +15,26 @@ const extractAudio = async (options) => {
15
15
  binariesDirectory: (_b = options.binariesDirectory) !== null && _b !== void 0 ? _b : null,
16
16
  extraThreads: 0,
17
17
  });
18
- await compositor.executeCommand('ExtractAudio', {
19
- input_path: options.videoSource,
20
- output_path: options.audioOutput,
21
- });
22
- await compositor.finishCommands();
23
- await compositor.waitForDone();
18
+ let executeError;
19
+ try {
20
+ await compositor.executeCommand('ExtractAudio', {
21
+ input_path: options.videoSource,
22
+ output_path: options.audioOutput,
23
+ });
24
+ }
25
+ catch (error) {
26
+ executeError = error;
27
+ }
28
+ try {
29
+ await compositor.shutDownOrKill();
30
+ }
31
+ catch (shutdownError) {
32
+ if (!executeError) {
33
+ throw shutdownError;
34
+ }
35
+ }
36
+ if (executeError) {
37
+ throw executeError;
38
+ }
24
39
  };
25
40
  exports.extractAudio = extractAudio;
@@ -21,7 +21,7 @@ type InternalGetCompositionsOptions = {
21
21
  serveUrlOrWebpackUrl: string;
22
22
  onLog: OnLog;
23
23
  } & ToOptions<typeof optionsMap.getCompositions>;
24
- export type GetCompositionsOptions = RequiredInputPropsInV5 & {
24
+ export type LegacyGetCompositionsOptions = RequiredInputPropsInV5 & {
25
25
  envVariables?: Record<string, string>;
26
26
  puppeteerInstance?: HeadlessBrowser;
27
27
  onBrowserLog?: (log: BrowserLog) => void;
@@ -29,6 +29,10 @@ export type GetCompositionsOptions = RequiredInputPropsInV5 & {
29
29
  chromiumOptions?: ChromiumOptions;
30
30
  port?: number | null;
31
31
  } & Partial<ToOptions<typeof optionsMap.getCompositions>>;
32
+ export type GetCompositionsOptions = LegacyGetCompositionsOptions & {
33
+ serveUrl: string;
34
+ };
35
+ type GetCompositionsArguments = [options: GetCompositionsOptions] | [serveUrlOrWebpackUrl: string, config?: LegacyGetCompositionsOptions];
32
36
  export declare const internalGetCompositions: (args_0: InternalGetCompositionsOptions) => Promise<VideoConfig[]>;
33
- export declare const getCompositions: (serveUrlOrWebpackUrl: string, config?: GetCompositionsOptions | undefined) => Promise<VideoConfig[]>;
37
+ export declare const getCompositions: (...args: GetCompositionsArguments) => Promise<VideoConfig[]>;
34
38
  export {};
@@ -16,6 +16,20 @@ const seek_to_frame_1 = require("./seek-to-frame");
16
16
  const set_props_and_env_1 = require("./set-props-and-env");
17
17
  const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
18
18
  const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
19
+ const convertGetCompositionsArgumentsToOptions = (args) => {
20
+ var _a;
21
+ if (args.length === 0) {
22
+ throw new Error('No serve URL or webpack bundle directory was passed to getCompositions().');
23
+ }
24
+ const firstArg = args[0];
25
+ if (typeof firstArg === 'string') {
26
+ return {
27
+ ...((_a = args[1]) !== null && _a !== void 0 ? _a : {}),
28
+ serveUrl: firstArg,
29
+ };
30
+ }
31
+ return firstArg;
32
+ };
19
33
  const innerGetCompositions = async ({ envVariables, serializedInputPropsWithCustomSchema, page, proxyPort, serveUrl, timeoutInMilliseconds, indent, logLevel, mediaCacheSizeInBytes, darkMode, }) => {
20
34
  (0, validate_puppeteer_timeout_1.validatePuppeteerTimeout)(timeoutInMilliseconds);
21
35
  await (0, set_props_and_env_1.setPropsAndEnv)({
@@ -163,11 +177,12 @@ exports.internalGetCompositions = (0, wrap_with_error_handling_1.wrapWithErrorHa
163
177
  * @description Gets a list of compositions defined in a Remotion project based on a Remotion Bundle by evaluating the Remotion Root.
164
178
  * @see [Documentation](https://www.remotion.dev/docs/renderer/get-compositions)
165
179
  */
166
- const getCompositions = (serveUrlOrWebpackUrl, config) => {
167
- if (!serveUrlOrWebpackUrl) {
180
+ const getCompositions = (...args) => {
181
+ const options = convertGetCompositionsArgumentsToOptions(args);
182
+ if (typeof (options === null || options === void 0 ? void 0 : options.serveUrl) !== 'string' || !options.serveUrl) {
168
183
  throw new Error('No serve URL or webpack bundle directory was passed to getCompositions().');
169
184
  }
170
- const { browserExecutable, chromiumOptions, envVariables, inputProps, onBrowserLog, port, puppeteerInstance, timeoutInMilliseconds, logLevel: passedLogLevel, onBrowserDownload, binariesDirectory, offthreadVideoCacheSizeInBytes, chromeMode, offthreadVideoThreads, mediaCacheSizeInBytes, } = config !== null && config !== void 0 ? config : {};
185
+ const { browserExecutable, chromiumOptions, envVariables, inputProps, onBrowserLog, port, puppeteerInstance, timeoutInMilliseconds, logLevel: passedLogLevel, onBrowserDownload, binariesDirectory, offthreadVideoCacheSizeInBytes, chromeMode, offthreadVideoThreads, mediaCacheSizeInBytes, serveUrl, } = options;
171
186
  const indent = false;
172
187
  const logLevel = passedLogLevel !== null && passedLogLevel !== void 0 ? passedLogLevel : 'info';
173
188
  return (0, exports.internalGetCompositions)({
@@ -183,7 +198,7 @@ const getCompositions = (serveUrlOrWebpackUrl, config) => {
183
198
  onBrowserLog: onBrowserLog !== null && onBrowserLog !== void 0 ? onBrowserLog : null,
184
199
  port: port !== null && port !== void 0 ? port : null,
185
200
  puppeteerInstance: puppeteerInstance !== null && puppeteerInstance !== void 0 ? puppeteerInstance : undefined,
186
- serveUrlOrWebpackUrl,
201
+ serveUrlOrWebpackUrl: serveUrl,
187
202
  server: undefined,
188
203
  timeoutInMilliseconds: timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : TimeoutSettings_1.DEFAULT_TIMEOUT,
189
204
  logLevel,
@@ -1,7 +1,7 @@
1
1
  import type { VideoMetadata } from './compositor/payloads';
2
2
  export { VideoMetadata } from './compositor/payloads';
3
3
  /**
4
- * @deprecated Use `parseMedia()` instead: https://www.remotion.dev/docs/media-parser/parse-media
4
+ * @deprecated Use Mediabunny instead: https://www.remotion.dev/docs/mediabunny/metadata
5
5
  */
6
6
  export declare const getVideoMetadata: (videoSource: string, options?: {
7
7
  logLevel?: "error" | "info" | "trace" | "verbose" | "warn" | undefined;
@@ -2,12 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getVideoMetadata = void 0;
4
4
  const node_path_1 = require("node:path");
5
+ const no_react_1 = require("remotion/no-react");
5
6
  const compositor_1 = require("./compositor/compositor");
6
7
  /**
7
- * @deprecated Use `parseMedia()` instead: https://www.remotion.dev/docs/media-parser/parse-media
8
+ * @deprecated Use Mediabunny instead: https://www.remotion.dev/docs/mediabunny/metadata
8
9
  */
9
10
  const getVideoMetadata = async (videoSource, options) => {
10
11
  var _a, _b;
12
+ if (no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES) {
13
+ throw new Error('getVideoMetadata() has been removed in Remotion 5. Use Mediabunny instead: https://www.remotion.dev/docs/mediabunny/metadata');
14
+ }
11
15
  const compositor = (0, compositor_1.startLongRunningCompositor)({
12
16
  maximumFrameCacheItemsInBytes: null,
13
17
  logLevel: (_a = options === null || options === void 0 ? void 0 : options.logLevel) !== null && _a !== void 0 ? _a : 'info',
package/dist/index.d.ts CHANGED
@@ -19,7 +19,7 @@ export { extractAudio } from './extract-audio';
19
19
  export type { FfmpegOverrideFn } from './ffmpeg-override';
20
20
  export { FileExtension } from './file-extensions';
21
21
  export { FrameRange } from './frame-range';
22
- export { GetCompositionsOptions, getCompositions } from './get-compositions';
22
+ export { GetCompositionsOptions, getCompositions, LegacyGetCompositionsOptions, } from './get-compositions';
23
23
  export { SilentPart, getSilentParts } from './get-silent-parts';
24
24
  export { VideoMetadata, getVideoMetadata } from './get-video-metadata';
25
25
  export { ImageFormat, StillImageFormat, VideoImageFormat, validateSelectedPixelFormatAndImageFormatCombination, } from './image-format';
@@ -1,4 +1,4 @@
1
- import type { NoReactInternals } from 'remotion/no-react';
1
+ import { NoReactInternals } from 'remotion/no-react';
2
2
  import type { Browser } from './browser';
3
3
  import type { HeadlessBrowser } from './browser/Browser';
4
4
  import type { Viewport } from './browser/PuppeteerViewport';
@@ -8,13 +8,6 @@ import type { validOpenGlRenderers } from './options/gl';
8
8
  import type { ToOptions } from './options/option';
9
9
  import type { optionsMap } from './options/options-map';
10
10
  type OpenGlRenderer = (typeof validOpenGlRenderers)[number];
11
- type OnlyV4Options = typeof NoReactInternals.ENABLE_V5_BREAKING_CHANGES extends true ? {} : {
12
- /**
13
- * @deprecated - Will be removed in v5.
14
- * Chrome Headless shell does not allow disabling headless mode anymore.
15
- */
16
- headless?: boolean;
17
- };
18
11
  export type ChromiumOptions = {
19
12
  ignoreCertificateErrors?: boolean;
20
13
  disableWebSecurity?: boolean;
@@ -22,7 +15,13 @@ export type ChromiumOptions = {
22
15
  userAgent?: string | null;
23
16
  enableMultiProcessOnLinux?: boolean;
24
17
  darkMode?: boolean;
25
- } & OnlyV4Options;
18
+ /**
19
+ * Opens a browser window if Chrome for Testing or a custom Chrome/Chromium
20
+ * executable is used. Chrome Headless Shell always runs headlessly.
21
+ */
22
+ headless?: boolean;
23
+ };
24
+ export declare const getOpenGlRenderer: (option: "angle" | "angle-egl" | "egl" | "swangle" | "swiftshader" | "vulkan" | null | undefined, enableV5BreakingChanges?: boolean) => string[];
26
25
  type InternalOpenBrowserOptions = {
27
26
  browserExecutable: string | null;
28
27
  chromiumOptions: ChromiumOptions;
@@ -3,10 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.openBrowser = exports.internalOpenBrowser = void 0;
6
+ exports.openBrowser = exports.internalOpenBrowser = exports.getOpenGlRenderer = void 0;
7
7
  const node_fs_1 = __importDefault(require("node:fs"));
8
8
  const node_os_1 = __importDefault(require("node:os"));
9
9
  const node_path_1 = __importDefault(require("node:path"));
10
+ const no_react_1 = require("remotion/no-react");
10
11
  const browser_download_progress_bar_1 = require("./browser/browser-download-progress-bar");
11
12
  const Launcher_1 = require("./browser/Launcher");
12
13
  const ensure_browser_1 = require("./ensure-browser");
@@ -15,7 +16,9 @@ const get_video_threads_flag_1 = require("./get-video-threads-flag");
15
16
  const logger_1 = require("./logger");
16
17
  const gl_1 = require("./options/gl");
17
18
  const featuresToEnable = (option) => {
18
- const renderer = option !== null && option !== void 0 ? option : gl_1.DEFAULT_OPENGL_RENDERER;
19
+ const renderer = option === undefined
20
+ ? (0, gl_1.getDefaultOpenGlRenderer)(no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES)
21
+ : option;
19
22
  const enableAlways = [
20
23
  'NetworkService',
21
24
  'NetworkServiceInProcess',
@@ -29,8 +32,10 @@ const featuresToEnable = (option) => {
29
32
  }
30
33
  return enableAlways;
31
34
  };
32
- const getOpenGlRenderer = (option) => {
33
- const renderer = option !== null && option !== void 0 ? option : gl_1.DEFAULT_OPENGL_RENDERER;
35
+ const getOpenGlRenderer = (option, enableV5BreakingChanges = no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES) => {
36
+ const renderer = option === undefined
37
+ ? (0, gl_1.getDefaultOpenGlRenderer)(enableV5BreakingChanges)
38
+ : option;
34
39
  (0, gl_1.validateOpenGlRenderer)(renderer);
35
40
  if (renderer === 'swangle') {
36
41
  return ['--use-gl=angle', '--use-angle=swiftshader'];
@@ -51,11 +56,20 @@ const getOpenGlRenderer = (option) => {
51
56
  if (renderer === null) {
52
57
  return [];
53
58
  }
59
+ if (renderer === 'angle' && enableV5BreakingChanges) {
60
+ return [
61
+ '--use-gl=angle',
62
+ // Opt into Chromium's software WebGL fallback for GPU-less machines:
63
+ // https://chromium.googlesource.com/chromium/src/+/main/docs/gpu/swiftshader.md
64
+ '--enable-unsafe-swiftshader',
65
+ ];
66
+ }
54
67
  return [`--use-gl=${renderer}`];
55
68
  };
69
+ exports.getOpenGlRenderer = getOpenGlRenderer;
56
70
  const internalOpenBrowser = async ({ browser, browserExecutable, chromiumOptions, forceDeviceScaleFactor, indent, viewport, logLevel, onBrowserDownload, chromeMode, }) => {
57
71
  var _a;
58
- var _b, _c, _d;
72
+ var _b, _c;
59
73
  // @ts-expect-error Firefox
60
74
  if (browser === 'firefox') {
61
75
  throw new TypeError('Firefox supported is not yet turned on. Stay tuned for the future.');
@@ -75,8 +89,8 @@ const internalOpenBrowser = async ({ browser, browserExecutable, chromiumOptions
75
89
  indent,
76
90
  chromeMode,
77
91
  });
78
- const customGlRenderer = getOpenGlRenderer((_b = chromiumOptions.gl) !== null && _b !== void 0 ? _b : null);
79
- const enableMultiProcessOnLinux = (_c = chromiumOptions.enableMultiProcessOnLinux) !== null && _c !== void 0 ? _c : true;
92
+ const customGlRenderer = (0, exports.getOpenGlRenderer)(chromiumOptions.gl);
93
+ const enableMultiProcessOnLinux = (_b = chromiumOptions.enableMultiProcessOnLinux) !== null && _b !== void 0 ? _b : true;
80
94
  logger_1.Log.verbose({ indent, logLevel, tag: 'openBrowser()' }, `Opening browser: gl = ${chromiumOptions.gl}, executable = ${executablePath}, enableMultiProcessOnLinux = ${enableMultiProcessOnLinux}`);
81
95
  if (chromiumOptions.userAgent) {
82
96
  logger_1.Log.verbose({ indent, logLevel, tag: 'openBrowser()' }, `Using custom user agent: ${chromiumOptions.userAgent}`);
@@ -123,7 +137,7 @@ const internalOpenBrowser = async ({ browser, browserExecutable, chromiumOptions
123
137
  '--enable-blink-features=IdleDetection',
124
138
  '--export-tagged-pdf',
125
139
  '--intensive-wake-up-throttling-policy=0',
126
- ((_d = chromiumOptions.headless) !== null && _d !== void 0 ? _d : true)
140
+ ((_c = chromiumOptions.headless) !== null && _c !== void 0 ? _c : true)
127
141
  ? chromeMode === 'chrome-for-testing'
128
142
  ? '--headless=new'
129
143
  : '--headless=old'
@@ -1,6 +1,7 @@
1
1
  export declare const validOpenGlRenderers: readonly ["swangle", "angle", "egl", "swiftshader", "vulkan", "angle-egl"];
2
2
  export type OpenGlRenderer = (typeof validOpenGlRenderers)[number];
3
- export declare const DEFAULT_OPENGL_RENDERER: OpenGlRenderer | null;
3
+ export declare const getDefaultOpenGlRenderer: (enableV5BreakingChanges: boolean) => "angle" | "angle-egl" | "egl" | "swangle" | "swiftshader" | "vulkan" | null;
4
+ export declare const DEFAULT_OPENGL_RENDERER: "angle" | "angle-egl" | "egl" | "swangle" | "swiftshader" | "vulkan" | null;
4
5
  export declare const getChromiumOpenGlRenderer: () => "angle" | "angle-egl" | "egl" | "swangle" | "swiftshader" | "vulkan" | null;
5
6
  export declare const setChromiumOpenGlRenderer: (renderer: "angle" | "angle-egl" | "egl" | "swangle" | "swiftshader" | "vulkan") => void;
6
7
  export declare const glOption: {
@@ -13,10 +14,7 @@ export declare const glOption: {
13
14
  getValue: ({ commandLine }: {
14
15
  commandLine: Record<string, unknown>;
15
16
  }) => {
16
- value: "angle" | "angle-egl" | "egl" | "swangle" | "swiftshader" | "vulkan";
17
- source: string;
18
- } | {
19
- value: null;
17
+ value: "angle" | "angle-egl" | "egl" | "swangle" | "swiftshader" | "vulkan" | null;
20
18
  source: string;
21
19
  };
22
20
  setConfig: (value: "angle" | "angle-egl" | "egl" | "swangle" | "swiftshader" | "vulkan" | null) => void;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateOpenGlRenderer = exports.glOption = exports.setChromiumOpenGlRenderer = exports.getChromiumOpenGlRenderer = exports.DEFAULT_OPENGL_RENDERER = exports.validOpenGlRenderers = void 0;
3
+ exports.validateOpenGlRenderer = exports.glOption = exports.setChromiumOpenGlRenderer = exports.getChromiumOpenGlRenderer = exports.DEFAULT_OPENGL_RENDERER = exports.getDefaultOpenGlRenderer = exports.validOpenGlRenderers = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const no_react_1 = require("remotion/no-react");
5
6
  exports.validOpenGlRenderers = [
6
7
  'swangle',
7
8
  'angle',
@@ -10,7 +11,11 @@ exports.validOpenGlRenderers = [
10
11
  'vulkan',
11
12
  'angle-egl',
12
13
  ];
13
- exports.DEFAULT_OPENGL_RENDERER = null;
14
+ const getDefaultOpenGlRenderer = (enableV5BreakingChanges) => {
15
+ return enableV5BreakingChanges ? 'angle' : null;
16
+ };
17
+ exports.getDefaultOpenGlRenderer = getDefaultOpenGlRenderer;
18
+ exports.DEFAULT_OPENGL_RENDERER = (0, exports.getDefaultOpenGlRenderer)(no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES);
14
19
  let openGlRenderer = exports.DEFAULT_OPENGL_RENDERER;
15
20
  const getChromiumOpenGlRenderer = () => openGlRenderer;
16
21
  exports.getChromiumOpenGlRenderer = getChromiumOpenGlRenderer;
@@ -26,8 +31,9 @@ const AngleChangelog = () => {
26
31
  ", but from v3.0.8 the default is", ' ', jsx_runtime_1.jsx("code", { children: "swangle" }),
27
32
  " (Swiftshader on Angle) since Chrome 101 added support for it."] }), jsx_runtime_1.jsxs("li", { children: ["From Remotion v2.4.3 until v2.6.6, the default was ",
28
33
  jsx_runtime_1.jsx("code", { children: "angle" }),
29
- ", however it turns out to have a small memory leak that could crash long Remotion renders."] })
30
- ] })
34
+ ", however it turns out to have a small memory leak that could crash long Remotion renders."] }), no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES ? (jsx_runtime_1.jsxs("li", { children: ["From Remotion v5.0, the default is ",
35
+ jsx_runtime_1.jsx("code", { children: "angle" }),
36
+ ". If no compatible GPU is available, Chromium automatically falls back to SwiftShader."] })) : null] })
31
37
  ] }));
32
38
  };
33
39
  const cliFlag = 'gl';
@@ -51,9 +57,11 @@ exports.glOption = {
51
57
  " (",
52
58
  jsx_runtime_1.jsx("em", { children: "from Remotion v4.0.51" }),
53
59
  ")"] })
54
- ] }), jsx_runtime_1.jsxs("p", { children: ["The default is ",
55
- jsx_runtime_1.jsx("code", { children: "null" }),
56
- ", letting Chrome decide, except on Lambda where the default is ",
60
+ ] }), jsx_runtime_1.jsxs("p", { children: ["The default is", ' ', jsx_runtime_1.jsx("code", { children: exports.DEFAULT_OPENGL_RENDERER === null
61
+ ? 'null'
62
+ : `"${exports.DEFAULT_OPENGL_RENDERER}"` }), exports.DEFAULT_OPENGL_RENDERER === null
63
+ ? ', letting Chrome decide'
64
+ : ', with automatic fallback to SwiftShader if no compatible GPU is available', ", except on Lambda where the default is ",
57
65
  jsx_runtime_1.jsx("code", { children: '"swangle"' })
58
66
  ] })
59
67
  ] }));
@@ -8,10 +8,7 @@ const cliFlag = 'disable-headless';
8
8
  exports.headlessOption = {
9
9
  name: 'Disable Headless Mode',
10
10
  cliFlag,
11
- description: () => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["Deprecated - will be removed in 5.0.0. With the migration to", ' ', jsx_runtime_1.jsx("a", { href: "/docs/miscellaneous/chrome-headless-shell", children: "Chrome Headless Shell" }),
12
- ", this option is not functional anymore.",
13
- jsx_runtime_1.jsx("br", {}), jsx_runtime_1.jsx("br", {}),
14
- " If disabled, the render will open an actual Chrome window where you can see the render happen. The default is headless mode."] })),
11
+ description: () => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["If disabled, the render will open an actual Chrome window where you can see the render happen. This requires", ' ', jsx_runtime_1.jsx("a", { href: "/docs/miscellaneous/chrome-headless-shell", children: "Chrome for Testing" }), ' ', "or a custom Chrome or Chromium executable. Chrome Headless Shell always runs headlessly. The default is headless mode."] })),
15
12
  ssrName: 'headless',
16
13
  docLink: 'https://www.remotion.dev/docs/chromium-flags#--disable-headless',
17
14
  type: false,
@@ -386,10 +386,7 @@ export declare const allOptions: {
386
386
  getValue: ({ commandLine }: {
387
387
  commandLine: Record<string, unknown>;
388
388
  }) => {
389
- value: "angle" | "angle-egl" | "egl" | "swangle" | "swiftshader" | "vulkan";
390
- source: string;
391
- } | {
392
- value: null;
389
+ value: "angle" | "angle-egl" | "egl" | "swangle" | "swiftshader" | "vulkan" | null;
393
390
  source: string;
394
391
  };
395
392
  setConfig: (value: "angle" | "angle-egl" | "egl" | "swangle" | "swiftshader" | "vulkan" | null) => void;
@@ -9,12 +9,10 @@ exports.publicPathOption = {
9
9
  cliFlag,
10
10
  description: () => {
11
11
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["The path of the URL where the bundle is going to be hosted. By default it is ",
12
- jsx_runtime_1.jsx("code", { children: "/" }),
13
- ", meaning that the bundle is going to be hosted at the root of the domain (e.g. ",
14
- jsx_runtime_1.jsx("code", { children: "https://localhost:3000/" }),
15
- "). If you are deploying to a subdirectory (e.g. ",
12
+ jsx_runtime_1.jsx("code", { children: "./" }),
13
+ ", making the bundle relocatable. Set an absolute path such as ",
16
14
  jsx_runtime_1.jsx("code", { children: "/sites/my-site/" }),
17
- "), you should set this to the subdirectory."] }));
15
+ " to host the bundle at a fixed location."] }));
18
16
  },
19
17
  ssrName: 'publicPath',
20
18
  docLink: 'https://www.remotion.dev/docs/renderer',
@@ -166,6 +166,11 @@ const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVa
166
166
  page,
167
167
  timeoutInMilliseconds: actualTimeout,
168
168
  });
169
+ // Increment this value when the generated bundle format or behavior changes
170
+ // in a backwards-incompatible way. It is not the Remotion package version and
171
+ // should not be bumped for every generated HTML change. Keep it synchronized
172
+ // with window.siteVersion in packages/studio-shared/src/studio-html.ts by
173
+ // incrementing both values.
169
174
  const requiredVersion = '11';
170
175
  if (siteVersion !== requiredVersion) {
171
176
  throw new Error([
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/renderer"
4
4
  },
5
5
  "name": "@remotion/renderer",
6
- "version": "4.0.496",
6
+ "version": "4.0.498",
7
7
  "description": "Render Remotion videos using Node.js or Bun",
8
8
  "main": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
@@ -22,11 +22,11 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "execa": "5.1.1",
25
- "remotion": "4.0.496",
26
- "@remotion/streaming": "4.0.496",
25
+ "remotion": "4.0.498",
26
+ "@remotion/streaming": "4.0.498",
27
27
  "source-map": "0.8.0-beta.0",
28
28
  "ws": "8.21.0",
29
- "@remotion/licensing": "4.0.496"
29
+ "@remotion/licensing": "4.0.498"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "react": ">=16.8.0",
@@ -40,19 +40,19 @@
40
40
  "react-dom": "19.2.3",
41
41
  "@typescript/native-preview": "7.0.0-dev.20260217.1",
42
42
  "@types/ws": "8.5.10",
43
- "@remotion/example-videos": "4.0.496",
44
- "@remotion/eslint-config-internal": "4.0.496",
43
+ "@remotion/example-videos": "4.0.498",
44
+ "@remotion/eslint-config-internal": "4.0.498",
45
45
  "eslint": "9.19.0",
46
46
  "@types/node": "20.12.14"
47
47
  },
48
48
  "optionalDependencies": {
49
- "@remotion/compositor-darwin-arm64": "4.0.496",
50
- "@remotion/compositor-darwin-x64": "4.0.496",
51
- "@remotion/compositor-linux-arm64-gnu": "4.0.496",
52
- "@remotion/compositor-linux-arm64-musl": "4.0.496",
53
- "@remotion/compositor-linux-x64-gnu": "4.0.496",
54
- "@remotion/compositor-linux-x64-musl": "4.0.496",
55
- "@remotion/compositor-win32-x64-msvc": "4.0.496"
49
+ "@remotion/compositor-darwin-arm64": "4.0.498",
50
+ "@remotion/compositor-darwin-x64": "4.0.498",
51
+ "@remotion/compositor-linux-arm64-gnu": "4.0.498",
52
+ "@remotion/compositor-linux-arm64-musl": "4.0.498",
53
+ "@remotion/compositor-linux-x64-gnu": "4.0.498",
54
+ "@remotion/compositor-linux-x64-musl": "4.0.498",
55
+ "@remotion/compositor-win32-x64-msvc": "4.0.498"
56
56
  },
57
57
  "keywords": [
58
58
  "remotion",