@remotion/renderer 4.0.114 → 4.0.116

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 (94) hide show
  1. package/dist/browser/BrowserFetcher.js +1 -1
  2. package/dist/browser/BrowserPage.js +3 -3
  3. package/dist/browser/Connection.js +1 -1
  4. package/dist/check-apple-silicon.d.ts +3 -1
  5. package/dist/check-apple-silicon.js +32 -2
  6. package/dist/client.d.ts +1256 -14
  7. package/dist/client.js +3 -1
  8. package/dist/combine-videos.js +1 -1
  9. package/dist/ffmpeg-args.d.ts +1 -1
  10. package/dist/get-compositions.d.ts +1 -7
  11. package/dist/get-compositions.js +2 -2
  12. package/dist/get-extension-of-filename.js +2 -5
  13. package/dist/get-local-browser-executable.js +1 -1
  14. package/dist/index.d.ts +143 -16
  15. package/dist/index.js +0 -2
  16. package/dist/jpeg-quality.d.ts +1 -1
  17. package/dist/logger.d.ts +2 -6
  18. package/dist/logger.js +5 -23
  19. package/dist/options/audio-bitrate.d.ts +10 -0
  20. package/dist/options/audio-bitrate.js +25 -2
  21. package/dist/options/beep-on-finish.d.ts +7 -0
  22. package/dist/options/beep-on-finish.js +24 -1
  23. package/dist/options/color-space.d.ts +7 -0
  24. package/dist/options/color-space.js +23 -0
  25. package/dist/options/crf.d.ts +9 -0
  26. package/dist/options/crf.js +33 -2
  27. package/dist/options/delete-after.d.ts +12 -1
  28. package/dist/options/delete-after.js +25 -2
  29. package/dist/options/enable-lambda-insights.d.ts +7 -0
  30. package/dist/options/enable-lambda-insights.js +24 -1
  31. package/dist/options/enable-multiprocess-on-linux.d.ts +7 -0
  32. package/dist/options/enable-multiprocess-on-linux.js +24 -1
  33. package/dist/options/encoding-buffer-size.d.ts +10 -0
  34. package/dist/options/encoding-buffer-size.js +28 -1
  35. package/dist/options/encoding-max-rate.d.ts +10 -0
  36. package/dist/options/encoding-max-rate.js +24 -1
  37. package/dist/options/enforce-audio.d.ts +7 -0
  38. package/dist/options/enforce-audio.js +25 -1
  39. package/dist/options/folder-expiry.d.ts +7 -0
  40. package/dist/options/folder-expiry.js +24 -1
  41. package/dist/options/gl.d.ts +16 -4
  42. package/dist/options/gl.js +35 -3
  43. package/dist/options/headless.d.ts +15 -0
  44. package/dist/options/headless.js +36 -0
  45. package/dist/options/index.d.ts +259 -10
  46. package/dist/options/index.js +13 -3
  47. package/dist/options/jpeg-quality.d.ts +9 -0
  48. package/dist/options/jpeg-quality.js +37 -2
  49. package/dist/options/log-level.d.ts +16 -0
  50. package/dist/options/log-level.js +32 -0
  51. package/dist/options/mute.d.ts +9 -2
  52. package/dist/options/mute.js +27 -3
  53. package/dist/options/number-of-gif-loops.d.ts +11 -0
  54. package/dist/options/number-of-gif-loops.js +31 -1
  55. package/dist/options/offthreadvideo-cache-size.d.ts +12 -1
  56. package/dist/options/offthreadvideo-cache-size.js +30 -3
  57. package/dist/options/option.d.ts +11 -3
  58. package/dist/options/options-map.d.ts +997 -3
  59. package/dist/options/options-map.js +79 -12
  60. package/dist/options/overwrite.d.ts +15 -0
  61. package/dist/options/overwrite.js +42 -0
  62. package/dist/options/repro.d.ts +8 -1
  63. package/dist/options/repro.js +25 -1
  64. package/dist/options/scale.d.ts +7 -0
  65. package/dist/options/scale.js +30 -1
  66. package/dist/options/timeout.d.ts +15 -0
  67. package/dist/options/timeout.js +44 -0
  68. package/dist/options/video-bitrate.d.ts +9 -2
  69. package/dist/options/video-bitrate.js +27 -4
  70. package/dist/options/video-codec.d.ts +16 -1
  71. package/dist/options/video-codec.js +81 -2
  72. package/dist/options/webhook-custom-data.d.ts +3 -1
  73. package/dist/options/webhook-custom-data.js +8 -1
  74. package/dist/options/x264-preset.d.ts +20 -3
  75. package/dist/options/x264-preset.js +47 -7
  76. package/dist/path-normalize.d.ts +1 -0
  77. package/dist/path-normalize.js +133 -0
  78. package/dist/prespawn-ffmpeg.d.ts +1 -1
  79. package/dist/print-useful-error-message.d.ts +2 -1
  80. package/dist/print-useful-error-message.js +29 -29
  81. package/dist/render-frames.d.ts +1 -7
  82. package/dist/render-frames.js +1 -1
  83. package/dist/render-media.d.ts +0 -17
  84. package/dist/render-media.js +4 -4
  85. package/dist/render-still.d.ts +1 -7
  86. package/dist/render-still.js +2 -3
  87. package/dist/repro.js +6 -6
  88. package/dist/select-composition.d.ts +2 -8
  89. package/dist/stitch-frames-to-video.d.ts +1 -1
  90. package/dist/stitch-frames-to-video.js +1 -1
  91. package/dist/wrap-with-error-handling.js +1 -1
  92. package/package.json +9 -9
  93. package/dist/does-have-m2-bug.d.ts +0 -3
  94. package/dist/does-have-m2-bug.js +0 -12
