@remotion/renderer 4.0.246 → 4.0.248

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 (37) hide show
  1. package/dist/browser/BrowserFetcher.d.ts +4 -2
  2. package/dist/browser/BrowserFetcher.js +41 -18
  3. package/dist/browser/browser-download-progress-bar.js +13 -3
  4. package/dist/client.d.ts +150 -2
  5. package/dist/client.js +2 -0
  6. package/dist/ensure-browser.d.ts +2 -3
  7. package/dist/ensure-browser.js +9 -13
  8. package/dist/get-browser-instance.d.ts +3 -1
  9. package/dist/get-browser-instance.js +2 -1
  10. package/dist/get-codec-name.d.ts +1 -1
  11. package/dist/get-compositions.js +5 -2
  12. package/dist/get-local-browser-executable.d.ts +3 -1
  13. package/dist/get-local-browser-executable.js +4 -8
  14. package/dist/index.d.ts +125 -8
  15. package/dist/open-browser.d.ts +6 -5
  16. package/dist/open-browser.js +14 -5
  17. package/dist/options/chrome-mode.d.ts +17 -0
  18. package/dist/options/chrome-mode.js +46 -0
  19. package/dist/options/gl.d.ts +1 -1
  20. package/dist/options/index.d.ts +17 -2
  21. package/dist/options/index.js +2 -0
  22. package/dist/options/metadata.d.ts +1 -1
  23. package/dist/options/on-browser-download.d.ts +4 -1
  24. package/dist/options/options-map.d.ts +132 -0
  25. package/dist/options/options-map.js +12 -0
  26. package/dist/options/webhook-custom-data.d.ts +1 -1
  27. package/dist/render-frames.js +5 -2
  28. package/dist/render-media.d.ts +1 -1
  29. package/dist/render-media.js +9 -3
  30. package/dist/render-still.js +9 -3
  31. package/dist/select-composition.js +5 -2
  32. package/dist/test-gpu.d.ts +3 -1
  33. package/dist/test-gpu.js +2 -1
  34. package/ensure-browser.mjs +66 -48
  35. package/package.json +12 -12
  36. package/dist/get-local-browser.d.ts +0 -1
  37. package/dist/get-local-browser.js +0 -19
@@ -4,6 +4,7 @@ exports.optionsMap = void 0;
4
4
  const audio_bitrate_1 = require("./audio-bitrate");
5
5
  const audio_codec_1 = require("./audio-codec");
6
6
  const binaries_directory_1 = require("./binaries-directory");
7
+ const chrome_mode_1 = require("./chrome-mode");
7
8
  const color_space_1 = require("./color-space");
8
9
  const crf_1 = require("./crf");
9
10
  const delete_after_1 = require("./delete-after");
@@ -49,6 +50,7 @@ exports.optionsMap = {
49
50
  audioCodec: audio_codec_1.audioCodecOption,
50
51
  onBrowserDownload: on_browser_download_1.onBrowserDownloadOption,
51
52
  hardwareAcceleration: hardware_acceleration_1.hardwareAccelerationOption,
53
+ chromeMode: chrome_mode_1.chromeModeOption,
52
54
  },
