@remotion/renderer 4.0.272 → 4.0.274

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.
@@ -50,9 +50,10 @@ const node_util_1 = require("node:util");
50
50
  const download_file_1 = require("../assets/download-file");
51
51
  const make_file_executable_1 = require("../compositor/make-file-executable");
52
52
  const get_download_destination_1 = require("./get-download-destination");
53
- const TESTED_VERSION = '123.0.6312.86';
54
- // https://github.com/microsoft/playwright/tree/v1.42.0
55
- const PLAYWRIGHT_VERSION = '1105'; // 123.0.6312.4
53
+ const TESTED_VERSION = '133.0.6943.0';
54
+ // https://github.com/microsoft/playwright/tree/v1.50.1
55
+ // packages/playwright-core/browsers.json
56
+ const PLAYWRIGHT_VERSION = '1155'; // 133.0.6943.16
56
57
  function getChromeDownloadUrl({ platform, version, chromeMode, }) {
57
58
  if (platform === 'linux-arm64') {
58
59
  if (chromeMode === 'chrome-for-testing') {
@@ -100,7 +100,12 @@ class Page extends EventEmitter_1.EventEmitter {
100
100
  ]
101
101
  .filter(truthy_1.truthy)
102
102
  .join(':');
103
- const tag = [origPosition === null || origPosition === void 0 ? void 0 : origPosition.name, file].filter(truthy_1.truthy).join('@');
103
+ const isDelayRenderClear = log.previewString.includes(no_react_1.NoReactInternals.DELAY_RENDER_CLEAR_TOKEN);
104
+ const tabInfo = `Tab ${this.pageIndex}`;
105
+ const tagInfo = [origPosition === null || origPosition === void 0 ? void 0 : origPosition.name, isDelayRenderClear ? null : file]
106
+ .filter(truthy_1.truthy)
107
+ .join('@');
108
+ const tag = [tabInfo, tagInfo].filter(truthy_1.truthy).join(', ');
104
109
  if (log.type === 'error') {
105
110
  logger_1.Log.error({
106
111
  logLevel,
@@ -113,7 +118,7 @@ class Page extends EventEmitter_1.EventEmitter {
113
118
  logLevel,
114
119
  tag,
115
120
  indent,
116
- }, log.previewString);
121
+ }, isDelayRenderClear ? log.previewString : log.previewString);
117
122
  }
118
123
  }
119
124
  else if (log.type === 'error') {
package/dist/client.d.ts CHANGED
@@ -412,7 +412,7 @@ export declare const BrowserSafeApis: {
412
412
  webhookCustomDataOption: {
413
413
  name: string;
414
414
  cliFlag: "webhook-custom-data";
415
- description: (type: "cli" | "ssr") => import("react/jsx-runtime").JSX.Element;
415
+ description: (type: "ssr" | "cli") => import("react/jsx-runtime").JSX.Element;
416
416
  ssrName: "customData";
417
417
  docLink: string;
418
418
  type: Record<string, unknown> | null;
@@ -825,7 +825,7 @@ export declare const BrowserSafeApis: {
825
825
  metadataOption: {
826
826
  name: string;
827
827
  cliFlag: "metadata";
828
- description: (mode: "cli" | "ssr") => import("react/jsx-runtime").JSX.Element;
828
+ description: (mode: "ssr" | "cli") => import("react/jsx-runtime").JSX.Element;
829
829
  docLink: string;
830
830
  type: import("./options/metadata").Metadata;
831
831
  getValue: ({ commandLine }: {
@@ -705,14 +705,19 @@ var assert = (value, message) => {
705
705
  };
706
706
 
707
707
  // src/browser/BrowserPage.ts
708
- import { NoReactInternals } from "remotion/no-react";
708
+ import { NoReactInternals as NoReactInternals2 } from "remotion/no-react";
709
709
 
710
710
  // src/format-logs.ts
711
+ import { NoReactInternals } from "remotion/no-react";
711
712
  var formatRemoteObject = (remoteObject) => {
712
713
  if (remoteObject.preview) {
713
714
  return formatObjectPreview(remoteObject.preview);
714
715
  }
715
716
  if (remoteObject.type === "string") {
717
+ const isDelayRenderClear = remoteObject.value.includes(NoReactInternals.DELAY_RENDER_CLEAR_TOKEN);
718
+ if (isDelayRenderClear) {
719
+ return chalk.gray(`${remoteObject.value}`);
720
+ }
716
721
  return chalk.reset(`${remoteObject.value}`);
717
722
  }
718
723
  if (remoteObject.type === "number") {
@@ -2845,7 +2850,7 @@ class Page extends EventEmitter {
2845
2850
  text: log.text,
2846
2851
  type: log.type
2847
2852
  });
2848
- if (url?.endsWith(NoReactInternals.bundleName) && lineNumber && this.sourceMapGetter()) {
2853
+ if (url?.endsWith(NoReactInternals2.bundleName) && lineNumber && this.sourceMapGetter()) {
2849
2854
  const origPosition = this.sourceMapGetter()?.originalPositionFor({
2850
2855
  column: columnNumber ?? 0,
2851
2856
  line: lineNumber
@@ -2855,7 +2860,10 @@ class Page extends EventEmitter {
2855
2860
  origPosition?.line,
2856
2861
  origPosition?.column
2857
2862
  ].filter(truthy).join(":");
2858
- const tag = [origPosition?.name, file].filter(truthy).join("@");
2863
+ const isDelayRenderClear = log.previewString.includes(NoReactInternals2.DELAY_RENDER_CLEAR_TOKEN);
2864
+ const tabInfo = `Tab ${this.pageIndex}`;
2865
+ const tagInfo = [origPosition?.name, isDelayRenderClear ? null : file].filter(truthy).join("@");
2866
+ const tag = [tabInfo, tagInfo].filter(truthy).join(", ");
2859
2867
  if (log.type === "error") {
2860
2868
  Log.error({
2861
2869
  logLevel,
@@ -2867,7 +2875,7 @@ class Page extends EventEmitter {
2867
2875
  logLevel,
2868
2876
  tag,
2869
2877
  indent
2870
- }, log.previewString);
2878
+ }, isDelayRenderClear ? log.previewString : log.previewString);
2871
2879
  }
2872
2880
  } else if (log.type === "error") {
2873
2881
  if (log.text.includes("Failed to load resource:")) {
@@ -4024,7 +4032,7 @@ var getShouldUsePartitionedRendering = () => {
4024
4032
  };
4025
4033
 
4026
4034
  // src/check-version-requirements.ts
4027
- import { NoReactInternals as NoReactInternals2 } from "remotion/no-react";
4035
+ import { NoReactInternals as NoReactInternals3 } from "remotion/no-react";
4028
4036
  var getRequiredLibCVersion = () => {
4029
4037
  if (process.platform !== "linux") {
4030
4038
  return null;
@@ -4078,13 +4086,13 @@ var checkLibCRequirement = (logLevel, indent) => {
4078
4086
  var checkNodeVersion = () => {
4079
4087
  const version = process.version.replace("v", "").split(".");
4080
4088
  const majorVersion = Number(version[0]);
4081
- if (majorVersion < NoReactInternals2.MIN_NODE_VERSION) {
4082
- throw new Error(`Remotion requires at least Node ${NoReactInternals2.MIN_NODE_VERSION}. You currently have ${process.version}. Update your node version to ${NoReactInternals2.MIN_NODE_VERSION} to use Remotion.`);
4089
+ if (majorVersion < NoReactInternals3.MIN_NODE_VERSION) {
4090
+ throw new Error(`Remotion requires at least Node ${NoReactInternals3.MIN_NODE_VERSION}. You currently have ${process.version}. Update your node version to ${NoReactInternals3.MIN_NODE_VERSION} to use Remotion.`);
4083
4091
  }
4084
4092
  };
4085
4093
  var checkBunVersion = () => {
4086
- if (!Bun.semver.satisfies(Bun.version, `>=${NoReactInternals2.MIN_BUN_VERSION}`)) {
4087
- throw new Error(`Remotion requires at least Bun ${NoReactInternals2.MIN_BUN_VERSION}. You currently have ${Bun.version}. Update your Bun version to ${NoReactInternals2.MIN_BUN_VERSION} to use Remotion.`);
4094
+ if (!Bun.semver.satisfies(Bun.version, `>=${NoReactInternals3.MIN_BUN_VERSION}`)) {
4095
+ throw new Error(`Remotion requires at least Bun ${NoReactInternals3.MIN_BUN_VERSION}. You currently have ${Bun.version}. Update your Bun version to ${NoReactInternals3.MIN_BUN_VERSION} to use Remotion.`);
4088
4096
  }
4089
4097
  };
4090
4098
  var checkRuntimeVersion = (logLevel, indent) => {
@@ -5100,10 +5108,10 @@ var getSourceMapFromLocalFile = (fileName) => {
5100
5108
  };
5101
5109
 
5102
5110
  // src/error-handling/handle-javascript-exception.ts
5103
- import { NoReactInternals as NoReactInternals4 } from "remotion/no-react";
5111
+ import { NoReactInternals as NoReactInternals5 } from "remotion/no-react";
5104
5112
 
5105
5113
  // src/delay-render-embedded-stack.ts
5106
- import { NoReactInternals as NoReactInternals3 } from "remotion/no-react";
5114
+ import { NoReactInternals as NoReactInternals4 } from "remotion/no-react";
5107
5115
 
5108
5116
  // src/parse-browser-error-stack.ts
5109
5117
  var regexValidFrame_Chrome = /^\s*(at|in)\s.+(:\d+)/;
@@ -5186,11 +5194,11 @@ var parseStack = (stack) => {
5186
5194
 
5187
5195
  // src/delay-render-embedded-stack.ts
5188
5196
  var parseDelayRenderEmbeddedStack = (message) => {
5189
- const index = message.indexOf(NoReactInternals3.DELAY_RENDER_CALLSTACK_TOKEN);
5197
+ const index = message.indexOf(NoReactInternals4.DELAY_RENDER_CALLSTACK_TOKEN);
5190
5198
  if (index === -1) {
5191
5199
  return null;
5192
5200
  }
5193
- const msg = message.substring(index + NoReactInternals3.DELAY_RENDER_CALLSTACK_TOKEN.length).trim();
5201
+ const msg = message.substring(index + NoReactInternals4.DELAY_RENDER_CALLSTACK_TOKEN.length).trim();
5194
5202
  const parsed = parseStack(msg.split(`
5195
5203
  `));
5196
5204
  return parsed;
@@ -5262,7 +5270,7 @@ var cleanUpErrorMessage = (exception) => {
5262
5270
  `);
5263
5271
  };
5264
5272
  var removeDelayRenderStack = (message) => {
5265
- const index = message.indexOf(NoReactInternals4.DELAY_RENDER_CALLSTACK_TOKEN);
5273
+ const index = message.indexOf(NoReactInternals5.DELAY_RENDER_CALLSTACK_TOKEN);
5266
5274
  if (index === -1) {
5267
5275
  return message;
5268
5276
  }
@@ -5380,7 +5388,7 @@ var validateFrameRange = (frameRange) => {
5380
5388
  };
5381
5389
 
5382
5390
  // src/get-compositions.ts
5383
- import { NoReactInternals as NoReactInternals7 } from "remotion/no-react";
5391
+ import { NoReactInternals as NoReactInternals8 } from "remotion/no-react";
5384
5392
 
5385
5393
  // src/to-megabytes.ts
5386
5394
  function toMegabytes(bytes) {
@@ -5494,8 +5502,8 @@ var getDownloadsCacheDir = () => {
5494
5502
  };
5495
5503
 
5496
5504
  // src/browser/BrowserFetcher.ts
5497
- var TESTED_VERSION = "123.0.6312.86";
5498
- var PLAYWRIGHT_VERSION = "1105";
5505
+ var TESTED_VERSION = "133.0.6943.0";
5506
+ var PLAYWRIGHT_VERSION = "1155";
5499
5507
  function getChromeDownloadUrl({
5500
5508
  platform: platform2,
5501
5509
  version,
@@ -6077,7 +6085,7 @@ var DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS = 2;
6077
6085
  // src/prepare-server.ts
6078
6086
  import { existsSync as existsSync4 } from "node:fs";
6079
6087
  import path18 from "node:path";
6080
- import { NoReactInternals as NoReactInternals6 } from "remotion/no-react";
6088
+ import { NoReactInternals as NoReactInternals7 } from "remotion/no-react";
6081
6089
 
6082
6090
  // src/assets/download-and-map-assets-to-file.ts
6083
6091
  import fs10 from "node:fs";
@@ -15781,7 +15789,7 @@ var cleanDownloadMap = (downloadMap) => {
15781
15789
 
15782
15790
  // src/get-bundle-url-from-serve-url.ts
15783
15791
  import path15 from "path";
15784
- import { NoReactInternals as NoReactInternals5 } from "remotion/no-react";
15792
+ import { NoReactInternals as NoReactInternals6 } from "remotion/no-react";
15785
15793
  var map = (webpackBundleOrServeUrl, suffix) => {
15786
15794
  if (isServeUrl(webpackBundleOrServeUrl)) {
15787
15795
  const parsed = new URL(webpackBundleOrServeUrl);
@@ -15796,7 +15804,7 @@ var map = (webpackBundleOrServeUrl, suffix) => {
15796
15804
  return url;
15797
15805
  };
15798
15806
  var getBundleMapUrlFromServeUrl = (serveUrl) => {
15799
- return map(serveUrl, NoReactInternals5.bundleMapName);
15807
+ return map(serveUrl, NoReactInternals6.bundleMapName);
15800
15808
  };
15801
15809
 
15802
15810
  // src/normalize-serve-url.ts
@@ -16435,7 +16443,7 @@ var prepareServer = async ({
16435
16443
  throw new Error(`Tried to serve the Webpack bundle on a HTTP server, but the file ${indexFile} does not exist. Is this a valid path to a Webpack bundle?`);
16436
16444
  }
16437
16445
  let localSourceMap = null;
16438
- getSourceMapFromLocalFile(path18.join(webpackConfigOrServeUrl, NoReactInternals6.bundleName)).then((s) => {
16446
+ getSourceMapFromLocalFile(path18.join(webpackConfigOrServeUrl, NoReactInternals7.bundleName)).then((s) => {
16439
16447
  localSourceMap = s;
16440
16448
  }).catch((err) => {
16441
16449
  Log.verbose({ indent, logLevel }, "Could not fetch sourcemap for ", webpackConfigOrServeUrl, err);
@@ -17210,8 +17218,8 @@ var innerGetCompositions = async ({
17210
17218
  height,
17211
17219
  fps,
17212
17220
  durationInFrames,
17213
- props: NoReactInternals7.deserializeJSONWithCustomFields(r.serializedResolvedPropsWithCustomSchema),
17214
- defaultProps: NoReactInternals7.deserializeJSONWithCustomFields(r.serializedDefaultPropsWithCustomSchema),
17221
+ props: NoReactInternals8.deserializeJSONWithCustomFields(r.serializedResolvedPropsWithCustomSchema),
17222
+ defaultProps: NoReactInternals8.deserializeJSONWithCustomFields(r.serializedDefaultPropsWithCustomSchema),
17215
17223
  defaultCodec,
17216
17224
  defaultOutName
17217
17225
  };
@@ -17328,7 +17336,7 @@ var getCompositions = (serveUrlOrWebpackUrl, config) => {
17328
17336
  browserExecutable: browserExecutable ?? null,
17329
17337
  chromiumOptions: chromiumOptions ?? {},
17330
17338
  envVariables: envVariables ?? {},
17331
- serializedInputPropsWithCustomSchema: NoReactInternals7.serializeJSONWithDate({
17339
+ serializedInputPropsWithCustomSchema: NoReactInternals8.serializeJSONWithDate({
17332
17340
  data: inputProps ?? {},
17333
17341
  indent: undefined,
17334
17342
  staticBase: null
@@ -17646,7 +17654,7 @@ var validateSelectedPixelFormatAndCodecCombination = (pixelFormat, codec) => {
17646
17654
  // src/render-frames.ts
17647
17655
  import fs14 from "node:fs";
17648
17656
  import path20 from "node:path";
17649
- import { NoReactInternals as NoReactInternals11 } from "remotion/no-react";
17657
+ import { NoReactInternals as NoReactInternals12 } from "remotion/no-react";
17650
17658
 
17651
17659
  // src/cycle-browser-tabs.ts
17652
17660
  var cycleBrowserTabs = ({
@@ -18007,10 +18015,10 @@ class Pool {
18007
18015
  }
18008
18016
 
18009
18017
  // src/render-frame-and-retry-target-close.ts
18010
- import { NoReactInternals as NoReactInternals9 } from "remotion/no-react";
18018
+ import { NoReactInternals as NoReactInternals10 } from "remotion/no-react";
18011
18019
 
18012
18020
  // src/is-delay-render-error-with-retry.ts
18013
- import { NoReactInternals as NoReactInternals8 } from "remotion/no-react";
18021
+ import { NoReactInternals as NoReactInternals9 } from "remotion/no-react";
18014
18022
  var getRetriesLeftFromError = (error) => {
18015
18023
  if (!error) {
18016
18024
  throw new Error("Expected stack");
@@ -18019,15 +18027,15 @@ var getRetriesLeftFromError = (error) => {
18019
18027
  if (!stack) {
18020
18028
  throw new Error("Expected stack: " + JSON.stringify(error));
18021
18029
  }
18022
- const beforeIndex = stack.indexOf(NoReactInternals8.DELAY_RENDER_ATTEMPT_TOKEN);
18030
+ const beforeIndex = stack.indexOf(NoReactInternals9.DELAY_RENDER_ATTEMPT_TOKEN);
18023
18031
  if (beforeIndex === -1) {
18024
18032
  throw new Error("Expected to find attempt token in stack");
18025
18033
  }
18026
- const afterIndex = stack.indexOf(NoReactInternals8.DELAY_RENDER_RETRY_TOKEN);
18034
+ const afterIndex = stack.indexOf(NoReactInternals9.DELAY_RENDER_RETRY_TOKEN);
18027
18035
  if (afterIndex === -1) {
18028
18036
  throw new Error("Expected to find retry token in stack");
18029
18037
  }
18030
- const inbetween = stack.substring(beforeIndex + NoReactInternals8.DELAY_RENDER_ATTEMPT_TOKEN.length, afterIndex);
18038
+ const inbetween = stack.substring(beforeIndex + NoReactInternals9.DELAY_RENDER_ATTEMPT_TOKEN.length, afterIndex);
18031
18039
  const parsed = Number(inbetween);
18032
18040
  if (Number.isNaN(parsed)) {
18033
18041
  throw new Error(`Expected to find a number in the stack ${stack}`);
@@ -18587,7 +18595,7 @@ var renderFrameAndRetryTargetClose = async ({
18587
18595
  currentPool.release(freePage);
18588
18596
  } catch (err) {
18589
18597
  const isTargetClosedError = isTargetClosedErr(err);
18590
- const shouldRetryError = err.stack?.includes(NoReactInternals9.DELAY_RENDER_RETRY_TOKEN);
18598
+ const shouldRetryError = err.stack?.includes(NoReactInternals10.DELAY_RENDER_RETRY_TOKEN);
18591
18599
  const flakyNetworkError = isFlakyNetworkError(err);
18592
18600
  if (isUserCancelledRender(err) && !shouldRetryError) {
18593
18601
  throw err;
@@ -18732,10 +18740,10 @@ var handleBrowserCrash = (instance, logLevel, indent) => {
18732
18740
  };
18733
18741
 
18734
18742
  // src/validate.ts
18735
- import { NoReactInternals as NoReactInternals10 } from "remotion/no-react";
18736
- var validateFps = NoReactInternals10.validateFps;
18737
- var validateDimension = NoReactInternals10.validateDimension;
18738
- var validateDurationInFrames = NoReactInternals10.validateDurationInFrames;
18743
+ import { NoReactInternals as NoReactInternals11 } from "remotion/no-react";
18744
+ var validateFps = NoReactInternals11.validateFps;
18745
+ var validateDimension = NoReactInternals11.validateDimension;
18746
+ var validateDurationInFrames = NoReactInternals11.validateDurationInFrames;
18739
18747
 
18740
18748
  // src/validate-scale.ts
18741
18749
  var validateScale = (scale) => {
@@ -19171,12 +19179,12 @@ var renderFrames = (options) => {
19171
19179
  indent,
19172
19180
  jpegQuality: jpegQuality ?? DEFAULT_JPEG_QUALITY,
19173
19181
  onDownload: onDownload ?? null,
19174
- serializedInputPropsWithCustomSchema: NoReactInternals11.serializeJSONWithDate({
19182
+ serializedInputPropsWithCustomSchema: NoReactInternals12.serializeJSONWithDate({
19175
19183
  indent: undefined,
19176
19184
  staticBase: null,
19177
19185
  data: inputProps ?? {}
19178
19186
  }).serializedString,
19179
- serializedResolvedPropsWithCustomSchema: NoReactInternals11.serializeJSONWithDate({
19187
+ serializedResolvedPropsWithCustomSchema: NoReactInternals12.serializeJSONWithDate({
19180
19188
  indent: undefined,
19181
19189
  staticBase: null,
19182
19190
  data: composition.props
@@ -19210,7 +19218,7 @@ var renderFrames = (options) => {
19210
19218
  import fs16 from "node:fs";
19211
19219
  import os6 from "node:os";
19212
19220
  import path25 from "node:path";
19213
- import { NoReactInternals as NoReactInternals13 } from "remotion/no-react";
19221
+ import { NoReactInternals as NoReactInternals14 } from "remotion/no-react";
19214
19222
 
19215
19223
  // src/crf.ts
19216
19224
  var defaultCrfMap = {
@@ -19404,11 +19412,11 @@ var ensureFramesInOrder = (framesToRender) => {
19404
19412
 
19405
19413
  // src/options/color-space.tsx
19406
19414
  var jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
19407
- import { NoReactInternals as NoReactInternals12 } from "remotion/no-react";
19415
+ import { NoReactInternals as NoReactInternals13 } from "remotion/no-react";
19408
19416
  var validV4ColorSpaces = ["default", "bt709", "bt2020-ncl"];
19409
19417
  var validV5ColorSpaces = ["bt601", "bt709", "bt2020-ncl"];
19410
- var validColorSpaces = NoReactInternals12.ENABLE_V5_BREAKING_CHANGES ? validV5ColorSpaces : validV4ColorSpaces;
19411
- var DEFAULT_COLOR_SPACE = NoReactInternals12.ENABLE_V5_BREAKING_CHANGES ? "bt709" : "default";
19418
+ var validColorSpaces = NoReactInternals13.ENABLE_V5_BREAKING_CHANGES ? validV5ColorSpaces : validV4ColorSpaces;
19419
+ var DEFAULT_COLOR_SPACE = NoReactInternals13.ENABLE_V5_BREAKING_CHANGES ? "bt709" : "default";
19412
19420
 
19413
19421
  // src/options/x264-preset.tsx
19414
19422
  var jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
@@ -20378,8 +20386,17 @@ var ffmpegVolumeExpression = ({
20378
20386
  };
20379
20387
 
20380
20388
  // src/stringify-ffmpeg-filter.ts
20389
+ var cleanUpFloatingPointError = (value) => {
20390
+ if (value % 1 < 0.0000001) {
20391
+ return Math.floor(value);
20392
+ }
20393
+ if (value % 1 > 0.9999999) {
20394
+ return Math.ceil(value);
20395
+ }
20396
+ return value;
20397
+ };
20381
20398
  var stringifyTrim = (trim) => {
20382
- const value = trim * 1e6;
20399
+ const value = cleanUpFloatingPointError(trim * 1e6);
20383
20400
  const asString = `${value}us`;
20384
20401
  if (asString.includes("e-")) {
20385
20402
  return "0us";
@@ -20409,7 +20426,6 @@ var getActualTrimLeft = ({
20409
20426
  throw new Error("This should never happen");
20410
20427
  };
20411
20428
  var trimAndSetTempo = ({
20412
- forSeamlessAacConcatenation,
20413
20429
  assetDuration,
20414
20430
  asset,
20415
20431
  trimLeftOffset,
@@ -20418,54 +20434,32 @@ var trimAndSetTempo = ({
20418
20434
  indent,
20419
20435
  logLevel
20420
20436
  }) => {
20421
- if (forSeamlessAacConcatenation) {
20422
- const { trimLeft, maxTrim } = getActualTrimLeft({
20423
- asset,
20424
- fps,
20425
- trimLeftOffset,
20426
- seamless: true,
20427
- assetDuration
20428
- });
20429
- const trimRight = trimLeft + asset.duration / fps - trimLeftOffset + trimRightOffset;
20430
- let trimRightOrAssetDuration = maxTrim ? Math.min(trimRight, maxTrim) : trimRight;
20431
- if (trimRightOrAssetDuration < trimLeft) {
20432
- Log.warn({ indent, logLevel }, "trimRightOrAssetDuration < trimLeft: " + JSON.stringify({
20433
- trimRight,
20434
- trimLeft,
20435
- assetDuration,
20436
- assetTrimLeft: asset.trimLeft
20437
- }));
20438
- trimRightOrAssetDuration = trimLeft;
20439
- }
20440
- return {
20441
- filter: [
20442
- calculateATempo(asset.playbackRate),
20443
- `atrim=${stringifyTrim(trimLeft)}:${stringifyTrim(trimRightOrAssetDuration)}`
20444
- ],
20445
- actualTrimLeft: trimLeft,
20446
- audibleDuration: trimRightOrAssetDuration - trimLeft
20447
- };
20448
- }
20449
- if (!forSeamlessAacConcatenation) {
20450
- const { trimLeft: actualTrimLeft, maxTrim } = getActualTrimLeft({
20451
- asset,
20452
- fps,
20453
- trimLeftOffset,
20454
- seamless: false,
20455
- assetDuration
20456
- });
20457
- const trimRight = actualTrimLeft + asset.duration / fps * asset.playbackRate;
20458
- const trimRightOrAssetDuration = maxTrim ? Math.min(trimRight, maxTrim) : trimRight;
20459
- return {
20460
- filter: [
20461
- `atrim=${stringifyTrim(actualTrimLeft)}:${stringifyTrim(trimRightOrAssetDuration)}`,
20462
- calculateATempo(asset.playbackRate)
20463
- ],
20464
- actualTrimLeft,
20465
- audibleDuration: (trimRightOrAssetDuration - actualTrimLeft) / asset.playbackRate
20466
- };
20437
+ const { trimLeft, maxTrim } = getActualTrimLeft({
20438
+ asset,
20439
+ fps,
20440
+ trimLeftOffset,
20441
+ seamless: true,
20442
+ assetDuration
20443
+ });
20444
+ const trimRight = trimLeft + asset.duration / fps - trimLeftOffset + trimRightOffset;
20445
+ let trimRightOrAssetDuration = maxTrim ? Math.min(trimRight, maxTrim) : trimRight;
20446
+ if (trimRightOrAssetDuration < trimLeft) {
20447
+ Log.warn({ indent, logLevel }, "trimRightOrAssetDuration < trimLeft: " + JSON.stringify({
20448
+ trimRight,
20449
+ trimLeft,
20450
+ assetDuration,
20451
+ assetTrimLeft: asset.trimLeft
20452
+ }));
20453
+ trimRightOrAssetDuration = trimLeft;
20467
20454
  }
20468
- throw new Error("This should never happen");
20455
+ return {
20456
+ filter: [
20457
+ calculateATempo(asset.playbackRate),
20458
+ `atrim=${stringifyTrim(trimLeft)}:${stringifyTrim(trimRightOrAssetDuration)}`
20459
+ ],
20460
+ actualTrimLeft: trimLeft,
20461
+ audibleDuration: trimRightOrAssetDuration - trimLeft
20462
+ };
20469
20463
  };
20470
20464
  var stringifyFfmpegFilter = ({
20471
20465
  channels,
@@ -20504,7 +20498,6 @@ var stringifyFfmpegFilter = ({
20504
20498
  audibleDuration,
20505
20499
  filter: trimAndTempoFilter
20506
20500
  } = trimAndSetTempo({
20507
- forSeamlessAacConcatenation,
20508
20501
  assetDuration,
20509
20502
  trimLeftOffset,
20510
20503
  trimRightOffset,
@@ -21598,10 +21591,10 @@ var internalRenderMediaRaw = ({
21598
21591
  onProgress: (frame) => {
21599
21592
  stitchStage = "muxing";
21600
21593
  if (preEncodedFileLocation) {
21601
- muxedFrames = frame;
21594
+ muxedFrames = Math.min(frame, totalFramesToRender);
21602
21595
  } else {
21603
- muxedFrames = frame;
21604
- encodedFrames = frame;
21596
+ muxedFrames = Math.min(frame, totalFramesToRender);
21597
+ encodedFrames = Math.min(frame, totalFramesToRender);
21605
21598
  }
21606
21599
  if (encodedFrames === totalFramesToRender) {
21607
21600
  encodedDoneIn = Date.now() - stitchStart;
@@ -21766,7 +21759,7 @@ var renderMedia = ({
21766
21759
  ffmpegOverride: ffmpegOverride ?? undefined,
21767
21760
  frameRange: frameRange ?? null,
21768
21761
  imageFormat: imageFormat ?? DEFAULT_VIDEO_IMAGE_FORMAT,
21769
- serializedInputPropsWithCustomSchema: NoReactInternals13.serializeJSONWithDate({
21762
+ serializedInputPropsWithCustomSchema: NoReactInternals14.serializeJSONWithDate({
21770
21763
  indent: undefined,
21771
21764
  staticBase: null,
21772
21765
  data: inputProps ?? {}
@@ -21801,7 +21794,7 @@ var renderMedia = ({
21801
21794
  return;
21802
21795
  },
21803
21796
  server: undefined,
21804
- serializedResolvedPropsWithCustomSchema: NoReactInternals13.serializeJSONWithDate({
21797
+ serializedResolvedPropsWithCustomSchema: NoReactInternals14.serializeJSONWithDate({
21805
21798
  indent: undefined,
21806
21799
  staticBase: null,
21807
21800
  data: composition.props ?? {}
@@ -21829,7 +21822,7 @@ var renderMedia = ({
21829
21822
  // src/render-still.ts
21830
21823
  import fs17, { statSync as statSync2 } from "node:fs";
21831
21824
  import path26 from "node:path";
21832
- import { NoReactInternals as NoReactInternals14 } from "remotion/no-react";
21825
+ import { NoReactInternals as NoReactInternals15 } from "remotion/no-react";
21833
21826
  var innerRenderStill = async ({
21834
21827
  composition,
21835
21828
  imageFormat = DEFAULT_STILL_IMAGE_FORMAT,
@@ -21865,7 +21858,7 @@ var innerRenderStill = async ({
21865
21858
  allowFloats: false
21866
21859
  });
21867
21860
  validateStillImageFormat(imageFormat);
21868
- NoReactInternals14.validateFrame({
21861
+ NoReactInternals15.validateFrame({
21869
21862
  frame,
21870
21863
  durationInFrames: composition.durationInFrames,
21871
21864
  allowFloats: false
@@ -22107,7 +22100,7 @@ var renderStill = (options) => {
22107
22100
  frame: frame ?? 0,
22108
22101
  imageFormat: imageFormat ?? DEFAULT_STILL_IMAGE_FORMAT,
22109
22102
  indent,
22110
- serializedInputPropsWithCustomSchema: NoReactInternals14.serializeJSONWithDate({
22103
+ serializedInputPropsWithCustomSchema: NoReactInternals15.serializeJSONWithDate({
22111
22104
  staticBase: null,
22112
22105
  indent: undefined,
22113
22106
  data: inputProps ?? {}
@@ -22124,7 +22117,7 @@ var renderStill = (options) => {
22124
22117
  serveUrl,
22125
22118
  timeoutInMilliseconds: timeoutInMilliseconds ?? DEFAULT_TIMEOUT,
22126
22119
  logLevel,
22127
- serializedResolvedPropsWithCustomSchema: NoReactInternals14.serializeJSONWithDate({
22120
+ serializedResolvedPropsWithCustomSchema: NoReactInternals15.serializeJSONWithDate({
22128
22121
  indent: undefined,
22129
22122
  staticBase: null,
22130
22123
  data: composition.props ?? {}
@@ -22143,7 +22136,7 @@ var renderStill = (options) => {
22143
22136
  };
22144
22137
 
22145
22138
  // src/select-composition.ts
22146
- import { NoReactInternals as NoReactInternals15 } from "remotion/no-react";
22139
+ import { NoReactInternals as NoReactInternals16 } from "remotion/no-react";
22147
22140
  var innerSelectComposition = async ({
22148
22141
  page,
22149
22142
  serializedInputPropsWithCustomSchema,
@@ -22219,8 +22212,8 @@ var innerSelectComposition = async ({
22219
22212
  height,
22220
22213
  fps,
22221
22214
  durationInFrames,
22222
- props: NoReactInternals15.deserializeJSONWithCustomFields(res.serializedResolvedPropsWithCustomSchema),
22223
- defaultProps: NoReactInternals15.deserializeJSONWithCustomFields(res.serializedDefaultPropsWithCustomSchema),
22215
+ props: NoReactInternals16.deserializeJSONWithCustomFields(res.serializedResolvedPropsWithCustomSchema),
22216
+ defaultProps: NoReactInternals16.deserializeJSONWithCustomFields(res.serializedDefaultPropsWithCustomSchema),
22224
22217
  defaultCodec,
22225
22218
  defaultOutName
22226
22219
  },
@@ -22351,7 +22344,7 @@ var selectComposition = async (options) => {
22351
22344
  browserExecutable: browserExecutable ?? null,
22352
22345
  chromiumOptions: chromiumOptions ?? {},
22353
22346
  envVariables: envVariables ?? {},
22354
- serializedInputPropsWithCustomSchema: NoReactInternals15.serializeJSONWithDate({
22347
+ serializedInputPropsWithCustomSchema: NoReactInternals16.serializeJSONWithDate({
22355
22348
  indent: undefined,
22356
22349
  staticBase: null,
22357
22350
  data: inputProps ?? {}
@@ -1,12 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.formatObjectPreview = exports.formatRemoteObject = void 0;
4
+ const no_react_1 = require("remotion/no-react");
4
5
  const chalk_1 = require("./chalk");
5
6
  const formatRemoteObject = (remoteObject) => {
6
7
  if (remoteObject.preview) {
7
8
  return (0, exports.formatObjectPreview)(remoteObject.preview);
8
9
  }
9
10
  if (remoteObject.type === 'string') {
11
+ const isDelayRenderClear = remoteObject.value.includes(no_react_1.NoReactInternals.DELAY_RENDER_CLEAR_TOKEN);
12
+ if (isDelayRenderClear) {
13
+ return chalk_1.chalk.gray(`${remoteObject.value}`);
14
+ }
10
15
  return chalk_1.chalk.reset(`${remoteObject.value}`);
11
16
  }
12
17
  if (remoteObject.type === 'number') {
@@ -9,7 +9,7 @@ export declare const hasSpecifiedUnsupportedHardwareQualifySettings: ({ encoding
9
9
  encodingMaxRate: string | null;
10
10
  encodingBufferSize: string | null;
11
11
  crf: unknown;
12
- }) => "encodingMaxRate" | "encodingBufferSize" | "crf" | null;
12
+ }) => "crf" | "encodingBufferSize" | "encodingMaxRate" | null;
13
13
  export declare const getCodecName: ({ codec, encodingMaxRate, encodingBufferSize, crf, hardwareAcceleration, logLevel, indent, }: {
14
14
  codec: Codec;
15
15
  hardwareAcceleration: HardwareAccelerationOption;
package/dist/index.d.ts CHANGED
@@ -354,8 +354,8 @@ export declare const RenderInternals: {
354
354
  }) => execa.ExecaChildProcess<string>;
355
355
  validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
356
356
  validVideoImageFormats: readonly ["png", "jpeg", "none"];
357
- DEFAULT_STILL_IMAGE_FORMAT: "png" | "jpeg" | "pdf" | "webp";
358
- DEFAULT_VIDEO_IMAGE_FORMAT: "png" | "jpeg" | "none";
357
+ DEFAULT_STILL_IMAGE_FORMAT: "jpeg" | "png" | "webp" | "pdf";
358
+ DEFAULT_VIDEO_IMAGE_FORMAT: "jpeg" | "png" | "none";
359
359
  DEFAULT_JPEG_QUALITY: number;
360
360
  chalk: {
361
361
  enabled: () => boolean;
@@ -189,7 +189,7 @@ export declare const allOptions: {
189
189
  webhookCustomDataOption: {
190
190
  name: string;
191
191
  cliFlag: "webhook-custom-data";
192
- description: (type: "cli" | "ssr") => import("react/jsx-runtime").JSX.Element;
192
+ description: (type: "ssr" | "cli") => import("react/jsx-runtime").JSX.Element;
193
193
  ssrName: "customData";
194
194
  docLink: string;
195
195
  type: Record<string, unknown> | null;
@@ -602,7 +602,7 @@ export declare const allOptions: {
602
602
  metadataOption: {
603
603
  name: string;
604
604
  cliFlag: "metadata";
605
- description: (mode: "cli" | "ssr") => import("react/jsx-runtime").JSX.Element;
605
+ description: (mode: "ssr" | "cli") => import("react/jsx-runtime").JSX.Element;
606
606
  docLink: string;
607
607
  type: import("./metadata").Metadata;
608
608
  getValue: ({ commandLine }: {
@@ -2,7 +2,7 @@ export type Metadata = Record<string, string>;
2
2
  export declare const metadataOption: {
3
3
  name: string;
4
4
  cliFlag: "metadata";
5
- description: (mode: "cli" | "ssr") => import("react/jsx-runtime").JSX.Element;
5
+ description: (mode: "ssr" | "cli") => import("react/jsx-runtime").JSX.Element;
6
6
  docLink: string;
7
7
  type: Metadata;
8
8
  getValue: ({ commandLine }: {
@@ -1,7 +1,7 @@
1
1
  export declare const webhookCustomDataOption: {
2
2
  name: string;
3
3
  cliFlag: "webhook-custom-data";
4
- description: (type: "cli" | "ssr") => import("react/jsx-runtime").JSX.Element;
4
+ description: (type: "ssr" | "cli") => import("react/jsx-runtime").JSX.Element;
5
5
  ssrName: "customData";
6
6
  docLink: string;
7
7
  type: Record<string, unknown> | null;
@@ -398,12 +398,14 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, s
398
398
  assetsInfo,
399
399
  onProgress: (frame) => {
400
400
  stitchStage = 'muxing';
401
+ // With seamless AAC concatenation, the amount of rendered frames
402
+ // might be longer, so we need to clamp it to avoid progress over 100%
401
403
  if (preEncodedFileLocation) {
402
- muxedFrames = frame;
404
+ muxedFrames = Math.min(frame, totalFramesToRender);
403
405
  }
404
406
  else {
405
- muxedFrames = frame;
406
- encodedFrames = frame;
407
+ muxedFrames = Math.min(frame, totalFramesToRender);
408
+ encodedFrames = Math.min(frame, totalFramesToRender);
407
409
  }
408
410
  if (encodedFrames === totalFramesToRender) {
409
411
  encodedDoneIn = Date.now() - stitchStart;
@@ -6,8 +6,17 @@ const ffmpeg_volume_expression_1 = require("./assets/ffmpeg-volume-expression");
6
6
  const logger_1 = require("./logger");
7
7
  const sample_rate_1 = require("./sample-rate");
8
8
  const truthy_1 = require("./truthy");
9
+ const cleanUpFloatingPointError = (value) => {
10
+ if (value % 1 < 0.0000001) {
11
+ return Math.floor(value);
12
+ }
13
+ if (value % 1 > 0.9999999) {
14
+ return Math.ceil(value);
15
+ }
16
+ return value;
17
+ };
9
18
  const stringifyTrim = (trim) => {
10
- const value = trim * 1000000;
19
+ const value = cleanUpFloatingPointError(trim * 1000000);
11
20
  const asString = `${value}us`;
12
21
  // Handle very small values such as `"6e-7us"`, those are essentially rounding errors to 0
13
22
  if (asString.includes('e-')) {
@@ -36,66 +45,40 @@ const getActualTrimLeft = ({ asset, fps, trimLeftOffset, seamless, assetDuration
36
45
  throw new Error('This should never happen');
37
46
  };
38
47
  exports.getActualTrimLeft = getActualTrimLeft;
39
- const trimAndSetTempo = ({ forSeamlessAacConcatenation, assetDuration, asset, trimLeftOffset, trimRightOffset, fps, indent, logLevel, }) => {
40
- // If we need seamless AAC stitching, we need to apply the tempo filter first
41
- // because the atempo filter is not frame-perfect. It creates a small offset
42
- // and the offset needs to be the same for all audio tracks, before processing it further.
48
+ const trimAndSetTempo = ({ assetDuration, asset, trimLeftOffset, trimRightOffset, fps, indent, logLevel, }) => {
49
+ // We need to apply the tempo filter first
50
+ // because the atempo filter is not frame-perfect.
51
+ // It creates a small offset and the offset needs to be the same for all audio tracks, before processing it further.
43
52
  // This also affects the trimLeft and trimRight values, as they need to be adjusted.
44
- if (forSeamlessAacConcatenation) {
45
- const { trimLeft, maxTrim } = (0, exports.getActualTrimLeft)({
46
- asset,
47
- fps,
48
- trimLeftOffset,
49
- seamless: true,
50
- assetDuration,
51
- });
52
- const trimRight = trimLeft + asset.duration / fps - trimLeftOffset + trimRightOffset;
53
- let trimRightOrAssetDuration = maxTrim
54
- ? Math.min(trimRight, maxTrim)
55
- : trimRight;
56
- if (trimRightOrAssetDuration < trimLeft) {
57
- logger_1.Log.warn({ indent, logLevel }, 'trimRightOrAssetDuration < trimLeft: ' +
58
- JSON.stringify({
59
- trimRight,
60
- trimLeft,
61
- assetDuration,
62
- assetTrimLeft: asset.trimLeft,
63
- }));
64
- trimRightOrAssetDuration = trimLeft;
65
- }
66
- return {
67
- filter: [
68
- (0, calculate_atempo_1.calculateATempo)(asset.playbackRate),
69
- `atrim=${stringifyTrim(trimLeft)}:${stringifyTrim(trimRightOrAssetDuration)}`,
70
- ],
71
- actualTrimLeft: trimLeft,
72
- audibleDuration: trimRightOrAssetDuration - trimLeft,
73
- };
74
- }
75
- // Otherwise, we first trim and then apply playback rate, as then the atempo
76
- // filter needs to do less work.
77
- if (!forSeamlessAacConcatenation) {
78
- const { trimLeft: actualTrimLeft, maxTrim } = (0, exports.getActualTrimLeft)({
79
- asset,
80
- fps,
81
- trimLeftOffset,
82
- seamless: false,
83
- assetDuration,
84
- });
85
- const trimRight = actualTrimLeft + (asset.duration / fps) * asset.playbackRate;
86
- const trimRightOrAssetDuration = maxTrim
87
- ? Math.min(trimRight, maxTrim)
88
- : trimRight;
89
- return {
90
- filter: [
91
- `atrim=${stringifyTrim(actualTrimLeft)}:${stringifyTrim(trimRightOrAssetDuration)}`,
92
- (0, calculate_atempo_1.calculateATempo)(asset.playbackRate),
93
- ],
94
- actualTrimLeft,
95
- audibleDuration: (trimRightOrAssetDuration - actualTrimLeft) / asset.playbackRate,
96
- };
53
+ const { trimLeft, maxTrim } = (0, exports.getActualTrimLeft)({
54
+ asset,
55
+ fps,
56
+ trimLeftOffset,
57
+ seamless: true,
58
+ assetDuration,
59
+ });
60
+ const trimRight = trimLeft + asset.duration / fps - trimLeftOffset + trimRightOffset;
61
+ let trimRightOrAssetDuration = maxTrim
62
+ ? Math.min(trimRight, maxTrim)
63
+ : trimRight;
64
+ if (trimRightOrAssetDuration < trimLeft) {
65
+ logger_1.Log.warn({ indent, logLevel }, 'trimRightOrAssetDuration < trimLeft: ' +
66
+ JSON.stringify({
67
+ trimRight,
68
+ trimLeft,
69
+ assetDuration,
70
+ assetTrimLeft: asset.trimLeft,
71
+ }));
72
+ trimRightOrAssetDuration = trimLeft;
97
73
  }
98
- throw new Error('This should never happen');
74
+ return {
75
+ filter: [
76
+ (0, calculate_atempo_1.calculateATempo)(asset.playbackRate),
77
+ `atrim=${stringifyTrim(trimLeft)}:${stringifyTrim(trimRightOrAssetDuration)}`,
78
+ ],
79
+ actualTrimLeft: trimLeft,
80
+ audibleDuration: trimRightOrAssetDuration - trimLeft,
81
+ };
99
82
  };
100
83
  const stringifyFfmpegFilter = ({ channels, volume, fps, assetDuration, chunkLengthInSeconds, forSeamlessAacConcatenation, trimLeftOffset, trimRightOffset, asset, indent, logLevel, presentationTimeOffsetInSeconds, }) => {
101
84
  if (channels === 0) {
@@ -117,7 +100,6 @@ const stringifyFfmpegFilter = ({ channels, volume, fps, assetDuration, chunkLeng
117
100
  throw new Error('toneFrequency must be a positive number between 0.01 and 2');
118
101
  }
119
102
  const { actualTrimLeft, audibleDuration, filter: trimAndTempoFilter, } = trimAndSetTempo({
120
- forSeamlessAacConcatenation,
121
103
  assetDuration,
122
104
  trimLeftOffset,
123
105
  trimRightOffset,
@@ -3064,8 +3064,8 @@ var getDownloadsCacheDir = () => {
3064
3064
  };
3065
3065
 
3066
3066
  // src/browser/BrowserFetcher.ts
3067
- var TESTED_VERSION = "123.0.6312.86";
3068
- var PLAYWRIGHT_VERSION = "1105";
3067
+ var TESTED_VERSION = "133.0.6943.0";
3068
+ var PLAYWRIGHT_VERSION = "1155";
3069
3069
  function getChromeDownloadUrl({
3070
3070
  platform: platform2,
3071
3071
  version,
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.272",
6
+ "version": "4.0.274",
7
7
  "description": "Render Remotion videos using Node.js or Bun",
8
8
  "main": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
@@ -18,8 +18,8 @@
18
18
  "extract-zip": "2.0.1",
19
19
  "source-map": "^0.8.0-beta.0",
20
20
  "ws": "8.17.1",
21
- "remotion": "4.0.272",
22
- "@remotion/streaming": "4.0.272"
21
+ "remotion": "4.0.274",
22
+ "@remotion/streaming": "4.0.274"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "react": ">=16.8.0",
@@ -33,17 +33,17 @@
33
33
  "react-dom": "19.0.0",
34
34
  "@types/ws": "8.5.10",
35
35
  "eslint": "9.19.0",
36
- "@remotion/example-videos": "4.0.272",
37
- "@remotion/eslint-config-internal": "4.0.272"
36
+ "@remotion/example-videos": "4.0.274",
37
+ "@remotion/eslint-config-internal": "4.0.274"
38
38
  },
39
39
  "optionalDependencies": {
40
- "@remotion/compositor-darwin-arm64": "4.0.272",
41
- "@remotion/compositor-darwin-x64": "4.0.272",
42
- "@remotion/compositor-linux-arm64-gnu": "4.0.272",
43
- "@remotion/compositor-linux-x64-gnu": "4.0.272",
44
- "@remotion/compositor-linux-x64-musl": "4.0.272",
45
- "@remotion/compositor-linux-arm64-musl": "4.0.272",
46
- "@remotion/compositor-win32-x64-msvc": "4.0.272"
40
+ "@remotion/compositor-darwin-arm64": "4.0.274",
41
+ "@remotion/compositor-linux-arm64-gnu": "4.0.274",
42
+ "@remotion/compositor-linux-x64-gnu": "4.0.274",
43
+ "@remotion/compositor-linux-x64-musl": "4.0.274",
44
+ "@remotion/compositor-linux-arm64-musl": "4.0.274",
45
+ "@remotion/compositor-win32-x64-msvc": "4.0.274",
46
+ "@remotion/compositor-darwin-x64": "4.0.274"
47
47
  },
48
48
  "keywords": [
49
49
  "remotion",