@remotion/renderer 4.0.19 → 4.0.21

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.
@@ -56,6 +56,7 @@ const fs = __importStar(require("node:fs"));
56
56
  const readline = __importStar(require("readline"));
57
57
  const delete_directory_1 = require("../delete-directory");
58
58
  const logger_1 = require("../logger");
59
+ const truthy_1 = require("../truthy");
59
60
  const assert_1 = require("./assert");
60
61
  const Connection_1 = require("./Connection");
61
62
  const Errors_1 = require("./Errors");
@@ -230,17 +231,19 @@ function waitForWSEndpoint(browserProcess, timeout) {
230
231
  function onClose(error) {
231
232
  cleanup();
232
233
  reject(new Error([
233
- 'Failed to launch the browser process!' +
234
- (error ? ' ' + error.message : ''),
234
+ 'Failed to launch the browser process!',
235
+ error ? error.message : null,
235
236
  stderr,
236
237
  '',
237
238
  'TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md',
238
239
  '',
239
- ].join('\n')));
240
+ ]
241
+ .filter(truthy_1.truthy)
242
+ .join('\n')));
240
243
  }
241
244
  function onTimeout() {
242
245
  cleanup();
243
- reject(new Errors_1.TimeoutError(`Timed out after ${timeout} ms while trying to connect to the browser!`));
246
+ reject(new Errors_1.TimeoutError(`Timed out after ${timeout} ms while trying to connect to the browser! Chrome logged the following: ${stderr}`));
244
247
  }
245
248
  function onLine(line) {
246
249
  stderr += line + '\n';
@@ -75,6 +75,9 @@ export type CompositorCommand = {
75
75
  maximum_frame_cache_items: number;
76
76
  verbose: boolean;
77
77
  };
78
+ CopyImageToClipboard: {
79
+ src: string;
80
+ };
78
81
  GetOpenVideoStats: {};
79
82
  DeliberatePanic: {};
80
83
  CloseAllVideos: {};
@@ -0,0 +1,2 @@
1
+ import type { LogLevel } from './log-level';
2
+ export declare const copyImageToClipboard: (src: string, logLevel: LogLevel) => Promise<void>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.copyImageToClipboard = void 0;
4
+ const compositor_1 = require("./compositor/compositor");
5
+ const copyImageToClipboard = async (src, logLevel) => {
6
+ const compositor = (0, compositor_1.startLongRunningCompositor)((0, compositor_1.getIdealMaximumFrameCacheItems)(), logLevel, false);
7
+ await compositor.executeCommand('CopyImageToClipboard', {
8
+ src,
9
+ });
10
+ compositor.finishCommands();
11
+ await compositor.waitForDone();
12
+ };
13
+ exports.copyImageToClipboard = copyImageToClipboard;
@@ -56,7 +56,19 @@ const innerGetCompositions = async ({ envVariables, serializedInputPropsWithCust
56
56
  page,
57
57
  args: [],
58
58
  });
59
- return result;
59
+ const res = result;
60
+ return res.map((r) => {
61
+ const { width, durationInFrames, fps, height, id } = r;
62
+ return {
63
+ id,
64
+ width,
65
+ height,
66
+ fps,
67
+ durationInFrames,
68
+ props: remotion_1.Internals.deserializeJSONWithCustomFields(r.serializedResolvedPropsWithCustomSchema),
69
+ defaultProps: remotion_1.Internals.deserializeJSONWithCustomFields(r.serializedDefaultPropsWithCustomSchema),
70
+ };
71
+ });
60
72
  };