53
55
  stitchFramesToVideo: {
54
56
  separateAudioTo: separate_audio_1.separateAudioOption,
@@ -61,6 +63,7 @@ exports.optionsMap = {
61
63
  timeoutInMilliseconds: timeout_1.delayRenderTimeoutInMillisecondsOption,
62
64
  binariesDirectory: binaries_directory_1.binariesDirectoryOption,
63
65
  onBrowserDownload: on_browser_download_1.onBrowserDownloadOption,
66
+ chromeMode: chrome_mode_1.chromeModeOption,
64
67
  },
65
68
  getCompositions: {
66
69
  offthreadVideoCacheSizeInBytes: offthreadvideo_cache_size_1.offthreadVideoCacheSizeInBytesOption,
@@ -68,6 +71,7 @@ exports.optionsMap = {
68
71
  timeoutInMilliseconds: timeout_1.delayRenderTimeoutInMillisecondsOption,
69
72
  binariesDirectory: binaries_directory_1.binariesDirectoryOption,
70
73
  onBrowserDownload: on_browser_download_1.onBrowserDownloadOption,
74
+ chromeMode: chrome_mode_1.chromeModeOption,
71
75
  },
72
76
  selectComposition: {
73
77
  offthreadVideoCacheSizeInBytes: offthreadvideo_cache_size_1.offthreadVideoCacheSizeInBytesOption,
@@ -75,6 +79,7 @@ exports.optionsMap = {
75
79
  timeoutInMilliseconds: timeout_1.delayRenderTimeoutInMillisecondsOption,
76
80
  binariesDirectory: binaries_directory_1.binariesDirectoryOption,
77
81
  onBrowserDownload: on_browser_download_1.onBrowserDownloadOption,
82
+ chromeMode: chrome_mode_1.chromeModeOption,
78
83
  },
79
84
  renderFrames: {
80
85
  forSeamlessAacConcatenation: for_seamless_aac_concatenation_1.forSeamlessAacConcatenationOption,
@@ -84,6 +89,7 @@ exports.optionsMap = {
84
89
  timeoutInMilliseconds: timeout_1.delayRenderTimeoutInMillisecondsOption,
85
90
  binariesDirectory: binaries_directory_1.binariesDirectoryOption,
86
91
  onBrowserDownload: on_browser_download_1.onBrowserDownloadOption,
92
+ chromeMode: chrome_mode_1.chromeModeOption,
87
93
  },
88
94
  renderMediaOnLambda: {
89
95
  offthreadVideoCacheSizeInBytes: offthreadvideo_cache_size_1.offthreadVideoCacheSizeInBytesOption,
@@ -141,6 +147,12 @@ exports.optionsMap = {
141
147
  ensureBrowser: {
142
148
  logLevel: log_level_1.logLevelOption,
143
149
  onBrowserDownload: on_browser_download_1.onBrowserDownloadOption,
150
+ chromeMode: chrome_mode_1.chromeModeOption,
151
+ },
152
+ openBrowser: {
153
+ logLevel: log_level_1.logLevelOption,
154
+ onBrowserDownload: on_browser_download_1.onBrowserDownloadOption,
155
+ chromeMode: chrome_mode_1.chromeModeOption,
144
156
  },
145
157
  deploySiteLambda: {
146
158
  logLevel: log_level_1.logLevelOption,
@@ -1,7 +1,7 @@
1
1
  export declare const webhookCustomDataOption: {
2
2
  name: string;
3
3
  cliFlag: "webhook-custom-data";
4
- description: (type: "ssr" | "cli") => import("react/jsx-runtime").JSX.Element;
4
+ description: (type: "cli" | "ssr") => import("react/jsx-runtime").JSX.Element;
5
5
  ssrName: "customData";
6
6
  docLink: string;
7
7
  type: Record<string, unknown> | null;
@@ -413,7 +413,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
413
413
  frameCount: framesToRender.length,
414
414
  };
415
415
  };
416
- const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency, envVariables, everyNthFrame, frameRange, imageFormat, indent, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, onFrameUpdate, onStart, outputDir, port, puppeteerInstance, scale, server, timeoutInMilliseconds, logLevel, webpackBundleOrServeUrl, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, parallelEncodingEnabled, binariesDirectory, forSeamlessAacConcatenation, compositionStart, onBrowserDownload, onArtifact, }) => {
416
+ const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency, envVariables, everyNthFrame, frameRange, imageFormat, indent, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, onFrameUpdate, onStart, outputDir, port, puppeteerInstance, scale, server, timeoutInMilliseconds, logLevel, webpackBundleOrServeUrl, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, parallelEncodingEnabled, binariesDirectory, forSeamlessAacConcatenation, compositionStart, onBrowserDownload, onArtifact, chromeMode, }) => {
417
417
  (0, validate_1.validateDimension)(composition.height, 'height', 'in the `config` object passed to `renderFrames()`');
418
418
  (0, validate_1.validateDimension)(composition.width, 'width', 'in the `config` object passed to `renderFrames()`');
419
419
  (0, validate_1.validateFps)(composition.fps, 'in the `config` object of `renderFrames()`', false);
@@ -432,6 +432,7 @@ const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOpti
432
432
  viewport: null,
433
433
  logLevel,
434
434
  onBrowserDownload,
435
+ chromeMode,
435
436
  });
436
437
  const browserInstance = puppeteerInstance !== null && puppeteerInstance !== void 0 ? puppeteerInstance : makeBrowser();
437
438
  const resolvedConcurrency = (0, get_concurrency_1.resolveConcurrency)(concurrency);
@@ -507,6 +508,7 @@ const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOpti
507
508
  compositionStart,
508
509
  onBrowserDownload,
509
510
  onArtifact,
511
+ chromeMode,
510
512
  });
511
513
  }),
512
514
  ])
