@remotion/renderer 4.0.340 → 4.0.344

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/LICENSE.md CHANGED
@@ -6,10 +6,10 @@ In Remotion 5.0, the license will slightly change. [View the changes here](https
6
6
 
7
7
  Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion to create videos for free (even commercial), while a company license is required for for-profit organizations of a certain size. This two-tier system was designed to ensure funding for this project while still allowing the source code to be available and the program to be free for most. Read below for the exact terms of use.
8
8
 
9
- - [Free license](#free-license)
10
- - [Company license](#company-license)
9
+ - [Free License](#free-license)
10
+ - [Company License](#company-license)
11
11
 
12
- ## Free license
12
+ ## Free License
13
13
 
14
14
  Copyright © 2025 [Remotion](https://www.remotion.dev)
15
15
 
@@ -24,7 +24,7 @@ You are eligible to use Remotion for free if you are:
24
24
 
25
25
  ### Allowed use cases
26
26
 
27
- Permission is hereby granted, free of charge, to any person eligible for the "Free license", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify the software to their own liking, for the purpose of fulfilling their custom use case or to contribute bug fixes or improvements back to Remotion.
27
+ Permission is hereby granted, free of charge, to any person eligible for the "Free License", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify the software to their own liking, for the purpose of fulfilling their custom use case or to contribute bug fixes or improvements back to Remotion.
28
28
 
29
29
  ### Disallowed use cases
30
30
 
@@ -38,12 +38,12 @@ The software is provided "as is", without warranty of any kind, express or impli
38
38
 
39
39
  Support is provided on a best-we-can-do basis via GitHub Issues and Discord.
40
40
 
41
- ## Company license
41
+ ## Company License
42
42
 
43
- You are required to obtain a company license to use Remotion if you are not within the group of entities eligible for a free license. This license will enable you to use Remotion for the allowed use cases specified in the free license, and give you access to prioritized support (read the [Support Policy](https://www.remotion.dev/docs/support)).
43
+ You are required to obtain a Company License to use Remotion if you are not within the group of entities eligible for a Free License. This license will enable you to use Remotion for the allowed use cases specified in the Free License, and give you access to prioritized support (read the [Support Policy](https://www.remotion.dev/docs/support)).
44
44
 
45
45
  Visit [remotion.pro](https://www.remotion.pro/license) for pricing and to buy a license.
46
46
 
47
47
  ### FAQs
48
48
 
49
- Are you not sure whether you need a company license because of an edge case? Here are some [frequently asked questions](https://www.remotion.pro/faq).
49
+ Are you not sure whether you need a Company License because of an edge case? Here are some [frequently asked questions](https://www.remotion.pro/faq).
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.uncompressMediaAsset = void 0;
4
4
  const uncompressMediaAsset = (allRenderAssets, assetToUncompress) => {
5
- const isCompressed = assetToUncompress.src.match(/same-as-(.*)-([0-9]+)$/);
5
+ const isCompressed = assetToUncompress.src.match(/same-as-(.*)-([0-9.]+)$/);
6
6
  if (!isCompressed) {
7
7
  return assetToUncompress;
8
8
  }
@@ -16160,15 +16160,17 @@ var innerSetPropsAndEnv = async ({
16160
16160
  videoEnabled,
16161
16161
  indent,
16162
16162
  logLevel,
16163
- onServeUrlVisited
16163
+ onServeUrlVisited,
16164
+ isMainTab
16164
16165
  }) => {
16165
16166
  validatePuppeteerTimeout(timeoutInMilliseconds);
16166
16167
  const actualTimeout = timeoutInMilliseconds ?? DEFAULT_TIMEOUT;
16167
16168
  page.setDefaultTimeout(actualTimeout);
16168
16169
  page.setDefaultNavigationTimeout(actualTimeout);
16169
16170
  const urlToVisit = normalizeServeUrl(serveUrl);
16170
- await page.evaluateOnNewDocument((timeout) => {
16171
+ await page.evaluateOnNewDocument((timeout, mainTab) => {
16171
16172
  window.remotion_puppeteerTimeout = timeout;
16173
+ window.remotion_isMainTab = mainTab;
16172
16174
  if (window.process === undefined) {
16173
16175
  window.process = {};
16174
16176
  }
@@ -16176,7 +16178,8 @@ var innerSetPropsAndEnv = async ({
16176
16178
  window.process.env = {};
16177
16179
  }
16178
16180
  window.process.env.NODE_ENV = "production";
16179
- }, actualTimeout);
16181
+ }, actualTimeout, isMainTab);
16182
+ await page.evaluateOnNewDocument('window.remotion_broadcastChannel = new BroadcastChannel("remotion-video-frame-extraction")');
16180
16183
  if (envVariables) {
16181
16184
  await page.evaluateOnNewDocument((input) => {
16182
16185
  window.remotion_envVariables = input;
@@ -16225,7 +16228,8 @@ var innerSetPropsAndEnv = async ({
16225
16228
  videoEnabled,
16226
16229
  indent,
16227
16230
  logLevel,
16228
- onServeUrlVisited
16231
+ onServeUrlVisited,
16232
+ isMainTab
16229
16233
  });
16230
16234
  };
16231
16235
  const [pageRes, error] = await gotoPageOrThrow(page, urlToVisit, actualTimeout);
@@ -16493,7 +16497,8 @@ var innerGetCompositions = async ({
16493
16497
  logLevel,
16494
16498
  onServeUrlVisited: () => {
16495
16499
  return;
16496
- }
16500
+ },
16501
+ isMainTab: true
16497
16502
  });
16498
16503
  await puppeteerEvaluateWithCatch({
16499
16504
  page,
@@ -17649,7 +17654,8 @@ var makePage = async ({
17649
17654
  serializedInputPropsWithCustomSchema,
17650
17655
  imageFormat,
17651
17656
  serializedResolvedPropsWithCustomSchema,
17652
- pageIndex
17657
+ pageIndex,
17658
+ isMainTab
17653
17659
  }) => {
17654
17660
  const page = await browserReplacer.getBrowser().newPage({ context, logLevel, indent, pageIndex, onBrowserLog });
17655
17661
  pagesArray.push(page);
@@ -17673,7 +17679,8 @@ var makePage = async ({
17673
17679
  logLevel,
17674
17680
  onServeUrlVisited: () => {
17675
17681
  return;
17676
- }
17682
+ },
17683
+ isMainTab
17677
17684
  });
17678
17685
  await puppeteerEvaluateWithCatch({
17679
17686
  pageFunction: (id, props, durationInFrames, fps, height, width, defaultCodec, defaultOutName, defaultVideoImageFormat, defaultPixelFormat) => {
@@ -18634,7 +18641,8 @@ var innerRenderFrames = async ({
18634
18641
  serializedResolvedPropsWithCustomSchema,
18635
18642
  serveUrl,
18636
18643
  timeoutInMilliseconds,
18637
- pageIndex
18644
+ pageIndex,
18645
+ isMainTab: pageIndex === 0
18638
18646
  });
18639
18647
  };
18640
18648
  const getPool = async () => {
@@ -19693,7 +19701,7 @@ var convertAssetToFlattenedVolume = (asset) => {
19693
19701
 
19694
19702
  // src/assets/types.ts
19695
19703
  var uncompressMediaAsset = (allRenderAssets, assetToUncompress) => {
19696
- const isCompressed = assetToUncompress.src.match(/same-as-(.*)-([0-9]+)$/);
19704
+ const isCompressed = assetToUncompress.src.match(/same-as-(.*)-([0-9.]+)$/);
19697
19705
  if (!isCompressed) {
19698
19706
  return assetToUncompress;
19699
19707
  }
@@ -21041,7 +21049,7 @@ var internalRenderMediaRaw = ({
21041
21049
  proResProfile,
21042
21050
  x264Preset,
21043
21051
  crf,
21044
- composition,
21052
+ composition: compositionWithPossibleUnevenDimensions,
21045
21053
  serializedInputPropsWithCustomSchema,
21046
21054
  pixelFormat: userPixelFormat,
21047
21055
  codec,
@@ -21095,11 +21103,11 @@ var internalRenderMediaRaw = ({
21095
21103
  chromeMode,
21096
21104
  offthreadVideoThreads
21097
21105
  }) => {
21098
- const pixelFormat = userPixelFormat ?? composition.defaultPixelFormat ?? DEFAULT_PIXEL_FORMAT;
21106
+ const pixelFormat = userPixelFormat ?? compositionWithPossibleUnevenDimensions.defaultPixelFormat ?? DEFAULT_PIXEL_FORMAT;
21099
21107
  if (repro) {
21100
21108
  enableRepro({
21101
21109
  serveUrl,
21102
- compositionName: composition.id,
21110
+ compositionName: compositionWithPossibleUnevenDimensions.id,
21103
21111
  serializedInputPropsWithCustomSchema,
21104
21112
  serializedResolvedPropsWithCustomSchema
21105
21113
  });
@@ -21155,8 +21163,8 @@ var internalRenderMediaRaw = ({
21155
21163
  const recentFrameTimings = [];
21156
21164
  const renderStart = Date.now();
21157
21165
  const { estimatedUsage, freeMemory, hasEnoughMemory } = shouldUseParallelEncoding({
21158
- height: composition.height,
21159
- width: composition.width,
21166
+ height: compositionWithPossibleUnevenDimensions.height,
21167
+ width: compositionWithPossibleUnevenDimensions.width,
21160
21168
  logLevel
21161
21169
  });
21162
21170
  const parallelEncoding = !disallowParallelEncoding && hasEnoughMemory && canUseParallelEncoding(codec);
@@ -21201,22 +21209,36 @@ var internalRenderMediaRaw = ({
21201
21209
  tag: "renderMedia()"
21202
21210
  }, "Parallel encoding is disabled.");
21203
21211
  }
21204
- const imageFormat = isAudioCodec(codec) ? "none" : provisionalImageFormat ?? composition.defaultVideoImageFormat ?? DEFAULT_VIDEO_IMAGE_FORMAT;
21212
+ const imageFormat = isAudioCodec(codec) ? "none" : provisionalImageFormat ?? compositionWithPossibleUnevenDimensions.defaultVideoImageFormat ?? DEFAULT_VIDEO_IMAGE_FORMAT;
21205
21213
  validateSelectedPixelFormatAndImageFormatCombination(pixelFormat, imageFormat);
21206
21214
  const workingDir = fs15.mkdtempSync(path25.join(os6.tmpdir(), "react-motion-render"));
21207
21215
  const preEncodedFileLocation = parallelEncoding ? path25.join(workingDir, "pre-encode." + getFileExtensionFromCodec(codec, audioCodec)) : null;
21208
21216
  if (onCtrlCExit && workingDir) {
21209
21217
  onCtrlCExit(`Delete ${workingDir}`, () => deleteDirectory(workingDir));
21210
21218
  }
21219
+ const { actualWidth: widthEvenDimensions, actualHeight: heightEvenDimensions } = validateEvenDimensionsWithCodec({
21220
+ codec,
21221
+ height: compositionWithPossibleUnevenDimensions.height,
21222
+ scale: 1,
21223
+ width: compositionWithPossibleUnevenDimensions.width,
21224
+ wantsImageSequence: false,
21225
+ indent,
21226
+ logLevel
21227
+ });
21211
21228
  const { actualWidth, actualHeight } = validateEvenDimensionsWithCodec({
21212
21229
  codec,
21213
- height: composition.height,
21230
+ height: compositionWithPossibleUnevenDimensions.height,
21214
21231
  scale,
21215
- width: composition.width,
21232
+ width: compositionWithPossibleUnevenDimensions.width,
21216
21233
  wantsImageSequence: false,
21217
21234
  indent,
21218
21235
  logLevel
21219
21236
  });
21237
+ const composition = {
21238
+ ...compositionWithPossibleUnevenDimensions,
21239
+ height: heightEvenDimensions,
21240
+ width: widthEvenDimensions
21241
+ };
21220
21242
  const realFrameRange = getRealFrameRange(composition.durationInFrames, frameRange);
21221
21243
  const totalFramesToRender = getFramesToRender(realFrameRange, everyNthFrame).length;
21222
21244
  Log.verbose({ indent, logLevel, tag: "renderMedia()" }, `Rendering frames ${realFrameRange.join("-")}`);
@@ -21777,7 +21799,8 @@ var innerRenderStill = async ({
21777
21799
  logLevel,
21778
21800
  onServeUrlVisited: () => {
21779
21801
  return;
21780
- }
21802
+ },
21803
+ isMainTab: true
21781
21804
  });
21782
21805
  await puppeteerEvaluateWithCatch({
21783
21806
  pageFunction: (id, props, durationInFrames, fps, height, width, defaultCodec, defaultOutName, defaultVideoImageFormat, defaultPixelFormat) => {
@@ -22004,7 +22027,8 @@ var innerSelectComposition = async ({
22004
22027
  videoEnabled: false,
22005
22028
  indent,
22006
22029
  logLevel,
22007
- onServeUrlVisited
22030
+ onServeUrlVisited,
22031
+ isMainTab: true
22008
22032
  });
22009
22033
  await puppeteerEvaluateWithCatch({
22010
22034
  page,
@@ -30,6 +30,7 @@ const innerGetCompositions = async ({ envVariables, serializedInputPropsWithCust
30
30
  indent,
31
31
  logLevel,
32
32
  onServeUrlVisited: () => undefined,
33
+ isMainTab: true,
33
34
  });
34
35
  await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
35
36
  page,
@@ -5,7 +5,7 @@ import type { SourceMapGetter } from './browser/source-map-getter';
5
5
  import type { VideoImageFormat } from './image-format';
6
6
  import type { LogLevel } from './log-level';
7
7
  import type { BrowserReplacer } from './replace-browser';
8
- export declare const makePage: ({ context, initialFrame, browserReplacer, logLevel, indent, pagesArray, onBrowserLog, scale, timeoutInMilliseconds, composition, proxyPort, serveUrl, muted, envVariables, serializedInputPropsWithCustomSchema, imageFormat, serializedResolvedPropsWithCustomSchema, pageIndex, }: {
8
+ export declare const makePage: ({ context, initialFrame, browserReplacer, logLevel, indent, pagesArray, onBrowserLog, scale, timeoutInMilliseconds, composition, proxyPort, serveUrl, muted, envVariables, serializedInputPropsWithCustomSchema, imageFormat, serializedResolvedPropsWithCustomSchema, pageIndex, isMainTab, }: {
9
9
  context: SourceMapGetter;
10
10
  initialFrame: number;
11
11
  browserReplacer: BrowserReplacer;
@@ -24,4 +24,5 @@ export declare const makePage: ({ context, initialFrame, browserReplacer, logLev
24
24
  serializedResolvedPropsWithCustomSchema: string;
25
25
  imageFormat: VideoImageFormat;
26
26
  pageIndex: number;
27
+ isMainTab: boolean;
27
28
  }) => Promise<Page>;
package/dist/make-page.js CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makePage = void 0;
4
4
  const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
5
5
  const set_props_and_env_1 = require("./set-props-and-env");
6
- const makePage = async ({ context, initialFrame, browserReplacer, logLevel, indent, pagesArray, onBrowserLog, scale, timeoutInMilliseconds, composition, proxyPort, serveUrl, muted, envVariables, serializedInputPropsWithCustomSchema, imageFormat, serializedResolvedPropsWithCustomSchema, pageIndex, }) => {
6
+ const makePage = async ({ context, initialFrame, browserReplacer, logLevel, indent, pagesArray, onBrowserLog, scale, timeoutInMilliseconds, composition, proxyPort, serveUrl, muted, envVariables, serializedInputPropsWithCustomSchema, imageFormat, serializedResolvedPropsWithCustomSchema, pageIndex, isMainTab, }) => {
7
7
  const page = await browserReplacer
8
8
  .getBrowser()
9
9
  .newPage({ context, logLevel, indent, pageIndex, onBrowserLog });
@@ -27,6 +27,7 @@ const makePage = async ({ context, initialFrame, browserReplacer, logLevel, inde
27
27
  indent,
28
28
  logLevel,
29
29
  onServeUrlVisited: () => undefined,
30
+ isMainTab,
30
31
  });
31
32
  await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
32
33
  // eslint-disable-next-line max-params
@@ -73,6 +73,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
73
73
  serveUrl,
74
74
  timeoutInMilliseconds,
75
75
  pageIndex,
76
+ isMainTab: pageIndex === 0,
76
77
  });
77
78
  };
78
79
  const getPool = async () => {
@@ -52,13 +52,13 @@ const validate_videobitrate_1 = require("./validate-videobitrate");
52
52
  const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
53
53
  const SLOWEST_FRAME_COUNT = 10;
54
54
  const MAX_RECENT_FRAME_TIMINGS = 50;
55
- const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, 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, }) => {
55
+ 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, }) => {
56
56
  var _a, _b;
57
- const pixelFormat = (_a = userPixelFormat !== null && userPixelFormat !== void 0 ? userPixelFormat : composition.defaultPixelFormat) !== null && _a !== void 0 ? _a : pixel_format_1.DEFAULT_PIXEL_FORMAT;
57
+ const pixelFormat = (_a = userPixelFormat !== null && userPixelFormat !== void 0 ? userPixelFormat : compositionWithPossibleUnevenDimensions.defaultPixelFormat) !== null && _a !== void 0 ? _a : pixel_format_1.DEFAULT_PIXEL_FORMAT;
58
58
  if (repro) {
59
59
  (0, repro_1.enableRepro)({
60
60
  serveUrl,
61
- compositionName: composition.id,
61
+ compositionName: compositionWithPossibleUnevenDimensions.id,
62
62
  serializedInputPropsWithCustomSchema,
63
63
  serializedResolvedPropsWithCustomSchema,
64
64
  });
@@ -117,8 +117,8 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, s
117
117
  const recentFrameTimings = [];
118
118
  const renderStart = Date.now();
119
119
  const { estimatedUsage, freeMemory, hasEnoughMemory } = (0, prestitcher_memory_usage_1.shouldUseParallelEncoding)({
120
- height: composition.height,
121
- width: composition.width,
120
+ height: compositionWithPossibleUnevenDimensions.height,
121
+ width: compositionWithPossibleUnevenDimensions.width,
122
122
  logLevel,
123
123
  });
124
124
  const parallelEncoding = !disallowParallelEncoding &&
@@ -168,7 +168,7 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, s
168
168
  }
169
169
  const imageFormat = (0, is_audio_codec_1.isAudioCodec)(codec)
170
170
  ? 'none'
171
- : ((_b = provisionalImageFormat !== null && provisionalImageFormat !== void 0 ? provisionalImageFormat : composition.defaultVideoImageFormat) !== null && _b !== void 0 ? _b : image_format_1.DEFAULT_VIDEO_IMAGE_FORMAT);
171
+ : ((_b = provisionalImageFormat !== null && provisionalImageFormat !== void 0 ? provisionalImageFormat : compositionWithPossibleUnevenDimensions.defaultVideoImageFormat) !== null && _b !== void 0 ? _b : image_format_1.DEFAULT_VIDEO_IMAGE_FORMAT);
172
172
  (0, image_format_1.validateSelectedPixelFormatAndImageFormatCombination)(pixelFormat, imageFormat);
173
173
  const workingDir = node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), 'react-motion-render'));
174
174
  const preEncodedFileLocation = parallelEncoding
@@ -177,15 +177,30 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, s
177
177
  if (onCtrlCExit && workingDir) {
178
178
  onCtrlCExit(`Delete ${workingDir}`, () => (0, delete_directory_1.deleteDirectory)(workingDir));
179
179
  }
180
+ const { actualWidth: widthEvenDimensions, actualHeight: heightEvenDimensions } = (0, validate_even_dimensions_with_codec_1.validateEvenDimensionsWithCodec)({
181
+ codec,
182
+ height: compositionWithPossibleUnevenDimensions.height,
183
+ // Don't apply scale yet, only ensure even dimensions
184
+ scale: 1,
185
+ width: compositionWithPossibleUnevenDimensions.width,
186
+ wantsImageSequence: false,
187
+ indent,
188
+ logLevel,
189
+ });
180
190
  const { actualWidth, actualHeight } = (0, validate_even_dimensions_with_codec_1.validateEvenDimensionsWithCodec)({
181
191
  codec,
182
- height: composition.height,
192
+ height: compositionWithPossibleUnevenDimensions.height,
183
193
  scale,
184
- width: composition.width,
194
+ width: compositionWithPossibleUnevenDimensions.width,
185
195
  wantsImageSequence: false,
186
196
  indent,
187
197
  logLevel,
188
198
  });
199
+ const composition = {
200
+ ...compositionWithPossibleUnevenDimensions,
201
+ height: heightEvenDimensions,
202
+ width: widthEvenDimensions,
203
+ };
189
204
  const realFrameRange = (0, get_frame_to_render_1.getRealFrameRange)(composition.durationInFrames, frameRange);
190
205
  const totalFramesToRender = (0, get_duration_from_frame_range_1.getFramesToRender)(realFrameRange, everyNthFrame).length;
191
206
  logger_1.Log.verbose({ indent, logLevel, tag: 'renderMedia()' }, `Rendering frames ${realFrameRange.join('-')}`);
@@ -158,6 +158,7 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
158
158
  indent,
159
159
  logLevel,
160
160
  onServeUrlVisited: () => undefined,
161
+ isMainTab: true,
161
162
  });
162
163
  await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
163
164
  // eslint-disable-next-line max-params
@@ -30,6 +30,7 @@ const innerSelectComposition = async ({ page, serializedInputPropsWithCustomSche
30
30
  indent,
31
31
  logLevel,
32
32
  onServeUrlVisited,
33
+ isMainTab: true,
33
34
  });
34
35
  await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
35
36
  page,
@@ -14,6 +14,7 @@ type SetPropsAndEnv = {
14
14
  indent: boolean;
15
15
  logLevel: LogLevel;
16
16
  onServeUrlVisited: () => void;
17
+ isMainTab: boolean;
17
18
  };
18
19
  export declare const setPropsAndEnv: (params: SetPropsAndEnv) => Promise<unknown>;
19
20
  export {};
@@ -10,15 +10,16 @@ const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
10
10
  const redirect_status_codes_1 = require("./redirect-status-codes");
11
11
  const truthy_1 = require("./truthy");
12
12
  const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
13
- const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVariables, page, serveUrl, initialFrame, timeoutInMilliseconds, proxyPort, retriesRemaining, audioEnabled, videoEnabled, indent, logLevel, onServeUrlVisited, }) => {
13
+ const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVariables, page, serveUrl, initialFrame, timeoutInMilliseconds, proxyPort, retriesRemaining, audioEnabled, videoEnabled, indent, logLevel, onServeUrlVisited, isMainTab, }) => {
14
14
  (0, validate_puppeteer_timeout_1.validatePuppeteerTimeout)(timeoutInMilliseconds);
15
15
  const actualTimeout = timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : TimeoutSettings_1.DEFAULT_TIMEOUT;
16
16
  page.setDefaultTimeout(actualTimeout);
17
17
  page.setDefaultNavigationTimeout(actualTimeout);
18
18
  const urlToVisit = (0, normalize_serve_url_1.normalizeServeUrl)(serveUrl);
19
- await page.evaluateOnNewDocument((timeout) => {
19
+ await page.evaluateOnNewDocument((timeout, mainTab) => {
20
20
  window.remotion_puppeteerTimeout = timeout;
21
- // To make getRemotionEnvironment() work
21
+ window.remotion_isMainTab = mainTab;
22
+ // To make useRemotionEnvironment() work
22
23
  if (window.process === undefined) {
23
24
  // @ts-expect-error
24
25
  window.process = {};
@@ -27,7 +28,8 @@ const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVa
27
28
  window.process.env = {};
28
29
  }
29
30
  window.process.env.NODE_ENV = 'production';
30
- }, actualTimeout);
31
+ }, actualTimeout, isMainTab);
32
+ await page.evaluateOnNewDocument('window.remotion_broadcastChannel = new BroadcastChannel("remotion-video-frame-extraction")');
31
33
  if (envVariables) {
32
34
  await page.evaluateOnNewDocument((input) => {
33
35
  window.remotion_envVariables = input;
@@ -79,6 +81,7 @@ const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVa
79
81
  indent,
80
82
  logLevel,
81
83
  onServeUrlVisited,
84
+ isMainTab,
82
85
  });
83
86
  };
84
87
  const [pageRes, error] = await (0, goto_page_or_throw_1.gotoPageOrThrow)(page, urlToVisit, actualTimeout);
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.340",
6
+ "version": "4.0.344",
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.340",
22
- "@remotion/streaming": "4.0.340"
21
+ "remotion": "4.0.344",
22
+ "@remotion/streaming": "4.0.344"
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.340",
37
- "@remotion/eslint-config-internal": "4.0.340"
36
+ "@remotion/example-videos": "4.0.344",
37
+ "@remotion/eslint-config-internal": "4.0.344"
38
38
  },
39
39
  "optionalDependencies": {
40
- "@remotion/compositor-darwin-arm64": "4.0.340",
41
- "@remotion/compositor-darwin-x64": "4.0.340",
42
- "@remotion/compositor-linux-arm64-musl": "4.0.340",
43
- "@remotion/compositor-linux-arm64-gnu": "4.0.340",
44
- "@remotion/compositor-linux-x64-musl": "4.0.340",
45
- "@remotion/compositor-win32-x64-msvc": "4.0.340",
46
- "@remotion/compositor-linux-x64-gnu": "4.0.340"
40
+ "@remotion/compositor-darwin-arm64": "4.0.344",
41
+ "@remotion/compositor-darwin-x64": "4.0.344",
42
+ "@remotion/compositor-win32-x64-msvc": "4.0.344",
43
+ "@remotion/compositor-linux-x64-musl": "4.0.344",
44
+ "@remotion/compositor-linux-arm64-gnu": "4.0.344",
45
+ "@remotion/compositor-linux-arm64-musl": "4.0.344",
46
+ "@remotion/compositor-linux-x64-gnu": "4.0.344"
47
47
  },
48
48
  "keywords": [
49
49
  "remotion",