@remotion/renderer 4.0.0-alpha5 → 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 (54) hide show
  1. package/dist/assets/download-and-map-assets-to-file.js +6 -6
  2. package/dist/assets/download-file.d.ts +3 -2
  3. package/dist/assets/download-file.js +18 -3
  4. package/dist/assets/download-map.js +7 -7
  5. package/dist/assets/read-file.d.ts +1 -1
  6. package/dist/assets/read-file.js +2 -2
  7. package/dist/assets/sanitize-filepath.js +2 -2
  8. package/dist/audio-codec.d.ts +1 -1
  9. package/dist/browser/BrowserFetcher.js +13 -13
  10. package/dist/browser/BrowserRunner.d.ts +1 -1
  11. package/dist/browser/BrowserRunner.js +2 -2
  12. package/dist/browser/Launcher.js +4 -4
  13. package/dist/browser/NodeWebSocketTransport.js +4 -4
  14. package/dist/browser/get-download-destination.js +8 -8
  15. package/dist/call-ffmpeg.js +6 -3
  16. package/dist/client.d.ts +16 -4
  17. package/dist/combine-videos.js +6 -6
  18. package/dist/compositor/compose.js +8 -5
  19. package/dist/compositor/compositor.js +6 -4
  20. package/dist/delete-directory.js +3 -3
  21. package/dist/does-have-m2-bug.js +2 -2
  22. package/dist/ensure-output-directory.js +5 -5
  23. package/dist/ffmpeg-filter-file.js +7 -7
  24. package/dist/file-extensions.js +7 -1
  25. package/dist/find-closest-package-json.js +6 -6
  26. package/dist/get-concurrency.js +3 -3
  27. package/dist/get-extension-of-filename.js +2 -2
  28. package/dist/get-local-browser-executable.js +4 -4
  29. package/dist/get-video-threads-flag.js +3 -3
  30. package/dist/index.d.ts +16 -4
  31. package/dist/merge-audio-track.js +2 -2
  32. package/dist/mime-types.js +2 -2
  33. package/dist/offthread-video-server.d.ts +1 -1
  34. package/dist/offthread-video-server.js +2 -2
  35. package/dist/options/jpeg-quality.js +1 -1
  36. package/dist/prepare-server.js +4 -4
  37. package/dist/prestitcher-memory-usage.js +2 -2
  38. package/dist/puppeteer-screenshot.js +1 -1
  39. package/dist/render-frames.js +5 -5
  40. package/dist/render-media.js +9 -9
  41. package/dist/render-still.d.ts +2 -0
  42. package/dist/render-still.js +17 -6
  43. package/dist/resolve-asset-src.js +2 -2
  44. package/dist/screenshot-task.js +2 -2
  45. package/dist/serve-handler/index.d.ts +1 -1
  46. package/dist/serve-handler/index.js +15 -15
  47. package/dist/serve-handler/is-path-inside.js +3 -3
  48. package/dist/serve-static.js +2 -2
  49. package/dist/stitch-frames-to-video.js +13 -13
  50. package/dist/take-frame-and-compose.js +6 -6
  51. package/dist/tmp-dir.js +7 -7
  52. package/install-toolchain.mjs +2 -2
  53. package/package.json +9 -9
  54. package/types/ws/index.d.ts +5 -5
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.serveStatic = void 0;
7
- const http_1 = __importDefault(require("http"));
7
+ const node_http_1 = __importDefault(require("node:http"));
8
8
  const get_port_1 = require("./get-port");
9
9
  const offthread_video_server_1 = require("./offthread-video-server");
10
10
  const serve_handler_1 = require("./serve-handler");
@@ -17,7 +17,7 @@ const serveStatic = async (path, options) => {
17
17
  verbose: options.verbose,
18
18
  });
19
19
  const connections = {};
