@remotion/renderer 4.0.227 → 4.0.228

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 (42) hide show
  1. package/dist/assets/download-map.d.ts +0 -3
  2. package/dist/assets/download-map.js +0 -1
  3. package/dist/client.d.ts +48 -1
  4. package/dist/client.js +2 -0
  5. package/dist/compositor/compose.d.ts +1 -21
  6. package/dist/compositor/compose.js +1 -33
  7. package/dist/compositor/payloads.d.ts +0 -35
  8. package/dist/crf.d.ts +4 -2
  9. package/dist/crf.js +12 -6
  10. package/dist/ffmpeg-args.d.ts +6 -1
  11. package/dist/ffmpeg-args.js +14 -5
  12. package/dist/get-codec-name.d.ts +5 -1
  13. package/dist/get-codec-name.js +38 -15
  14. package/dist/index.d.ts +5 -5
  15. package/dist/logger.d.ts +4 -4
  16. package/dist/logger.js +19 -1
  17. package/dist/options/hardware-acceleration.d.ts +18 -0
  18. package/dist/options/hardware-acceleration.js +56 -0
  19. package/dist/options/index.d.ts +15 -0
  20. package/dist/options/index.js +2 -0
  21. package/dist/options/options-map.d.ts +30 -0
  22. package/dist/options/options-map.js +3 -0
  23. package/dist/prespawn-ffmpeg.d.ts +2 -0
  24. package/dist/prespawn-ffmpeg.js +3 -0
  25. package/dist/provide-screenshot.d.ts +1 -3
  26. package/dist/provide-screenshot.js +1 -2
  27. package/dist/puppeteer-screenshot.d.ts +0 -2
  28. package/dist/puppeteer-screenshot.js +0 -1
  29. package/dist/render-frames.js +4 -7
  30. package/dist/render-media.d.ts +1 -1
  31. package/dist/render-media.js +6 -2
  32. package/dist/render-still.js +4 -8
  33. package/dist/screenshot-dom-element.d.ts +1 -3
  34. package/dist/screenshot-dom-element.js +1 -2
  35. package/dist/screenshot-task.d.ts +1 -3
  36. package/dist/screenshot-task.js +8 -16
  37. package/dist/stitch-frames-to-video.d.ts +2 -2
  38. package/dist/stitch-frames-to-video.js +7 -2
  39. package/dist/take-frame.d.ts +18 -0
  40. package/dist/take-frame.js +34 -0
  41. package/ensure-browser.mjs +13 -1
  42. package/package.json +11 -11
@@ -313,6 +313,21 @@ export declare const optionsMap: {
313
313
  getValue: () => never;
314
314
  setConfig: () => never;
315
315
  };
316
+ readonly hardwareAcceleration: {
317
+ name: string;
318
+ cliFlag: "hardware-acceleration";
319
+ description: () => string;
320
+ ssrName: string;
321
+ docLink: string;
322
+ type: import("./hardware-acceleration").HardwareAccelerationOption;
323
+ getValue: ({ commandLine }: {
324
+ commandLine: Record<string, unknown>;
325
+ }) => {
326
+ source: string;
327
+ value: "disable" | "if-possible" | "required";
328
+ };
329
+ setConfig: (value: import("./hardware-acceleration").HardwareAccelerationOption) => void;
330
+ };
316
331
  };
