@remotion/renderer 4.0.375 → 4.0.377

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.
package/dist/client.d.ts CHANGED
@@ -1363,6 +1363,21 @@ export declare const BrowserSafeApis: {
1363
1363
  setConfig: (newChromeMode: import("./options/chrome-mode").ChromeMode) => void;
1364
1364
  type: import("./options/chrome-mode").ChromeMode;
1365
1365
  };
1366
+ readonly apiKey: {
1367
+ name: string;
1368
+ cliFlag: "api-key";
1369
+ description: () => import("react/jsx-runtime").JSX.Element;
1370
+ ssrName: "apiKey";
1371
+ docLink: string;
1372
+ type: string | null;
1373
+ getValue: ({ commandLine }: {
1374
+ commandLine: Record<string, unknown>;
1375
+ }) => {
1376
+ source: string;
1377
+ value: string | null;
1378
+ };
1379
+ setConfig: (value: string | null) => void;
1380
+ };
1366
1381
  };
1367
1382
  readonly stitchFramesToVideo: {
1368
1383
  readonly separateAudioTo: {
@@ -1539,6 +1554,21 @@ export declare const BrowserSafeApis: {
1539
1554
  setConfig: (newChromeMode: import("./options/chrome-mode").ChromeMode) => void;
1540
1555
  type: import("./options/chrome-mode").ChromeMode;
1541
1556
  };
1557
+ readonly apiKey: {
1558
+ name: string;
1559
+ cliFlag: "api-key";
1560
+ description: () => import("react/jsx-runtime").JSX.Element;
1561
+ ssrName: "apiKey";
1562
+ docLink: string;
1563
+ type: string | null;
1564
+ getValue: ({ commandLine }: {
1565
+ commandLine: Record<string, unknown>;
1566
+ }) => {
1567
+ source: string;
1568
+ value: string | null;
1569
+ };
1570
+ setConfig: (value: string | null) => void;
1571
+ };
1542
1572
  };
1543
1573
  readonly getCompositions: {
1544
1574
  readonly mediaCacheSizeInBytes: {
@@ -2486,8 +2486,10 @@ var delayRenderTimeoutInMillisecondsOption = {
2486
2486
  })
2487
2487
  }),
2488
2488
  " ",
2489
- "calls ",
2489
+ "calls",
2490
+ " ",
2490
2491
  /* @__PURE__ */ jsx36("a", {
2492
+ style: { fontSize: "inherit" },
2491
2493
  href: "https://remotion.dev/docs/timeout",
2492
2494
  children: "before it times out"
2493
2495
  }),
@@ -3039,7 +3041,8 @@ var optionsMap = {
3039
3041
  audioCodec: audioCodecOption,
3040
3042
  onBrowserDownload: onBrowserDownloadOption,
3041
3043
  hardwareAcceleration: hardwareAccelerationOption,
3042
- chromeMode: chromeModeOption
3044
+ chromeMode: chromeModeOption,
3045
+ apiKey: apiKeyOption
3043
3046
  },
