@remotion/renderer 3.2.27 → 3.2.28

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.
@@ -0,0 +1 @@
1
+ export declare const downloadBrowser: (url: string) => Promise<void>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.downloadBrowser = void 0;
4
+ const listeners = {};
5
+ const isDownloading = {};
6
+ const waitForFfmpegToBeDownloaded = (url) => {
7
+ return new Promise((resolve) => {
8
+ if (!listeners[url]) {
9
+ listeners[url] = [];
10
+ }
11
+ listeners[url].push(resolve);
12
+ });
13
+ };
14
+ const downloadBrowser = async (url) => {
15
+ if (isDownloading[url]) {
16
+ console.log('WAITING');
17
+ return waitForFfmpegToBeDownloaded(url);
18
+ }
19
+ isDownloading[url] = true;
20
+ await new Promise((resolve) => {
21
+ console.log('DOWNLOADING BROWSER');
22
+ setTimeout(resolve, 20000);
23
+ });
24
+ isDownloading[url] = false;
25
+ if (!listeners[url]) {
26
+ listeners[url] = [];
27
+ }
28
+ listeners[url].forEach((listener) => listener());
29
+ listeners[url] = [];
30
+ };
31
+ exports.downloadBrowser = downloadBrowser;
32
+ (0, exports.downloadBrowser)('https://remotion.dev').then(() => {
33
+ (0, exports.downloadBrowser)('https://remotion.dev').then(() => {
34
+ (0, exports.downloadBrowser)('https://remotion.dev').then(() => console.log('FINISHED DOWNLOADING'));
35
+ (0, exports.downloadBrowser)('https://remotion.dev').then(() => console.log('FINISHED DOWNLOADING'));
36
+ (0, exports.downloadBrowser)('https://remotion.dev').then(() => console.log('FINISHED DOWNLOADING'));
37
+ });
38
+ });
@@ -0,0 +1 @@
1
+ export declare const warnIfAppleSiliconIsNotUsingArm64Architecture: () => void;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.warnIfAppleSiliconIsNotUsingArm64Architecture = void 0;
27
+ const os = __importStar(require("os"));
28
+ const warnIfAppleSiliconIsNotUsingArm64Architecture = () => {
29
+ // see https://github.com/nodejs/node/issues/41900#issuecomment-1113511254
30
+ const cpus = os.cpus();
31
+ const isAppleSilicon = cpus[0].model.includes('Apple');
32
+ const isArm64 = os.arch() === 'arm64';
33
+ if (isAppleSilicon && !isArm64) {
34
+ const recommendedNodeVersion = 16;
35
+ const version = process.version.replace('v', '').split('.');
36
+ const majorVersion = Number(version[0]);
37
+ const recommendNodeUpgrade = majorVersion < recommendedNodeVersion;
38
+ console.warn([
39
+ `⚠️ Apple Silicon detected but Node.JS running under Rosetta. This will cause performance issues.\n`,
40
+ `Recommended actions:\n`,
41
+ recommendNodeUpgrade
42
+ ? ` - Upgrade to Node ${recommendedNodeVersion} or later\n`
43
+ : ' - Run Node using `arch -arm64` architecture\n',
44
+ 'See https://remotion.dev/docs/troubleshooting/rosetta for more information.',
45
+ '---',
46
+ ]
47
+ .filter(Boolean)
48
+ .join('\n'));
49
+ }
50
+ };
51
+ exports.warnIfAppleSiliconIsNotUsingArm64Architecture = warnIfAppleSiliconIsNotUsingArm64Architecture;
@@ -2,10 +2,9 @@ export declare type FfmpegVersion = [number, number, number] | null;
2
2
  export declare const getFfmpegBuildInfo: (options: {
3
3
  ffmpegExecutable: string | null;
4
4
  }) => Promise<string>;