20
- const server = http_1.default.createServer((request, response) => {
20
+ const server = node_http_1.default.createServer((request, response) => {
21
21
  var _a;
22
22
  if ((_a = request.url) === null || _a === void 0 ? void 0 : _a.startsWith('/proxy')) {
23
23
  return offthreadRequest(request, response);
@@ -27,8 +27,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.stitchFramesToVideo = void 0;
30
- const fs_1 = __importStar(require("fs"));
31
- const path_1 = __importDefault(require("path"));
30
+ const node_fs_1 = __importStar(require("node:fs"));
31
+ const node_path_1 = __importDefault(require("node:path"));
32
32
  const remotion_1 = require("remotion");
33
33
  const calculate_asset_positions_1 = require("./assets/calculate-asset-positions");
34
34
  const convert_assets_to_file_urls_1 = require("./assets/convert-assets-to-file-urls");
@@ -55,9 +55,9 @@ const prores_profile_1 = require("./prores-profile");
55
55
  const truthy_1 = require("./truthy");
56
56
  const validate_even_dimensions_with_codec_1 = require("./validate-even-dimensions-with-codec");
57
57
  const validate_videobitrate_1 = require("./validate-videobitrate");
58
- const packageJsonPath = path_1.default.join(__dirname, '..', 'package.json');
59
- const packageJson = fs_1.default.existsSync(packageJsonPath)
60
- ? JSON.parse(fs_1.default.readFileSync(packageJsonPath, 'utf-8'))
58
+ const packageJsonPath = node_path_1.default.join(__dirname, '..', 'package.json');
59
+ const packageJson = node_fs_1.default.existsSync(packageJsonPath)
60
+ ? JSON.parse(node_fs_1.default.readFileSync(packageJsonPath, 'utf-8'))
61
61
  : null;
62
62
  const getAssetsData = async ({ assets, onDownload, fps, expectedFrames, verbose, onProgress, downloadMap, remotionRoot, }) => {
63
63
  const fileUrlAssets = await (0, convert_assets_to_file_urls_1.convertAssetsToFileUrls)({
@@ -75,7 +75,7 @@ const getAssetsData = async ({ assets, onDownload, fps, expectedFrames, verbose,
75
75
  onProgress(preprocessProgress.reduce((a, b) => a + b, 0) / assetPositions.length);
76
76
  };
77
77
  const preprocessed = (await Promise.all(assetPositions.map(async (asset, index) => {
78
- const filterFile = path_1.default.join(downloadMap.audioMixing, `${index}.wav`);
78
+ const filterFile = node_path_1.default.join(downloadMap.audioMixing, `${index}.wav`);
79
79
  const result = await (0, preprocess_audio_track_1.preprocessAudioTrack)({
80
80
  outName: filterFile,
81
81
  asset,
@@ -87,7 +87,7 @@ const getAssetsData = async ({ assets, onDownload, fps, expectedFrames, verbose,
87
87
  updateProgress();
88
88
  return result;
89
89
  }))).filter(truthy_1.truthy);
90
- const outName = path_1.default.join(downloadMap.audioPreprocessing, `audio.wav`);
90
+ const outName = node_path_1.default.join(downloadMap.audioPreprocessing, `audio.wav`);
91
91
  await (0, merge_audio_track_1.mergeAudioTrack)({
92
92
  files: preprocessed,
93
93
  outName,
@@ -138,7 +138,7 @@ const spawnFfmpeg = async (options, remotionRoot) => {
138
138
  : (_d = options.audioCodec) !== null && _d !== void 0 ? _d : (0, audio_codec_1.getDefaultAudioCodec)({ codec, preferLossless: false });
139
139
  const tempFile = options.outputLocation
140
140
  ? null
141
- : path_1.default.join(options.assetsInfo.downloadMap.stitchFrames, `out.${(0, get_extension_from_codec_1.getFileExtensionFromCodec)(codec, resolvedAudioCodec)}`);
141
+ : node_path_1.default.join(options.assetsInfo.downloadMap.stitchFrames, `out.${(0, get_extension_from_codec_1.getFileExtensionFromCodec)(codec, resolvedAudioCodec)}`);
142
142
  if (options.verbose) {
143
143
  console.log('[verbose] ffmpeg', (0, get_executable_path_1.getExecutablePath)('ffmpeg'));
144
144
  console.log('[verbose] encoder', encoderName);
@@ -197,11 +197,11 @@ const spawnFfmpeg = async (options, remotionRoot) => {
197
197
  await ffmpegTask;
198
198
  (_j = options.onProgress) === null || _j === void 0 ? void 0 : _j.call(options, expectedFrames);
199
199
  if (audio) {
200
- (0, delete_directory_1.deleteDirectory)(path_1.default.dirname(audio));
200
+ (0, delete_directory_1.deleteDirectory)(node_path_1.default.dirname(audio));
201
201
  }
202
202
  const file = await new Promise((resolve, reject) => {
203
203
  if (tempFile) {
204
- fs_1.promises
204
+ node_fs_1.promises
205
205
  .readFile(tempFile)
206
206
  .then((f) => {
207
207
  return resolve(f);
@@ -219,10 +219,10 @@ const spawnFfmpeg = async (options, remotionRoot) => {
219
219
  };
220
220
  }
221
221
  const ffmpegArgs = [
222
- ['-r', String(options.fps)],
223
222
  ...(((_k = options.internalOptions) === null || _k === void 0 ? void 0 : _k.preEncodedFileLocation)
224
223
  ? [['-i', (_l = options.internalOptions) === null || _l === void 0 ? void 0 : _l.preEncodedFileLocation]]
225
224
  : [
225
+ ['-r', String(options.fps)],
226
226
  ['-f', 'image2'],
227
227
  ['-s', `${options.width}x${options.height}`],
228
228
  ['-start_number', String(options.assetsInfo.firstFrameIndex)],
@@ -317,12 +317,12 @@ const spawnFfmpeg = async (options, remotionRoot) => {
317
317
  (0, delete_directory_1.deleteDirectory)(options.assetsInfo.downloadMap.stitchFrames);
318
318
  return null;
319
319
  }
320
- return fs_1.promises
320
+ return node_fs_1.promises
321
321
  .readFile(tempFile)
322
322
  .then((file) => {
323
323
  return Promise.all([
324
324
  file,
325
- (0, delete_directory_1.deleteDirectory)(path_1.default.dirname(tempFile)),
325
+ (0, delete_directory_1.deleteDirectory)(node_path_1.default.dirname(tempFile)),
326
326
  (0, delete_directory_1.deleteDirectory)(options.assetsInfo.downloadMap.stitchFrames),
327
327
  ]);
328
328
  })
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.takeFrameAndCompose = void 0;
7
- const fs_1 = __importDefault(require("fs"));
8
- const path_1 = __importDefault(require("path"));
7
+ const node_fs_1 = __importDefault(require("node:fs"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
9
  const compose_1 = require("./compositor/compose");
10
10
  const provide_screenshot_1 = require("./provide-screenshot");
11
11
  const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
@@ -39,8 +39,8 @@ const takeFrameAndCompose = async ({ freePage, imageFormat, jpegQuality, frame,
39
39
  const needsComposing = clipRegion === null
40
40
  ? null
41
41
  : {
42
- tmpFile: path_1.default.join(downloadMap.compositingDir, `${frame}.${imageFormat}`),
43
- finalOutFile: output !== null && output !== void 0 ? output : path_1.default.join(downloadMap.compositingDir, `${frame}-final.${imageFormat}`),
42
+ tmpFile: node_path_1.default.join(downloadMap.compositingDir, `${frame}.${imageFormat}`),
43
+ finalOutFile: output !== null && output !== void 0 ? output : node_path_1.default.join(downloadMap.compositingDir, `${frame}-final.${imageFormat}`),
44
44
  clipRegion: clipRegion,
45
45
  };
46
46
  if (clipRegion !== 'hide') {
@@ -92,8 +92,8 @@ const takeFrameAndCompose = async ({ freePage, imageFormat, jpegQuality, frame,
92
92
  imageFormat: imageFormat === 'jpeg' ? 'Jpeg' : 'Png',
93
93
  });
94
94
  if (wantsBuffer) {
95
- const buffer = await fs_1.default.promises.readFile(needsComposing.finalOutFile);
96
- await fs_1.default.promises.unlink(needsComposing.finalOutFile);
95
+ const buffer = await node_fs_1.default.promises.readFile(needsComposing.finalOutFile);
96
+ await node_fs_1.default.promises.unlink(needsComposing.finalOutFile);
97
97
  return { buffer, collectedAssets };
98
98
  }
99
99
  }
package/dist/tmp-dir.js CHANGED
@@ -27,9 +27,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.tmpDir = void 0;
30
- const fs_1 = __importStar(require("fs"));
31
- const os_1 = __importDefault(require("os"));
32
- const path_1 = __importDefault(require("path"));
30
+ const node_fs_1 = __importStar(require("node:fs"));
31
+ const node_os_1 = __importDefault(require("node:os"));
32
+ const node_path_1 = __importDefault(require("node:path"));
33
33
  const alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789';
34
34
  const randomHash = () => {
35
35
  return new Array(10)
@@ -40,14 +40,14 @@ const randomHash = () => {
40
40
  .join('');
41
41
  };
42
42
  const tmpDir = (str) => {
43
- const newDir = path_1.default.join(os_1.default.tmpdir(), str + randomHash());
44
- if (fs_1.default.existsSync(newDir)) {
45
- fs_1.default.rmSync(newDir, {
43
+ const newDir = node_path_1.default.join(node_os_1.default.tmpdir(), str + randomHash());
44
+ if (node_fs_1.default.existsSync(newDir)) {
45
+ node_fs_1.default.rmSync(newDir, {
46
46
  recursive: true,
47
47
  force: true,
48
48
  });
49
49
  }
50
- (0, fs_1.mkdirSync)(newDir);
50
+ (0, node_fs_1.mkdirSync)(newDir);
51
51
  return newDir;
52
52
  };
53
53
  exports.tmpDir = tmpDir;
@@ -1,5 +1,5 @@
1
- import {execSync} from 'child_process';
2
- import {existsSync, mkdirSync, unlinkSync} from 'fs';
1
+ import {execSync} from 'node:child_process';
2
+ import {existsSync, mkdirSync, unlinkSync} from 'node:fs';
3
3
  import {toolchains} from './toolchains.mjs';
4
4
 
5
5
  const unpatched = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "4.0.0-alpha5",
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-alpha5",
19
+ "remotion": "4.0.0-alpha6",
20
20
  "source-map": "^0.8.0-beta.0",
21
21
  "ws": "8.7.0"
22
22
  },
@@ -42,13 +42,13 @@
42
42
  "zod": "^3.21.4"
43
43
  },
44
44
  "optionalDependencies": {
45
- "@remotion/compositor-darwin-arm64": "4.0.0-alpha5",
46
- "@remotion/compositor-darwin-x64": "4.0.0-alpha5",
47
- "@remotion/compositor-linux-arm64-gnu": "4.0.0-alpha5",
48
- "@remotion/compositor-linux-arm64-musl": "4.0.0-alpha5",
49
- "@remotion/compositor-linux-x64-gnu": "4.0.0-alpha5",
50
- "@remotion/compositor-linux-x64-musl": "4.0.0-alpha5",
51
- "@remotion/compositor-win32-x64-msvc": "4.0.0-alpha5"
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"
52
52
  },
53
53
  "keywords": [
54
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;