@@ -1,12 +1,52 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.offthreadVideoCacheSizeInBytes = void 0;
3
+ exports.x264Option = exports.validateSelectedCodecAndPresetCombination = exports.x264PresetOptions = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- exports.offthreadVideoCacheSizeInBytes = {
5
+ exports.x264PresetOptions = [
6
+ 'ultrafast',
7
+ 'superfast',
8
+ 'veryfast',
9
+ 'faster',
10
+ 'fast',
11
+ 'medium',
12
+ 'slow',
13
+ 'slower',
14
+ 'veryslow',
15
+ 'placebo',
16
+ ];
17
+ let preset = null;
18
+ const validateSelectedCodecAndPresetCombination = ({ codec, x264Preset, }) => {
19
+ if (x264Preset !== null && codec !== 'h264' && codec !== 'h264-mkv') {
20
+ throw new TypeError(`You have set a x264 preset but the codec is "${codec}". Set the codec to "h264" or remove the Preset profile.`);
21
+ }
22
+ if (x264Preset !== null &&
23
+ !exports.x264PresetOptions.includes(x264Preset)) {
24
+ throw new TypeError(`The Preset profile "${x264Preset}" is not valid. Valid options are ${exports.x264PresetOptions
25
+ .map((p) => `"${p}"`)
26
+ .join(', ')}`);
27
+ }
28
+ };
29
+ exports.validateSelectedCodecAndPresetCombination = validateSelectedCodecAndPresetCombination;
30
+ const cliFlag = 'x264-preset';
31
+ const DEFAULT_PRESET = 'medium';
32
+ exports.x264Option = {
6
33
  name: 'x264 Preset',
7
- cliFlag: 'x264-preset',
8
- description: () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["From v4.0, Remotion has a cache for", ' ', (0, jsx_runtime_1.jsx)("a", { href: "https://remotion.dev/docs/offthreadvideo", children: (0, jsx_runtime_1.jsx)("code", { children: "<OffthreadVideo>" }) }), ' ', "frames. The default is ", (0, jsx_runtime_1.jsx)("code", { children: "null" }), ", corresponding to half of the system memory available when the render starts.", (0, jsx_runtime_1.jsx)("br", {}), " This option allows to override the size of the cache. The higher it is, the faster the render will be, but the more memory will be used.", (0, jsx_runtime_1.jsx)("br", {}), "The used value will be printed when running in verbose mode.", (0, jsx_runtime_1.jsx)("br", {}), "Default: ", (0, jsx_runtime_1.jsx)("code", { children: "null" })] })),
9
- ssrName: 'offthreadVideoCacheSizeInBytes',
10
- docLink: 'https://www.remotion.dev/docs/offthreadvideo',
11
- type: 0,
34
+ cliFlag,
35
+ description: () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Sets a x264 preset profile. Only applies to videos rendered with", ' ', (0, jsx_runtime_1.jsx)("code", { children: "h264" }), " codec.", (0, jsx_runtime_1.jsx)("br", {}), "Possible values: ", (0, jsx_runtime_1.jsx)("code", { children: "superfast" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "veryfast" }), ",", ' ', (0, jsx_runtime_1.jsx)("code", { children: "faster" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "fast" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "medium" }), ",", ' ', (0, jsx_runtime_1.jsx)("code", { children: "slow" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "slower" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "veryslow" }), ",", ' ', (0, jsx_runtime_1.jsx)("code", { children: "placebo" }), ".", (0, jsx_runtime_1.jsx)("br", {}), "Default: ", (0, jsx_runtime_1.jsx)("code", { children: DEFAULT_PRESET })] })),
36
+ ssrName: 'x264Preset',
37
+ docLink: 'https://www.remotion.dev/docs/renderer/render-media',
38
+ type: 'fast',
39
+ getValue: ({ commandLine }) => {
40
+ const value = commandLine[cliFlag];
41
+ if (typeof value !== 'undefined') {
42
+ return { value: value, source: 'cli' };
43
+ }
44
+ if (preset !== null) {
45
+ return { value: preset, source: 'config' };
46
+ }
47
+ return { value: null, source: 'default' };
48
+ },
49
+ setConfig: (profile) => {
50
+ preset = profile;
51
+ },
12
52
  };
