@remotion/renderer 4.0.0-alpha4 → 4.0.0-alpha6

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 (143) hide show
  1. package/README.md +5 -43
  2. package/dist/assets/download-and-map-assets-to-file.js +6 -6
  3. package/dist/assets/download-file.d.ts +3 -2
  4. package/dist/assets/download-file.js +18 -3
  5. package/dist/assets/download-map.d.ts +0 -26
  6. package/dist/assets/download-map.js +7 -12
  7. package/dist/assets/get-audio-channels.d.ts +1 -2
  8. package/dist/assets/get-audio-channels.js +5 -9
  9. package/dist/assets/read-file.d.ts +1 -1
  10. package/dist/assets/read-file.js +2 -2
  11. package/dist/assets/sanitize-filepath.js +2 -2
  12. package/dist/audio-codec.d.ts +4 -3
  13. package/dist/audio-codec.js +3 -9
  14. package/dist/browser/BrowserFetcher.d.ts +0 -1
  15. package/dist/browser/BrowserFetcher.js +14 -15
  16. package/dist/browser/BrowserRunner.d.ts +1 -1
  17. package/dist/browser/BrowserRunner.js +10 -4
  18. package/dist/browser/FrameManager.js +2 -3
  19. package/dist/browser/LaunchOptions.d.ts +1 -0
  20. package/dist/browser/Launcher.js +6 -5
  21. package/dist/browser/NodeWebSocketTransport.js +4 -4
  22. package/dist/browser/devtools-commands.d.ts +5 -1
  23. package/dist/browser/devtools-types.d.ts +78 -0
  24. package/dist/browser/get-download-destination.js +8 -8
  25. package/dist/browser/is-target-closed-err.d.ts +1 -0
  26. package/dist/browser/is-target-closed-err.js +9 -0
  27. package/dist/call-ffmpeg.d.ts +14 -0
  28. package/dist/call-ffmpeg.js +40 -0
  29. package/dist/check-apple-silicon.js +2 -45
  30. package/dist/client.d.ts +79 -42
  31. package/dist/client.js +27 -1
  32. package/dist/codec-supports-media.d.ts +2 -1
  33. package/dist/codec-supports-media.js +20 -5
  34. package/dist/combine-videos.d.ts +0 -3
  35. package/dist/combine-videos.js +9 -13
  36. package/dist/compositor/compose.d.ts +3 -1
  37. package/dist/compositor/compose.js +41 -18
  38. package/dist/compositor/compositor.d.ts +12 -0
  39. package/dist/compositor/compositor.js +204 -0
  40. package/dist/compositor/get-executable-path.d.ts +1 -1
  41. package/dist/compositor/get-executable-path.js +27 -8
  42. package/dist/compositor/make-nonce.d.ts +1 -0
  43. package/dist/compositor/make-nonce.js +8 -0
  44. package/dist/compositor/payloads.d.ts +34 -7
  45. package/dist/create-ffmpeg-complex-filter.d.ts +5 -5
  46. package/dist/create-ffmpeg-complex-filter.js +2 -4
  47. package/dist/create-ffmpeg-merge-filter.d.ts +2 -5
  48. package/dist/create-ffmpeg-merge-filter.js +2 -10
  49. package/dist/create-silent-audio.d.ts +1 -4
  50. package/dist/create-silent-audio.js +3 -7
  51. package/dist/crf.js +8 -2
  52. package/dist/delete-directory.js +18 -18
  53. package/dist/does-have-m2-bug.js +2 -2
  54. package/dist/ensure-output-directory.js +5 -5
  55. package/dist/ffmpeg-filter-file.js +7 -7
  56. package/dist/file-extensions.d.ts +1 -12
  57. package/dist/file-extensions.js +8 -14
  58. package/dist/find-closest-package-json.js +6 -6
  59. package/dist/get-compositions.d.ts +3 -5
  60. package/dist/get-compositions.js +8 -11
  61. package/dist/get-concurrency.js +3 -3
  62. package/dist/get-extension-from-codec.d.ts +2 -2
  63. package/dist/get-extension-of-filename.js +2 -2
  64. package/dist/get-frame-padded-index.d.ts +2 -1
  65. package/dist/get-local-browser-executable.js +4 -4
  66. package/dist/get-video-threads-flag.js +3 -3
  67. package/dist/guess-extension-for-media.d.ts +1 -3
  68. package/dist/guess-extension-for-media.js +4 -8
  69. package/dist/image-format.d.ts +12 -6
  70. package/dist/image-format.js +16 -13
  71. package/dist/index.d.ts +80 -61
  72. package/dist/index.js +15 -17
  73. package/dist/jpeg-quality.d.ts +1 -0
  74. package/dist/jpeg-quality.js +21 -0
  75. package/dist/merge-audio-track.d.ts +0 -2
  76. package/dist/merge-audio-track.js +5 -12
  77. package/dist/mime-types.js +2 -2
  78. package/dist/offthread-video-server.d.ts +9 -9
  79. package/dist/offthread-video-server.js +65 -58
  80. package/dist/open-browser.d.ts +1 -0
  81. package/dist/open-browser.js +7 -6
  82. package/dist/options/audio-bitrate.d.ts +2 -0
  83. package/dist/options/audio-bitrate.js +11 -0
  84. package/dist/options/crf.d.ts +2 -0
  85. package/dist/options/crf.js +11 -0
  86. package/dist/options/enforce-audio.d.ts +2 -0
  87. package/dist/options/enforce-audio.js +11 -0
  88. package/dist/options/jpeg-quality.d.ts +2 -0
  89. package/dist/options/jpeg-quality.js +11 -0
  90. package/dist/options/mute.d.ts +2 -0
  91. package/dist/options/mute.js +11 -0
  92. package/dist/options/option.d.ts +8 -0
  93. package/dist/options/option.js +2 -0
  94. package/dist/options/scale.d.ts +2 -0
  95. package/dist/options/scale.js +11 -0
  96. package/dist/options/video-bitrate.d.ts +2 -0
  97. package/dist/options/video-bitrate.js +11 -0
  98. package/dist/options/video-codec.d.ts +2 -0
  99. package/dist/options/video-codec.js +11 -0
  100. package/dist/perf.d.ts +1 -1
  101. package/dist/perf.js +9 -7
  102. package/dist/prepare-server.d.ts +3 -4
  103. package/dist/prepare-server.js +9 -9
  104. package/dist/preprocess-audio-track.d.ts +0 -4
  105. package/dist/preprocess-audio-track.js +4 -8
  106. package/dist/prespawn-ffmpeg.d.ts +6 -9
  107. package/dist/prespawn-ffmpeg.js +7 -12
  108. package/dist/prestitcher-memory-usage.d.ts +0 -4
  109. package/dist/prestitcher-memory-usage.js +4 -5
  110. package/dist/prores-profile.d.ts +1 -2
  111. package/dist/prores-profile.js +4 -4
  112. package/dist/provide-screenshot.d.ts +4 -5
  113. package/dist/provide-screenshot.js +2 -2
  114. package/dist/puppeteer-screenshot.d.ts +3 -3
  115. package/dist/puppeteer-screenshot.js +10 -33
  116. package/dist/render-frames.d.ts +13 -25
  117. package/dist/render-frames.js +34 -45
  118. package/dist/render-media.d.ts +16 -18
  119. package/dist/render-media.js +42 -52
  120. package/dist/render-still.d.ts +12 -8
  121. package/dist/render-still.js +30 -18
  122. package/dist/resolve-asset-src.js +2 -2
  123. package/dist/screenshot-dom-element.d.ts +4 -5
  124. package/dist/screenshot-dom-element.js +6 -3
  125. package/dist/screenshot-task.d.ts +2 -3
  126. package/dist/screenshot-task.js +40 -25
  127. package/dist/serve-handler/index.d.ts +1 -1
  128. package/dist/serve-handler/index.js +21 -19
  129. package/dist/serve-handler/is-path-inside.js +3 -3
  130. package/dist/serve-static.d.ts +2 -3
  131. package/dist/serve-static.js +26 -22
  132. package/dist/stitch-frames-to-video.d.ts +2 -12
  133. package/dist/stitch-frames-to-video.js +37 -46
  134. package/dist/take-frame-and-compose.d.ts +4 -5
  135. package/dist/take-frame-and-compose.js +15 -9
  136. package/dist/tmp-dir.js +7 -8
  137. package/dist/validate-concurrency.d.ts +2 -0
  138. package/dist/validate-concurrency.js +11 -5
  139. package/dist/validate-output-filename.d.ts +1 -1
  140. package/dist/validate-puppeteer-timeout.js +1 -0
  141. package/install-toolchain.mjs +36 -0
  142. package/package.json +11 -10
  143. package/types/ws/index.d.ts +5 -5
