@remotion/renderer 4.0.0 → 4.0.2

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.
@@ -40,6 +40,14 @@ const TaskQueue_1 = require("./TaskQueue");
40
40
  const TimeoutSettings_1 = require("./TimeoutSettings");
41
41
  const util_1 = require("./util");
42
42
  const format_logs_1 = require("../format-logs");
43
+ const shouldHideWarning = (log) => {
44
+ // Mixed Content warnings caused by localhost should not be displayed
45
+ if (log.text.includes('Mixed Content:') &&
46
+ log.text.includes('http://localhost:')) {
47
+ return true;
48
+ }
49
+ return false;
50
+ };
43
51
  class Page extends EventEmitter_1.EventEmitter {
44
52
  static async _create({ client, target, defaultViewport, browser, sourcemapContext, logLevel, indent, }) {
45
53
  const page = new Page({
@@ -106,6 +114,9 @@ class Page extends EventEmitter_1.EventEmitter {
106
114
  this.on('console', (log) => {
107
115
  var _a;
108
116
  const { url, columnNumber, lineNumber } = log.location();
117
+ if (shouldHideWarning(log)) {
118
+ return;
119
+ }
109
120
  if ((url === null || url === void 0 ? void 0 : url.endsWith(remotion_1.Internals.bundleName)) &&
110
121
  lineNumber &&
111
122
  this.sourcemapContext) {
@@ -18,6 +18,12 @@ const shouldLogBrowserMessage = (message) => {
18
18
  if (message.includes('Failed to send GpuControl.CreateCommandBuffer')) {
19
19
  return false;
20
20
  }
21
+ if (message.includes('CreatePlatformSocket() failed: Address family not supported by protocol')) {
22
+ return false;
23
+ }
24
+ if (message.includes('Fontconfig error: No writable cache directories')) {
25
+ return false;
26
+ }
21
27
  return true;
22
28
  };
23
29
  exports.shouldLogBrowserMessage = shouldLogBrowserMessage;
@@ -48,6 +48,9 @@ const formatObjectPreview = (preview) => {
48
48
  return chalk_1.chalk.reset(`${property.name}: ${formatProperty(property)}`);
49
49
  });
50
50
  if (preview.subtype === 'array') {
51
+ if (preview.overflow) {
52
+ return chalk_1.chalk.reset(`[ ${preview.properties.map((p) => formatProperty(p)).join(', ')}, …]`);
53
+ }
51
54
  return chalk_1.chalk.reset(`[ ${preview.properties.map((p) => formatProperty(p)).join(', ')} ]`);
52
55
  }
53
56
  if (preview.subtype === 'arraybuffer') {
@@ -104,6 +107,9 @@ const formatObjectPreview = (preview) => {
104
107
  if (properties.length === 0) {
105
108
  return chalk_1.chalk.reset('{}');
106
109
  }
110
+ if (preview.overflow) {
111
+ return chalk_1.chalk.reset(`{ ${properties.join(', ')}, …}`);
112
+ }
107
113
  return chalk_1.chalk.reset(`{ ${properties.join(', ')} }`);
108
114
  }
109
115
  return '';
package/dist/logger.js CHANGED
@@ -23,15 +23,16 @@ exports.Log = {
23
23
  return console.log(...[
24
24
  options.indent ? exports.INDENT_TOKEN : null,
25
25
  options.tag ? (0, exports.verboseTag)(options.tag) : null,
26
- ...args.map((a) => chalk_1.chalk.gray(a)),
27
- ].filter(truthy_1.truthy));
26
+ ]
27
+ .filter(truthy_1.truthy)
28
+ .concat(args.map((a) => chalk_1.chalk.gray(a))));
28
29
  }
29
30
  },
30
31
  info: (...args) => {
31
32
  exports.Log.infoAdvanced({ indent: false, logLevel: (0, exports.getLogLevel)() }, ...args);
32
33
  },
33
34
  infoAdvanced: (options, ...args) => {
34
- return console.log(...[options.indent ? exports.INDENT_TOKEN : null, ...args].filter(truthy_1.truthy));
35
+ return console.log(...[options.indent ? exports.INDENT_TOKEN : null].filter(truthy_1.truthy).concat(args));
35
36
  },
36
37
  warn: (...args) => {
37
38
  if ((0, log_level_1.isEqualOrBelowLogLevel)((0, exports.getLogLevel)(), 'warn')) {
@@ -40,10 +41,9 @@ exports.Log = {
40
41
  },
41
42
  warnAdvanced: (options, ...args) => {
42
43
  if ((0, log_level_1.isEqualOrBelowLogLevel)(options.logLevel, 'warn')) {
43
- return console.warn(...[
44
- options.indent ? chalk_1.chalk.yellow(exports.INDENT_TOKEN) : null,
45
- ...args.map((a) => chalk_1.chalk.yellow(a)),
46
- ].filter(truthy_1.truthy));
44
+ return console.warn(...[options.indent ? chalk_1.chalk.yellow(exports.INDENT_TOKEN) : null]
45
+ .filter(truthy_1.truthy)
46
+ .concat(args.map((a) => chalk_1.chalk.yellow(a))));
47
47
  }
48
48
  },
49
49
  error: (...args) => {
@@ -5,6 +5,7 @@ const node_url_1 = require("node:url");
5
5
  const download_and_map_assets_to_file_1 = require("./assets/download-and-map-assets-to-file");
6
6
  const compositor_1 = require("./compositor/compositor");
7
7
  const log_level_1 = require("./log-level");
8
+ const logger_1 = require("./logger");
8
9
  const extractUrlAndSourceFromUrl = (url) => {
9
10
  const parsed = new URL(url, 'http://localhost');
10
11
  const query = parsed.search;
@@ -68,8 +69,10 @@ const startOffthreadVideoServer = ({ downloadMap, concurrency, logLevel, indent,
68
69
  res.end();
69
70
  return;
70
71
  }
72
+ let extractStart = Date.now();
71
73
  (0, download_and_map_assets_to_file_1.downloadAsset)({ src, emitter: events, downloadMap })
72
74
  .then((to) => {
75
+ extractStart = Date.now();
73
76
  return compositor.executeCommand('ExtractFrame', {
74
77
  input: to,
75
78
  time,
@@ -77,6 +80,11 @@ const startOffthreadVideoServer = ({ downloadMap, concurrency, logLevel, indent,
77
80
  });
78
81
  })
79
82
  .then((readable) => {
83
+ const extractEnd = Date.now();
84
+ const timeToExtract = extractEnd - extractStart;
85
+ if (timeToExtract > 1000) {
86
+ logger_1.Log.verbose(`Took ${timeToExtract}ms to extract frame from ${src} at ${time}`);
87
+ }
80
88
  if (!readable) {
81
89
  throw new Error('no readable from ffmpeg');
82
90
  }
@@ -149,7 +149,12 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, inputProps
149
149
  frame,
150
150
  });
151
151
  freePage.on('error', errorCallbackOnFrame);
152
+ const startSeeking = Date.now();
152
153
  await (0, seek_to_frame_1.seekToFrame)({ frame, page: freePage, composition: compId });
154
+ const timeToSeek = Date.now() - startSeeking;
155
+ if (timeToSeek > 1000) {
156
+ logger_1.Log.verbose(`Seeking to frame ${frame} took ${timeToSeek}ms`);
157
+ }
153
158
  if (!outputDir && !onFrameBuffer && imageFormat !== 'none') {
154
159
  throw new Error('Called renderFrames() without specifying either `outputDir` or `onFrameBuffer`');
155
160
  }
@@ -94,11 +94,13 @@ const internalRenderMedia = ({ proResProfile, crf, composition, inputProps, pixe
94
94
  logLevel,
95
95
  tag: 'renderMedia()',
96
96
  }, 'Codec supports parallel rendering:', (0, can_use_parallel_encoding_1.canUseParallelEncoding)(codec));
97
- logger_1.Log.verboseAdvanced({
98
- indent,
99
- logLevel,
100
- tag: 'renderMedia()',
101
- }, 'User disallowed parallel encoding:', Boolean(disallowParallelEncoding));
97
+ if (disallowParallelEncoding) {
98
+ logger_1.Log.verboseAdvanced({
99
+ indent,
100
+ logLevel,
101
+ tag: 'renderMedia()',
102
+ }, 'User disallowed parallel encoding.');
103
+ }
102
104
  if (parallelEncoding) {
103
105
  logger_1.Log.verboseAdvanced({
104
106
  indent,
@@ -7,6 +7,7 @@ const normalize_serve_url_1 = require("./normalize-serve-url");
7
7
  const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
8
8
  const redirect_status_codes_1 = require("./redirect-status-codes");
9
9
  const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
10
+ const logger_1 = require("./logger");
10
11
  const innerSetPropsAndEnv = async ({ inputProps, envVariables, page, serveUrl, initialFrame, timeoutInMilliseconds, proxyPort, retriesRemaining, audioEnabled, videoEnabled, }) => {
11
12
  (0, validate_puppeteer_timeout_1.validatePuppeteerTimeout)(timeoutInMilliseconds);
12
13
  const actualTimeout = timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : TimeoutSettings_1.DEFAULT_TIMEOUT;
@@ -103,10 +104,10 @@ const innerSetPropsAndEnv = async ({ inputProps, envVariables, page, serveUrl, i
103
104
  }
104
105
  if (remotionVersion !== version_1.VERSION && process.env.NODE_ENV !== 'test') {
105
106
  if (remotionVersion) {
106
- console.warn(`The site was bundled with version ${remotionVersion} of @remotion/bundler, while @remotion/renderer is on version ${version_1.VERSION}. You may not have the newest bugfixes and features. Re-bundle the site to fix this issue.`);
107
+ logger_1.Log.warn(`The site was bundled with version ${remotionVersion} of @remotion/bundler, while @remotion/renderer is on version ${version_1.VERSION}. You may not have the newest bugfixes and features. Re-bundle the site to fix this issue.`);
107
108
  }
108
109
  else {
109
- console.warn(`The site was bundled with an old version of Remotion, while @remotion/renderer is on version ${version_1.VERSION}. You may not have the newest bugfixes and features. Re-bundle the site to fix this issue.`);
110
+ logger_1.Log.warn(`The site was bundled with an old version of Remotion, while @remotion/renderer is on version ${version_1.VERSION}. You may not have the newest bugfixes and features. Re-bundle the site to fix this issue.`);
110
111
  }
111
112
  }
112
113
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "description": "Renderer for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "extract-zip": "2.0.1",
19
19
  "source-map": "^0.8.0-beta.0",
20
20
  "ws": "8.7.0",
21
- "remotion": "4.0.0"
21
+ "remotion": "4.0.2"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": ">=16.8.0",
@@ -42,13 +42,13 @@
42
42
  "zod": "^3.21.4"
43
43
  },
44
44
  "optionalDependencies": {
45
- "@remotion/compositor-linux-arm64-gnu": "4.0.0",
46
- "@remotion/compositor-linux-x64-gnu": "4.0.0",
47
- "@remotion/compositor-darwin-arm64": "4.0.0",
48
- "@remotion/compositor-linux-x64-musl": "4.0.0",
49
- "@remotion/compositor-linux-arm64-musl": "4.0.0",
50
- "@remotion/compositor-darwin-x64": "4.0.0",
51
- "@remotion/compositor-win32-x64-msvc": "4.0.0"
45
+ "@remotion/compositor-darwin-x64": "4.0.2",
46
+ "@remotion/compositor-darwin-arm64": "4.0.2",
47
+ "@remotion/compositor-linux-x64-gnu": "4.0.2",
48
+ "@remotion/compositor-linux-arm64-gnu": "4.0.2",
49
+ "@remotion/compositor-linux-arm64-musl": "4.0.2",
50
+ "@remotion/compositor-linux-x64-musl": "4.0.2",
51
+ "@remotion/compositor-win32-x64-msvc": "4.0.2"
52
52
  },
53
53
  "keywords": [
54
54
  "remotion",