@@ -0,0 +1 @@
1
+ export declare const pathNormalize: (p: string) => string;
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ // https://github.com/zacanger/path-normalize/blob/master/src/index.js
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.pathNormalize = void 0;
5
+ /**
6
+ * Copyright © 2022 Zac Anger
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
+
12
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13
+ */
14
+ /* eslint-disable max-depth, max-statements, complexity, max-lines-per-function */
15
+ const SLASH = 47;
16
+ const DOT = 46;
17
+ const assertPath = (path) => {
18
+ const t = typeof path;
19
+ if (t !== 'string') {
20
+ throw new TypeError(`Expected a string, got a ${t}`);
21
+ }
22
+ };
23
+ // this function is directly from node source
24
+ const posixNormalize = (path, allowAboveRoot) => {
25
+ let res = '';
26
+ let lastSegmentLength = 0;
27
+ let lastSlash = -1;
28
+ let dots = 0;
29
+ let code;
30
+ for (let i = 0; i <= path.length; ++i) {
31
+ if (i < path.length) {
32
+ code = path.charCodeAt(i);
33
+ }
34
+ else if (code === SLASH) {
35
+ break;
36
+ }
37
+ else {
38
+ code = SLASH;
39
+ }
40
+ if (code === SLASH) {
41
+ if (lastSlash === i - 1 || dots === 1) {
42
+ // NOOP
43
+ }
44
+ else if (lastSlash !== i - 1 && dots === 2) {
45
+ if (res.length < 2 ||
46
+ lastSegmentLength !== 2 ||
47
+ res.charCodeAt(res.length - 1) !== DOT ||
48
+ res.charCodeAt(res.length - 2) !== DOT) {
49
+ if (res.length > 2) {
50
+ const lastSlashIndex = res.lastIndexOf('/');
51
+ if (lastSlashIndex !== res.length - 1) {
52
+ if (lastSlashIndex === -1) {
53
+ res = '';
54
+ lastSegmentLength = 0;
55
+ }
56
+ else {
57
+ res = res.slice(0, lastSlashIndex);
58
+ lastSegmentLength = res.length - 1 - res.lastIndexOf('/');
59
+ }
60
+ lastSlash = i;
61
+ dots = 0;
62
+ continue;
63
+ }
64
+ }
65
+ else if (res.length === 2 || res.length === 1) {
66
+ res = '';
67
+ lastSegmentLength = 0;
68
+ lastSlash = i;
69
+ dots = 0;
70
+ continue;
71
+ }
72
+ }
73
+ if (allowAboveRoot) {
74
+ if (res.length > 0) {
75
+ res += '/..';
76
+ }
77
+ else {
78
+ res = '..';
79
+ }
80
+ lastSegmentLength = 2;
81
+ }
82
+ }
83
+ else {
84
+ if (res.length > 0) {
85
+ res += '/' + path.slice(lastSlash + 1, i);
86
+ }
87
+ else {
88
+ res = path.slice(lastSlash + 1, i);
89
+ }
90
+ lastSegmentLength = i - lastSlash - 1;
91
+ }
92
+ lastSlash = i;
93
+ dots = 0;
94
+ }
95
+ else if (code === DOT && dots !== -1) {
96
+ ++dots;
97
+ }
98
+ else {
99
+ dots = -1;
100
+ }
101
+ }
102
+ return res;
103
+ };
104
+ const decode = (s) => {
105
+ try {
106
+ return decodeURIComponent(s);
107
+ }
108
+ catch (_a) {
109
+ return s;
110
+ }
111
+ };
112
+ const pathNormalize = (p) => {
113
+ assertPath(p);
114
+ let path = p;
115
+ if (path.length === 0) {
116
+ return '.';
117
+ }
118
+ const isAbsolute = path.charCodeAt(0) === SLASH;
119
+ const trailingSeparator = path.charCodeAt(path.length - 1) === SLASH;
120
+ path = decode(path);
121
+ path = posixNormalize(path, !isAbsolute);
122
+ if (path.length === 0 && !isAbsolute) {
123
+ path = '.';
124
+ }
125
+ if (path.length > 0 && trailingSeparator) {
126
+ path += '/';
127
+ }
128
+ if (isAbsolute) {
129
+ return '/' + path;
130
+ }
131
+ return path;
132
+ };
133
+ exports.pathNormalize = pathNormalize;
@@ -4,9 +4,9 @@ import type { VideoImageFormat } from './image-format';
4
4
  import type { LogLevel } from './log-level';
5
5
  import type { CancelSignal } from './make-cancel-signal';
6
6
  import type { ColorSpace } from './options/color-space';
7
+ import type { X264Preset } from './options/x264-preset';
7
8
  import type { PixelFormat } from './pixel-format';
8
9
  import type { ProResProfile } from './prores-profile';