61
73
  const internalGetCompositions = async ({ browserExecutable, chromiumOptions, envVariables, indent, serializedInputPropsWithCustomSchema, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, }) => {
62
74
  const { page, cleanup: cleanupPage } = await (0, get_browser_instance_1.getPageAndCleanupFn)({
@@ -3,6 +3,6 @@ import type { LogLevel } from './log-level';
3
3
  export declare const getSilentParts: ({ src, noiseThresholdInDecibels: passedNoiseThresholdInDecibels, minDurationInSeconds: passedMinDuration, logLevel, }: {
4
4
  src: string;
5
5
  minDurationInSeconds?: number | undefined;
6
- logLevel?: "verbose" | "info" | "warn" | "error" | undefined;
6
+ logLevel?: "error" | "verbose" | "info" | "warn" | undefined;
7
7
  noiseThresholdInDecibels?: number | undefined;
8
8
  }) => Promise<GetSilentPartsResponse>;
package/dist/index.d.ts CHANGED
@@ -45,7 +45,7 @@ export declare const RenderInternals: {
45
45
  downloadMap: import("./assets/download-map").DownloadMap;
46
46
  remotionRoot: string;
47
47
  concurrency: number;
48
- logLevel: "verbose" | "info" | "warn" | "error";
48
+ logLevel: "error" | "verbose" | "info" | "warn";
49
49
  indent: boolean;
50
50
  }) => Promise<{
51
51
  port: number;
@@ -124,7 +124,7 @@ export declare const RenderInternals: {
124
124
  DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
125
125
  isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | undefined) => boolean;
126
126
  logLevels: readonly ["verbose", "info", "warn", "error"];
127
- isEqualOrBelowLogLevel: (currentLevel: "verbose" | "info" | "warn" | "error", level: "verbose" | "info" | "warn" | "error") => boolean;
127
+ isEqualOrBelowLogLevel: (currentLevel: "error" | "verbose" | "info" | "warn", level: "error" | "verbose" | "info" | "warn") => boolean;
128
128
  isValidLogLevel: (level: string) => boolean;
129
129
  perf: typeof perf;
130
130
  convertToPositiveFrameIndex: ({ frame, durationInFrames, }: {
@@ -361,30 +361,30 @@ export declare const RenderInternals: {
361
361
  verbose: (message?: any, ...optionalParams: any[]) => void;
362
362
  verboseAdvanced: (options: {
363
363
  indent: boolean;
364
- logLevel: "verbose" | "info" | "warn" | "error";
364
+ logLevel: "error" | "verbose" | "info" | "warn";
365
365
  } & {
366
366
  tag?: string | undefined;
367
367
  }, message?: any, ...optionalParams: any[]) => void;
368
368
  info: (message?: any, ...optionalParams: any[]) => void;
369
369
  infoAdvanced: (options: {
370
370
  indent: boolean;
371
- logLevel: "verbose" | "info" | "warn" | "error";
371
+ logLevel: "error" | "verbose" | "info" | "warn";
372
372
  }, message?: any, ...optionalParams: any[]) => void;
373
373
  warn: (message?: any, ...optionalParams: any[]) => void;
374
374
  warnAdvanced: (options: {
375
375
  indent: boolean;
376
- logLevel: "verbose" | "info" | "warn" | "error";
376
+ logLevel: "error" | "verbose" | "info" | "warn";
377
377
  }, message?: any, ...optionalParams: any[]) => void;
378
378
  error: (message?: any, ...optionalParams: any[]) => void;
379
379
  errorAdvanced: (options: {
380
380
  indent: boolean;
381
- logLevel: "verbose" | "info" | "warn" | "error";
381
+ logLevel: "error" | "verbose" | "info" | "warn";
382
382
  } & {
383
383
  tag?: string | undefined;
384
384
  }, message?: any, ...optionalParams: any[]) => void;
385
385
  };
386
- getLogLevel: () => "verbose" | "info" | "warn" | "error";
387
- setLogLevel: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
386
+ getLogLevel: () => "error" | "verbose" | "info" | "warn";
387
+ setLogLevel: (newLogLevel: "error" | "verbose" | "info" | "warn") => void;
388
388
  INDENT_TOKEN: string;
389
389
  isColorSupported: () => boolean;
390
390
  HeadlessBrowser: typeof HeadlessBrowser;
@@ -393,7 +393,7 @@ export declare const RenderInternals: {
393
393
  port: number | null;
394
394
  remotionRoot: string;
395
395
  concurrency: number;
396
- logLevel: "verbose" | "info" | "warn" | "error";
396
+ logLevel: "error" | "verbose" | "info" | "warn";
397
397
  indent: boolean;
398
398
  }) => Promise<import("./prepare-server").RemotionServer>;
399
399
  makeOrReuseServer: (server: import("./prepare-server").RemotionServer | undefined, config: {
@@ -401,7 +401,7 @@ export declare const RenderInternals: {
401
401
  port: number | null;
402
402
  remotionRoot: string;
403
403
  concurrency: number;
404
- logLevel: "verbose" | "info" | "warn" | "error";
404
+ logLevel: "error" | "verbose" | "info" | "warn";
405
405
  indent: boolean;
406
406
  }, { onDownload, onError, }: {
407
407
  onError: (err: Error) => void;
@@ -430,7 +430,7 @@ export declare const RenderInternals: {
430
430
  cancelSignal: import("./make-cancel-signal").CancelSignal | null;
431
431
  indent: boolean;
432
432
  server: import("./prepare-server").RemotionServer | undefined;
433
- logLevel: "verbose" | "info" | "warn" | "error";
433
+ logLevel: "error" | "verbose" | "info" | "warn";
434
434
  serveUrl: string;
435
435
  port: number | null;
436
436
  }) => Promise<{
@@ -443,7 +443,7 @@ export declare const RenderInternals: {
443
443
  viewport: import("./browser/PuppeteerViewport").Viewport | null;
444
444
  indent: boolean;
445
445
  browser: "chrome";
446
- logLevel: "verbose" | "info" | "warn" | "error";
446
+ logLevel: "error" | "verbose" | "info" | "warn";
447
447
  }) => Promise<HeadlessBrowser>;
448
448
  internalSelectComposition: (options: {
449
449
  serializedInputPropsWithCustomSchema: string;
@@ -456,7 +456,7 @@ export declare const RenderInternals: {
456
456
  port: number | null;
457
457
  indent: boolean;
458
458
  server: import("./prepare-server").RemotionServer | undefined;
459
- logLevel: "verbose" | "info" | "warn" | "error";
459
+ logLevel: "error" | "verbose" | "info" | "warn";
460
460
  serveUrl: string;
461
461
  id: string;
462
462
  }) => Promise<{
@@ -474,7 +474,7 @@ export declare const RenderInternals: {
474
474
  port: number | null;
475
475
  server: import("./prepare-server").RemotionServer | undefined;
476
476
  indent: boolean;
477
- logLevel: "verbose" | "info" | "warn" | "error";
477
+ logLevel: "error" | "verbose" | "info" | "warn";
478
478
  serveUrlOrWebpackUrl: string;
479
479
  }) => Promise<import("remotion").VideoConfig[]>;
480
480
  internalRenderFrames: ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency, envVariables, everyNthFrame, frameRange, imageFormat, indent, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, onFrameUpdate, onStart, outputDir, port, puppeteerInstance, scale, server, timeoutInMilliseconds, logLevel, webpackBundleOrServeUrl, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, }: import("./render-frames").InternalRenderFramesOptions) => Promise<import("./types").RenderFramesOutput>;
@@ -483,4 +483,5 @@ export declare const RenderInternals: {
483
483
  slowestFrames: import("./render-media").SlowFrame[];
484
484
  }>;
485
485
  validOpenGlRenderers: readonly ["swangle", "angle", "egl", "swiftshader"];
486
+ copyImageToClipboard: (src: string, logLevel: "error" | "verbose" | "info" | "warn") => Promise<void>;
486
487
  };
package/dist/index.js CHANGED
@@ -42,6 +42,7 @@ const codec_1 = require("./codec");
42
42
  const combine_videos_1 = require("./combine-videos");
43
43
  const get_executable_path_1 = require("./compositor/get-executable-path");
44
44
  const convert_to_positive_frame_index_1 = require("./convert-to-positive-frame-index");
45
+ const copy_to_clipboard_1 = require("./copy-to-clipboard");
45
46
  const delete_directory_1 = require("./delete-directory");
46
47
  const ensure_output_directory_1 = require("./ensure-output-directory");
47
48
  const symbolicate_error_1 = require("./error-handling/symbolicate-error");
@@ -187,6 +188,7 @@ exports.RenderInternals = {
187
188
  internalRenderFrames: render_frames_1.internalRenderFrames,
188
189
  internalRenderMedia: render_media_1.internalRenderMedia,
189
190
  validOpenGlRenderers: validate_opengl_renderer_1.validOpenGlRenderers,
191
+ copyImageToClipboard: copy_to_clipboard_1.copyImageToClipboard,
190
192
  };
191
193
  // Warn of potential performance issues with Apple Silicon (M1 chip under Rosetta)
192
194
  (0, check_apple_silicon_1.checkNodeVersionAndWarnAboutRosetta)();
package/dist/logger.d.ts CHANGED
@@ -19,6 +19,6 @@ export declare const Log: {
19
19
  error: (message?: any, ...optionalParams: any[]) => void;
20
20
  errorAdvanced: (options: VerboseLogOptions, message?: any, ...optionalParams: any[]) => void;
21
21
  };
22
- export declare const getLogLevel: () => "verbose" | "info" | "warn" | "error";
22
+ export declare const getLogLevel: () => "error" | "verbose" | "info" | "warn";
23
23
  export declare const setLogLevel: (newLogLevel: LogLevel) => void;
24
24
  export {};
@@ -110,7 +110,7 @@ const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVa
110
110
  frame: null,
111
111
  page,
112
112
  });
113
- const requiredVersion = '9';
113
+ const requiredVersion = '10';
114
114
  if (siteVersion !== requiredVersion) {
115
115
  throw new Error([
116
116
  `Incompatible site: When visiting ${urlToVisit}, a bundle was found, but one that is not compatible with this version of Remotion. Found version: ${siteVersion} - Required version: ${requiredVersion}. To resolve this error:`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "4.0.19",
3
+ "version": "4.0.21",
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.19"
21
+ "remotion": "4.0.21"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": ">=16.8.0",
@@ -41,13 +41,13 @@
41
41
  "zod": "^3.21.4"
42
42
  },
43
43
  "optionalDependencies": {
44
- "@remotion/compositor-darwin-arm64": "4.0.19",
45
- "@remotion/compositor-linux-arm64-musl": "4.0.19",
46
- "@remotion/compositor-darwin-x64": "4.0.19",
47
- "@remotion/compositor-win32-x64-msvc": "4.0.19",
48
- "@remotion/compositor-linux-x64-musl": "4.0.19",
49
- "@remotion/compositor-linux-x64-gnu": "4.0.19",
50
- "@remotion/compositor-linux-arm64-gnu": "4.0.19"
44
+ "@remotion/compositor-darwin-arm64": "4.0.21",
45
+ "@remotion/compositor-darwin-x64": "4.0.21",
46
+ "@remotion/compositor-linux-arm64-gnu": "4.0.21",
47
+ "@remotion/compositor-linux-arm64-musl": "4.0.21",
48
+ "@remotion/compositor-win32-x64-msvc": "4.0.21",
49
+ "@remotion/compositor-linux-x64-gnu": "4.0.21",
50
+ "@remotion/compositor-linux-x64-musl": "4.0.21"
51
51
  },
52
52
  "keywords": [
53
53
  "remotion",
@@ -1,16 +0,0 @@
1
- /**
2
- * Copyright 2020 Google Inc. All rights reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- export type Product = 'chrome' | 'firefox';
@@ -1,17 +0,0 @@
1
- "use strict";
2
- /**
3
- * Copyright 2020 Google Inc. All rights reserved.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,17 +0,0 @@
1
- /**
2
- * Copyright 2020 Google Inc. All rights reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import type { Product } from './Product';
17
- export declare function downloadBrowser(product: Product): Promise<void>;
@@ -1,58 +0,0 @@
1
- "use strict";
2
- /**
3
- * Copyright 2020 Google Inc. All rights reserved.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.downloadBrowser = void 0;
19
- const BrowserFetcher_1 = require("./BrowserFetcher");
20
- const revisions_1 = require("./revisions");
21
- const supportedProducts = {
22
- chrome: 'Chromium',
23
- firefox: 'Firefox Nightly',
24
- };
25
- function getRevision(product) {
26
- if (product === 'chrome') {
27
- return revisions_1.PUPPETEER_REVISIONS.chromium;
28
- }
29
- throw new Error(`Unsupported product ${product}`);
30
- }
31
- async function downloadBrowser(product) {
32
- const revision = getRevision(product);
33
- const revisionInfo = (0, BrowserFetcher_1.getRevisionInfo)(revision, product);
34
- await (0, BrowserFetcher_1.download)({
35
- revision: revisionInfo.revision,
36
- progressCallback: (downloadedBytes, totalBytes) => {
37
- console.log('Downloading', supportedProducts[product], toMegabytes(downloadedBytes) + '/' + toMegabytes(totalBytes));
38
- },
39
- product,
40
- platform: (0, BrowserFetcher_1.getPlatform)(product),
41
- downloadHost: (0, BrowserFetcher_1.getDownloadHost)(product),
42
- downloadsFolder: (0, BrowserFetcher_1.getDownloadsFolder)(product),
43
- });
44
- const _localRevisions = await (0, BrowserFetcher_1.localRevisions)((0, BrowserFetcher_1.getDownloadsFolder)(product), product, (0, BrowserFetcher_1.getPlatform)(product));
45
- console.log(`${supportedProducts[product]} (${revisionInfo.revision}) downloaded to ${revisionInfo.folderPath}`);
46
- await Promise.all(_localRevisions
47
- .filter((__revision) => {
48
- return __revision !== revisionInfo.revision;
49
- })
50
- .map((__revision) => {
51
- return (0, BrowserFetcher_1.removeBrowser)(__revision, (0, BrowserFetcher_1.getFolderPath)(revision, (0, BrowserFetcher_1.getDownloadsFolder)(product), (0, BrowserFetcher_1.getPlatform)(product)));
52
- }));
53
- }
54
- exports.downloadBrowser = downloadBrowser;
55
- function toMegabytes(bytes) {
56
- const mb = bytes / 1024 / 1024;
57
- return `${Math.round(mb * 10) / 10} Mb`;
58
- }
@@ -1,20 +0,0 @@
1
- /**
2
- * Copyright 2020 Google Inc. All rights reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- type Revisions = Readonly<{
17
- readonly chromium: string;
18
- }>;
19
- export declare const PUPPETEER_REVISIONS: Revisions;
20
- export {};
@@ -1,21 +0,0 @@
1
- "use strict";
2
- /**
3
- * Copyright 2020 Google Inc. All rights reserved.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.PUPPETEER_REVISIONS = void 0;
19
- exports.PUPPETEER_REVISIONS = {
20
- chromium: '1002410',
21
- };