3044
3047
  stitchFramesToVideo: {
3045
3048
  separateAudioTo: separateAudioOption,
@@ -3054,7 +3057,8 @@ var optionsMap = {
3054
3057
  timeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption,
3055
3058
  binariesDirectory: binariesDirectoryOption,
3056
3059
  onBrowserDownload: onBrowserDownloadOption,
3057
- chromeMode: chromeModeOption
3060
+ chromeMode: chromeModeOption,
3061
+ apiKey: apiKeyOption
3058
3062
  },
3059
3063
  getCompositions: {
3060
3064
  mediaCacheSizeInBytes: mediaCacheSizeInBytesOption,
@@ -19312,6 +19312,7 @@ var renderFrames = (options) => {
19312
19312
  };
19313
19313
 
19314
19314
  // src/render-media.ts
19315
+ import { registerUsageEvent } from "@remotion/licensing";
19315
19316
  import fs16 from "node:fs";
19316
19317
  import os6 from "node:os";
19317
19318
  import path26 from "node:path";
@@ -21423,7 +21424,8 @@ var internalRenderMediaRaw = ({
21423
21424
  chromeMode,
21424
21425
  offthreadVideoThreads,
21425
21426
  mediaCacheSizeInBytes,
21426
- onLog
21427
+ onLog,
21428
+ apiKey
21427
21429
  }) => {
21428
21430
  const pixelFormat = userPixelFormat ?? compositionWithPossibleUnevenDimensions.defaultPixelFormat ?? DEFAULT_PIXEL_FORMAT;
21429
21431
  if (repro) {
@@ -21806,14 +21808,34 @@ var internalRenderMediaRaw = ({
21806
21808
  buffer,
21807
21809
  slowestFrames
21808
21810
  };
21811
+ const sendTelemetryAndResolve = () => {
21812
+ if (apiKey === null) {
21813
+ resolve2(result);
21814
+ return;
21815
+ }
21816
+ registerUsageEvent({
21817
+ apiKey,
21818
+ event: "cloud-render",
21819
+ host: null,
21820
+ succeeded: true
21821
+ }).then(() => {
21822
+ Log.verbose({ indent, logLevel }, "Usage event sent successfully");
21823
+ }).catch((err) => {
21824
+ Log.error({ indent, logLevel }, "Failed to send usage event");
21825
+ Log.error({ indent: true, logLevel }, err);
21826
+ }).finally(() => {
21827
+ resolve2(result);
21828
+ });
21829
+ };
21809
21830
  if (isReproEnabled()) {
21810
21831
  getReproWriter().onRenderSucceed({ indent, logLevel, output: absoluteOutputLocation }).then(() => {
21811
- resolve2(result);
21832
+ sendTelemetryAndResolve();
21812
21833
  }).catch((err) => {
21813
21834
  Log.error({ indent, logLevel }, "Could not create reproduction", err);
21835
+ sendTelemetryAndResolve();
21814
21836
  });
21815
21837
  } else {
21816
- resolve2(result);
21838
+ sendTelemetryAndResolve();
21817
21839
  }
21818
21840
  }).catch((err) => {
21819
21841
  cancelled = true;
@@ -21910,7 +21932,8 @@ var renderMedia = ({
21910
21932
  chromeMode,
21911
21933
  offthreadVideoThreads,
21912
21934
  compositionStart,
21913
- mediaCacheSizeInBytes
21935
+ mediaCacheSizeInBytes,
21936
+ apiKey
21914
21937
  }) => {
21915
21938
  const indent = false;
21916
21939
  const logLevel = verbose || dumpBrowserLogs ? "verbose" : passedLogLevel ?? "info";
@@ -21995,11 +22018,13 @@ var renderMedia = ({
21995
22018
  hardwareAcceleration: hardwareAcceleration ?? "disable",
21996
22019
  chromeMode: chromeMode ?? "headless-shell",
21997
22020
  mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
22021
+ apiKey: apiKey ?? null,
21998
22022
  onLog: defaultOnLog
21999
22023
  });
22000
22024
  };
22001
22025
 
22002
22026
  // src/render-still.ts
22027
+ import { registerUsageEvent as registerUsageEvent2 } from "@remotion/licensing";
22003
22028
  import fs17, { statSync as statSync2 } from "node:fs";
22004
22029
  import path27 from "node:path";
22005
22030
  import { NoReactInternals as NoReactInternals16 } from "remotion/no-react";
@@ -22235,7 +22260,25 @@ var internalRenderStillRaw = (options) => {
22235
22260
  proxyPort: offthreadPort,
22236
22261
  sourceMapGetter
22237
22262
  });
22238
- }).then((res) => resolve2(res)).catch((err) => reject(err)).finally(() => {
22263
+ }).then((res) => {
22264
+ if (options.apiKey === null) {
22265
+ resolve2(res);
22266
+ return;
22267
+ }
22268
+ registerUsageEvent2({
22269
+ apiKey: options.apiKey,
22270
+ event: "cloud-render",
22271
+ host: null,
22272
+ succeeded: true
22273
+ }).then(() => {
22274
+ Log.verbose(options, "Usage event sent successfully");
22275
+ }).catch((err) => {
22276
+ Log.error(options, "Failed to send usage event");
22277
+ Log.error(options, err);
22278
+ }).finally(() => {
22279
+ resolve2(res);
22280
+ });
22281
+ }).catch((err) => reject(err)).finally(() => {
22239
22282
  cleanup.forEach((c) => {
22240
22283
  c().catch((err) => {
22241
22284
  Log.error(options, "Cleanup error:", err);
@@ -22283,7 +22326,8 @@ var renderStill = (options) => {
22283
22326
  onArtifact,
22284
22327
  chromeMode,
22285
22328
  offthreadVideoThreads,
22286
- mediaCacheSizeInBytes
22329
+ mediaCacheSizeInBytes,
22330
+ apiKey
22287
22331
  } = options;
22288
22332
  if (typeof jpegQuality !== "undefined" && imageFormat !== "jpeg") {
22289
22333
  throw new Error("You can only pass the `quality` option if `imageFormat` is 'jpeg'.");
@@ -22335,6 +22379,7 @@ var renderStill = (options) => {
22335
22379
  chromeMode: chromeMode ?? "headless-shell",
22336
22380
  offthreadVideoThreads: offthreadVideoThreads ?? null,
22337
22381
  mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
22382
+ apiKey: apiKey ?? null,
22338
22383
  onLog: defaultOnLog
22339
22384
  });
22340
22385
  };
package/dist/index.d.ts CHANGED
@@ -599,6 +599,21 @@ export declare const RenderInternals: {
599
599
  setConfig: (newChromeMode: import("./options/chrome-mode").ChromeMode) => void;
600
600
  type: import("./options/chrome-mode").ChromeMode;
601
601
  };
602
+ readonly apiKey: {
603
+ name: string;
604
+ cliFlag: "api-key";
605
+ description: () => import("react/jsx-runtime").JSX.Element;
606
+ ssrName: "apiKey";
607
+ docLink: string;
608
+ type: string | null;
609
+ getValue: ({ commandLine }: {
610
+ commandLine: Record<string, unknown>;
611
+ }) => {
612
+ source: string;
613
+ value: string | null;
614
+ };
615
+ setConfig: (value: string | null) => void;
616
+ };
602
617
  }>) => Promise<{
603
618
  buffer: Buffer | null;
604
619
  }>;
@@ -394,6 +394,21 @@ export declare const optionsMap: {
394
394
  setConfig: (newChromeMode: import("./chrome-mode").ChromeMode) => void;
395
395
  type: import("./chrome-mode").ChromeMode;
396
396
  };
397
+ readonly apiKey: {
398
+ name: string;
399
+ cliFlag: "api-key";
400
+ description: () => import("react/jsx-runtime").JSX.Element;
401
+ ssrName: "apiKey";
402
+ docLink: string;
403
+ type: string | null;
404
+ getValue: ({ commandLine }: {
405
+ commandLine: Record<string, unknown>;
406
+ }) => {
407
+ source: string;
408
+ value: string | null;
409
+ };
410
+ setConfig: (value: string | null) => void;
411
+ };
397
412
  };
398
413
  readonly stitchFramesToVideo: {
399
414
  readonly separateAudioTo: {
@@ -570,6 +585,21 @@ export declare const optionsMap: {
570
585
  setConfig: (newChromeMode: import("./chrome-mode").ChromeMode) => void;
571
586
  type: import("./chrome-mode").ChromeMode;
572
587
  };
588
+ readonly apiKey: {
589
+ name: string;
590
+ cliFlag: "api-key";
591
+ description: () => import("react/jsx-runtime").JSX.Element;
592
+ ssrName: "apiKey";
593
+ docLink: string;
594
+ type: string | null;
595
+ getValue: ({ commandLine }: {
596
+ commandLine: Record<string, unknown>;
597
+ }) => {
598
+ source: string;
599
+ value: string | null;
600
+ };
601
+ setConfig: (value: string | null) => void;
602
+ };
573
603
  };
574
604
  readonly getCompositions: {
575
605
  readonly mediaCacheSizeInBytes: {
@@ -59,6 +59,7 @@ exports.optionsMap = {
59
59
  onBrowserDownload: on_browser_download_1.onBrowserDownloadOption,
60
60
  hardwareAcceleration: hardware_acceleration_1.hardwareAccelerationOption,
61
61
  chromeMode: chrome_mode_1.chromeModeOption,
62
+ apiKey: api_key_1.apiKeyOption,
62
63
  },
63
64
  stitchFramesToVideo: {
64
65
  separateAudioTo: separate_audio_1.separateAudioOption,
@@ -74,6 +75,7 @@ exports.optionsMap = {
74
75
  binariesDirectory: binaries_directory_1.binariesDirectoryOption,
75
76
  onBrowserDownload: on_browser_download_1.onBrowserDownloadOption,
76
77
  chromeMode: chrome_mode_1.chromeModeOption,
78
+ apiKey: api_key_1.apiKeyOption,
77
79
  },
78
80
  getCompositions: {
79
81
  mediaCacheSizeInBytes: video_cache_size_1.mediaCacheSizeInBytesOption,
@@ -14,7 +14,7 @@ const cliFlag = 'timeout';
14
14
  exports.delayRenderTimeoutInMillisecondsOption = {
15
15
  name: 'delayRender() timeout',
16
16
  cliFlag,
17
- description: () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["A number describing how long the render may take to resolve all", ' ', (0, jsx_runtime_1.jsx)("a", { href: "https://remotion.dev/docs/delay-render", children: (0, jsx_runtime_1.jsx)("code", { children: "delayRender()" }) }), ' ', "calls ", (0, jsx_runtime_1.jsx)("a", { href: "https://remotion.dev/docs/timeout", children: "before it times out" }), ". Default: ", (0, jsx_runtime_1.jsx)("code", { children: "30000" })] })),
17
+ description: () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["A number describing how long the render may take to resolve all", ' ', (0, jsx_runtime_1.jsx)("a", { href: "https://remotion.dev/docs/delay-render", children: (0, jsx_runtime_1.jsx)("code", { children: "delayRender()" }) }), ' ', "calls", ' ', (0, jsx_runtime_1.jsx)("a", { style: { fontSize: 'inherit' }, href: "https://remotion.dev/docs/timeout", children: "before it times out" }), ". Default: ", (0, jsx_runtime_1.jsx)("code", { children: "30000" })] })),
18
18
  ssrName: 'timeoutInMilliseconds',
19
19
  docLink: 'https://www.remotion.dev/docs/timeout',
20
20
  type: 0,
@@ -69,6 +69,7 @@ export type InternalRenderMediaOptions = {
69
69
  compositionStart: number;
70
70
  onArtifact: OnArtifact | null;
71
71
  metadata: Record<string, string> | null;
72
+ apiKey: string | null;
72
73
  onLog: OnLog;
73
74
  } & MoreRenderMediaOptions;
74
75
  type Prettify<T> = {
@@ -131,5 +132,5 @@ type RenderMediaResult = {
131
132
  slowestFrames: SlowFrame[];
132
133
  };
133
134
  export declare const internalRenderMedia: (args_0: InternalRenderMediaOptions) => Promise<RenderMediaResult>;
134
- export declare const renderMedia: ({ proResProfile, x264Preset, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, jpegQuality, concurrency, serveUrl, disallowParallelEncoding, everyNthFrame, imageFormat, numberOfGifLoops, dumpBrowserLogs, preferLossless, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, chromeMode, offthreadVideoThreads, compositionStart, mediaCacheSizeInBytes, }: RenderMediaOptions) => Promise<RenderMediaResult>;
135
+ export declare const renderMedia: ({ proResProfile, x264Preset, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, jpegQuality, concurrency, serveUrl, disallowParallelEncoding, everyNthFrame, imageFormat, numberOfGifLoops, dumpBrowserLogs, preferLossless, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, chromeMode, offthreadVideoThreads, compositionStart, mediaCacheSizeInBytes, apiKey, }: RenderMediaOptions) => Promise<RenderMediaResult>;
135
136
  export {};
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.renderMedia = exports.internalRenderMedia = void 0;
7
+ const licensing_1 = require("@remotion/licensing");
7
8
  const node_fs_1 = __importDefault(require("node:fs"));
8
9
  const node_os_1 = __importDefault(require("node:os"));
9
10
  const node_path_1 = __importDefault(require("node:path"));
@@ -53,7 +54,7 @@ const validate_videobitrate_1 = require("./validate-videobitrate");
53
54
  const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
54
55
  const SLOWEST_FRAME_COUNT = 10;
55
56
  const MAX_RECENT_FRAME_TIMINGS = 150;
56
- const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition: compositionWithPossibleUnevenDimensions, serializedInputPropsWithCustomSchema, pixelFormat: userPixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, concurrency, disallowParallelEncoding, everyNthFrame, imageFormat: provisionalImageFormat, indent, jpegQuality, numberOfGifLoops, onCtrlCExit, preferLossless, serveUrl, server: reusedServer, logLevel, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, compositionStart, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, chromeMode, offthreadVideoThreads, mediaCacheSizeInBytes, onLog, }) => {
57
+ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition: compositionWithPossibleUnevenDimensions, serializedInputPropsWithCustomSchema, pixelFormat: userPixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, concurrency, disallowParallelEncoding, everyNthFrame, imageFormat: provisionalImageFormat, indent, jpegQuality, numberOfGifLoops, onCtrlCExit, preferLossless, serveUrl, server: reusedServer, logLevel, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, compositionStart, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, chromeMode, offthreadVideoThreads, mediaCacheSizeInBytes, onLog, apiKey, }) => {
57
58
  var _a, _b;
58
59
  const pixelFormat = (_a = userPixelFormat !== null && userPixelFormat !== void 0 ? userPixelFormat : compositionWithPossibleUnevenDimensions.defaultPixelFormat) !== null && _a !== void 0 ? _a : pixel_format_1.DEFAULT_PIXEL_FORMAT;
59
60
  if (repro) {
@@ -467,18 +468,41 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition: c
467
468
  buffer,
468
469
  slowestFrames,
469
470
  };
471
+ const sendTelemetryAndResolve = () => {
472
+ if (apiKey === null) {
473
+ resolve(result);
474
+ return;
475
+ }
476
+ (0, licensing_1.registerUsageEvent)({
477
+ apiKey,
478
+ event: 'cloud-render',
479
+ host: null,
480
+ succeeded: true,
481
+ })
482
+ .then(() => {
483
+ logger_1.Log.verbose({ indent, logLevel }, 'Usage event sent successfully');
484
+ })
485
+ .catch((err) => {
486
+ logger_1.Log.error({ indent, logLevel }, 'Failed to send usage event');
487
+ logger_1.Log.error({ indent: true, logLevel }, err);
488
+ })
489
+ .finally(() => {
490
+ resolve(result);
491
+ });
492
+ };
470
493
  if ((0, repro_1.isReproEnabled)()) {
471
494
  (0, repro_1.getReproWriter)()
472
495
  .onRenderSucceed({ indent, logLevel, output: absoluteOutputLocation })
473
496
  .then(() => {
474
- resolve(result);
497
+ sendTelemetryAndResolve();
475
498
  })
476
499
  .catch((err) => {
477
500
  logger_1.Log.error({ indent, logLevel }, 'Could not create reproduction', err);
501
+ sendTelemetryAndResolve();
478
502
  });
479
503
  }
480
504
  else {
481
- resolve(result);
505
+ sendTelemetryAndResolve();
482
506
  }
483
507
  })
484
508
  .catch((err) => {
@@ -538,7 +562,7 @@ exports.internalRenderMedia = (0, wrap_with_error_handling_1.wrapWithErrorHandli
538
562
  * @description Render a video or an audio programmatically.
539
563
  * @see [Documentation](https://www.remotion.dev/docs/renderer/render-media)
540
564
  */
541
- const renderMedia = ({ proResProfile, x264Preset, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, jpegQuality, concurrency, serveUrl, disallowParallelEncoding, everyNthFrame, imageFormat, numberOfGifLoops, dumpBrowserLogs, preferLossless, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, chromeMode, offthreadVideoThreads, compositionStart, mediaCacheSizeInBytes, }) => {
565
+ const renderMedia = ({ proResProfile, x264Preset, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, jpegQuality, concurrency, serveUrl, disallowParallelEncoding, everyNthFrame, imageFormat, numberOfGifLoops, dumpBrowserLogs, preferLossless, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, chromeMode, offthreadVideoThreads, compositionStart, mediaCacheSizeInBytes, apiKey, }) => {
542
566
  var _a, _b;
543
567
  const indent = false;
544
568
  const logLevel = verbose || dumpBrowserLogs ? 'verbose' : (passedLogLevel !== null && passedLogLevel !== void 0 ? passedLogLevel : 'info');
@@ -615,6 +639,7 @@ const renderMedia = ({ proResProfile, x264Preset, crf, composition, inputProps,
615
639
  hardwareAcceleration: hardwareAcceleration !== null && hardwareAcceleration !== void 0 ? hardwareAcceleration : 'disable',
616
640
  chromeMode: chromeMode !== null && chromeMode !== void 0 ? chromeMode : 'headless-shell',
617
641
  mediaCacheSizeInBytes: mediaCacheSizeInBytes !== null && mediaCacheSizeInBytes !== void 0 ? mediaCacheSizeInBytes : null,
642
+ apiKey: apiKey !== null && apiKey !== void 0 ? apiKey : null,
618
643
  onLog: default_on_log_1.defaultOnLog,
619
644
  });
620
645
  };
@@ -37,6 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.renderStill = exports.internalRenderStill = void 0;
40
+ const licensing_1 = require("@remotion/licensing");
40
41
  const node_fs_1 = __importStar(require("node:fs"));
41
42
  const node_path_1 = __importDefault(require("node:path"));
42
43
  const no_react_1 = require("remotion/no-react");
@@ -274,7 +275,28 @@ const internalRenderStillRaw = (options) => {
274
275
  sourceMapGetter,
275
276
  });
276
277
  })
277
- .then((res) => resolve(res))
278
+ .then((res) => {
279
+ if (options.apiKey === null) {
280
+ resolve(res);
281
+ return;
282
+ }
283
+ (0, licensing_1.registerUsageEvent)({
284
+ apiKey: options.apiKey,
285
+ event: 'cloud-render',
286
+ host: null,
287
+ succeeded: true,
288
+ })
289
+ .then(() => {
290
+ logger_1.Log.verbose(options, 'Usage event sent successfully');
291
+ })
292
+ .catch((err) => {
293
+ logger_1.Log.error(options, 'Failed to send usage event');
294
+ logger_1.Log.error(options, err);
295
+ })
296
+ .finally(() => {
297
+ resolve(res);
298
+ });
299
+ })
278
300
  .catch((err) => reject(err))
279
301
  .finally(() => {
280
302
  cleanup.forEach((c) => {
@@ -301,7 +323,7 @@ exports.internalRenderStill = (0, wrap_with_error_handling_1.wrapWithErrorHandli
301
323
  */
302
324
  const renderStill = (options) => {
303
325
  var _a, _b;
304
- const { composition, serveUrl, browserExecutable, cancelSignal, chromiumOptions, dumpBrowserLogs, envVariables, frame, imageFormat, inputProps, jpegQuality, onBrowserLog, onDownload, output, overwrite, port, puppeteerInstance, scale, timeoutInMilliseconds, verbose, quality, offthreadVideoCacheSizeInBytes, logLevel: passedLogLevel, binariesDirectory, onBrowserDownload, onArtifact, chromeMode, offthreadVideoThreads, mediaCacheSizeInBytes, } = options;
326
+ const { composition, serveUrl, browserExecutable, cancelSignal, chromiumOptions, dumpBrowserLogs, envVariables, frame, imageFormat, inputProps, jpegQuality, onBrowserLog, onDownload, output, overwrite, port, puppeteerInstance, scale, timeoutInMilliseconds, verbose, quality, offthreadVideoCacheSizeInBytes, logLevel: passedLogLevel, binariesDirectory, onBrowserDownload, onArtifact, chromeMode, offthreadVideoThreads, mediaCacheSizeInBytes, apiKey, } = options;
305
327
  if (typeof jpegQuality !== 'undefined' && imageFormat !== 'jpeg') {
306
328
  throw new Error("You can only pass the `quality` option if `imageFormat` is 'jpeg'.");
307
329
  }
@@ -352,6 +374,7 @@ const renderStill = (options) => {
352
374
  chromeMode: chromeMode !== null && chromeMode !== void 0 ? chromeMode : 'headless-shell',
353
375
  offthreadVideoThreads: offthreadVideoThreads !== null && offthreadVideoThreads !== void 0 ? offthreadVideoThreads : null,
354
376
  mediaCacheSizeInBytes: mediaCacheSizeInBytes !== null && mediaCacheSizeInBytes !== void 0 ? mediaCacheSizeInBytes : null,
377
+ apiKey: apiKey !== null && apiKey !== void 0 ? apiKey : null,
355
378
  onLog: default_on_log_1.defaultOnLog,
356
379
  });
357
380
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/renderer"
4
4
  },
5
5
  "name": "@remotion/renderer",
6
- "version": "4.0.375",
6
+ "version": "4.0.377",
7
7
  "description": "Render Remotion videos using Node.js or Bun",
8
8
  "main": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
@@ -22,10 +22,11 @@
22
22
  "dependencies": {
23
23
  "execa": "5.1.1",
24
24
  "extract-zip": "2.0.1",
25
- "remotion": "4.0.375",
26
- "@remotion/streaming": "4.0.375",
25
+ "remotion": "4.0.377",
26
+ "@remotion/streaming": "4.0.377",
27
27
  "source-map": "^0.8.0-beta.0",
28
- "ws": "8.17.1"
28
+ "ws": "8.17.1",
29
+ "@remotion/licensing": "4.0.377"
29
30
  },
30
31
  "peerDependencies": {
31
32
  "react": ">=16.8.0",
@@ -38,19 +39,19 @@
38
39
  "react": "19.0.0",
39
40
  "react-dom": "19.0.0",
40
41
  "@types/ws": "8.5.10",
41
- "@remotion/example-videos": "4.0.375",
42
- "@remotion/eslint-config-internal": "4.0.375",
42
+ "@remotion/example-videos": "4.0.377",
43
+ "@remotion/eslint-config-internal": "4.0.377",
43
44
  "eslint": "9.19.0",
44
45
  "@types/node": "20.12.14"
45
46
  },
46
47
  "optionalDependencies": {
47
- "@remotion/compositor-darwin-arm64": "4.0.375",
48
- "@remotion/compositor-darwin-x64": "4.0.375",
49
- "@remotion/compositor-linux-arm64-gnu": "4.0.375",
50
- "@remotion/compositor-linux-arm64-musl": "4.0.375",
51
- "@remotion/compositor-linux-x64-gnu": "4.0.375",
52
- "@remotion/compositor-linux-x64-musl": "4.0.375",
53
- "@remotion/compositor-win32-x64-msvc": "4.0.375"
48
+ "@remotion/compositor-darwin-arm64": "4.0.377",
49
+ "@remotion/compositor-darwin-x64": "4.0.377",
50
+ "@remotion/compositor-linux-arm64-gnu": "4.0.377",
51
+ "@remotion/compositor-linux-arm64-musl": "4.0.377",
52
+ "@remotion/compositor-linux-x64-gnu": "4.0.377",
53
+ "@remotion/compositor-linux-x64-musl": "4.0.377",
54
+ "@remotion/compositor-win32-x64-msvc": "4.0.377"
54
55
  },
55
56
  "keywords": [
56
57
  "remotion",