9
- import type { X264Preset } from './x264-preset';
10
10
  type RunningStatus = {
11
11
  type: 'running';
12
12
  } | {
@@ -1 +1,2 @@
1
- export declare const printUsefulErrorMessage: (err: Error) => void;
1
+ import type { LogLevel } from './log-level';
2
+ export declare const printUsefulErrorMessage: (err: Error, logLevel: LogLevel) => void;
@@ -4,75 +4,75 @@ exports.printUsefulErrorMessage = void 0;
4
4
  const logger_1 = require("./logger");
5
5
  const truthy_1 = require("./truthy");
6
6
  const alreadyPrinted = [];
7
- // Don't use Log.info() here, as BrowserSafeApis need tto be
8
- const printUsefulErrorMessage = (err) => {
7
+ // Don't use Log.info({indent: false, logLevel},) here, as BrowserSafeApis need tto be
8
+ const printUsefulErrorMessage = (err, logLevel) => {
9
9
  var _a, _b;
10
10
  if (alreadyPrinted.includes(err)) {
11
11
  return;
12
12
  }
13
13
  alreadyPrinted.push(err);
14
14
  if (err.message.includes('Could not play video with')) {
15
- logger_1.Log.info();
16
- logger_1.Log.info('💡 Get help for this issue at https://remotion.dev/docs/media-playback-error');
15
+ logger_1.Log.info({ indent: false, logLevel });
16
+ logger_1.Log.info({ indent: false, logLevel }, '💡 Get help for this issue at https://remotion.dev/docs/media-playback-error');
17
17
  }
18
18
  if (err.message.includes('A delayRender()') &&
19
19
  err.message.includes('was called but not cleared after')) {
20
- logger_1.Log.info();
20
+ logger_1.Log.info({ indent: false, logLevel });
21
21
  if (err.message.includes('/proxy')) {
22
- logger_1.Log.info('💡 Get help for this issue at https://remotion.dev/docs/troubleshooting/delay-render-proxy');
22
+ logger_1.Log.info({ indent: false, logLevel }, '💡 Get help for this issue at https://remotion.dev/docs/troubleshooting/delay-render-proxy');
23
23
  }
24
- logger_1.Log.info('💡 Get help for this issue at https://remotion.dev/docs/timeout');
24
+ logger_1.Log.info({ indent: false, logLevel }, '💡 Get help for this issue at https://remotion.dev/docs/timeout');
25
25
  }
26
26
  if (err.message.includes('Target closed')) {
27
- logger_1.Log.info();
28
- logger_1.Log.info('💡 Get help for this issue at https://remotion.dev/docs/target-closed');
27
+ logger_1.Log.info({ indent: false, logLevel });
28
+ logger_1.Log.info({ indent: false, logLevel }, '💡 Get help for this issue at https://remotion.dev/docs/target-closed');
29
29
  }
30
30
  if (err.message.includes('Timed out evaluating')) {
31
- logger_1.Log.info();
32
- logger_1.Log.info('💡 Get help for this issue at https://remotion.dev/docs/troubleshooting/timed-out-page-function');
31
+ logger_1.Log.info({ indent: false, logLevel });
32
+ logger_1.Log.info({ indent: false, logLevel }, '💡 Get help for this issue at https://remotion.dev/docs/troubleshooting/timed-out-page-function');
33
33
  }
34
34
  if (err.message.includes('ENAMETOOLONG')) {
35
- logger_1.Log.info();
36
- logger_1.Log.info('💡 Get help for this issue at https://remotion.dev/docs/enametoolong');
35
+ logger_1.Log.info({ indent: false, logLevel });
36
+ logger_1.Log.info({ indent: false, logLevel }, '💡 Get help for this issue at https://remotion.dev/docs/enametoolong');
37
37
  }
38
38
  if (err.message.includes('Member must have value less than or equal to 3008')) {
39
- logger_1.Log.info();
40
- logger_1.Log.info('💡 This error indicates that you have a AWS account on the free tier or have been limited by your organization. Often times this can be solved by adding a credit card. See also: https://repost.aws/questions/QUKruWYNDYTSmP17jCnIz6IQ/questions/QUKruWYNDYTSmP17jCnIz6IQ/unable-to-set-lambda-memory-over-3008mb');
39
+ logger_1.Log.info({ indent: false, logLevel });
40
+ logger_1.Log.info({ indent: false, logLevel }, '💡 This error indicates that you have a AWS account on the free tier or have been limited by your organization. Often times this can be solved by adding a credit card. See also: https://repost.aws/questions/QUKruWYNDYTSmP17jCnIz6IQ/questions/QUKruWYNDYTSmP17jCnIz6IQ/unable-to-set-lambda-memory-over-3008mb');
41
41
  }
42
42
  if ((_a = err.stack) === null || _a === void 0 ? void 0 : _a.includes('TooManyRequestsException: Rate Exceeded.')) {
43
- logger_1.Log.info();
44
- logger_1.Log.info('💡 This error indicates that your Lambda concurrency limit is too low. See: https://www.remotion.dev/docs/lambda/troubleshooting/rate-limit');
43
+ logger_1.Log.info({ indent: false, logLevel });
44
+ logger_1.Log.info({ indent: false, logLevel }, '💡 This error indicates that your Lambda concurrency limit is too low. See: https://www.remotion.dev/docs/lambda/troubleshooting/rate-limit');
45
45
  }
46
46
  if (err.message.includes('Error creating WebGL context')) {
47
- logger_1.Log.info();
47
+ logger_1.Log.info({ indent: false, logLevel });
48
48
  console.warn('💡 You might need to set the OpenGL renderer to "angle-egl", "angle" (or "swangle" if rendering on lambda). Learn why at https://www.remotion.dev/docs/three');
49
49
  console.warn("💡 Check how it's done at https://www.remotion.dev/docs/chromium-flags#--gl");
50
50
  }
51
51
  if (err.message.includes('The bucket does not allow ACLs')) {
52
- logger_1.Log.info();
53
- logger_1.Log.info('💡 Fix for this issue: https://remotion.dev/docs/lambda/troubleshooting/bucket-disallows-acl');
52
+ logger_1.Log.info({ indent: false, logLevel });
53
+ logger_1.Log.info({ indent: false, logLevel }, '💡 Fix for this issue: https://remotion.dev/docs/lambda/troubleshooting/bucket-disallows-acl');
54
54
  }
55
55
  if (err.message.includes('Minified React error #306')) {
56
56
  const componentName = (_b = err.message.match(/<\w+>/)) === null || _b === void 0 ? void 0 : _b[0];
57
- logger_1.Log.info([
57
+ logger_1.Log.info({ indent: false, logLevel }, [
58
58
  '💡 This error indicates that the component',
59
59
  componentName ? `(${componentName})` : null,
60
60
  'you are trying to render is not imported correctly.',
61
61
  ]
62
62
  .filter(truthy_1.truthy)
63
63
  .join(' '));
64
- logger_1.Log.info();
65
- logger_1.Log.info(' Check the root file and ensure that the component is not undefined.');
66
- logger_1.Log.info(' Oftentimes, this happens if the component is missing the `export` keyword');
67
- logger_1.Log.info(' or if the component was renamed and the import statement not properly adjusted.');
64
+ logger_1.Log.info({ indent: false, logLevel });
65
+ logger_1.Log.info({ indent: false, logLevel }, ' Check the root file and ensure that the component is not undefined.');
66
+ logger_1.Log.info({ indent: false, logLevel }, ' Oftentimes, this happens if the component is missing the `export` keyword');
67
+ logger_1.Log.info({ indent: false, logLevel }, ' or if the component was renamed and the import statement not properly adjusted.');
68
68
  }
69
69
  if (err.message.includes('GLIBC_')) {
70
- logger_1.Log.info('💡 Remotion requires at least Libc 2.35.');
71
- logger_1.Log.info('💡 Get help for this issue: https://github.com/remotion-dev/remotion/issues/2439');
70
+ logger_1.Log.info({ indent: false, logLevel }, '💡 Remotion requires at least Libc 2.35.');
71
+ logger_1.Log.info({ indent: false, logLevel }, '💡 Get help for this issue: https://github.com/remotion-dev/remotion/issues/2439');
72
72
  }
73
73
  if (err.message.includes('EBADF')) {
74
- logger_1.Log.info('💡 This error might be fixed by changing your Node version:');
75
- logger_1.Log.info(' https://github.com/remotion-dev/remotion/issues/2452');
74
+ logger_1.Log.info({ indent: false, logLevel }, '💡 This error might be fixed by changing your Node version:');
75
+ logger_1.Log.info({ indent: false, logLevel }, ' https://github.com/remotion-dev/remotion/issues/2452');
76
76
  }
77
77
  };
78
78
  exports.printUsefulErrorMessage = printUsefulErrorMessage;
@@ -6,7 +6,6 @@ import type { BrowserLog } from './browser-log';
6
6
  import type { HeadlessBrowser } from './browser/Browser';
7
7
  import type { FrameRange } from './frame-range';
8
8
  import type { VideoImageFormat } from './image-format';
9
- import { type LogLevel } from './log-level';
10
9
  import type { CancelSignal } from './make-cancel-signal';
11
10
  import type { ChromiumOptions } from './open-browser';
12
11
  import type { ToOptions } from './options/option';
@@ -27,7 +26,6 @@ export type InternalRenderFramesOptions = {
27
26
  onBrowserLog: null | ((log: BrowserLog) => void);
28
27
  onFrameBuffer: null | ((buffer: Buffer, frame: number) => void);
29
28
  onDownload: RenderMediaOnDownload | null;
30
- timeoutInMilliseconds: number;
31
29
  chromiumOptions: ChromiumOptions;
32
30
  scale: number;
33
31
  port: number | null;
@@ -38,7 +36,6 @@ export type InternalRenderFramesOptions = {
38
36
  muted: boolean;
39
37
  concurrency: number | string | null;
40
38
  webpackBundleOrServeUrl: string;
41
- logLevel: LogLevel;
42
39
  serializedInputPropsWithCustomSchema: string;
43
40
  serializedResolvedPropsWithCustomSchema: string;
44
41
  parallelEncodingEnabled: boolean;
@@ -54,7 +51,6 @@ export type RenderFramesOptions = {
54
51
  * @deprecated Renamed to "jpegQuality"
55
52
  */
56
53
  quality?: never;
57
- jpegQuality?: number;
58
54
  frameRange?: FrameRange | null;
59
55
  everyNthFrame?: number;
60
56
  /**
@@ -65,7 +61,6 @@ export type RenderFramesOptions = {
65
61
  * @deprecated Use "logLevel" instead
66
62
  */
67
63
  verbose?: boolean;
68
- logLevel?: LogLevel;
69
64
  puppeteerInstance?: HeadlessBrowser;
70
65
  browserExecutable?: BrowserExecutable;
71
66
  onBrowserLog?: (log: BrowserLog) => void;
@@ -80,8 +75,7 @@ export type RenderFramesOptions = {
80
75
  muted?: boolean;
81
76
  concurrency?: number | string | null;
82
77
  serveUrl: string;
83
- offthreadVideoCacheSizeInBytes?: number | null;
84
- };
78
+ } & Partial<ToOptions<typeof optionsMap.renderFrames>>;
85
79
  export declare const internalRenderFrames: (args_0: InternalRenderFramesOptions) => Promise<RenderFramesOutput>;
86
80
  /**
87
81
  * @description Renders a series of images using Puppeteer and computes information for mixing audio.
@@ -482,7 +482,7 @@ const renderFrames = (options) => {
482
482
  outputDir,
483
483
  port: port !== null && port !== void 0 ? port : null,
484
484
  scale: scale !== null && scale !== void 0 ? scale : 1,
485
- logLevel: verbose || dumpBrowserLogs ? 'verbose' : logLevel !== null && logLevel !== void 0 ? logLevel : (0, logger_1.getLogLevel)(),
485
+ logLevel: verbose || dumpBrowserLogs ? 'verbose' : logLevel !== null && logLevel !== void 0 ? logLevel : 'info',
486
486
  timeoutInMilliseconds: timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : TimeoutSettings_1.DEFAULT_TIMEOUT,
487
487
  webpackBundleOrServeUrl: serveUrl,
488
488
  server: undefined,
@@ -9,7 +9,6 @@ import type { Codec } from './codec';
9
9
  import type { FfmpegOverrideFn } from './ffmpeg-override';
10
10
  import type { FrameRange } from './frame-range';
11
11
  import type { VideoImageFormat } from './image-format';
12
- import { type LogLevel } from './log-level';
13
12
  import type { CancelSignal } from './make-cancel-signal';
14
13
  import type { ChromiumOptions } from './open-browser';
15
14
  import type { ColorSpace } from './options/color-space';
@@ -19,7 +18,6 @@ import type { PixelFormat } from './pixel-format';
19
18
  import type { RemotionServer } from './prepare-server';
20
19
  import type { ProResProfile } from './prores-profile';
21
20
  import type { OnStartData } from './types';
22
- import type { X264Preset } from './x264-preset';
23
21
  export type StitchingState = 'encoding' | 'muxing';
24
22
  export type SlowFrame = {
25
23
  frame: number;
@@ -36,7 +34,6 @@ export type RenderMediaOnProgress = (progress: {
36
34
  type MoreRenderMediaOptions = ToOptions<typeof optionsMap.renderMedia>;
37
35
  export type InternalRenderMediaOptions = {
38
36
  outputLocation: string | null;
39
- codec: Codec;
40
37
  composition: Omit<VideoConfig, 'props' | 'defaultProps'>;
41
38
  serializedInputPropsWithCustomSchema: string;
42
39
  serializedResolvedPropsWithCustomSchema: string;
@@ -44,7 +41,6 @@ export type InternalRenderMediaOptions = {
44
41
  imageFormat: VideoImageFormat;
45
42
  pixelFormat: PixelFormat;
46
43
  envVariables: Record<string, string>;
47
- jpegQuality: number;
48
44
  frameRange: FrameRange | null;
49
45
  everyNthFrame: number;
50
46
  puppeteerInstance: HeadlessBrowser | undefined;
@@ -52,32 +48,23 @@ export type InternalRenderMediaOptions = {
52
48
  onProgress: RenderMediaOnProgress;
53
49
  onDownload: RenderMediaOnDownload;
54
50
  proResProfile: ProResProfile | undefined;
55
- x264Preset: X264Preset | undefined;
56
51
  onBrowserLog: ((log: BrowserLog) => void) | null;
57
52
  onStart: (data: OnStartData) => void;
58
- timeoutInMilliseconds: number;
59
53
  chromiumOptions: ChromiumOptions;
60
54
  scale: number;
61
55
  port: number | null;
62
56
  cancelSignal: CancelSignal | undefined;
63
57
  browserExecutable: BrowserExecutable | null;
64
- logLevel: LogLevel;
65
58
  onCtrlCExit: (fn: () => void) => void;
66
59
  indent: boolean;
67
60
  server: RemotionServer | undefined;
68
61
  preferLossless: boolean;
69
- muted: boolean;
70
62
  enforceAudioTrack: boolean;
71
63
  ffmpegOverride: FfmpegOverrideFn | undefined;
72
- audioBitrate: string | null;
73
- videoBitrate: string | null;
74
- encodingMaxRate: string | null;
75
- encodingBufferSize: string | null;
76
64
  disallowParallelEncoding: boolean;
77
65
  audioCodec: AudioCodec | null;
78
66
  serveUrl: string;
79
67
  concurrency: number | string | null;
80
- colorSpace: ColorSpace;
81
68
  finishRenderProgress: () => void;
82
69
  } & MoreRenderMediaOptions;
83
70
  type Prettify<T> = {
@@ -104,14 +91,12 @@ export type RenderMediaOptions = Prettify<{
104
91
  onProgress?: RenderMediaOnProgress;
105
92
  onDownload?: RenderMediaOnDownload;
106
93
  proResProfile?: ProResProfile;
107
- x264Preset?: X264Preset;
108
94
  /**
109
95
  * @deprecated Use "logLevel": "verbose" instead
110
96
  */
111
97
  dumpBrowserLogs?: boolean;
112
98
  onBrowserLog?: ((log: BrowserLog) => void) | undefined;
113
99
  onStart?: (data: OnStartData) => void;
114
- timeoutInMilliseconds?: number;
115
100
  chromiumOptions?: ChromiumOptions;
116
101
  scale?: number;
117
102
  port?: number | null;
@@ -122,7 +107,6 @@ export type RenderMediaOptions = Prettify<{
122
107
  */
123
108
  verbose?: boolean;
124
109
  preferLossless?: boolean;
125
- muted?: boolean;
126
110
  enforceAudioTrack?: boolean;
127
111
  ffmpegOverride?: FfmpegOverrideFn;
128
112
  audioBitrate?: string | null;
@@ -132,7 +116,6 @@ export type RenderMediaOptions = Prettify<{
132
116
  audioCodec?: AudioCodec | null;
133
117
  serveUrl: string;
134
118
  concurrency?: number | string | null;
135
- logLevel?: LogLevel;
136
119
  colorSpace?: ColorSpace;
137
120
  repro?: boolean;
138
121
  }> & Partial<MoreRenderMediaOptions>;
@@ -26,6 +26,7 @@ const is_audio_codec_1 = require("./is-audio-codec");
26
26
  const jpeg_quality_1 = require("./jpeg-quality");
27
27
  const logger_1 = require("./logger");
28
28
  const make_cancel_signal_1 = require("./make-cancel-signal");
29
+ const x264_preset_1 = require("./options/x264-preset");
29
30
  const overwrite_1 = require("./overwrite");
30
31
  const perf_1 = require("./perf");
31
32
  const pixel_format_1 = require("./pixel-format");
@@ -45,7 +46,6 @@ const validate_output_filename_1 = require("./validate-output-filename");
45
46
  const validate_scale_1 = require("./validate-scale");
46
47
  const validate_videobitrate_1 = require("./validate-videobitrate");
47
48
  const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
48
- const x264_preset_1 = require("./x264-preset");
49
49
  const SLOWEST_FRAME_COUNT = 10;
50
50
  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, finishRenderProgress, }) => {
51
51
  if (repro) {
@@ -414,7 +414,7 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, s
414
414
  resolve(result);
415
415
  })
416
416
  .catch((err) => {
417
- logger_1.Log.errorAdvanced({ indent, logLevel }, 'Could not create reproduction', err);
417
+ logger_1.Log.error({ indent, logLevel }, 'Could not create reproduction', err);
418
418
  });
419
419
  }
420
420
  else {
@@ -482,7 +482,7 @@ const renderMedia = ({ proResProfile, x264Preset, crf, composition, inputProps,
482
482
  }
483
483
  return (0, exports.internalRenderMedia)({
484
484
  proResProfile: proResProfile !== null && proResProfile !== void 0 ? proResProfile : undefined,
485
- x264Preset,
485
+ x264Preset: x264Preset !== null && x264Preset !== void 0 ? x264Preset : null,
486
486
  codec,
487
487
  composition,
488
488
  serveUrl,
@@ -522,7 +522,7 @@ const renderMedia = ({ proResProfile, x264Preset, crf, composition, inputProps,
522
522
  videoBitrate: videoBitrate !== null && videoBitrate !== void 0 ? videoBitrate : null,
523
523
  encodingMaxRate: encodingMaxRate !== null && encodingMaxRate !== void 0 ? encodingMaxRate : null,
524
524
  encodingBufferSize: encodingBufferSize !== null && encodingBufferSize !== void 0 ? encodingBufferSize : null,
525
- logLevel: verbose || dumpBrowserLogs ? 'verbose' : logLevel !== null && logLevel !== void 0 ? logLevel : (0, logger_1.getLogLevel)(),
525
+ logLevel: verbose || dumpBrowserLogs ? 'verbose' : logLevel !== null && logLevel !== void 0 ? logLevel : 'info',
526
526
  preferLossless: preferLossless !== null && preferLossless !== void 0 ? preferLossless : false,
527
527
  indent: false,
528
528
  onCtrlCExit: () => undefined,
@@ -5,7 +5,6 @@ import type { BrowserExecutable } from './browser-executable';
5
5
  import type { BrowserLog } from './browser-log';
6
6
  import type { HeadlessBrowser } from './browser/Browser';
7
7
  import type { StillImageFormat } from './image-format';
8
- import type { LogLevel } from './log-level';
9
8
  import type { CancelSignal } from './make-cancel-signal';
10
9
  import type { ChromiumOptions } from './open-browser';
11
10
  import type { ToOptions } from './options/option';
@@ -24,14 +23,12 @@ type InternalRenderStillOptions = {
24
23
  overwrite: boolean;
25
24
  browserExecutable: BrowserExecutable;
26
25
  onBrowserLog: null | ((log: BrowserLog) => void);
27
- timeoutInMilliseconds: number;
28
26
  chromiumOptions: ChromiumOptions;
29
27
  scale: number;
30
28
  onDownload: RenderMediaOnDownload | null;
31
29
  cancelSignal: CancelSignal | null;
32
30
  indent: boolean;
33
31
  server: RemotionServer | undefined;
34
- logLevel: LogLevel;
35
32
  serveUrl: string;
36
33
  port: number | null;
37
34
  offthreadVideoCacheSizeInBytes: number | null;
@@ -43,7 +40,6 @@ export type RenderStillOptions = {
43
40
  frame?: number;
44
41
  inputProps?: Record<string, unknown>;
45
42
  imageFormat?: StillImageFormat;
46
- jpegQuality?: number;
47
43
  puppeteerInstance?: HeadlessBrowser;
48
44
  /**
49
45
  * @deprecated Use "logLevel": "verbose" instead
@@ -53,7 +49,6 @@ export type RenderStillOptions = {
53
49
  overwrite?: boolean;
54
50
  browserExecutable?: BrowserExecutable;
55
51
  onBrowserLog?: (log: BrowserLog) => void;
56
- timeoutInMilliseconds?: number;
57
52
  chromiumOptions?: ChromiumOptions;
58
53
  scale?: number;
59
54
  onDownload?: RenderMediaOnDownload;
@@ -67,8 +62,7 @@ export type RenderStillOptions = {
67
62
  * @deprecated Renamed to `jpegQuality`
68
63
  */
69
64
  quality?: never;
70
- offthreadVideoCacheSizeInBytes?: number | null;
71
- };
65
+ } & Partial<ToOptions<typeof optionsMap.renderStill>>;
72
66
  type RenderStillReturnValue = {
73
67
  buffer: Buffer | null;
74
68
  };
@@ -38,7 +38,6 @@ const handle_javascript_exception_1 = require("./error-handling/handle-javascrip
38
38
  const find_closest_package_json_1 = require("./find-closest-package-json");
39
39
  const image_format_1 = require("./image-format");
40
40
  const jpeg_quality_1 = require("./jpeg-quality");
41
- const logger_1 = require("./logger");
42
41
  const make_cancel_signal_1 = require("./make-cancel-signal");
43
42
  const open_browser_1 = require("./open-browser");
44
43
  const overwrite_1 = require("./overwrite");
@@ -258,7 +257,7 @@ exports.internalRenderStill = (0, wrap_with_error_handling_1.wrapWithErrorHandli
258
257
  */
259
258
  const renderStill = (options) => {
260
259
  var _a, _b;
261
- const { composition, serveUrl, browserExecutable, cancelSignal, chromiumOptions, dumpBrowserLogs, envVariables, frame, imageFormat, inputProps, jpegQuality, onBrowserLog, onDownload, output, overwrite, port, puppeteerInstance, scale, timeoutInMilliseconds, verbose, quality, offthreadVideoCacheSizeInBytes, } = options;
260
+ const { composition, serveUrl, browserExecutable, cancelSignal, chromiumOptions, dumpBrowserLogs, envVariables, frame, imageFormat, inputProps, jpegQuality, onBrowserLog, onDownload, output, overwrite, port, puppeteerInstance, scale, timeoutInMilliseconds, verbose, quality, offthreadVideoCacheSizeInBytes, logLevel, } = options;
262
261
  if (typeof jpegQuality !== 'undefined' && imageFormat !== 'jpeg') {
263
262
  throw new Error("You can only pass the `quality` option if `imageFormat` is 'jpeg'.");
264
263
  }
@@ -290,7 +289,7 @@ const renderStill = (options) => {
290
289
  server: undefined,
291
290
  serveUrl,
292
291
  timeoutInMilliseconds: timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : TimeoutSettings_1.DEFAULT_TIMEOUT,
293
- logLevel: verbose || dumpBrowserLogs ? 'verbose' : (0, logger_1.getLogLevel)(),
292
+ logLevel: logLevel !== null && logLevel !== void 0 ? logLevel : (verbose || dumpBrowserLogs ? 'verbose' : 'info'),
294
293
  serializedResolvedPropsWithCustomSchema: no_react_1.NoReactInternals.serializeJSONWithDate({
295
294
  indent: undefined,
296
295
  staticBase: null,
package/dist/repro.js CHANGED
@@ -58,7 +58,7 @@ const readyDirSync = (dir) => {
58
58
  const zipFolder = ({ sourceFolder, targetZip, indent, logLevel, }) => {
59
59
  const platform = node_os_1.default.platform();
60
60
  try {
61
- logger_1.Log.infoAdvanced({ indent, logLevel }, '+ Creating reproduction ZIP');
61
+ logger_1.Log.info({ indent, logLevel }, '+ Creating reproduction ZIP');
62
62
  if (platform === 'win32') {
63
63
  (0, node_child_process_1.execSync)(`powershell.exe Compress-Archive -Path "${sourceFolder}" -DestinationPath "${targetZip}"`);
64
64
  }
@@ -66,11 +66,11 @@ const zipFolder = ({ sourceFolder, targetZip, indent, logLevel, }) => {
66
66
  (0, node_child_process_1.execSync)(`zip -r "${targetZip}" "${sourceFolder}"`);
67
67
  }
68
68
  (0, node_fs_1.rmSync)(sourceFolder, { recursive: true });
69
- logger_1.Log.infoAdvanced({ indent, logLevel }, `${chalk_1.chalk.blue(`+ Repro: ${targetZip}`)}`);
69
+ logger_1.Log.info({ indent, logLevel }, `${chalk_1.chalk.blue(`+ Repro: ${targetZip}`)}`);
70
70
  }
71
71
  catch (error) {
72
- logger_1.Log.errorAdvanced({ indent, logLevel }, `Failed to zip repro folder, The repro folder is ${sourceFolder}. You can try manually zip it.`);
73
- logger_1.Log.errorAdvanced({ indent, logLevel }, error);
72
+ logger_1.Log.error({ indent, logLevel }, `Failed to zip repro folder, The repro folder is ${sourceFolder}. You can try manually zip it.`);
73
+ logger_1.Log.error({ indent, logLevel }, error);
74
74
  }
75
75
  };
76
76
  const reproWriter = (name) => {
@@ -129,8 +129,8 @@ const reproWriter = (name) => {
129
129
  });
130
130
  }
131
131
  catch (error) {
132
- logger_1.Log.error(`repro render success error:`);
133
- logger_1.Log.error(error);
132
+ logger_1.Log.error({ indent: false, logLevel }, `repro render success error:`);
133
+ logger_1.Log.error({ indent: false, logLevel }, error);
134
134
  reject(error);
135
135
  }
136
136
  });