@remotion/renderer 3.2.32 → 3.2.33

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.
@@ -1 +1 @@
1
- export declare const warnIfAppleSiliconIsNotUsingArm64Architecture: () => void;
1
+ export declare const checkNodeVersionAndWarnAboutRosetta: () => void;
@@ -23,17 +23,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.warnIfAppleSiliconIsNotUsingArm64Architecture = void 0;
26
+ exports.checkNodeVersionAndWarnAboutRosetta = void 0;
27
27
  const os = __importStar(require("os"));
28
- const warnIfAppleSiliconIsNotUsingArm64Architecture = () => {
28
+ const checkNodeVersionAndWarnAboutRosetta = () => {
29
29
  // see https://github.com/nodejs/node/issues/41900#issuecomment-1113511254
30
30
  const cpus = os.cpus();
31
31
  const isAppleSilicon = cpus[0].model.includes('Apple');
32
32
  const isArm64 = os.arch() === 'arm64';
33
+ const version = process.version.replace('v', '').split('.');
34
+ const majorVersion = Number(version[0]);
35
+ const requiredNodeVersion = 14;
36
+ if (majorVersion < 13) {
37
+ throw new Error(`Remotion requires at least Node ${requiredNodeVersion}. You currently have ${process.version}. Update your node version to ${requiredNodeVersion} to use Remotion.`);
38
+ }
33
39
  if (isAppleSilicon && !isArm64) {
34
40
  const recommendedNodeVersion = 16;
35
- const version = process.version.replace('v', '').split('.');
36
- const majorVersion = Number(version[0]);
37
41
  const recommendNodeUpgrade = majorVersion < recommendedNodeVersion;
38
42
  console.warn([
39
43
  `⚠️ Apple Silicon detected but Node.JS running under Rosetta. This will cause performance issues.\n`,
@@ -48,4 +52,4 @@ const warnIfAppleSiliconIsNotUsingArm64Architecture = () => {
48
52
  .join('\n'));
49
53
  }
50
54
  };
51
- exports.warnIfAppleSiliconIsNotUsingArm64Architecture = warnIfAppleSiliconIsNotUsingArm64Architecture;
55
+ exports.checkNodeVersionAndWarnAboutRosetta = checkNodeVersionAndWarnAboutRosetta;
@@ -10,3 +10,7 @@ export declare const parseFfmpegVersion: (buildconf: string) => FfmpegVersion;
10
10
  export declare const getFfmpegVersion: (options: {
11
11
  ffmpegExecutable: string | null;
12
12
  }) => Promise<FfmpegVersion>;
13
+ export declare const warnAboutFfmpegVersion: ({ ffmpegVersion, buildConf, }: {
14
+ ffmpegVersion: FfmpegVersion;
15
+ buildConf: string | null;
16
+ }) => null | undefined;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getFfmpegVersion = exports.parseFfmpegVersion = exports.ffmpegHasFeature = exports.getFfmpegBuildInfo = void 0;
6
+ exports.warnAboutFfmpegVersion = exports.getFfmpegVersion = exports.parseFfmpegVersion = exports.ffmpegHasFeature = exports.getFfmpegBuildInfo = void 0;
7
7
  const execa_1 = __importDefault(require("execa"));
8
8
  const validate_ffmpeg_1 = require("./validate-ffmpeg");
9
9
  let buildConfig = null;
@@ -20,7 +20,7 @@ const getFfmpegBuildInfo = async (options) => {
20
20
  };
21
21
  exports.getFfmpegBuildInfo = getFfmpegBuildInfo;
22
22
  const ffmpegHasFeature = async ({ ffmpegExecutable, feature, }) => {
23
- if (!(await (0, validate_ffmpeg_1.binaryExists)('ffmpeg', ffmpegExecutable))) {
23
+ if (!(0, validate_ffmpeg_1.binaryExists)('ffmpeg', ffmpegExecutable)) {
24
24
  return false;
25
25
  }
26
26
  const config = await (0, exports.getFfmpegBuildInfo)({ ffmpegExecutable });
@@ -43,3 +43,37 @@ const getFfmpegVersion = async (options) => {
43
43
  return (0, exports.parseFfmpegVersion)(buildInfo);
44
44
  };
45
45
  exports.getFfmpegVersion = getFfmpegVersion;
46
+ const printMessage = (ffmpegVersion) => {
47
+ console.warn('⚠️Old FFMPEG version detected: ' + ffmpegVersion.join('.'));
48
+ console.warn(' For audio support, you need at least version 4.1.0.');
49
+ console.warn(' Upgrade FFMPEG to get rid of this warning.');
50
+ };
51
+ const printBuildConfMessage = () => {
52
+ console.error('⚠️ Unsupported FFMPEG version detected.');
53
+ console.error(" Your version doesn't support the -buildconf flag");
54
+ console.error(' Audio will not be supported and you may experience other issues.');
55
+ console.error(' Upgrade FFMPEG to at least v4.1.0 to get rid of this warning.');
56
+ };
57
+ const warnAboutFfmpegVersion = ({ ffmpegVersion, buildConf, }) => {
58
+ if (buildConf === null) {
59
+ printBuildConfMessage();
60
+ return;
61
+ }
62
+ if (ffmpegVersion === null) {
63
+ return null;
64
+ }
65
+ const [major, minor] = ffmpegVersion;
66
+ // 3.x and below definitely is too old
67
+ if (major < 4) {
68
+ printMessage(ffmpegVersion);
69
+ return;
70
+ }
71
+ // 5.x will be all good
72
+ if (major > 4) {
73
+ return;
74
+ }
75
+ if (minor < 1) {
76
+ printMessage(ffmpegVersion);
77
+ }
78
+ };
79
+ exports.warnAboutFfmpegVersion = warnAboutFfmpegVersion;
@@ -7,6 +7,7 @@ const get_browser_instance_1 = require("./get-browser-instance");
7
7
  const prepare_server_1 = require("./prepare-server");
8
8
  const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
9
9
  const set_props_and_env_1 = require("./set-props-and-env");
10
+ const validate_ffmpeg_1 = require("./validate-ffmpeg");
10
11
  const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
11
12
  const innerGetCompositions = async (serveUrl, page, config, proxyPort) => {
12
13
  if (config === null || config === void 0 ? void 0 : config.onBrowserLog) {
@@ -54,12 +55,13 @@ const innerGetCompositions = async (serveUrl, page, config, proxyPort) => {
54
55
  return result;
55
56
  };
56
57
  const getCompositions = async (serveUrlOrWebpackUrl, config) => {
57
- var _a, _b, _c;
58
- const downloadMap = (_a = config === null || config === void 0 ? void 0 : config.downloadMap) !== null && _a !== void 0 ? _a : (0, download_map_1.makeDownloadMap)();
58
+ var _a, _b, _c, _d;
59
+ await (0, validate_ffmpeg_1.validateFfmpeg)((_a = config === null || config === void 0 ? void 0 : config.ffmpegExecutable) !== null && _a !== void 0 ? _a : null);
60
+ const downloadMap = (_b = config === null || config === void 0 ? void 0 : config.downloadMap) !== null && _b !== void 0 ? _b : (0, download_map_1.makeDownloadMap)();
59
61
  const { page, cleanup } = await (0, get_browser_instance_1.getPageAndCleanupFn)({
60
62
  passedInInstance: config === null || config === void 0 ? void 0 : config.puppeteerInstance,
61
- browserExecutable: (_b = config === null || config === void 0 ? void 0 : config.browserExecutable) !== null && _b !== void 0 ? _b : null,
62
- chromiumOptions: (_c = config === null || config === void 0 ? void 0 : config.chromiumOptions) !== null && _c !== void 0 ? _c : {},
63
+ browserExecutable: (_c = config === null || config === void 0 ? void 0 : config.browserExecutable) !== null && _c !== void 0 ? _c : null,
64
+ chromiumOptions: (_d = config === null || config === void 0 ? void 0 : config.chromiumOptions) !== null && _d !== void 0 ? _d : {},
63
65
  });
64
66
  return new Promise((resolve, reject) => {
65
67
  var _a, _b, _c;
package/dist/index.d.ts CHANGED
@@ -39,14 +39,8 @@ export declare const RenderInternals: {
39
39
  feature: "enable-gpl" | "enable-libx265" | "enable-libvpx";
40
40
  }) => Promise<boolean>;
41
41
  getActualConcurrency: (userPreference: number | null) => number;
42
- getFfmpegVersion: (options: {
43
- ffmpegExecutable: string | null;
44
- }) => Promise<import("./ffmpeg-flags").FfmpegVersion>;
45
42
  validateFfmpeg: (customFfmpegBinary: string | null) => Promise<void>;
46
- binaryExists: (name: "ffmpeg" | "brew", localFFmpeg: string | null) => Promise<boolean>;
47
- getFfmpegBuildInfo: (options: {
48
- ffmpegExecutable: string | null;
49
- }) => Promise<string>;
43
+ binaryExists: (name: "ffmpeg" | "brew", localFFmpeg: string | null) => boolean;
50
44
  serveStatic: (path: string | null, options: {
51
45
  port: number | null;
52
46
  ffmpegExecutable: import("./ffmpeg-executable").FfmpegExecutable;
@@ -158,4 +152,7 @@ export declare const RenderInternals: {
158
152
  durationInFrames: number;
159
153
  }) => number;
160
154
  validateBitrate: (bitrate: unknown, name: string) => void;
155
+ getFfmpegVersion: (options: {
156
+ ffmpegExecutable: string | null;
157
+ }) => Promise<import("./ffmpeg-flags").FfmpegVersion>;
161
158
  };
package/dist/index.js CHANGED
@@ -103,10 +103,8 @@ exports.RenderInternals = {
103
103
  ensureLocalBrowser: get_local_browser_executable_1.ensureLocalBrowser,
104
104
  ffmpegHasFeature: ffmpeg_flags_1.ffmpegHasFeature,
105
105
  getActualConcurrency: get_concurrency_1.getActualConcurrency,
106
- getFfmpegVersion: ffmpeg_flags_1.getFfmpegVersion,
107
106
  validateFfmpeg: validate_ffmpeg_1.validateFfmpeg,
108
107
  binaryExists: validate_ffmpeg_1.binaryExists,
109
- getFfmpegBuildInfo: ffmpeg_flags_1.getFfmpegBuildInfo,
110
108
  serveStatic: serve_static_1.serveStatic,
111
109
  validateEvenDimensionsWithCodec: validate_even_dimensions_with_codec_1.validateEvenDimensionsWithCodec,
112
110
  normalizeServeUrl: normalize_serve_url_1.normalizeServeUrl,
@@ -162,6 +160,7 @@ exports.RenderInternals = {
162
160
  cleanDownloadMap: download_map_1.cleanDownloadMap,
163
161
  convertToPositiveFrameIndex: convert_to_positive_frame_index_1.convertToPositiveFrameIndex,
164
162
  validateBitrate: validate_videobitrate_1.validateBitrate,
163
+ getFfmpegVersion: ffmpeg_flags_1.getFfmpegVersion,
165
164
  };
166
165
  // Warn of potential performance issues with Apple Silicon (M1 chip under Rosetta)
167
- (0, check_apple_silicon_1.warnIfAppleSiliconIsNotUsingArm64Architecture)();
166
+ (0, check_apple_silicon_1.checkNodeVersionAndWarnAboutRosetta)();
@@ -227,11 +227,12 @@ const innerRenderFrames = ({ onFrameUpdate, outputDir, onStart, inputProps, qual
227
227
  return compressedAssets;
228
228
  }));
229
229
  const happyPath = progress.then(() => {
230
+ const firstFrameIndex = countType === 'from-zero' ? 0 : framesToRender[0];
230
231
  const returnValue = {
231
232
  assetsInfo: {
232
233
  assets,
233
234
  imageSequenceName: `element-%0${filePadLength}d.${imageFormat}`,
234
- firstFrameIndex: framesToRender[0],
235
+ firstFrameIndex,
235
236
  downloadMap,
236
237
  },
237
238
  frameCount: framesToRender.length,
@@ -31,6 +31,7 @@ const quality_1 = require("./quality");
31
31
  const render_frames_1 = require("./render-frames");
32
32
  const stitch_frames_to_video_1 = require("./stitch-frames-to-video");
33
33
  const validate_even_dimensions_with_codec_1 = require("./validate-even-dimensions-with-codec");
34
+ const validate_ffmpeg_1 = require("./validate-ffmpeg");
34
35
  const validate_ffmpeg_override_1 = require("./validate-ffmpeg-override");
35
36
  const validate_output_filename_1 = require("./validate-output-filename");
36
37
  const validate_scale_1 = require("./validate-scale");
@@ -52,6 +53,7 @@ const getConcurrency = (others) => {
52
53
  */
53
54
  const renderMedia = ({ proResProfile, crf, composition, ffmpegExecutable, ffprobeExecutable, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, dumpBrowserLogs, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, onSlowestFrames, ...options }) => {
54
55
  var _a, _b, _c, _d;
56
+ (0, validate_ffmpeg_1.validateFfmpeg)(ffmpegExecutable !== null && ffmpegExecutable !== void 0 ? ffmpegExecutable : null);
55
57
  (0, quality_1.validateQuality)(options.quality);
56
58
  (0, crf_1.validateQualitySettings)({ crf, codec, videoBitrate });
57
59
  (0, validate_videobitrate_1.validateBitrate)(audioBitrate, 'audioBitrate');
@@ -1,2 +1,5 @@
1
- export declare const binaryExists: (name: 'ffmpeg' | 'brew', localFFmpeg: string | null) => Promise<boolean>;
1
+ export declare const binaryExists: (name: 'ffmpeg' | 'brew', localFFmpeg: string | null) => boolean;
2
+ export declare const checkAndValidateFfmpegVersion: (options: {
3
+ ffmpegExecutable: string | null;
4
+ }) => Promise<void>;
2
5
  export declare const validateFfmpeg: (customFfmpegBinary: string | null) => Promise<void>;
@@ -3,12 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.validateFfmpeg = exports.binaryExists = void 0;
6
+ exports.validateFfmpeg = exports.checkAndValidateFfmpegVersion = exports.binaryExists = void 0;
7
7
  const execa_1 = __importDefault(require("execa"));
8
8
  const fs_1 = require("fs");
9
9
  const os_1 = __importDefault(require("os"));
10
+ const ffmpeg_flags_1 = require("./ffmpeg-flags");
11
+ const warn_about_ffmpeg_version_1 = require("./warn-about-ffmpeg-version");
10
12
  const existsMap = {};
11
- const binaryExists = async (name, localFFmpeg) => {
13
+ const binaryExists = (name, localFFmpeg) => {
12
14
  if (typeof existsMap[name] !== 'undefined') {
13
15
  return existsMap[name];
14
16
  }
@@ -25,7 +27,7 @@ const binaryExists = async (name, localFFmpeg) => {
25
27
  const isWin = os_1.default.platform() === 'win32';
26
28
  const where = isWin ? 'where' : 'which';
27
29
  try {
28
- await (0, execa_1.default)(where, [name]);
30
+ execa_1.default.sync(where, [name]);
29
31
  existsMap[name] = true;
30
32
  return true;
31
33
  }
@@ -38,16 +40,26 @@ exports.binaryExists = binaryExists;
38
40
  const isHomebrewInstalled = () => {
39
41
  return (0, exports.binaryExists)('brew', null);
40
42
  };
43
+ const checkAndValidateFfmpegVersion = async (options) => {
44
+ const ffmpegVersion = await (0, ffmpeg_flags_1.getFfmpegVersion)({
45
+ ffmpegExecutable: options.ffmpegExecutable,
46
+ });
47
+ const buildConf = await (0, ffmpeg_flags_1.getFfmpegBuildInfo)({
48
+ ffmpegExecutable: options.ffmpegExecutable,
49
+ });
50
+ (0, warn_about_ffmpeg_version_1.warnAboutFfmpegVersion)({ ffmpegVersion, buildConf });
51
+ };
52
+ exports.checkAndValidateFfmpegVersion = checkAndValidateFfmpegVersion;
41
53
  const validateFfmpeg = async (customFfmpegBinary) => {
42
- const ffmpegExists = await (0, exports.binaryExists)('ffmpeg', customFfmpegBinary);
54
+ const ffmpegExists = (0, exports.binaryExists)('ffmpeg', customFfmpegBinary);
43
55
  if (!ffmpegExists) {
44
56
  if (customFfmpegBinary) {
45
57
  console.error('FFmpeg executable not found:');
46
58
  console.error(customFfmpegBinary);
47
- process.exit(1);
59
+ throw new Error('FFmpeg not found');
48
60
  }
49
61
  console.error('It looks like FFMPEG is not installed');
50
- if (os_1.default.platform() === 'darwin' && (await isHomebrewInstalled())) {
62
+ if (os_1.default.platform() === 'darwin' && isHomebrewInstalled()) {
51
63
  console.error('Run `brew install ffmpeg` to install ffmpeg');
52
64
  }
53
65
  else if (os_1.default.platform() === 'win32') {
@@ -66,7 +78,8 @@ const validateFfmpeg = async (customFfmpegBinary) => {
66
78
  else {
67
79
  console.error('See https://github.com/adaptlearning/adapt_authoring/wiki/Installing-FFmpeg on how to install FFMPEG.');
68
80
  }
69
- process.exit(1);
81
+ throw new Error('FFmpeg not found');
70
82
  }
83
+ await (0, exports.checkAndValidateFfmpegVersion)({ ffmpegExecutable: customFfmpegBinary });
71
84
  };
72
85
  exports.validateFfmpeg = validateFfmpeg;
@@ -0,0 +1,5 @@
1
+ import type { FfmpegVersion } from './ffmpeg-flags';
2
+ export declare const warnAboutFfmpegVersion: ({ ffmpegVersion, buildConf, }: {
3
+ ffmpegVersion: FfmpegVersion;
4
+ buildConf: string | null;
5
+ }) => null | undefined;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.warnAboutFfmpegVersion = void 0;
4
+ const printMessage = (ffmpegVersion) => {
5
+ console.warn('⚠️Old FFMPEG version detected: ' + ffmpegVersion.join('.'));
6
+ console.warn(' For audio support, you need at least version 4.1.0.');
7
+ console.warn(' Upgrade FFMPEG to get rid of this warning.');
8
+ };
9
+ const printBuildConfMessage = () => {
10
+ console.error('⚠️ Unsupported FFMPEG version detected.');
11
+ console.error(" Your version doesn't support the -buildconf flag");
12
+ console.error(' Audio will not be supported and you may experience other issues.');
13
+ console.error(' Upgrade FFMPEG to at least v4.1.0 to get rid of this warning.');
14
+ };
15
+ const warnAboutFfmpegVersion = ({ ffmpegVersion, buildConf, }) => {
16
+ if (buildConf === null) {
17
+ printBuildConfMessage();
18
+ return;
19
+ }
20
+ if (ffmpegVersion === null) {
21
+ return null;
22
+ }
23
+ const [major, minor] = ffmpegVersion;
24
+ // 3.x and below definitely is too old
25
+ if (major < 4) {
26
+ printMessage(ffmpegVersion);
27
+ return;
28
+ }
29
+ // 5.x will be all good
30
+ if (major > 4) {
31
+ return;
32
+ }
33
+ if (minor < 1) {
34
+ printMessage(ffmpegVersion);
35
+ }
36
+ };
37
+ exports.warnAboutFfmpegVersion = warnAboutFfmpegVersion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "3.2.32",
3
+ "version": "3.2.33",
4
4
  "description": "Renderer for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "execa": "5.1.1",
24
24
  "extract-zip": "2.0.1",
25
- "remotion": "3.2.32",
25
+ "remotion": "3.2.33",
26
26
  "source-map": "^0.8.0-beta.0",
27
27
  "ws": "8.7.0"
28
28
  },
@@ -44,7 +44,7 @@
44
44
  "react": "18.0.0",
45
45
  "react-dom": "18.0.0",
46
46
  "typescript": "^4.7.0",
47
- "vitest": "0.18.0"
47
+ "vitest": "0.24.3"
48
48
  },
49
49
  "keywords": [
50
50
  "remotion",
@@ -57,5 +57,5 @@
57
57
  "publishConfig": {
58
58
  "access": "public"
59
59
  },
60
- "gitHead": "4f7ab3637405d140041f898f95f78c99943d1b40"
60
+ "gitHead": "3c864e5ab73870674d028a1199005ddbabaede12"
61
61
  }
package/vitest.config.ts DELETED
@@ -1,8 +0,0 @@
1
- import {defineConfig} from 'vitest/config';
2
-
3
- export default defineConfig({
4
- test: {
5
- testTimeout: 90000,
6
- maxConcurrency: 2,
7
- },
8
- });