@@ -1 +1,3 @@
1
1
  export declare const validateConcurrency: (value: unknown, setting: string) => void;
2
+ export declare const getMaxConcurrency: () => any;
3
+ export declare const getMinConcurrency: () => number;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateConcurrency = void 0;
3
+ exports.getMinConcurrency = exports.getMaxConcurrency = exports.validateConcurrency = void 0;
4
4
  const validateConcurrency = (value, setting) => {
5
5
  if (typeof value === 'undefined') {
6
6
  return;
@@ -15,11 +15,11 @@ const validateConcurrency = (value, setting) => {
15
15
  if (value % 1 !== 0) {
16
16
  throw new Error(setting + ' must be an integer, but is ' + value);
17
17
  }
18
- if (value < 1) {
19
- throw new Error(setting + ' must be at least 1, but is ' + value);
18
+ if (value < (0, exports.getMinConcurrency)()) {
19
+ throw new Error(`${setting} must be at least ${(0, exports.getMinConcurrency)()}, but is ${JSON.stringify(value)}`);
20
20
  }
21
- if (value > require('os').cpus().length) {
22
- throw new Error(`${setting} is set higher than the amount of CPU cores available. Available CPU cores: ${require('os').cpus().length}, value set: ${value}`);
21
+ if (value > (0, exports.getMaxConcurrency)()) {
22
+ throw new Error(`${setting} is set higher than the amount of CPU cores available. Available CPU cores: ${(0, exports.getMaxConcurrency)()}, value set: ${value}`);
23
23
  }
24
24
  }
25
25
  else if (!/^\d+(\.\d+)?%$/.test(value)) {
@@ -27,3 +27,9 @@ const validateConcurrency = (value, setting) => {
27
27
  }
28
28
  };
29
29
  exports.validateConcurrency = validateConcurrency;
30
+ const getMaxConcurrency = () => {
31
+ return require('os').cpus().length;
32
+ };
33
+ exports.getMaxConcurrency = getMaxConcurrency;
34
+ const getMinConcurrency = () => 1;
35
+ exports.getMinConcurrency = getMinConcurrency;
@@ -1,5 +1,5 @@
1
1
  import type { AudioCodec } from './audio-codec';
2
- export declare const validateOutputFilename: <T extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">({ codec, audioCodec, extension, preferLossless, }: {
2
+ export declare const validateOutputFilename: <T extends "aac" | "mp3" | "h264" | "h265" | "vp8" | "vp9" | "wav" | "prores" | "h264-mkv" | "gif">({ codec, audioCodec, extension, preferLossless, }: {
3
3
  codec: T;
4
4
  audioCodec: AudioCodec | null;
5
5
  extension: string;
@@ -8,6 +8,7 @@ const validatePuppeteerTimeout = (timeoutInMilliseconds) => {
8
8
  if (typeof timeoutInMilliseconds !== 'number') {
9
9
  throw new TypeError(`'timeoutInMilliseconds' should be a number, but is: ${JSON.stringify(timeoutInMilliseconds)}`);
10
10
  }
11
+ // Value also appears in packages/cli/src/editor/components/RenderModal/RenderModalAdvanced.tsx
11
12
  if (timeoutInMilliseconds < 7000 && process.env.NODE_ENV !== 'test') {
12
13
  throw new TypeError(`'timeoutInMilliseconds' should be bigger or equal than 7000, but is ${timeoutInMilliseconds}`);
13
14
  }
@@ -0,0 +1,36 @@
1
+ import {execSync} from 'node:child_process';
2
+ import {existsSync, mkdirSync, unlinkSync} from 'node:fs';
3
+ import {toolchains} from './toolchains.mjs';
4
+
5
+ const unpatched = [
6
+ 'x86_64-apple-darwin',
7
+ 'aarch64-apple-darwin',
8
+ 'x86_64-pc-windows-gnu',
9
+ ];
10
+
11
+ for (const toolchain of toolchains) {
12
+ process.stdout.write(toolchain + '...');
13
+
14
+ execSync(
15
+ `curl https://remotion-ffmpeg-binaries.s3.eu-central-1.amazonaws.com/${toolchain}.zip -o ${toolchain}.zip`
16
+ );
17
+
18
+ if (!existsSync('toolchains')) {
19
+ mkdirSync('toolchains');
20
+ }
21
+
22
+ if (!existsSync('toolchains/' + toolchain)) {
23
+ mkdirSync('toolchains/' + toolchain);
24
+ }
25
+
26
+ execSync(`tar -xzf ../../${toolchain}.zip`, {
27
+ cwd: `toolchains/${toolchain}`,
28
+ });
29
+
30
+ unlinkSync(`${toolchain}.zip`);
31
+ process.stdout.write('Done.\n');
32
+ }
33
+
34
+ for (const target of unpatched) {
35
+ execSync(`rustup target add ${target}`);
36
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "4.0.0-alpha4",
3
+ "version": "4.0.0-alpha6",
4
4
  "description": "Renderer for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,7 +16,7 @@
16
16
  "dependencies": {
17
17
  "execa": "5.1.1",
18
18
  "extract-zip": "2.0.1",
19
- "remotion": "4.0.0-alpha4",
19
+ "remotion": "4.0.0-alpha6",
20
20
  "source-map": "^0.8.0-beta.0",
21
21
  "ws": "8.7.0"
22
22
  },
@@ -38,16 +38,17 @@
38
38
  "react": "18.0.0",
39
39
  "react-dom": "18.0.0",
40
40
  "typescript": "^4.7.0",
41
- "vitest": "0.24.3"
41
+ "vitest": "0.24.3",
42
+ "zod": "^3.21.4"
42
43
  },
43
44
  "optionalDependencies": {
44
- "@remotion/compositor-darwin-arm64": "4.0.0-alpha4",
45
- "@remotion/compositor-darwin-x64": "4.0.0-alpha4",
46
- "@remotion/compositor-linux-arm64-gnu": "4.0.0-alpha4",
47
- "@remotion/compositor-linux-arm64-musl": "4.0.0-alpha4",
48
- "@remotion/compositor-linux-x64-gnu": "4.0.0-alpha4",
49
- "@remotion/compositor-linux-x64-musl": "4.0.0-alpha4",
50
- "@remotion/compositor-win32-x64-msvc": "4.0.0-alpha4"
45
+ "@remotion/compositor-darwin-arm64": "4.0.0-alpha6",
46
+ "@remotion/compositor-darwin-x64": "4.0.0-alpha6",
47
+ "@remotion/compositor-linux-arm64-gnu": "4.0.0-alpha6",
48
+ "@remotion/compositor-linux-arm64-musl": "4.0.0-alpha6",
49
+ "@remotion/compositor-linux-x64-gnu": "4.0.0-alpha6",
50
+ "@remotion/compositor-linux-x64-musl": "4.0.0-alpha6",
51
+ "@remotion/compositor-win32-x64-msvc": "4.0.0-alpha6"
51
52
  },
52
53
  "keywords": [
53
54
  "remotion",
@@ -6,7 +6,8 @@
6
6
  /* eslint-disable no-dupe-class-members */
7
7
  /// <reference types="node" />
8
8
 
9
- import {EventEmitter} from 'events';
9
+ import type {Server as HTTPSServer} from 'https';
10
+ import {EventEmitter} from 'node:events';
10
11
  import type {
11
12
  Agent,
12
13
  ClientRequest,
@@ -14,12 +15,11 @@ import type {
14
15
  IncomingMessage,
15
16
  OutgoingHttpHeaders,
16
17
  Server as HTTPServer,
17
- } from 'http';
18
- import type {Server as HTTPSServer} from 'https';
18
+ } from 'node:http';
19
+ import type {URL} from 'node:url';
20
+ import type {ZlibOptions} from 'node:zlib';
19
21
  import type {Duplex, DuplexOptions} from 'stream';
20
22
  import type {SecureContextOptions} from 'tls';
21
- import type {URL} from 'url';
22
- import type {ZlibOptions} from 'zlib';
23
23
  declare class WebSocket extends EventEmitter {
24
24
  /** The connection is not yet open. */
25
25
  static readonly CONNECTING: 0;