5
- export declare const ffmpegHasFeature: ({ ffmpegExecutable, feature, isLambda, }: {
5
+ export declare const ffmpegHasFeature: ({ ffmpegExecutable, feature, }: {
6
6
  ffmpegExecutable: string | null;
7
7
  feature: 'enable-gpl' | 'enable-libx265' | 'enable-libvpx';
8
- isLambda: boolean;
9
8
  }) => Promise<boolean>;
10
9
  export declare const parseFfmpegVersion: (buildconf: string) => FfmpegVersion;
11
10
  export declare const getFfmpegVersion: (options: {
@@ -19,11 +19,7 @@ const getFfmpegBuildInfo = async (options) => {
19
19
  return buildConfig;
20
20
  };
21
21
  exports.getFfmpegBuildInfo = getFfmpegBuildInfo;
22
- const ffmpegHasFeature = async ({ ffmpegExecutable, feature, isLambda, }) => {
23
- if (isLambda) {
24
- // When rendering in the cloud, we don't need a local binary
25
- return true;
26
- }
22
+ const ffmpegHasFeature = async ({ ffmpegExecutable, feature, }) => {
27
23
  if (!(await (0, validate_ffmpeg_1.binaryExists)('ffmpeg', ffmpegExecutable))) {
28
24
  return false;
29
25
  }
package/dist/index.d.ts CHANGED
@@ -26,17 +26,17 @@ export { PixelFormat } from './pixel-format';
26
26
  export { ProResProfile } from './prores-profile';
27
27
  export { renderFrames } from './render-frames';
28
28
  export { renderMedia, RenderMediaOnProgress, RenderMediaOptions, StitchingState, } from './render-media';
29
- export { renderStill } from './render-still';
29
+ export { renderStill, RenderStillOptions } from './render-still';
30
30
  export { StitcherOptions, stitchFramesToVideo } from './stitch-frames-to-video';
31
31
  export { SymbolicatedStackFrame } from './symbolicate-stacktrace';
32
32
  export { OnStartData, RenderFramesOutput } from './types';
33
33
  export { OpenGlRenderer } from './validate-opengl-renderer';
34
+ export { validateOutputFilename } from './validate-output-filename';
34
35
  export declare const RenderInternals: {
35
36
  ensureLocalBrowser: (browser: import("./browser").Browser, preferredBrowserExecutable: import("./browser-executable").BrowserExecutable) => Promise<void>;
36
- ffmpegHasFeature: ({ ffmpegExecutable, feature, isLambda, }: {
37
+ ffmpegHasFeature: ({ ffmpegExecutable, feature, }: {
37
38
  ffmpegExecutable: string | null;
38
39
  feature: "enable-gpl" | "enable-libx265" | "enable-libvpx";
39
- isLambda: boolean;
40
40
  }) => Promise<boolean>;
41
41
  getActualConcurrency: (userPreference: number | null) => number;
42
42
  getFfmpegVersion: (options: {
package/dist/index.js CHANGED
@@ -26,13 +26,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.RenderInternals = exports.stitchFramesToVideo = exports.renderStill = exports.renderMedia = exports.renderFrames = exports.openBrowser = exports.makeCancelSignal = exports.validImageFormats = exports.validateSelectedPixelFormatAndImageFormatCombination = exports.getCompositions = exports.ErrorWithStackFrame = exports.combineVideos = void 0;
29
+ exports.RenderInternals = exports.validateOutputFilename = exports.stitchFramesToVideo = exports.renderStill = exports.renderMedia = exports.renderFrames = exports.openBrowser = exports.makeCancelSignal = exports.validImageFormats = exports.validateSelectedPixelFormatAndImageFormatCombination = exports.getCompositions = exports.ErrorWithStackFrame = exports.combineVideos = void 0;
30
30
  const execa_1 = __importDefault(require("execa"));
31
31
  const download_file_1 = require("./assets/download-file");
32
32
  const download_map_1 = require("./assets/download-map");
33
33
  const browser_1 = require("./browser");
34
34
  const TimeoutSettings_1 = require("./browser/TimeoutSettings");
35
35
  const can_use_parallel_encoding_1 = require("./can-use-parallel-encoding");
36
+ const check_apple_silicon_1 = require("./check-apple-silicon");
36
37
  const codec_1 = require("./codec");
37
38
  const convert_to_positive_frame_index_1 = require("./convert-to-positive-frame-index");
38
39
  const crf_1 = require("./crf");
@@ -95,6 +96,8 @@ var render_still_1 = require("./render-still");
95
96
  Object.defineProperty(exports, "renderStill", { enumerable: true, get: function () { return render_still_1.renderStill; } });
96
97
  var stitch_frames_to_video_2 = require("./stitch-frames-to-video");
97
98
  Object.defineProperty(exports, "stitchFramesToVideo", { enumerable: true, get: function () { return stitch_frames_to_video_2.stitchFramesToVideo; } });
99
+ var validate_output_filename_1 = require("./validate-output-filename");
100
+ Object.defineProperty(exports, "validateOutputFilename", { enumerable: true, get: function () { return validate_output_filename_1.validateOutputFilename; } });
98
101
  exports.RenderInternals = {
99
102
  ensureLocalBrowser: get_local_browser_executable_1.ensureLocalBrowser,
100
103
  ffmpegHasFeature: ffmpeg_flags_1.ffmpegHasFeature,
@@ -159,3 +162,5 @@ exports.RenderInternals = {
159
162
  cleanDownloadMap: download_map_1.cleanDownloadMap,
160
163
  convertToPositiveFrameIndex: convert_to_positive_frame_index_1.convertToPositiveFrameIndex,
161
164
  };
165
+ // Warn of potential performance issues with Apple Silicon (M1 chip under Rosetta)
166
+ (0, check_apple_silicon_1.warnIfAppleSiliconIsNotUsingArm64Architecture)();
@@ -84,7 +84,7 @@ const renderMedia = ({ proResProfile, crf, composition, ffmpegExecutable, ffprob
84
84
  console.log('[PRESTITCHER] Free memory:', freeMemory, 'Estimated usage parallel encoding', estimatedUsage);
85
85
  console.log('[PRESTICHER]: Codec supports parallel rendering:', (0, can_use_parallel_encoding_1.canUseParallelEncoding)(codec));
86
86
  if (parallelEncoding) {
87
- console.log('[PRESTICHER] Parallel encoding is enabled.');
87
+ console.log('[PRESTITCHER] Parallel encoding is enabled.');
88
88
  }
89
89
  else {
90
90
  console.log('[PRESTITCHER] Parallel encoding is disabled.');
@@ -32,7 +32,7 @@ declare type InnerStillOptions = {
32
32
  */
33
33
  downloadMap?: DownloadMap;
34
34
  };
35
- declare type RenderStillOptions = InnerStillOptions & ServeUrlOrWebpackBundle & {
35
+ export declare type RenderStillOptions = InnerStillOptions & ServeUrlOrWebpackBundle & {
36
36
  port?: number | null;
37
37
  };
38
38
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "3.2.27",
3
+ "version": "3.2.28",
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.27",
25
+ "remotion": "3.2.28",
26
26
  "source-map": "^0.8.0-beta.0",
27
27
  "ws": "8.7.0"
28
28
  },
@@ -57,5 +57,5 @@
57
57
  "publishConfig": {
58
58
  "access": "public"
59
59
  },
60
- "gitHead": "662c69bcb2fee4d51553b2f8e61635fb4d6688b1"
60
+ "gitHead": "49bb70afa503bfb0c89ee51d8bf3386ad1b91ac4"
61
61
  }