@@ -555,7 +557,7 @@ exports.internalRenderFrames = (0, wrap_with_error_handling_1.wrapWithErrorHandl
555
557
  * @see [Documentation](https://www.remotion.dev/docs/renderer/render-frames)
556
558
  */
557
559
  const renderFrames = (options) => {
558
- const { composition, inputProps, onFrameUpdate, onStart, outputDir, serveUrl, browserExecutable, cancelSignal, chromiumOptions, concurrency, dumpBrowserLogs, envVariables, everyNthFrame, frameRange, imageFormat, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, port, puppeteerInstance, scale, timeoutInMilliseconds, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, binariesDirectory, onBrowserDownload, onArtifact, } = options;
560
+ const { composition, inputProps, onFrameUpdate, onStart, outputDir, serveUrl, browserExecutable, cancelSignal, chromiumOptions, concurrency, dumpBrowserLogs, envVariables, everyNthFrame, frameRange, imageFormat, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, port, puppeteerInstance, scale, timeoutInMilliseconds, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, binariesDirectory, onBrowserDownload, onArtifact, chromeMode, } = options;
559
561
  if (!composition) {
560
562
  throw new Error('No `composition` option has been specified for renderFrames()');
561
563
  }
@@ -610,6 +612,7 @@ const renderFrames = (options) => {
610
612
  forSeamlessAacConcatenation: false,
611
613
  onBrowserDownload: onBrowserDownload !== null && onBrowserDownload !== void 0 ? onBrowserDownload : (0, browser_download_progress_bar_1.defaultBrowserDownloadProgress)({ indent, logLevel, api: 'renderFrames()' }),
612
614
  onArtifact: onArtifact !== null && onArtifact !== void 0 ? onArtifact : null,
615
+ chromeMode: chromeMode !== null && chromeMode !== void 0 ? chromeMode : 'headless-shell',
613
616
  });
614
617
  };
615
618
  exports.renderFrames = renderFrames;
@@ -128,5 +128,5 @@ type RenderMediaResult = {
128
128
  slowestFrames: SlowFrame[];
129
129
  };
130
130
  export declare const internalRenderMedia: (args_0: InternalRenderMediaOptions) => Promise<RenderMediaResult>;
131
- export declare const renderMedia: ({ proResProfile, x264Preset, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, jpegQuality, concurrency, serveUrl, disallowParallelEncoding, everyNthFrame, imageFormat, numberOfGifLoops, dumpBrowserLogs, preferLossless, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, }: RenderMediaOptions) => Promise<RenderMediaResult>;
131
+ export declare const renderMedia: ({ proResProfile, x264Preset, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, jpegQuality, concurrency, serveUrl, disallowParallelEncoding, everyNthFrame, imageFormat, numberOfGifLoops, dumpBrowserLogs, preferLossless, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, chromeMode, }: RenderMediaOptions) => Promise<RenderMediaResult>;
132
132
  export {};
@@ -50,7 +50,7 @@ const validate_scale_1 = require("./validate-scale");
50
50
  const validate_videobitrate_1 = require("./validate-videobitrate");
51
51
  const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
52
52
  const SLOWEST_FRAME_COUNT = 10;
53
- const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, serializedInputPropsWithCustomSchema, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, concurrency, disallowParallelEncoding, everyNthFrame, imageFormat: provisionalImageFormat, indent, jpegQuality, numberOfGifLoops, onCtrlCExit, preferLossless, serveUrl, server: reusedServer, logLevel, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, compositionStart, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, }) => {
53
+ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, serializedInputPropsWithCustomSchema, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, concurrency, disallowParallelEncoding, everyNthFrame, imageFormat: provisionalImageFormat, indent, jpegQuality, numberOfGifLoops, onCtrlCExit, preferLossless, serveUrl, server: reusedServer, logLevel, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, compositionStart, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, chromeMode, }) => {
54
54
  if (repro) {
55
55
  (0, repro_1.enableRepro)({
56
56
  serveUrl,
@@ -361,6 +361,7 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, s
361
361
  forSeamlessAacConcatenation,
362
362
  onBrowserDownload,
363
363
  onArtifact,
364
+ chromeMode,
364
365
  });
365
366
  return renderFramesProc;
366
367
  })
@@ -505,7 +506,7 @@ exports.internalRenderMedia = (0, wrap_with_error_handling_1.wrapWithErrorHandli
505
506
  * @description Render a video or an audio programmatically.
506
507
  * @see [Documentation](https://www.remotion.dev/docs/renderer/render-media)
507
508
  */
508
- const renderMedia = ({ proResProfile, x264Preset, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, jpegQuality, concurrency, serveUrl, disallowParallelEncoding, everyNthFrame, imageFormat, numberOfGifLoops, dumpBrowserLogs, preferLossless, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, }) => {
509
+ const renderMedia = ({ proResProfile, x264Preset, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, jpegQuality, concurrency, serveUrl, disallowParallelEncoding, everyNthFrame, imageFormat, numberOfGifLoops, dumpBrowserLogs, preferLossless, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, chromeMode, }) => {
509
510
  var _a, _b;
510
511
  const indent = false;
511
512
  const logLevel = verbose || dumpBrowserLogs ? 'verbose' : (passedLogLevel !== null && passedLogLevel !== void 0 ? passedLogLevel : 'info');
@@ -570,12 +571,17 @@ const renderMedia = ({ proResProfile, x264Preset, crf, composition, inputProps,
570
571
  binariesDirectory: binariesDirectory !== null && binariesDirectory !== void 0 ? binariesDirectory : null,
571
572
  separateAudioTo: separateAudioTo !== null && separateAudioTo !== void 0 ? separateAudioTo : null,
572
573
  forSeamlessAacConcatenation: forSeamlessAacConcatenation !== null && forSeamlessAacConcatenation !== void 0 ? forSeamlessAacConcatenation : false,
573
- onBrowserDownload: onBrowserDownload !== null && onBrowserDownload !== void 0 ? onBrowserDownload : (0, browser_download_progress_bar_1.defaultBrowserDownloadProgress)({ indent, logLevel, api: 'renderMedia()' }),
574
+ onBrowserDownload: onBrowserDownload !== null && onBrowserDownload !== void 0 ? onBrowserDownload : (0, browser_download_progress_bar_1.defaultBrowserDownloadProgress)({
575
+ indent,
576
+ logLevel,
577
+ api: 'renderMedia()',
578
+ }),
574
579
  onArtifact: onArtifact !== null && onArtifact !== void 0 ? onArtifact : null,
575
580
  metadata: metadata !== null && metadata !== void 0 ? metadata : null,
576
581
  // TODO: In the future, introduce this as a public API when launching the distributed rendering API
577
582
  compositionStart: 0,
578
583
  hardwareAcceleration: hardwareAcceleration !== null && hardwareAcceleration !== void 0 ? hardwareAcceleration : 'disable',
584
+ chromeMode: chromeMode !== null && chromeMode !== void 0 ? chromeMode : 'headless-shell',
579
585
  });
580
586
  };
581
587
  exports.renderMedia = renderMedia;
@@ -53,7 +53,7 @@ const validate_1 = require("./validate");
53
53
  const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
54
54
  const validate_scale_1 = require("./validate-scale");
55
55
  const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
56
- const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFAULT_STILL_IMAGE_FORMAT, serveUrl, puppeteerInstance, onError, serializedInputPropsWithCustomSchema, envVariables, output, frame = 0, overwrite, browserExecutable, timeoutInMilliseconds, chromiumOptions, scale, proxyPort, cancelSignal, jpegQuality, onBrowserLog, sourceMapGetter, logLevel, indent, serializedResolvedPropsWithCustomSchema, onBrowserDownload, onArtifact, }) => {
56
+ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFAULT_STILL_IMAGE_FORMAT, serveUrl, puppeteerInstance, onError, serializedInputPropsWithCustomSchema, envVariables, output, frame = 0, overwrite, browserExecutable, timeoutInMilliseconds, chromiumOptions, scale, proxyPort, cancelSignal, jpegQuality, onBrowserLog, sourceMapGetter, logLevel, indent, serializedResolvedPropsWithCustomSchema, onBrowserDownload, onArtifact, chromeMode, }) => {
57
57
  (0, validate_1.validateDimension)(composition.height, 'height', 'in the `config` object passed to `renderStill()`');
58
58
  (0, validate_1.validateDimension)(composition.width, 'width', 'in the `config` object passed to `renderStill()`');
59
59
  (0, validate_1.validateFps)(composition.fps, 'in the `config` object of `renderStill()`', false);
@@ -97,6 +97,7 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
97
97
  viewport: null,
98
98
  logLevel,
99
99
  onBrowserDownload,
100
+ chromeMode,
100
101
  }));