317
332
  readonly stitchFramesToVideo: {
318
333
  readonly separateAudioTo: {
@@ -333,6 +348,21 @@ export declare const optionsMap: {
333
348
  ssrName: string;
334
349
  type: string | null;
335
350
  };
351
+ readonly hardwareAcceleration: {
352
+ name: string;
353
+ cliFlag: "hardware-acceleration";
354
+ description: () => string;
355
+ ssrName: string;
356
+ docLink: string;
357
+ type: import("./hardware-acceleration").HardwareAccelerationOption;
358
+ getValue: ({ commandLine }: {
359
+ commandLine: Record<string, unknown>;
360
+ }) => {
361
+ source: string;
362
+ value: "disable" | "if-possible" | "required";
363
+ };
364
+ setConfig: (value: import("./hardware-acceleration").HardwareAccelerationOption) => void;
365
+ };
336
366
  };
337
367
  readonly renderStill: {
338
368
  readonly offthreadVideoCacheSizeInBytes: {
@@ -11,6 +11,7 @@ const encoding_buffer_size_1 = require("./encoding-buffer-size");
11
11
  const encoding_max_rate_1 = require("./encoding-max-rate");
12
12
  const enforce_audio_1 = require("./enforce-audio");
13
13
  const for_seamless_aac_concatenation_1 = require("./for-seamless-aac-concatenation");
14
+ const hardware_acceleration_1 = require("./hardware-acceleration");
14
15
  const jpeg_quality_1 = require("./jpeg-quality");
15
16
  const log_level_1 = require("./log-level");
16
17
  const mute_1 = require("./mute");
@@ -47,9 +48,11 @@ exports.optionsMap = {
47
48
  separateAudioTo: separate_audio_1.separateAudioOption,
48
49
  audioCodec: audio_codec_1.audioCodecOption,
49
50
  onBrowserDownload: on_browser_download_1.onBrowserDownloadOption,
51
+ hardwareAcceleration: hardware_acceleration_1.hardwareAccelerationOption,
50
52
  },
51
53
  stitchFramesToVideo: {
52
54
  separateAudioTo: separate_audio_1.separateAudioOption,
55
+ hardwareAcceleration: hardware_acceleration_1.hardwareAccelerationOption,
53
56
  },
54
57
  renderStill: {
55
58
  offthreadVideoCacheSizeInBytes: offthreadvideo_cache_size_1.offthreadVideoCacheSizeInBytesOption,
@@ -1,3 +1,4 @@
1
+ import type { HardwareAccelerationOption } from './client';
1
2
  import type { Codec } from './codec';
2
3
  import type { FfmpegOverrideFn } from './ffmpeg-override';
3
4
  import type { VideoImageFormat } from './image-format';
@@ -38,6 +39,7 @@ type PreStitcherOptions = {
38
39
  indent: boolean;
39
40
  colorSpace: ColorSpace | null;
40
41
  binariesDirectory: string | null;
42
+ hardwareAcceleration: HardwareAccelerationOption;
41
43
  };
42
44
  export declare const prespawnFfmpeg: (options: PreStitcherOptions) => {
43
45
  task: import("execa").ExecaChildProcess<string>;
@@ -47,6 +47,9 @@ const prespawnFfmpeg = (options) => {
47
47
  encodingMaxRate: options.encodingMaxRate,
48
48
  encodingBufferSize: options.encodingBufferSize,
49
49
  colorSpace: options.colorSpace,
50
+ hardwareAcceleration: options.hardwareAcceleration,
51
+ indent: options.indent,
52
+ logLevel: options.logLevel,
50
53
  }),
51
54
  '-y',
52
55
  options.outputLocation,
@@ -1,7 +1,6 @@
1
- import type { ClipRegion } from 'remotion/no-react';
2
1
  import type { Page } from './browser/BrowserPage';
3
2
  import type { StillImageFormat } from './image-format';
4
- export declare const provideScreenshot: ({ page, imageFormat, options, jpegQuality, height, width, clipRegion, timeoutInMilliseconds, scale, }: {
3
+ export declare const provideScreenshot: ({ page, imageFormat, options, jpegQuality, height, width, timeoutInMilliseconds, scale, }: {
5
4
  page: Page;
6
5
  imageFormat: StillImageFormat;
7
6
  jpegQuality: number | undefined;
@@ -11,7 +10,6 @@ export declare const provideScreenshot: ({ page, imageFormat, options, jpegQuali
11
10
  };
12
11
  height: number;
13
12
  width: number;
14
- clipRegion: ClipRegion | null;
15
13
  timeoutInMilliseconds: number;
16
14
  scale: number;
17
15
  }) => Promise<Buffer>;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.provideScreenshot = void 0;
4
4
  const screenshot_dom_element_1 = require("./screenshot-dom-element");
5
- const provideScreenshot = ({ page, imageFormat, options, jpegQuality, height, width, clipRegion, timeoutInMilliseconds, scale, }) => {
5
+ const provideScreenshot = ({ page, imageFormat, options, jpegQuality, height, width, timeoutInMilliseconds, scale, }) => {
6
6
  return (0, screenshot_dom_element_1.screenshotDOMElement)({
7
7
  page,
8
8
  opts: {
@@ -12,7 +12,6 @@ const provideScreenshot = ({ page, imageFormat, options, jpegQuality, height, wi
12
12
  jpegQuality,
13
13
  height,
14
14
  width,
15
- clipRegion,
16
15
  timeoutInMilliseconds,
17
16
  scale,
18
17
  });
@@ -1,4 +1,3 @@
1
- import type { ClipRegion } from 'remotion/no-react';
2
1
  import type { Page } from './browser/BrowserPage';
3
2
  import type { StillImageFormat } from './image-format';
4
3
  export declare const screenshot: (options: {
@@ -9,6 +8,5 @@ export declare const screenshot: (options: {
9
8
  omitBackground: boolean;
10
9
  width: number;
11
10
  height: number;
12
- clipRegion: ClipRegion | null;
13
11
  scale: number;
14
12
  }) => Promise<Buffer | string>;
@@ -42,7 +42,6 @@ const screenshot = (options) => {
42
42
  omitBackground: options.omitBackground,
43
43
  path: options.path,
44
44
  jpegQuality: options.type === 'jpeg' ? options.jpegQuality : undefined,
45
- clipRegion: options.clipRegion,
46
45
  scale: options.scale,
47
46
  }));
48
47
  };
@@ -35,13 +35,13 @@ const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
35
35
  const replace_browser_1 = require("./replace-browser");
36
36
  const seek_to_frame_1 = require("./seek-to-frame");
37
37
  const set_props_and_env_1 = require("./set-props-and-env");
38
- const take_frame_and_compose_1 = require("./take-frame-and-compose");
38
+ const take_frame_1 = require("./take-frame");
39
39
  const truthy_1 = require("./truthy");
40
40
  const validate_1 = require("./validate");
41
41
  const validate_scale_1 = require("./validate-scale");
42
42
  const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
43
43
  const MAX_RETRIES_PER_FRAME = 1;
44
- const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, jpegQuality, imageFormat, frameRange, onError, envVariables, onBrowserLog, onFrameBuffer, onDownload, pagesArray, serveUrl, composition, timeoutInMilliseconds, scale, resolvedConcurrency, everyNthFrame, proxyPort, cancelSignal, downloadMap, muted, makeBrowser, browserReplacer, compositor, sourceMapGetter, logLevel, indent, parallelEncodingEnabled, compositionStart, forSeamlessAacConcatenation, onArtifact, binariesDirectory, }) => {
44
+ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, jpegQuality, imageFormat, frameRange, onError, envVariables, onBrowserLog, onFrameBuffer, onDownload, pagesArray, serveUrl, composition, timeoutInMilliseconds, scale, resolvedConcurrency, everyNthFrame, proxyPort, cancelSignal, downloadMap, muted, makeBrowser, browserReplacer, sourceMapGetter, logLevel, indent, parallelEncodingEnabled, compositionStart, forSeamlessAacConcatenation, onArtifact, binariesDirectory, }) => {
45
45
  if (outputDir) {
46
46
  if (!node_fs_1.default.existsSync(outputDir)) {
47
47
  node_fs_1.default.mkdirSync(outputDir, {
@@ -191,7 +191,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
191
191
  throw new Error('Pass either `outputDir` or `onFrameBuffer` to renderFrames(), not both.');
192
192
  }
193
193
  const id = (0, perf_1.startPerfMeasure)('save');
194
- const { buffer, collectedAssets } = await (0, take_frame_and_compose_1.takeFrameAndCompose)({
194
+ const { buffer, collectedAssets } = await (0, take_frame_1.takeFrame)({
195
195
  frame,
196
196
  freePage,
197
197
  height,
@@ -209,9 +209,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
209
209
  jpegQuality,
210
210
  width,
211
211
  scale,
212
- downloadMap,
213
212
  wantsBuffer: Boolean(onFrameBuffer),
214
- compositor,
215
213
  timeoutInMilliseconds,
216
214
  });
217
215
  if (onFrameBuffer && !assetsOnly) {
@@ -465,7 +463,7 @@ const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOpti
465
463
  }),
466
464
  browserInstance,
467
465
  ]).then(([{ server: openedServer, cleanupServer }, pInstance]) => {
468
- const { serveUrl, offthreadPort, compositor, sourceMap, downloadMap } = openedServer;
466
+ const { serveUrl, offthreadPort, sourceMap, downloadMap } = openedServer;
469
467
  const browserReplacer = (0, replace_browser_1.handleBrowserCrash)(pInstance, logLevel, indent);
470
468
  const cycle = (0, cycle_browser_tabs_1.cycleBrowserTabs)(browserReplacer, resolvedConcurrency, logLevel, indent);
471
469
  cleanup.push(() => {
@@ -483,7 +481,6 @@ const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOpti
483
481
  proxyPort: offthreadPort,
484
482
  makeBrowser,
485
483
  browserReplacer,
486
- compositor,
487
484
  sourceMapGetter: sourceMap,
488
485
  downloadMap,
489
486
  cancelSignal,
@@ -135,5 +135,5 @@ export declare const internalRenderMedia: (args_0: InternalRenderMediaOptions) =
135
135
  * @returns {Promise<RenderMediaResult>} A promise that resolves to the rendering result, including a buffer and information about the slowest frames.
136
136
  *
137
137
  */
138
- 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, }: RenderMediaOptions) => Promise<RenderMediaResult>;
138
+ 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>;
139
139
  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, }) => {
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, }) => {
54
54
  if (repro) {
55
55
  (0, repro_1.enableRepro)({
56
56
  serveUrl,
@@ -69,6 +69,7 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, s
69
69
  videoBitrate,
70
70
  encodingMaxRate,
71
71
  encodingBufferSize,
72
+ hardwareAcceleration,
72
73
  });
73
74
  (0, validate_videobitrate_1.validateBitrate)(audioBitrate, 'audioBitrate');
74
75
  (0, validate_videobitrate_1.validateBitrate)(videoBitrate, 'videoBitrate');
@@ -228,6 +229,7 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, s
228
229
  x264Preset: x264Preset !== null && x264Preset !== void 0 ? x264Preset : null,
229
230
  colorSpace,
230
231
  binariesDirectory,
232
+ hardwareAcceleration,
231
233
  });
232
234
  stitcherFfmpeg = preStitcher.task;
233
235
  }
@@ -422,6 +424,7 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, s
422
424
  binariesDirectory,
423
425
  separateAudioTo,
424
426
  metadata,
427
+ hardwareAcceleration,
425
428
  });
426
429
  })
427
430
  .then((buffer) => {
@@ -505,7 +508,7 @@ exports.internalRenderMedia = (0, wrap_with_error_handling_1.wrapWithErrorHandli
505
508
  * @returns {Promise<RenderMediaResult>} A promise that resolves to the rendering result, including a buffer and information about the slowest frames.
506
509
  *
507
510
  */
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, }) => {
511
+ 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
512
  var _a, _b;
510
513
  const indent = false;
511
514
  const logLevel = verbose || dumpBrowserLogs ? 'verbose' : (passedLogLevel !== null && passedLogLevel !== void 0 ? passedLogLevel : 'info');
@@ -575,6 +578,7 @@ const renderMedia = ({ proResProfile, x264Preset, crf, composition, inputProps,
575
578
  metadata: metadata !== null && metadata !== void 0 ? metadata : null,
576
579
  // TODO: In the future, introduce this as a public API when launching the distributed rendering API
577
580
  compositionStart: 0,
581
+ hardwareAcceleration: hardwareAcceleration !== null && hardwareAcceleration !== void 0 ? hardwareAcceleration : 'disable',
578
582
  });
579
583
  };
580
584
  exports.renderMedia = renderMedia;
@@ -48,12 +48,12 @@ const prepare_server_1 = require("./prepare-server");
48
48
  const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
49
49
  const seek_to_frame_1 = require("./seek-to-frame");
50
50
  const set_props_and_env_1 = require("./set-props-and-env");
51
- const take_frame_and_compose_1 = require("./take-frame-and-compose");
51
+ const take_frame_1 = require("./take-frame");
52
52
  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, compositor, sourceMapGetter, downloadMap, 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, }) => {
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);
@@ -189,7 +189,7 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
189
189
  logLevel,
190
190
  attempt: 0,
191
191
  });
192
- const { buffer, collectedAssets } = await (0, take_frame_and_compose_1.takeFrameAndCompose)({
192
+ const { buffer, collectedAssets } = await (0, take_frame_1.takeFrame)({
193
193
  frame: stillFrame,
194
194
  freePage: page,
195
195
  height: composition.height,
@@ -199,8 +199,6 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
199
199
  output,
200
200
  jpegQuality,
201
201
  wantsBuffer: !output,
202
- compositor,
203
- downloadMap,
204
202
  timeoutInMilliseconds,
205
203
  });
206
204
  const artifactAssets = (0, filter_asset_types_1.onlyArtifact)(collectedAssets);
@@ -236,15 +234,13 @@ const internalRenderStillRaw = (options) => {
236
234
  })
237
235
  .then(({ server, cleanupServer }) => {
238
236
  cleanup.push(() => cleanupServer(false));
239
- const { serveUrl, offthreadPort, compositor, sourceMap: sourceMapGetter, downloadMap, } = server;
237
+ const { serveUrl, offthreadPort, sourceMap: sourceMapGetter } = server;
240
238
  return innerRenderStill({
241
239
  ...options,
242
240
  serveUrl,
243
241
  onError,
244
242
  proxyPort: offthreadPort,
245
- compositor,
246
243
  sourceMapGetter,
247
- downloadMap,
248
244
  });
249
245
  })
250
246
  .then((res) => resolve(res))
@@ -1,7 +1,6 @@
1
- import type { ClipRegion } from 'remotion/no-react';
2
1
  import type { Page } from './browser/BrowserPage';
3
2
  import type { StillImageFormat } from './image-format';
4
- export declare const screenshotDOMElement: ({ page, imageFormat, jpegQuality, opts, height, width, clipRegion, timeoutInMilliseconds, scale, }: {
3
+ export declare const screenshotDOMElement: ({ page, imageFormat, jpegQuality, opts, height, width, timeoutInMilliseconds, scale, }: {
5
4
  page: Page;
6
5
  imageFormat: StillImageFormat;
7
6
  jpegQuality: number | undefined;
@@ -10,7 +9,6 @@ export declare const screenshotDOMElement: ({ page, imageFormat, jpegQuality, op
10
9
  };
11
10
  height: number;
12
11
  width: number;
13
- clipRegion: ClipRegion | null;
14
12
  timeoutInMilliseconds: number;
15
13
  scale: number;
16
14
  }) => Promise<Buffer>;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.screenshotDOMElement = void 0;
4
4
  const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
5
5
  const puppeteer_screenshot_1 = require("./puppeteer-screenshot");
6
- const screenshotDOMElement = async ({ page, imageFormat, jpegQuality, opts, height, width, clipRegion, timeoutInMilliseconds, scale, }) => {
6
+ const screenshotDOMElement = async ({ page, imageFormat, jpegQuality, opts, height, width, timeoutInMilliseconds, scale, }) => {
7
7
  const { path } = opts;
8
8
  if (imageFormat === 'png' ||
9
9
  imageFormat === 'pdf' ||
@@ -41,7 +41,6 @@ const screenshotDOMElement = async ({ page, imageFormat, jpegQuality, opts, heig
41
41
  jpegQuality,
42
42
  width,
43
43
  height,
44
- clipRegion,
45
44
  scale,
46
45
  });
47
46
  if (typeof buf === 'string') {
@@ -1,7 +1,6 @@
1
- import type { ClipRegion } from 'remotion/no-react';
2
1
  import type { Page } from './browser/BrowserPage';
3
2
  import type { StillImageFormat } from './image-format';
4
- export declare const screenshotTask: ({ format, height, omitBackground, page, width, path, jpegQuality, clipRegion, scale, }: {
3
+ export declare const screenshotTask: ({ format, height, omitBackground, page, width, path, jpegQuality, scale, }: {
5
4
  page: Page;
6
5
  format: StillImageFormat;
7
6
  path?: string;
@@ -9,6 +8,5 @@ export declare const screenshotTask: ({ format, height, omitBackground, page, wi
9
8
  omitBackground: boolean;
10
9
  width: number;
11
10
  height: number;
12
- clipRegion: ClipRegion | null;
13
11
  scale: number;
14
12
  }) => Promise<Buffer | string>;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.screenshotTask = void 0;
7
7
  const node_fs_1 = __importDefault(require("node:fs"));
8
8
  const perf_1 = require("./perf");
9
- const screenshotTask = async ({ format, height, omitBackground, page, width, path, jpegQuality, clipRegion, scale, }) => {
9
+ const screenshotTask = async ({ format, height, omitBackground, page, width, path, jpegQuality, scale, }) => {
10
10
  var _a;
11
11
  const client = page._client();
12
12
  const target = page.target();
@@ -49,21 +49,13 @@ const screenshotTask = async ({ format, height, omitBackground, page, width, pat
49
49
  const { value } = await client.send('Page.captureScreenshot', {
50
50
  format,
51
51
  quality: jpegQuality,
52
- clip: clipRegion !== null && clipRegion !== 'hide'
53
- ? {
54
- x: clipRegion.x,
55
- y: clipRegion.y,
56
- height: clipRegion.height,
57
- scale: 1,
58
- width: clipRegion.width,
59
- }
60
- : {
61
- x: 0,
62
- y: 0,
63
- height: height * scaleFactor,
64
- scale: 1,
65
- width: width * scaleFactor,
66
- },
52
+ clip: {
53
+ x: 0,
54
+ y: 0,
55
+ height: height * scaleFactor,
56
+ scale: 1,
57
+ width: width * scaleFactor,
58
+ },
67
59
  captureBeyondViewport: true,
68
60
  optimizeForSpeed: true,
69
61
  fromSurface,
@@ -41,7 +41,7 @@ type InternalStitchFramesToVideoOptions = {
41
41
  ffmpegOverride: null | FfmpegOverrideFn;
42
42
  colorSpace: ColorSpace | null;
43
43
  binariesDirectory: string | null;
44
- metadata?: Record<string, string> | null;
44
+ metadata: Record<string, string> | null;
45
45
  } & ToOptions<typeof optionsMap.stitchFramesToVideo>;
46
46
  export type StitchFramesToVideoOptions = {
47
47
  fps: number;
@@ -79,5 +79,5 @@ export declare const internalStitchFramesToVideo: (options: InternalStitchFrames
79
79
  * @param {StitchFramesToVideoOptions} options The configuration options for stitching frames into a video
80
80
  * @returns {Promise<Buffer | null>} A promise that resolves with the video buffer or null if the output was written to a file
81
81
  */
82
- export declare const stitchFramesToVideo: ({ assetsInfo, force, fps, height, width, audioBitrate, audioCodec, cancelSignal, codec, crf, enforceAudioTrack, ffmpegOverride, muted, numberOfGifLoops, onDownload, onProgress, outputLocation, pixelFormat, proResProfile, verbose, videoBitrate, maxRate, bufferSize, x264Preset, colorSpace, binariesDirectory, separateAudioTo, metadata, }: StitchFramesToVideoOptions) => Promise<Buffer | null>;
82
+ export declare const stitchFramesToVideo: ({ assetsInfo, force, fps, height, width, audioBitrate, audioCodec, cancelSignal, codec, crf, enforceAudioTrack, ffmpegOverride, muted, numberOfGifLoops, onDownload, onProgress, outputLocation, pixelFormat, proResProfile, verbose, videoBitrate, maxRate, bufferSize, x264Preset, colorSpace, binariesDirectory, separateAudioTo, metadata, hardwareAcceleration, }: StitchFramesToVideoOptions) => Promise<Buffer | null>;
83
83
  export {};
@@ -30,7 +30,7 @@ const render_has_audio_1 = require("./render-has-audio");
30
30
  const validate_1 = require("./validate");
31
31
  const validate_even_dimensions_with_codec_1 = require("./validate-even-dimensions-with-codec");
32
32
  const validate_videobitrate_1 = require("./validate-videobitrate");
33
- const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec: audioCodecSetting, cancelSignal, codec, crf, enforceAudioTrack, ffmpegOverride, force, fps, height, indent, muted, onDownload, outputLocation, pixelFormat, preEncodedFileLocation, preferLossless, proResProfile, logLevel, videoBitrate, maxRate, bufferSize, width, numberOfGifLoops, onProgress, x264Preset, colorSpace, binariesDirectory, separateAudioTo, metadata, }, remotionRoot) => {
33
+ const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec: audioCodecSetting, cancelSignal, codec, crf, enforceAudioTrack, ffmpegOverride, force, fps, height, indent, muted, onDownload, outputLocation, pixelFormat, preEncodedFileLocation, preferLossless, proResProfile, logLevel, videoBitrate, maxRate, bufferSize, width, numberOfGifLoops, onProgress, x264Preset, colorSpace, binariesDirectory, separateAudioTo, metadata, hardwareAcceleration, }, remotionRoot) => {
34
34
  var _a;
35
35
  (0, validate_1.validateDimension)(height, 'height', 'passed to `stitchFramesToVideo()`');
36
36
  (0, validate_1.validateDimension)(width, 'width', 'passed to `stitchFramesToVideo()`');
@@ -108,6 +108,7 @@ const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec:
108
108
  videoBitrate,
109
109
  encodingMaxRate: maxRate,
110
110
  encodingBufferSize: bufferSize,
111
+ hardwareAcceleration,
111
112
  });
112
113
  (0, pixel_format_1.validateSelectedPixelFormatAndCodecCombination)(pixelFormat, codec);
113
114
  const updateProgress = (muxProgress) => {
@@ -197,6 +198,9 @@ const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec:
197
198
  pixelFormat,
198
199
  x264Preset,
199
200
  colorSpace,
201
+ hardwareAcceleration,
202
+ indent,
203
+ logLevel,
200
204
  }),
201
205
  codec === 'h264' ? ['-movflags', 'faststart'] : null,
202
206
  // Ignore metadata that may come from remote media
@@ -305,7 +309,7 @@ exports.internalStitchFramesToVideo = internalStitchFramesToVideo;
305
309
  * @param {StitchFramesToVideoOptions} options The configuration options for stitching frames into a video
306
310
  * @returns {Promise<Buffer | null>} A promise that resolves with the video buffer or null if the output was written to a file
307
311
  */
308
- const stitchFramesToVideo = ({ assetsInfo, force, fps, height, width, audioBitrate, audioCodec, cancelSignal, codec, crf, enforceAudioTrack, ffmpegOverride, muted, numberOfGifLoops, onDownload, onProgress, outputLocation, pixelFormat, proResProfile, verbose, videoBitrate, maxRate, bufferSize, x264Preset, colorSpace, binariesDirectory, separateAudioTo, metadata, }) => {
312
+ const stitchFramesToVideo = ({ assetsInfo, force, fps, height, width, audioBitrate, audioCodec, cancelSignal, codec, crf, enforceAudioTrack, ffmpegOverride, muted, numberOfGifLoops, onDownload, onProgress, outputLocation, pixelFormat, proResProfile, verbose, videoBitrate, maxRate, bufferSize, x264Preset, colorSpace, binariesDirectory, separateAudioTo, metadata, hardwareAcceleration, }) => {
309
313
  return (0, exports.internalStitchFramesToVideo)({
310
314
  assetsInfo,
311
315
  audioBitrate: audioBitrate !== null && audioBitrate !== void 0 ? audioBitrate : null,
@@ -338,6 +342,7 @@ const stitchFramesToVideo = ({ assetsInfo, force, fps, height, width, audioBitra
338
342
  binariesDirectory: binariesDirectory !== null && binariesDirectory !== void 0 ? binariesDirectory : null,
339
343
  metadata: metadata !== null && metadata !== void 0 ? metadata : null,
340
344
  separateAudioTo: separateAudioTo !== null && separateAudioTo !== void 0 ? separateAudioTo : null,
345
+ hardwareAcceleration: hardwareAcceleration !== null && hardwareAcceleration !== void 0 ? hardwareAcceleration : 'disable',
341
346
  });
342
347
  };
343
348
  exports.stitchFramesToVideo = stitchFramesToVideo;
@@ -0,0 +1,18 @@
1
+ import type { TRenderAsset } from 'remotion/no-react';
2
+ import type { Page } from './browser/BrowserPage';
3
+ import type { StillImageFormat, VideoImageFormat } from './image-format';
4
+ export declare const takeFrame: ({ freePage, imageFormat, jpegQuality, frame, width, height, output, scale, wantsBuffer, timeoutInMilliseconds, }: {
5
+ freePage: Page;
6
+ imageFormat: VideoImageFormat | StillImageFormat;
7
+ jpegQuality: number | undefined;
8
+ frame: number;
9
+ height: number;
10
+ width: number;
11
+ output: string | null;
12
+ scale: number;
13
+ wantsBuffer: boolean;
14
+ timeoutInMilliseconds: number;
15
+ }) => Promise<{
16
+ buffer: Buffer | null;
17
+ collectedAssets: TRenderAsset[];
18
+ }>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.takeFrame = void 0;
4
+ const collect_assets_1 = require("./collect-assets");
5
+ const provide_screenshot_1 = require("./provide-screenshot");
6
+ const takeFrame = async ({ freePage, imageFormat, jpegQuality, frame, width, height, output, scale, wantsBuffer, timeoutInMilliseconds, }) => {
7
+ const collectedAssets = await (0, collect_assets_1.collectAssets)({
8
+ frame,
9
+ freePage,
10
+ timeoutInMilliseconds,
11
+ });
12
+ if (imageFormat === 'none') {
13
+ return { buffer: null, collectedAssets };
14
+ }
15
+ const shouldMakeBuffer = wantsBuffer;
16
+ const buf = await (0, provide_screenshot_1.provideScreenshot)({
17
+ page: freePage,
18
+ imageFormat,
19
+ jpegQuality,
20
+ options: {
21
+ frame,
22
+ output: wantsBuffer ? null : output,
23
+ },
24
+ height,
25
+ width,
26
+ timeoutInMilliseconds,
27
+ scale,
28
+ });
29
+ if (shouldMakeBuffer) {
30
+ return { buffer: buf, collectedAssets };
31
+ }
32
+ return { buffer: null, collectedAssets };
33
+ };
34
+ exports.takeFrame = takeFrame;
@@ -2743,6 +2743,9 @@ var Log = {
2743
2743
  verbose: (options, ...args) => {
2744
2744
  writeInRepro("verbose", ...args);
2745
2745
  if (isEqualOrBelowLogLevel(options.logLevel, "verbose")) {
2746
+ if (args.length === 0) {
2747
+ return process.stdout.write("\n");
2748
+ }
2746
2749
  return console.log(...[
2747
2750
  options.indent ? INDENT_TOKEN : null,
2748
2751
  options.tag ? verboseTag(options.tag) : null
@@ -2752,18 +2755,27 @@ var Log = {
2752
2755
  info: (options, ...args) => {
2753
2756
  writeInRepro("info", ...args);
2754
2757
  if (isEqualOrBelowLogLevel(options.logLevel, "info")) {
2755
- return console.log(...[options.indent ? INDENT_TOKEN : null].filter(truthy).concat(args));
2758
+ if (args.length === 0) {
2759
+ return process.stdout.write("\n");
2760
+ }
2761
+ return console.log(...[options.indent ? INDENT_TOKEN : null].filter(truthy).concat(args ?? []));
2756
2762
  }
2757
2763
  },
2758
2764
  warn: (options, ...args) => {
2759
2765
  writeInRepro("warn", ...args);
2760
2766
  if (isEqualOrBelowLogLevel(options.logLevel, "warn")) {
2767
+ if (args.length === 0) {
2768
+ return process.stdout.write("\n");
2769
+ }
2761
2770
  return console.warn(...[options.indent ? chalk.yellow(INDENT_TOKEN) : null].filter(truthy).concat(args.map((a) => chalk.yellow(a))));
2762
2771
  }
2763
2772
  },
2764
2773
  error: (options, ...args) => {
2765
2774
  writeInRepro("error", ...args);
2766
2775
  if (isEqualOrBelowLogLevel(options.logLevel, "error")) {
2776
+ if (args.length === 0) {
2777
+ return process.stdout.write("\n");
2778
+ }
2767
2779
  return console.error(...[
2768
2780
  options.indent ? INDENT_TOKEN : null,
2769
2781
  options.tag ? verboseTag(options.tag) : null
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.227",
6
+ "version": "4.0.228",
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.227",
22
- "@remotion/streaming": "4.0.227"
21
+ "remotion": "4.0.228",
22
+ "@remotion/streaming": "4.0.228"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "react": ">=16.8.0",
@@ -33,16 +33,16 @@
33
33
  "react-dom": "18.3.1",
34
34
  "@types/ws": "8.5.10",
35
35
  "eslint": "9.14.0",
36
- "@remotion/eslint-config-internal": "4.0.227"
36
+ "@remotion/eslint-config-internal": "4.0.228"
37
37
  },
38
38
  "optionalDependencies": {
39
- "@remotion/compositor-darwin-x64": "4.0.227",
40
- "@remotion/compositor-darwin-arm64": "4.0.227",
41
- "@remotion/compositor-linux-arm64-gnu": "4.0.227",
42
- "@remotion/compositor-linux-x64-gnu": "4.0.227",
43
- "@remotion/compositor-win32-x64-msvc": "4.0.227",
44
- "@remotion/compositor-linux-arm64-musl": "4.0.227",
45
- "@remotion/compositor-linux-x64-musl": "4.0.227"
39
+ "@remotion/compositor-darwin-x64": "4.0.228",
40
+ "@remotion/compositor-linux-arm64-gnu": "4.0.228",
41
+ "@remotion/compositor-linux-arm64-musl": "4.0.228",
42
+ "@remotion/compositor-linux-x64-gnu": "4.0.228",
43
+ "@remotion/compositor-linux-x64-musl": "4.0.228",
44
+ "@remotion/compositor-win32-x64-msvc": "4.0.228",
45
+ "@remotion/compositor-darwin-arm64": "4.0.228"
46
46
  },
47
47
  "keywords": [
48
48
  "remotion",