@remotion/renderer 4.0.227 → 4.0.229

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 (46) 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 +50 -3
  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 +7 -41
  15. package/dist/index.js +0 -2
  16. package/dist/logger.d.ts +4 -4
  17. package/dist/logger.js +19 -1
  18. package/dist/options/gl.d.ts +1 -1
  19. package/dist/options/hardware-acceleration.d.ts +18 -0
  20. package/dist/options/hardware-acceleration.js +56 -0
  21. package/dist/options/index.d.ts +17 -2
  22. package/dist/options/index.js +2 -0
  23. package/dist/options/metadata.d.ts +1 -1
  24. package/dist/options/options-map.d.ts +30 -0
  25. package/dist/options/options-map.js +3 -0
  26. package/dist/options/webhook-custom-data.d.ts +1 -1
  27. package/dist/prespawn-ffmpeg.d.ts +2 -0
  28. package/dist/prespawn-ffmpeg.js +3 -0
  29. package/dist/provide-screenshot.d.ts +1 -3
  30. package/dist/provide-screenshot.js +1 -2
  31. package/dist/puppeteer-screenshot.d.ts +0 -2
  32. package/dist/puppeteer-screenshot.js +0 -1
  33. package/dist/render-frames.js +4 -7
  34. package/dist/render-media.d.ts +1 -1
  35. package/dist/render-media.js +6 -2
  36. package/dist/render-still.js +4 -8
  37. package/dist/screenshot-dom-element.d.ts +1 -3
  38. package/dist/screenshot-dom-element.js +1 -2
  39. package/dist/screenshot-task.d.ts +1 -3
  40. package/dist/screenshot-task.js +8 -16
  41. package/dist/stitch-frames-to-video.d.ts +2 -2
  42. package/dist/stitch-frames-to-video.js +7 -2
  43. package/dist/take-frame.d.ts +18 -0
  44. package/dist/take-frame.js +34 -0
  45. package/ensure-browser.mjs +13 -1
  46. package/package.json +12 -11
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hardwareAccelerationOption = exports.getHardwareAcceleration = exports.hardwareAccelerationOptions = void 0;
4
+ exports.hardwareAccelerationOptions = [
5
+ 'disable',
6
+ 'if-possible',
7
+ 'required',
8
+ ];
9
+ const cliFlag = 'hardware-acceleration';
10
+ let currentValue = null;
11
+ const getHardwareAcceleration = () => {
12
+ return currentValue;
13
+ };
14
+ exports.getHardwareAcceleration = getHardwareAcceleration;
15
+ exports.hardwareAccelerationOption = {
16
+ name: 'Hardware Acceleration',
17
+ cliFlag,
18
+ description: () => `
19
+ One of
20
+ ${new Intl.ListFormat('en', { type: 'disjunction' }).format(exports.hardwareAccelerationOptions.map((a) => JSON.stringify(a)))}
21
+ . Default "disable". Encode using a hardware-accelerated encoder if
22
+ available. If set to "required" and no hardware-accelerated encoder is
23
+ available, then the render will fail.
24
+ `,
25
+ ssrName: 'hardwareAcceleration',
26
+ docLink: 'https://www.remotion.dev/docs/encoding',
27
+ type: 'disable',
28
+ getValue: ({ commandLine }) => {
29
+ if (commandLine[cliFlag] !== undefined) {
30
+ const value = commandLine[cliFlag];
31
+ if (!exports.hardwareAccelerationOptions.includes(value)) {
32
+ throw new Error(`Invalid value for --${cliFlag}: ${value}`);
33
+ }
34
+ return {
35
+ source: 'cli',
36
+ value,
37
+ };
38
+ }
39
+ if (currentValue !== null) {
40
+ return {
41
+ source: 'config',
42
+ value: currentValue,
43
+ };
44
+ }
45
+ return {
46
+ source: 'default',
47
+ value: 'disable',
48
+ };
49
+ },
50
+ setConfig: (value) => {
51
+ if (!exports.hardwareAccelerationOptions.includes(value)) {
52
+ throw new Error(`Invalid value for --${cliFlag}: ${value}`);
53
+ }
54
+ currentValue = value;
55
+ },
56
+ };
@@ -171,7 +171,7 @@ export declare const allOptions: {
171
171
  webhookCustomDataOption: {
172
172
  name: string;
173
173
  cliFlag: "webhook-custom-data";
174
- description: (type: "cli" | "ssr") => import("react/jsx-runtime").JSX.Element;
174
+ description: (type: "ssr" | "cli") => import("react/jsx-runtime").JSX.Element;
175
175
  ssrName: "customData";
176
176
  docLink: string;
177
177
  type: Record<string, unknown> | null;
@@ -584,7 +584,7 @@ export declare const allOptions: {
584
584
  metadataOption: {
585
585
  name: string;
586
586
  cliFlag: "metadata";
587
- description: (mode: "cli" | "ssr") => import("react/jsx-runtime").JSX.Element;
587
+ description: (mode: "ssr" | "cli") => import("react/jsx-runtime").JSX.Element;
588
588
  docLink: string;
589
589
  type: import("./metadata").Metadata;
590
590
  getValue: ({ commandLine }: {
@@ -598,6 +598,21 @@ export declare const allOptions: {
598
598
  setConfig: (newMetadata: import("./metadata").Metadata) => void;
599
599
  ssrName: string;
600
600
  };
601
+ hardwareAccelerationOption: {
602
+ name: string;
603
+ cliFlag: "hardware-acceleration";
604
+ description: () => string;
605
+ ssrName: string;
606
+ docLink: string;
607
+ type: import("./hardware-acceleration").HardwareAccelerationOption;
608
+ getValue: ({ commandLine }: {
609
+ commandLine: Record<string, unknown>;
610
+ }) => {
611
+ source: string;
612
+ value: "disable" | "if-possible" | "required";
613
+ };
614
+ setConfig: (value: import("./hardware-acceleration").HardwareAccelerationOption) => void;
615
+ };
601
616
  };
602
617
  export type AvailableOptions = keyof typeof allOptions;
603
618
  export type TypeOfOption<Type> = Type extends AnyRemotionOption<infer X> ? X : never;
@@ -17,6 +17,7 @@ const enforce_audio_1 = require("./enforce-audio");
17
17
  const folder_expiry_1 = require("./folder-expiry");
18
18
  const for_seamless_aac_concatenation_1 = require("./for-seamless-aac-concatenation");
19
19
  const gl_1 = require("./gl");
20
+ const hardware_acceleration_1 = require("./hardware-acceleration");
20
21
  const headless_1 = require("./headless");
21
22
  const jpeg_quality_1 = require("./jpeg-quality");
22
23
  const log_level_1 = require("./log-level");
@@ -76,4 +77,5 @@ exports.allOptions = {
76
77
  throwIfSiteExistsOption: throw_if_site_exists_1.throwIfSiteExistsOption,
77
78
  disableGitSourceOption: disable_git_source_1.disableGitSourceOption,
78
79
  metadataOption: metadata_1.metadataOption,
80
+ hardwareAccelerationOption: hardware_acceleration_1.hardwareAccelerationOption,
79
81
  };
@@ -2,7 +2,7 @@ export type Metadata = Record<string, string>;
2
2
  export declare const metadataOption: {
3
3
  name: string;
4
4
  cliFlag: "metadata";
5
- description: (mode: "cli" | "ssr") => import("react/jsx-runtime").JSX.Element;
5
+ description: (mode: "ssr" | "cli") => import("react/jsx-runtime").JSX.Element;
6
6
  docLink: string;
7
7
  type: Metadata;
8
8
  getValue: ({ commandLine }: {
@@ -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,7 +1,7 @@
1
1
  export declare const webhookCustomDataOption: {
2
2
  name: string;
3
3
  cliFlag: "webhook-custom-data";
4
- description: (type: "cli" | "ssr") => import("react/jsx-runtime").JSX.Element;
4
+ description: (type: "ssr" | "cli") => import("react/jsx-runtime").JSX.Element;
5
5
  ssrName: "customData";
6
6
  docLink: string;
7
7
  type: Record<string, unknown> | null;
@@ -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
+ }>;