101
102
  const page = await browserInstance.newPage(sourceMapGetter, logLevel, indent);
102
103
  await page.setViewport({
@@ -270,7 +271,7 @@ exports.internalRenderStill = (0, wrap_with_error_handling_1.wrapWithErrorHandli
270
271
  */
271
272
  const renderStill = (options) => {
272
273
  var _a, _b;
273
- const { composition, serveUrl, browserExecutable, cancelSignal, chromiumOptions, dumpBrowserLogs, envVariables, frame, imageFormat, inputProps, jpegQuality, onBrowserLog, onDownload, output, overwrite, port, puppeteerInstance, scale, timeoutInMilliseconds, verbose, quality, offthreadVideoCacheSizeInBytes, logLevel: passedLogLevel, binariesDirectory, onBrowserDownload, onArtifact, } = options;
274
+ const { composition, serveUrl, browserExecutable, cancelSignal, chromiumOptions, dumpBrowserLogs, envVariables, frame, imageFormat, inputProps, jpegQuality, onBrowserLog, onDownload, output, overwrite, port, puppeteerInstance, scale, timeoutInMilliseconds, verbose, quality, offthreadVideoCacheSizeInBytes, logLevel: passedLogLevel, binariesDirectory, onBrowserDownload, onArtifact, chromeMode, } = options;
274
275
  if (typeof jpegQuality !== 'undefined' && imageFormat !== 'jpeg') {
275
276
  throw new Error("You can only pass the `quality` option if `imageFormat` is 'jpeg'.");
276
277
  }
@@ -312,8 +313,13 @@ const renderStill = (options) => {
312
313
  }).serializedString,
313
314
  offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes !== null && offthreadVideoCacheSizeInBytes !== void 0 ? offthreadVideoCacheSizeInBytes : null,
314
315
  binariesDirectory: binariesDirectory !== null && binariesDirectory !== void 0 ? binariesDirectory : null,
315
- onBrowserDownload: onBrowserDownload !== null && onBrowserDownload !== void 0 ? onBrowserDownload : (0, browser_download_progress_bar_1.defaultBrowserDownloadProgress)({ indent, logLevel, api: 'renderStill()' }),
316
+ onBrowserDownload: onBrowserDownload !== null && onBrowserDownload !== void 0 ? onBrowserDownload : (0, browser_download_progress_bar_1.defaultBrowserDownloadProgress)({
317
+ indent,
318
+ logLevel,
319
+ api: 'renderStill()',
320
+ }),
316
321
  onArtifact: onArtifact !== null && onArtifact !== void 0 ? onArtifact : null,
322
+ chromeMode: chromeMode !== null && chromeMode !== void 0 ? chromeMode : 'headless-shell',
317
323
  });
318
324
  };
319
325
  exports.renderStill = renderStill;
@@ -96,7 +96,7 @@ const innerSelectComposition = async ({ page, onBrowserLog, serializedInputProps
96
96
  };
97
97
  const internalSelectCompositionRaw = async (options) => {
98
98
  const cleanup = [];
99
- const { puppeteerInstance, browserExecutable, chromiumOptions, serveUrl: serveUrlOrWebpackUrl, logLevel, indent, port, envVariables, id, serializedInputPropsWithCustomSchema, onBrowserLog, server, timeoutInMilliseconds, offthreadVideoCacheSizeInBytes, binariesDirectory, onBrowserDownload, onServeUrlVisited, } = options;
99
+ const { puppeteerInstance, browserExecutable, chromiumOptions, serveUrl: serveUrlOrWebpackUrl, logLevel, indent, port, envVariables, id, serializedInputPropsWithCustomSchema, onBrowserLog, server, timeoutInMilliseconds, offthreadVideoCacheSizeInBytes, binariesDirectory, onBrowserDownload, onServeUrlVisited, chromeMode, } = options;
100
100
  const [{ page, cleanupPage }, serverUsed] = await Promise.all([
101
101
  (0, get_browser_instance_1.getPageAndCleanupFn)({
102
102
  passedInInstance: puppeteerInstance,
@@ -106,6 +106,7 @@ const internalSelectCompositionRaw = async (options) => {
106
106
  indent,
107
107
  logLevel,
108
108
  onBrowserDownload,
109
+ chromeMode,
109
110
  }),
110
111
  (0, prepare_server_1.makeOrReuseServer)(options.server, {
111
112
  webpackConfigOrServeUrl: serveUrlOrWebpackUrl,
@@ -152,6 +153,7 @@ const internalSelectCompositionRaw = async (options) => {
152
153
  binariesDirectory,
153
154
  onBrowserDownload,
154
155
  onServeUrlVisited,
156
+ chromeMode,
155
157
  })
156
158
  .then((data) => {
157
159
  return resolve(data);
@@ -177,7 +179,7 @@ exports.internalSelectComposition = (0, wrap_with_error_handling_1.wrapWithError
177
179
  * @see [Documentation](https://www.remotion.dev/docs/renderer/select-composition)
178
180
  */
179
181
  const selectComposition = async (options) => {
180
- const { id, serveUrl, browserExecutable, chromiumOptions, envVariables, inputProps, onBrowserLog, port, puppeteerInstance, timeoutInMilliseconds, verbose, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, binariesDirectory, onBrowserDownload, } = options;
182
+ const { id, serveUrl, browserExecutable, chromiumOptions, envVariables, inputProps, onBrowserLog, port, puppeteerInstance, timeoutInMilliseconds, verbose, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, binariesDirectory, onBrowserDownload, chromeMode, } = options;
181
183
  const indent = false;
182
184
  const logLevel = (passedLogLevel !== null && passedLogLevel !== void 0 ? passedLogLevel : verbose) ? 'verbose' : 'info';
183
185
  const data = await (0, exports.internalSelectComposition)({
@@ -206,6 +208,7 @@ const selectComposition = async (options) => {
206
208
  api: 'selectComposition()',
207
209
  }),
208
210
  onServeUrlVisited: () => undefined,
211
+ chromeMode: chromeMode !== null && chromeMode !== void 0 ? chromeMode : 'headless-shell',
209
212
  });
210
213
  return data.metadata;
211
214
  };
@@ -1,17 +1,19 @@
1
1
  import type { BrowserExecutable } from './browser-executable';
2
2
  import type { LogLevel } from './log-level';
3
3
  import type { ChromiumOptions } from './open-browser';
4
+ import type { ChromeMode } from './options/chrome-mode';
4
5
  import type { OnBrowserDownload } from './options/on-browser-download';
5
6
  type Item = {
6
7
  feature: string;
7
8
  status: string;
8
9
  };
9
- export declare const getChromiumGpuInformation: ({ browserExecutable, indent, logLevel, chromiumOptions, timeoutInMilliseconds, onBrowserDownload, }: {
10
+ export declare const getChromiumGpuInformation: ({ browserExecutable, indent, logLevel, chromiumOptions, timeoutInMilliseconds, onBrowserDownload, chromeMode, }: {
10
11
  browserExecutable: BrowserExecutable;
11
12
  indent: boolean;
12
13
  logLevel: LogLevel;
13
14
  chromiumOptions: ChromiumOptions;
14
15
  timeoutInMilliseconds: number;
15
16
  onBrowserDownload: OnBrowserDownload;
17
+ chromeMode: ChromeMode;
16
18
  }) => Promise<Item[]>;
17
19
  export {};
package/dist/test-gpu.js CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getChromiumGpuInformation = void 0;
4
4
  const get_browser_instance_1 = require("./get-browser-instance");
5
5
  const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
6
- const getChromiumGpuInformation = async ({ browserExecutable, indent, logLevel, chromiumOptions, timeoutInMilliseconds, onBrowserDownload, }) => {
6
+ const getChromiumGpuInformation = async ({ browserExecutable, indent, logLevel, chromiumOptions, timeoutInMilliseconds, onBrowserDownload, chromeMode, }) => {
7
7
  const { page, cleanupPage: cleanup } = await (0, get_browser_instance_1.getPageAndCleanupFn)({
8
8
  passedInInstance: undefined,
9
9
  browserExecutable,
@@ -12,6 +12,7 @@ const getChromiumGpuInformation = async ({ browserExecutable, indent, logLevel,
12
12
  indent,
13
13
  logLevel,
14
14
  onBrowserDownload,
15
+ chromeMode,
15
16
  });
16
17
  await page.goto({ url: 'chrome://gpu', timeout: 12000 });
17
18
  const { value } = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
@@ -2545,7 +2545,7 @@ var require_extract_zip = __commonJS((exports, module) => {
2545
2545
  });
2546
2546
 
2547
2547
  // src/ensure-browser.ts
2548
- import fs5 from "fs";
2548
+ import fs4 from "fs";
2549
2549
 
2550
2550
  // src/browser/BrowserFetcher.ts
2551
2551
  var import_extract_zip = __toESM(require_extract_zip(), 1);
@@ -3055,12 +3055,19 @@ var TESTED_VERSION = "123.0.6312.86";
3055
3055
  var PLAYWRIGHT_VERSION = "1105";
3056
3056
  function getChromeDownloadUrl({
3057
3057
  platform: platform2,
3058
- version
3058
+ version,
3059
+ chromeMode
3059
3060
  }) {
3060
3061
  if (platform2 === "linux-arm64") {
3062
+ if (chromeMode === "chrome-for-testing") {
3063
+ throw new Error(`chromeMode: 'chrome-for-testing' is not supported on platform linux-arm64`);
3064
+ }
3061
3065
  return `https://playwright.azureedge.net/builds/chromium/${version ?? PLAYWRIGHT_VERSION}/chromium-linux-arm64.zip`;
3062
3066
  }
3063
- return `https://storage.googleapis.com/chrome-for-testing-public/${version ?? TESTED_VERSION}/${platform2}/chrome-headless-shell-${platform2}.zip`;
3067
+ if (chromeMode === "headless-shell") {
3068
+ return `https://storage.googleapis.com/chrome-for-testing-public/${version ?? TESTED_VERSION}/${platform2}/chrome-headless-shell-${platform2}.zip`;
3069
+ }
3070
+ return `https://storage.googleapis.com/chrome-for-testing-public/${version ?? TESTED_VERSION}/${platform2}/chrome-${platform2}.zip`;
3064
3071
  }
3065
3072
  var mkdirAsync = fs3.promises.mkdir;
3066
3073
  var unlinkAsync = promisify(fs3.unlink.bind(fs3));
@@ -3084,27 +3091,28 @@ var getPlatform = () => {
3084
3091
  throw new Error("Unsupported platform: " + platform2);
3085
3092
  }
3086
3093
  };
3087
- var destination = "chrome-headless-shell";
3088
- var getDownloadsFolder = () => {
3094
+ var getDownloadsFolder = (chromeMode) => {
3095
+ const destination = chromeMode === "headless-shell" ? "chrome-headless-shell" : "chrome-for-testing";
3089
3096
  return path3.join(getDownloadsCacheDir(), destination);
3090
3097
  };
3091
3098
  var downloadBrowser = async ({
3092
3099
  logLevel,
3093
3100
  indent,
3094
3101
  onProgress,
3095
- version
3102
+ version,
3103
+ chromeMode
3096
3104
  }) => {
3097
3105
  const platform2 = getPlatform();
3098
- const downloadURL = getChromeDownloadUrl({ platform: platform2, version });
3106
+ const downloadURL = getChromeDownloadUrl({ platform: platform2, version, chromeMode });
3099
3107
  const fileName = downloadURL.split("/").pop();
3100
3108
  if (!fileName) {
3101
3109
  throw new Error(`A malformed download URL was found: ${downloadURL}.`);
3102
3110
  }
3103
- const downloadsFolder = getDownloadsFolder();
3111
+ const downloadsFolder = getDownloadsFolder(chromeMode);
3104
3112
  const archivePath = path3.join(downloadsFolder, fileName);
3105
3113
  const outputPath = getFolderPath(downloadsFolder, platform2);
3106
3114
  if (await existsAsync(outputPath)) {
3107
- return getRevisionInfo();
3115
+ return getRevisionInfo(chromeMode);
3108
3116
  }
3109
3117
  if (!await existsAsync(downloadsFolder)) {
3110
3118
  await mkdirAsync(downloadsFolder, {
@@ -3149,25 +3157,40 @@ var downloadBrowser = async ({
3149
3157
  await unlinkAsync(archivePath);
3150
3158
  }
3151
3159
  }
3152
- const revisionInfo = getRevisionInfo();
3160
+ const revisionInfo = getRevisionInfo(chromeMode);
3153
3161
  makeFileExecutableIfItIsNot(revisionInfo.executablePath);
3154
3162
  return revisionInfo;
3155
3163
  };
3156
3164
  var getFolderPath = (downloadsFolder, platform2) => {
3157
3165
  return path3.resolve(downloadsFolder, platform2);
3158
3166
  };
3159
- var getExecutablePath = () => {
3160
- const downloadsFolder = getDownloadsFolder();
3167
+ var getExecutablePath = (chromeMode) => {
3168
+ const downloadsFolder = getDownloadsFolder(chromeMode);
3161
3169
  const platform2 = getPlatform();
3162
3170
  const folderPath = getFolderPath(downloadsFolder, platform2);
3163
- return path3.join(folderPath, `chrome-headless-shell-${platform2}`, platform2 === "win64" ? "chrome-headless-shell.exe" : "chrome-headless-shell");
3171
+ if (chromeMode === "chrome-for-testing") {
3172
+ if (platform2 === "mac-arm64" || platform2 === "mac-x64") {
3173
+ return path3.join(folderPath, `chrome-${platform2}`, "Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing");
3174
+ }
3175
+ if (platform2 === "win64") {
3176
+ return path3.join(folderPath, "chrome-win64", "chrome.exe");
3177
+ }
3178
+ if (platform2 === "linux64" || platform2 === "linux-arm64") {
3179
+ return path3.join(folderPath, "chrome-linux64", "chrome");
3180
+ }
3181
+ throw new Error("unsupported platform" + platform2);
3182
+ }
3183
+ if (chromeMode === "headless-shell") {
3184
+ return path3.join(folderPath, `chrome-headless-shell-${platform2}`, platform2 === "win64" ? "chrome-headless-shell.exe" : "chrome-headless-shell");
3185
+ }
3186
+ throw new Error("unsupported chrome mode" + chromeMode);
3164
3187
  };
3165
- var getRevisionInfo = () => {
3166
- const executablePath = getExecutablePath();
3167
- const downloadsFolder = getDownloadsFolder();
3188
+ var getRevisionInfo = (chromeMode) => {
3189
+ const executablePath = getExecutablePath(chromeMode);
3190
+ const downloadsFolder = getDownloadsFolder(chromeMode);
3168
3191
  const platform2 = getPlatform();
3169
3192
  const folderPath = getFolderPath(downloadsFolder, platform2);
3170
- const url = getChromeDownloadUrl({ platform: platform2, version: null });
3193
+ const url = getChromeDownloadUrl({ platform: platform2, version: null, chromeMode });
3171
3194
  const local = fs3.existsSync(folderPath);
3172
3195
  return {
3173
3196
  executablePath,
@@ -3188,68 +3211,62 @@ var defaultBrowserDownloadProgress = ({
3188
3211
  indent,
3189
3212
  logLevel,
3190
3213
  api
3191
- }) => () => {
3192
- Log.info({ indent, logLevel }, "Downloading Chrome Headless Shell https://www.remotion.dev/docs/miscellaneous/chrome-headless-shell");
3214
+ }) => ({ chromeMode }) => {
3215
+ if (chromeMode === "chrome-for-testing") {
3216
+ Log.info({ indent, logLevel }, "Downloading Chrome for Testing https://www.remotion.dev/docs/miscellaneous/chrome-headless-shell");
3217
+ } else {
3218
+ Log.info({ indent, logLevel }, "Downloading Chrome Headless Shell https://www.remotion.dev/docs/miscellaneous/chrome-headless-shell");
3219
+ }
3193
3220
  Log.info({ indent, logLevel }, `Customize this behavior by adding a onBrowserDownload function to ${api}.`);
3194
3221
  let lastProgress = 0;
3195
3222
  return {
3196
3223
  onProgress: (progress) => {
3197
3224
  if (progress.downloadedBytes > lastProgress + 1e7 || progress.percent === 1) {
3198
3225
  lastProgress = progress.downloadedBytes;
3199
- Log.info({ indent, logLevel }, `Downloading Chrome Headless Shell - ${toMegabytes(progress.downloadedBytes)}/${toMegabytes(progress.totalSizeInBytes)}`);
3226
+ if (chromeMode === "chrome-for-testing") {
3227
+ Log.info({ indent, logLevel }, `Downloading Chrome for Testing - ${toMegabytes(progress.downloadedBytes)}/${toMegabytes(progress.totalSizeInBytes)}`);
3228
+ } else {
3229
+ Log.info({ indent, logLevel }, `Downloading Chrome Headless Shell - ${toMegabytes(progress.downloadedBytes)}/${toMegabytes(progress.totalSizeInBytes)}`);
3230
+ }
3200
3231
  }
3201
3232
  },
3202
3233
  version: null
3203
3234
  };
3204
3235
  };
3205
3236
 
3206
- // src/get-local-browser.ts
3207
- import fs4 from "fs";
3208
- var getSearchPathsForProduct = () => {
3209
- return [];
3210
- };
3211
- var getLocalBrowser = () => {
3212
- for (const p of getSearchPathsForProduct()) {
3213
- if (fs4.existsSync(p)) {
3214
- return p;
3215
- }
3216
- }
3217
- return null;
3218
- };
3219
-
3220
3237
  // src/ensure-browser.ts
3221
3238
  var currentEnsureBrowserOperation = Promise.resolve();
3222
3239
  var internalEnsureBrowserUncapped = async ({
3223
3240
  indent,
3224
3241
  logLevel,
3225
3242
  browserExecutable,
3226
- onBrowserDownload
3243
+ onBrowserDownload,
3244
+ chromeMode
3227
3245
  }) => {
3228
- const status = getBrowserStatus(browserExecutable);
3246
+ const status = getBrowserStatus({ browserExecutable, chromeMode });
3229
3247
  if (status.type === "no-browser") {
3230
- const { onProgress, version } = onBrowserDownload();
3231
- await downloadBrowser({ indent, logLevel, onProgress, version });
3248
+ const { onProgress, version } = onBrowserDownload({ chromeMode });
3249
+ await downloadBrowser({ indent, logLevel, onProgress, version, chromeMode });
3232
3250
  }
3233
- const newStatus = getBrowserStatus(browserExecutable);
3251
+ const newStatus = getBrowserStatus({ browserExecutable, chromeMode });
3234
3252
  return newStatus;
3235
3253
  };
3236
3254
  var internalEnsureBrowser = (options) => {
3237
3255
  currentEnsureBrowserOperation = currentEnsureBrowserOperation.then(() => internalEnsureBrowserUncapped(options));
3238
3256
  return currentEnsureBrowserOperation;
3239
3257
  };
3240
- var getBrowserStatus = (browserExecutable) => {
3258
+ var getBrowserStatus = ({
3259
+ browserExecutable,
3260
+ chromeMode
3261
+ }) => {
3241
3262
  if (browserExecutable) {
3242
- if (!fs5.existsSync(browserExecutable)) {
3263
+ if (!fs4.existsSync(browserExecutable)) {
3243
3264
  throw new Error(`"browserExecutable" was specified as '${browserExecutable}' but the path doesn't exist. Pass "null" for "browserExecutable" to download a browser automatically.`);
3244
3265
  }
3245
3266
  return { path: browserExecutable, type: "user-defined-path" };
3246
3267
  }
3247
- const localBrowser = getLocalBrowser();
3248
- if (localBrowser !== null) {
3249
- return { path: localBrowser, type: "local-browser" };
3250
- }
3251
- const revision = getRevisionInfo();
3252
- if (revision.local && fs5.existsSync(revision.executablePath)) {
3268
+ const revision = getRevisionInfo(chromeMode);
3269
+ if (revision.local && fs4.existsSync(revision.executablePath)) {
3253
3270
  return { path: revision.executablePath, type: "local-puppeteer-browser" };
3254
3271
  }
3255
3272
  return { type: "no-browser" };
@@ -3265,7 +3282,8 @@ var ensureBrowser = (options) => {
3265
3282
  api: "ensureBrowser()",
3266
3283
  indent: false,
3267
3284
  logLevel
3268
- })
3285
+ }),
3286
+ chromeMode: options?.chromeMode ?? "headless-shell"
3269
3287
  });
3270
3288
  };
3271
3289
  export {
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.246",
6
+ "version": "4.0.248",
7
7
  "description": "Render Remotion videos using Node.js or Bun",
8
8
  "main": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
@@ -18,8 +18,8 @@
18
18
  "extract-zip": "2.0.1",
19
19
  "source-map": "^0.8.0-beta.0",
20
20
  "ws": "8.17.1",
21
- "remotion": "4.0.246",
22
- "@remotion/streaming": "4.0.246"
21
+ "remotion": "4.0.248",
22
+ "@remotion/streaming": "4.0.248"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "react": ">=16.8.0",
@@ -33,17 +33,17 @@
33
33
  "react-dom": "19.0.0",
34
34
  "@types/ws": "8.5.10",
35
35
  "eslint": "9.14.0",
36
- "@remotion/example-videos": "4.0.246",
37
- "@remotion/eslint-config-internal": "4.0.246"
36
+ "@remotion/example-videos": "4.0.248",
37
+ "@remotion/eslint-config-internal": "4.0.248"
38
38
  },
39
39
  "optionalDependencies": {
40
- "@remotion/compositor-darwin-arm64": "4.0.246",
41
- "@remotion/compositor-linux-arm64-gnu": "4.0.246",
42
- "@remotion/compositor-linux-x64-gnu": "4.0.246",
43
- "@remotion/compositor-linux-arm64-musl": "4.0.246",
44
- "@remotion/compositor-win32-x64-msvc": "4.0.246",
45
- "@remotion/compositor-linux-x64-musl": "4.0.246",
46
- "@remotion/compositor-darwin-x64": "4.0.246"
40
+ "@remotion/compositor-darwin-x64": "4.0.248",
41
+ "@remotion/compositor-darwin-arm64": "4.0.248",
42
+ "@remotion/compositor-linux-arm64-gnu": "4.0.248",
43
+ "@remotion/compositor-linux-arm64-musl": "4.0.248",
44
+ "@remotion/compositor-linux-x64-musl": "4.0.248",
45
+ "@remotion/compositor-win32-x64-msvc": "4.0.248",
46
+ "@remotion/compositor-linux-x64-gnu": "4.0.248"
47
47
  },
48
48
  "keywords": [
49
49
  "remotion",
@@ -1 +0,0 @@
1
- export declare const getLocalBrowser: () => null;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getLocalBrowser = void 0;
7
- const fs_1 = __importDefault(require("fs"));
8
- const getSearchPathsForProduct = () => {
9
- return [];
10
- };
11
- const getLocalBrowser = () => {
12
- for (const p of getSearchPathsForProduct()) {
13
- if (fs_1.default.existsSync(p)) {
14
- return p;
15
- }
16
- }
17
- return null;
18
- };
19
- exports.getLocalBrowser = getLocalBrowser;