@remotion/renderer 4.0.350 → 4.0.352
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 +186 -6
- package/dist/collect-assets.d.ts +1 -1
- package/dist/esm/client.mjs +92 -29
- package/dist/esm/index.mjs +70 -32
- package/dist/get-compositions.js +8 -3
- package/dist/index.d.ts +72 -0
- package/dist/make-page.d.ts +2 -1
- package/dist/make-page.js +4 -1
- package/dist/options/index.d.ts +18 -0
- package/dist/options/index.js +2 -0
- package/dist/options/options-map.d.ts +168 -6
- package/dist/options/options-map.js +11 -1
- package/dist/options/video-cache-size.d.ts +19 -0
- package/dist/options/video-cache-size.js +39 -0
- package/dist/render-frames.js +6 -3
- package/dist/render-media.d.ts +1 -1
- package/dist/render-media.js +4 -2
- package/dist/render-still.js +6 -2
- package/dist/select-composition.js +8 -3
- package/dist/set-props-and-env.d.ts +2 -0
- package/dist/set-props-and-env.js +7 -3
- package/package.json +12 -12
package/dist/esm/index.mjs
CHANGED
|
@@ -16280,16 +16280,20 @@ var innerSetPropsAndEnv = async ({
|
|
|
16280
16280
|
indent,
|
|
16281
16281
|
logLevel,
|
|
16282
16282
|
onServeUrlVisited,
|
|
16283
|
-
isMainTab
|
|
16283
|
+
isMainTab,
|
|
16284
|
+
mediaCacheSizeInBytes,
|
|
16285
|
+
initialMemoryAvailable
|
|
16284
16286
|
}) => {
|
|
16285
16287
|
validatePuppeteerTimeout(timeoutInMilliseconds);
|
|
16286
16288
|
const actualTimeout = timeoutInMilliseconds ?? DEFAULT_TIMEOUT;
|
|
16287
16289
|
page.setDefaultTimeout(actualTimeout);
|
|
16288
16290
|
page.setDefaultNavigationTimeout(actualTimeout);
|
|
16289
16291
|
const urlToVisit = normalizeServeUrl(serveUrl);
|
|
16290
|
-
await page.evaluateOnNewDocument((timeout, mainTab) => {
|
|
16292
|
+
await page.evaluateOnNewDocument((timeout, mainTab, cacheSizeInBytes, initMemoryAvailable) => {
|
|
16291
16293
|
window.remotion_puppeteerTimeout = timeout;
|
|
16292
16294
|
window.remotion_isMainTab = mainTab;
|
|
16295
|
+
window.remotion_mediaCacheSizeInBytes = cacheSizeInBytes;
|
|
16296
|
+
window.remotion_initialMemoryAvailable = initMemoryAvailable;
|
|
16293
16297
|
if (window.process === undefined) {
|
|
16294
16298
|
window.process = {};
|
|
16295
16299
|
}
|
|
@@ -16297,7 +16301,7 @@ var innerSetPropsAndEnv = async ({
|
|
|
16297
16301
|
window.process.env = {};
|
|
16298
16302
|
}
|
|
16299
16303
|
window.process.env.NODE_ENV = "production";
|
|
16300
|
-
}, actualTimeout, isMainTab);
|
|
16304
|
+
}, actualTimeout, isMainTab, mediaCacheSizeInBytes, initialMemoryAvailable);
|
|
16301
16305
|
await page.evaluateOnNewDocument('window.remotion_broadcastChannel = new BroadcastChannel("remotion-video-frame-extraction")');
|
|
16302
16306
|
if (envVariables) {
|
|
16303
16307
|
await page.evaluateOnNewDocument((input) => {
|
|
@@ -16348,7 +16352,9 @@ var innerSetPropsAndEnv = async ({
|
|
|
16348
16352
|
indent,
|
|
16349
16353
|
logLevel,
|
|
16350
16354
|
onServeUrlVisited,
|
|
16351
|
-
isMainTab
|
|
16355
|
+
isMainTab,
|
|
16356
|
+
mediaCacheSizeInBytes,
|
|
16357
|
+
initialMemoryAvailable
|
|
16352
16358
|
});
|
|
16353
16359
|
};
|
|
16354
16360
|
const [pageRes, error] = await gotoPageOrThrow(page, urlToVisit, actualTimeout);
|
|
@@ -16598,7 +16604,8 @@ var innerGetCompositions = async ({
|
|
|
16598
16604
|
serveUrl,
|
|
16599
16605
|
timeoutInMilliseconds,
|
|
16600
16606
|
indent,
|
|
16601
|
-
logLevel
|
|
16607
|
+
logLevel,
|
|
16608
|
+
mediaCacheSizeInBytes
|
|
16602
16609
|
}) => {
|
|
16603
16610
|
validatePuppeteerTimeout(timeoutInMilliseconds);
|
|
16604
16611
|
await setPropsAndEnv({
|
|
@@ -16617,7 +16624,9 @@ var innerGetCompositions = async ({
|
|
|
16617
16624
|
onServeUrlVisited: () => {
|
|
16618
16625
|
return;
|
|
16619
16626
|
},
|
|
16620
|
-
isMainTab: true
|
|
16627
|
+
isMainTab: true,
|
|
16628
|
+
mediaCacheSizeInBytes,
|
|
16629
|
+
initialMemoryAvailable: getAvailableMemory(logLevel)
|
|
16621
16630
|
});
|
|
16622
16631
|
await puppeteerEvaluateWithCatch({
|
|
16623
16632
|
page,
|
|
@@ -16691,7 +16700,8 @@ var internalGetCompositionsRaw = async ({
|
|
|
16691
16700
|
binariesDirectory,
|
|
16692
16701
|
onBrowserDownload,
|
|
16693
16702
|
chromeMode,
|
|
16694
|
-
offthreadVideoThreads
|
|
16703
|
+
offthreadVideoThreads,
|
|
16704
|
+
mediaCacheSizeInBytes
|
|
16695
16705
|
}) => {
|
|
16696
16706
|
const { page, cleanupPage } = await getPageAndCleanupFn({
|
|
16697
16707
|
passedInInstance: puppeteerInstance,
|
|
@@ -16745,7 +16755,8 @@ var internalGetCompositionsRaw = async ({
|
|
|
16745
16755
|
binariesDirectory,
|
|
16746
16756
|
onBrowserDownload,
|
|
16747
16757
|
chromeMode,
|
|
16748
|
-
offthreadVideoThreads
|
|
16758
|
+
offthreadVideoThreads,
|
|
16759
|
+
mediaCacheSizeInBytes
|
|
16749
16760
|
});
|
|
16750
16761
|
}).then((comp) => {
|
|
16751
16762
|
return resolve2(comp);
|
|
@@ -16777,7 +16788,8 @@ var getCompositions = (serveUrlOrWebpackUrl, config) => {
|
|
|
16777
16788
|
binariesDirectory,
|
|
16778
16789
|
offthreadVideoCacheSizeInBytes,
|
|
16779
16790
|
chromeMode,
|
|
16780
|
-
offthreadVideoThreads
|
|
16791
|
+
offthreadVideoThreads,
|
|
16792
|
+
mediaCacheSizeInBytes
|
|
16781
16793
|
} = config ?? {};
|
|
16782
16794
|
const indent = false;
|
|
16783
16795
|
const logLevel = passedLogLevel ?? "info";
|
|
@@ -16806,7 +16818,8 @@ var getCompositions = (serveUrlOrWebpackUrl, config) => {
|
|
|
16806
16818
|
api: "getCompositions()"
|
|
16807
16819
|
}),
|
|
16808
16820
|
chromeMode: chromeMode ?? "headless-shell",
|
|
16809
|
-
offthreadVideoThreads: offthreadVideoThreads ?? null
|
|
16821
|
+
offthreadVideoThreads: offthreadVideoThreads ?? null,
|
|
16822
|
+
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null
|
|
16810
16823
|
});
|
|
16811
16824
|
};
|
|
16812
16825
|
|
|
@@ -17771,7 +17784,8 @@ var makePage = async ({
|
|
|
17771
17784
|
imageFormat,
|
|
17772
17785
|
serializedResolvedPropsWithCustomSchema,
|
|
17773
17786
|
pageIndex,
|
|
17774
|
-
isMainTab
|
|
17787
|
+
isMainTab,
|
|
17788
|
+
mediaCacheSizeInBytes
|
|
17775
17789
|
}) => {
|
|
17776
17790
|
const page = await browserReplacer.getBrowser().newPage({ context, logLevel, indent, pageIndex, onBrowserLog });
|
|
17777
17791
|
pagesArray.push(page);
|
|
@@ -17796,7 +17810,9 @@ var makePage = async ({
|
|
|
17796
17810
|
onServeUrlVisited: () => {
|
|
17797
17811
|
return;
|
|
17798
17812
|
},
|
|
17799
|
-
isMainTab
|
|
17813
|
+
isMainTab,
|
|
17814
|
+
mediaCacheSizeInBytes,
|
|
17815
|
+
initialMemoryAvailable: getAvailableMemory(logLevel)
|
|
17800
17816
|
});
|
|
17801
17817
|
await puppeteerEvaluateWithCatch({
|
|
17802
17818
|
pageFunction: (id, props, durationInFrames, fps, height, width, defaultCodec, defaultOutName, defaultVideoImageFormat, defaultPixelFormat) => {
|
|
@@ -18750,7 +18766,8 @@ var innerRenderFrames = async ({
|
|
|
18750
18766
|
forSeamlessAacConcatenation,
|
|
18751
18767
|
onArtifact,
|
|
18752
18768
|
binariesDirectory,
|
|
18753
|
-
imageSequencePattern
|
|
18769
|
+
imageSequencePattern,
|
|
18770
|
+
mediaCacheSizeInBytes
|
|
18754
18771
|
}) => {
|
|
18755
18772
|
if (outputDir) {
|
|
18756
18773
|
if (!fs14.existsSync(outputDir)) {
|
|
@@ -18796,7 +18813,8 @@ var innerRenderFrames = async ({
|
|
|
18796
18813
|
serveUrl,
|
|
18797
18814
|
timeoutInMilliseconds,
|
|
18798
18815
|
pageIndex,
|
|
18799
|
-
isMainTab: pageIndex === 0
|
|
18816
|
+
isMainTab: pageIndex === 0,
|
|
18817
|
+
mediaCacheSizeInBytes
|
|
18800
18818
|
});
|
|
18801
18819
|
};
|
|
18802
18820
|
const getPool = async () => {
|
|
@@ -18938,7 +18956,8 @@ var internalRenderFramesRaw = ({
|
|
|
18938
18956
|
onArtifact,
|
|
18939
18957
|
chromeMode,
|
|
18940
18958
|
offthreadVideoThreads,
|
|
18941
|
-
imageSequencePattern
|
|
18959
|
+
imageSequencePattern,
|
|
18960
|
+
mediaCacheSizeInBytes
|
|
18942
18961
|
}) => {
|
|
18943
18962
|
validateDimension(composition.height, "height", "in the `config` object passed to `renderFrames()`");
|
|
18944
18963
|
validateDimension(composition.width, "width", "in the `config` object passed to `renderFrames()`");
|
|
@@ -19041,7 +19060,8 @@ var internalRenderFramesRaw = ({
|
|
|
19041
19060
|
onArtifact,
|
|
19042
19061
|
chromeMode,
|
|
19043
19062
|
offthreadVideoThreads,
|
|
19044
|
-
imageSequencePattern
|
|
19063
|
+
imageSequencePattern,
|
|
19064
|
+
mediaCacheSizeInBytes
|
|
19045
19065
|
});
|
|
19046
19066
|
})
|
|
19047
19067
|
]).then((res) => {
|
|
@@ -19110,7 +19130,8 @@ var renderFrames = (options) => {
|
|
|
19110
19130
|
onArtifact,
|
|
19111
19131
|
chromeMode,
|
|
19112
19132
|
offthreadVideoThreads,
|
|
19113
|
-
imageSequencePattern
|
|
19133
|
+
imageSequencePattern,
|
|
19134
|
+
mediaCacheSizeInBytes
|
|
19114
19135
|
} = options;
|
|
19115
19136
|
if (!composition) {
|
|
19116
19137
|
throw new Error("No `composition` option has been specified for renderFrames()");
|
|
@@ -19168,7 +19189,8 @@ var renderFrames = (options) => {
|
|
|
19168
19189
|
onArtifact: onArtifact ?? null,
|
|
19169
19190
|
chromeMode: chromeMode ?? "headless-shell",
|
|
19170
19191
|
offthreadVideoThreads: offthreadVideoThreads ?? null,
|
|
19171
|
-
imageSequencePattern: imageSequencePattern ?? null
|
|
19192
|
+
imageSequencePattern: imageSequencePattern ?? null,
|
|
19193
|
+
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null
|
|
19172
19194
|
});
|
|
19173
19195
|
};
|
|
19174
19196
|
|
|
@@ -21287,7 +21309,8 @@ var internalRenderMediaRaw = ({
|
|
|
21287
21309
|
metadata,
|
|
21288
21310
|
hardwareAcceleration,
|
|
21289
21311
|
chromeMode,
|
|
21290
|
-
offthreadVideoThreads
|
|
21312
|
+
offthreadVideoThreads,
|
|
21313
|
+
mediaCacheSizeInBytes
|
|
21291
21314
|
}) => {
|
|
21292
21315
|
const pixelFormat = userPixelFormat ?? compositionWithPossibleUnevenDimensions.defaultPixelFormat ?? DEFAULT_PIXEL_FORMAT;
|
|
21293
21316
|
if (repro) {
|
|
@@ -21601,7 +21624,8 @@ var internalRenderMediaRaw = ({
|
|
|
21601
21624
|
onBrowserDownload,
|
|
21602
21625
|
onArtifact,
|
|
21603
21626
|
chromeMode,
|
|
21604
|
-
imageSequencePattern: null
|
|
21627
|
+
imageSequencePattern: null,
|
|
21628
|
+
mediaCacheSizeInBytes
|
|
21605
21629
|
});
|
|
21606
21630
|
return renderFramesProc;
|
|
21607
21631
|
}).then((renderFramesReturn) => {
|
|
@@ -21774,7 +21798,8 @@ var renderMedia = ({
|
|
|
21774
21798
|
hardwareAcceleration,
|
|
21775
21799
|
chromeMode,
|
|
21776
21800
|
offthreadVideoThreads,
|
|
21777
|
-
compositionStart
|
|
21801
|
+
compositionStart,
|
|
21802
|
+
mediaCacheSizeInBytes
|
|
21778
21803
|
}) => {
|
|
21779
21804
|
const indent = false;
|
|
21780
21805
|
const logLevel = verbose || dumpBrowserLogs ? "verbose" : passedLogLevel ?? "info";
|
|
@@ -21857,7 +21882,8 @@ var renderMedia = ({
|
|
|
21857
21882
|
metadata: metadata ?? null,
|
|
21858
21883
|
compositionStart: compositionStart ?? 0,
|
|
21859
21884
|
hardwareAcceleration: hardwareAcceleration ?? "disable",
|
|
21860
|
-
chromeMode: chromeMode ?? "headless-shell"
|
|
21885
|
+
chromeMode: chromeMode ?? "headless-shell",
|
|
21886
|
+
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null
|
|
21861
21887
|
});
|
|
21862
21888
|
};
|
|
21863
21889
|
|
|
@@ -21890,7 +21916,8 @@ var innerRenderStill = async ({
|
|
|
21890
21916
|
serializedResolvedPropsWithCustomSchema,
|
|
21891
21917
|
onBrowserDownload,
|
|
21892
21918
|
onArtifact,
|
|
21893
|
-
chromeMode
|
|
21919
|
+
chromeMode,
|
|
21920
|
+
mediaCacheSizeInBytes
|
|
21894
21921
|
}) => {
|
|
21895
21922
|
validateDimension(composition.height, "height", "in the `config` object passed to `renderStill()`");
|
|
21896
21923
|
validateDimension(composition.width, "width", "in the `config` object passed to `renderStill()`");
|
|
@@ -21986,7 +22013,9 @@ var innerRenderStill = async ({
|
|
|
21986
22013
|
onServeUrlVisited: () => {
|
|
21987
22014
|
return;
|
|
21988
22015
|
},
|
|
21989
|
-
isMainTab: true
|
|
22016
|
+
isMainTab: true,
|
|
22017
|
+
mediaCacheSizeInBytes,
|
|
22018
|
+
initialMemoryAvailable: getAvailableMemory(logLevel)
|
|
21990
22019
|
});
|
|
21991
22020
|
await puppeteerEvaluateWithCatch({
|
|
21992
22021
|
pageFunction: (id, props, durationInFrames, fps, height, width, defaultCodec, defaultOutName, defaultVideoImageFormat, defaultPixelFormat) => {
|
|
@@ -22137,7 +22166,8 @@ var renderStill = (options) => {
|
|
|
22137
22166
|
onBrowserDownload,
|
|
22138
22167
|
onArtifact,
|
|
22139
22168
|
chromeMode,
|
|
22140
|
-
offthreadVideoThreads
|
|
22169
|
+
offthreadVideoThreads,
|
|
22170
|
+
mediaCacheSizeInBytes
|
|
22141
22171
|
} = options;
|
|
22142
22172
|
if (typeof jpegQuality !== "undefined" && imageFormat !== "jpeg") {
|
|
22143
22173
|
throw new Error("You can only pass the `quality` option if `imageFormat` is 'jpeg'.");
|
|
@@ -22187,7 +22217,8 @@ var renderStill = (options) => {
|
|
|
22187
22217
|
}),
|
|
22188
22218
|
onArtifact: onArtifact ?? null,
|
|
22189
22219
|
chromeMode: chromeMode ?? "headless-shell",
|
|
22190
|
-
offthreadVideoThreads: offthreadVideoThreads ?? null
|
|
22220
|
+
offthreadVideoThreads: offthreadVideoThreads ?? null,
|
|
22221
|
+
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null
|
|
22191
22222
|
});
|
|
22192
22223
|
};
|
|
22193
22224
|
|
|
@@ -22203,7 +22234,8 @@ var innerSelectComposition = async ({
|
|
|
22203
22234
|
id,
|
|
22204
22235
|
indent,
|
|
22205
22236
|
logLevel,
|
|
22206
|
-
onServeUrlVisited
|
|
22237
|
+
onServeUrlVisited,
|
|
22238
|
+
mediaCacheSizeInBytes
|
|
22207
22239
|
}) => {
|
|
22208
22240
|
validatePuppeteerTimeout(timeoutInMilliseconds);
|
|
22209
22241
|
await setPropsAndEnv({
|
|
@@ -22220,7 +22252,9 @@ var innerSelectComposition = async ({
|
|
|
22220
22252
|
indent,
|
|
22221
22253
|
logLevel,
|
|
22222
22254
|
onServeUrlVisited,
|
|
22223
|
-
isMainTab: true
|
|
22255
|
+
isMainTab: true,
|
|
22256
|
+
mediaCacheSizeInBytes,
|
|
22257
|
+
initialMemoryAvailable: getAvailableMemory(logLevel)
|
|
22224
22258
|
});
|
|
22225
22259
|
await puppeteerEvaluateWithCatch({
|
|
22226
22260
|
page,
|
|
@@ -22308,7 +22342,8 @@ var internalSelectCompositionRaw = async (options) => {
|
|
|
22308
22342
|
binariesDirectory,
|
|
22309
22343
|
onBrowserDownload,
|
|
22310
22344
|
onServeUrlVisited,
|
|
22311
|
-
chromeMode
|
|
22345
|
+
chromeMode,
|
|
22346
|
+
mediaCacheSizeInBytes
|
|
22312
22347
|
} = options;
|
|
22313
22348
|
const [{ page, cleanupPage }, serverUsed] = await Promise.all([
|
|
22314
22349
|
getPageAndCleanupFn({
|
|
@@ -22369,7 +22404,8 @@ var internalSelectCompositionRaw = async (options) => {
|
|
|
22369
22404
|
binariesDirectory,
|
|
22370
22405
|
onBrowserDownload,
|
|
22371
22406
|
onServeUrlVisited,
|
|
22372
|
-
chromeMode
|
|
22407
|
+
chromeMode,
|
|
22408
|
+
mediaCacheSizeInBytes
|
|
22373
22409
|
}).then((data) => {
|
|
22374
22410
|
return resolve2(data);
|
|
22375
22411
|
}).catch((err) => {
|
|
@@ -22402,7 +22438,8 @@ var selectComposition = async (options) => {
|
|
|
22402
22438
|
binariesDirectory,
|
|
22403
22439
|
onBrowserDownload,
|
|
22404
22440
|
chromeMode,
|
|
22405
|
-
offthreadVideoThreads
|
|
22441
|
+
offthreadVideoThreads,
|
|
22442
|
+
mediaCacheSizeInBytes
|
|
22406
22443
|
} = options;
|
|
22407
22444
|
const indent = false;
|
|
22408
22445
|
const logLevel = passedLogLevel ?? (verbose ? "verbose" : "info");
|
|
@@ -22435,7 +22472,8 @@ var selectComposition = async (options) => {
|
|
|
22435
22472
|
return;
|
|
22436
22473
|
},
|
|
22437
22474
|
chromeMode: chromeMode ?? "headless-shell",
|
|
22438
|
-
offthreadVideoThreads: offthreadVideoThreads ?? null
|
|
22475
|
+
offthreadVideoThreads: offthreadVideoThreads ?? null,
|
|
22476
|
+
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null
|
|
22439
22477
|
});
|
|
22440
22478
|
return data.metadata;
|
|
22441
22479
|
};
|
package/dist/get-compositions.js
CHANGED
|
@@ -7,6 +7,7 @@ const browser_download_progress_bar_1 = require("./browser/browser-download-prog
|
|
|
7
7
|
const handle_javascript_exception_1 = require("./error-handling/handle-javascript-exception");
|
|
8
8
|
const find_closest_package_json_1 = require("./find-closest-package-json");
|
|
9
9
|
const get_browser_instance_1 = require("./get-browser-instance");
|
|
10
|
+
const get_available_memory_1 = require("./memory/get-available-memory");
|
|
10
11
|
const offthreadvideo_threads_1 = require("./options/offthreadvideo-threads");
|
|
11
12
|
const prepare_server_1 = require("./prepare-server");
|
|
12
13
|
const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
|
|
@@ -14,7 +15,7 @@ const seek_to_frame_1 = require("./seek-to-frame");
|
|
|
14
15
|
const set_props_and_env_1 = require("./set-props-and-env");
|
|
15
16
|
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
16
17
|
const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
|
|
17
|
-
const innerGetCompositions = async ({ envVariables, serializedInputPropsWithCustomSchema, page, proxyPort, serveUrl, timeoutInMilliseconds, indent, logLevel, }) => {
|
|
18
|
+
const innerGetCompositions = async ({ envVariables, serializedInputPropsWithCustomSchema, page, proxyPort, serveUrl, timeoutInMilliseconds, indent, logLevel, mediaCacheSizeInBytes, }) => {
|
|
18
19
|
(0, validate_puppeteer_timeout_1.validatePuppeteerTimeout)(timeoutInMilliseconds);
|
|
19
20
|
await (0, set_props_and_env_1.setPropsAndEnv)({
|
|
20
21
|
serializedInputPropsWithCustomSchema,
|
|
@@ -31,6 +32,8 @@ const innerGetCompositions = async ({ envVariables, serializedInputPropsWithCust
|
|
|
31
32
|
logLevel,
|
|
32
33
|
onServeUrlVisited: () => undefined,
|
|
33
34
|
isMainTab: true,
|
|
35
|
+
mediaCacheSizeInBytes,
|
|
36
|
+
initialMemoryAvailable: (0, get_available_memory_1.getAvailableMemory)(logLevel),
|
|
34
37
|
});
|
|
35
38
|
await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
36
39
|
page,
|
|
@@ -77,7 +80,7 @@ const innerGetCompositions = async ({ envVariables, serializedInputPropsWithCust
|
|
|
77
80
|
};
|
|
78
81
|
});
|
|
79
82
|
};
|
|
80
|
-
const internalGetCompositionsRaw = async ({ browserExecutable, chromiumOptions, envVariables, indent, serializedInputPropsWithCustomSchema, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, offthreadVideoCacheSizeInBytes, binariesDirectory, onBrowserDownload, chromeMode, offthreadVideoThreads, }) => {
|
|
83
|
+
const internalGetCompositionsRaw = async ({ browserExecutable, chromiumOptions, envVariables, indent, serializedInputPropsWithCustomSchema, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, offthreadVideoCacheSizeInBytes, binariesDirectory, onBrowserDownload, chromeMode, offthreadVideoThreads, mediaCacheSizeInBytes, }) => {
|
|
81
84
|
const { page, cleanupPage } = await (0, get_browser_instance_1.getPageAndCleanupFn)({
|
|
82
85
|
passedInInstance: puppeteerInstance,
|
|
83
86
|
browserExecutable,
|
|
@@ -130,6 +133,7 @@ const internalGetCompositionsRaw = async ({ browserExecutable, chromiumOptions,
|
|
|
130
133
|
onBrowserDownload,
|
|
131
134
|
chromeMode,
|
|
132
135
|
offthreadVideoThreads,
|
|
136
|
+
mediaCacheSizeInBytes,
|
|
133
137
|
});
|
|
134
138
|
})
|
|
135
139
|
.then((comp) => {
|
|
@@ -154,7 +158,7 @@ const getCompositions = (serveUrlOrWebpackUrl, config) => {
|
|
|
154
158
|
if (!serveUrlOrWebpackUrl) {
|
|
155
159
|
throw new Error('No serve URL or webpack bundle directory was passed to getCompositions().');
|
|
156
160
|
}
|
|
157
|
-
const { browserExecutable, chromiumOptions, envVariables, inputProps, onBrowserLog, port, puppeteerInstance, timeoutInMilliseconds, logLevel: passedLogLevel, onBrowserDownload, binariesDirectory, offthreadVideoCacheSizeInBytes, chromeMode, offthreadVideoThreads, } = config !== null && config !== void 0 ? config : {};
|
|
161
|
+
const { browserExecutable, chromiumOptions, envVariables, inputProps, onBrowserLog, port, puppeteerInstance, timeoutInMilliseconds, logLevel: passedLogLevel, onBrowserDownload, binariesDirectory, offthreadVideoCacheSizeInBytes, chromeMode, offthreadVideoThreads, mediaCacheSizeInBytes, } = config !== null && config !== void 0 ? config : {};
|
|
158
162
|
const indent = false;
|
|
159
163
|
const logLevel = passedLogLevel !== null && passedLogLevel !== void 0 ? passedLogLevel : 'info';
|
|
160
164
|
return (0, exports.internalGetCompositions)({
|
|
@@ -183,6 +187,7 @@ const getCompositions = (serveUrlOrWebpackUrl, config) => {
|
|
|
183
187
|
}),
|
|
184
188
|
chromeMode: chromeMode !== null && chromeMode !== void 0 ? chromeMode : 'headless-shell',
|
|
185
189
|
offthreadVideoThreads: offthreadVideoThreads !== null && offthreadVideoThreads !== void 0 ? offthreadVideoThreads : null,
|
|
190
|
+
mediaCacheSizeInBytes: mediaCacheSizeInBytes !== null && mediaCacheSizeInBytes !== void 0 ? mediaCacheSizeInBytes : null,
|
|
186
191
|
});
|
|
187
192
|
};
|
|
188
193
|
exports.getCompositions = getCompositions;
|
package/dist/index.d.ts
CHANGED
|
@@ -456,6 +456,24 @@ export declare const RenderInternals: {
|
|
|
456
456
|
port: number | null;
|
|
457
457
|
onArtifact: import("./render-frames").OnArtifact | null;
|
|
458
458
|
} & import("./options/option").ToOptions<{
|
|
459
|
+
readonly mediaCacheSizeInBytes: {
|
|
460
|
+
name: string;
|
|
461
|
+
cliFlag: "media-cache-size-in-bytes";
|
|
462
|
+
description: () => import("react/jsx-runtime").JSX.Element;
|
|
463
|
+
ssrName: "mediaCacheSizeInBytes";
|
|
464
|
+
docLink: string;
|
|
465
|
+
type: number | null;
|
|
466
|
+
getValue: ({ commandLine }: {
|
|
467
|
+
commandLine: Record<string, unknown>;
|
|
468
|
+
}) => {
|
|
469
|
+
source: string;
|
|
470
|
+
value: number;
|
|
471
|
+
} | {
|
|
472
|
+
source: string;
|
|
473
|
+
value: null;
|
|
474
|
+
};
|
|
475
|
+
setConfig: (size: number | null) => void;
|
|
476
|
+
};
|
|
459
477
|
readonly offthreadVideoCacheSizeInBytes: {
|
|
460
478
|
name: string;
|
|
461
479
|
cliFlag: "offthreadvideo-cache-size-in-bytes";
|
|
@@ -643,6 +661,24 @@ export declare const RenderInternals: {
|
|
|
643
661
|
id: string;
|
|
644
662
|
onServeUrlVisited: () => void;
|
|
645
663
|
} & import("./options/option").ToOptions<{
|
|
664
|
+
readonly mediaCacheSizeInBytes: {
|
|
665
|
+
name: string;
|
|
666
|
+
cliFlag: "media-cache-size-in-bytes";
|
|
667
|
+
description: () => import("react/jsx-runtime").JSX.Element;
|
|
668
|
+
ssrName: "mediaCacheSizeInBytes";
|
|
669
|
+
docLink: string;
|
|
670
|
+
type: number | null;
|
|
671
|
+
getValue: ({ commandLine }: {
|
|
672
|
+
commandLine: Record<string, unknown>;
|
|
673
|
+
}) => {
|
|
674
|
+
source: string;
|
|
675
|
+
value: number;
|
|
676
|
+
} | {
|
|
677
|
+
source: string;
|
|
678
|
+
value: null;
|
|
679
|
+
};
|
|
680
|
+
setConfig: (size: number | null) => void;
|
|
681
|
+
};
|
|
646
682
|
readonly offthreadVideoCacheSizeInBytes: {
|
|
647
683
|
name: string;
|
|
648
684
|
cliFlag: "offthreadvideo-cache-size-in-bytes";
|
|
@@ -765,6 +801,24 @@ export declare const RenderInternals: {
|
|
|
765
801
|
indent: boolean;
|
|
766
802
|
serveUrlOrWebpackUrl: string;
|
|
767
803
|
} & import("./options/option").ToOptions<{
|
|
804
|
+
readonly mediaCacheSizeInBytes: {
|
|
805
|
+
name: string;
|
|
806
|
+
cliFlag: "media-cache-size-in-bytes";
|
|
807
|
+
description: () => import("react/jsx-runtime").JSX.Element;
|
|
808
|
+
ssrName: "mediaCacheSizeInBytes";
|
|
809
|
+
docLink: string;
|
|
810
|
+
type: number | null;
|
|
811
|
+
getValue: ({ commandLine }: {
|
|
812
|
+
commandLine: Record<string, unknown>;
|
|
813
|
+
}) => {
|
|
814
|
+
source: string;
|
|
815
|
+
value: number;
|
|
816
|
+
} | {
|
|
817
|
+
source: string;
|
|
818
|
+
value: null;
|
|
819
|
+
};
|
|
820
|
+
setConfig: (size: number | null) => void;
|
|
821
|
+
};
|
|
768
822
|
readonly offthreadVideoCacheSizeInBytes: {
|
|
769
823
|
name: string;
|
|
770
824
|
cliFlag: "offthreadvideo-cache-size-in-bytes";
|
|
@@ -902,6 +956,24 @@ export declare const RenderInternals: {
|
|
|
902
956
|
compositionStart: number;
|
|
903
957
|
onArtifact: import("./render-frames").OnArtifact | null;
|
|
904
958
|
} & import("./options/option").ToOptions<{
|
|
959
|
+
readonly mediaCacheSizeInBytes: {
|
|
960
|
+
name: string;
|
|
961
|
+
cliFlag: "media-cache-size-in-bytes";
|
|
962
|
+
description: () => import("react/jsx-runtime").JSX.Element;
|
|
963
|
+
ssrName: "mediaCacheSizeInBytes";
|
|
964
|
+
docLink: string;
|
|
965
|
+
type: number | null;
|
|
966
|
+
getValue: ({ commandLine }: {
|
|
967
|
+
commandLine: Record<string, unknown>;
|
|
968
|
+
}) => {
|
|
969
|
+
source: string;
|
|
970
|
+
value: number;
|
|
971
|
+
} | {
|
|
972
|
+
source: string;
|
|
973
|
+
value: null;
|
|
974
|
+
};
|
|
975
|
+
setConfig: (size: number | null) => void;
|
|
976
|
+
};
|
|
905
977
|
readonly forSeamlessAacConcatenation: {
|
|
906
978
|
name: string;
|
|
907
979
|
cliFlag: "for-seamless-aac-concatenation";
|
package/dist/make-page.d.ts
CHANGED
|
@@ -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, isMainTab, }: {
|
|
8
|
+
export declare const makePage: ({ context, initialFrame, browserReplacer, logLevel, indent, pagesArray, onBrowserLog, scale, timeoutInMilliseconds, composition, proxyPort, serveUrl, muted, envVariables, serializedInputPropsWithCustomSchema, imageFormat, serializedResolvedPropsWithCustomSchema, pageIndex, isMainTab, mediaCacheSizeInBytes, }: {
|
|
9
9
|
context: SourceMapGetter;
|
|
10
10
|
initialFrame: number;
|
|
11
11
|
browserReplacer: BrowserReplacer;
|
|
@@ -25,4 +25,5 @@ export declare const makePage: ({ context, initialFrame, browserReplacer, logLev
|
|
|
25
25
|
imageFormat: VideoImageFormat;
|
|
26
26
|
pageIndex: number;
|
|
27
27
|
isMainTab: boolean;
|
|
28
|
+
mediaCacheSizeInBytes: number | null;
|
|
28
29
|
}) => Promise<Page>;
|
package/dist/make-page.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makePage = void 0;
|
|
4
|
+
const get_available_memory_1 = require("./memory/get-available-memory");
|
|
4
5
|
const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
|
|
5
6
|
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, isMainTab, }) => {
|
|
7
|
+
const makePage = async ({ context, initialFrame, browserReplacer, logLevel, indent, pagesArray, onBrowserLog, scale, timeoutInMilliseconds, composition, proxyPort, serveUrl, muted, envVariables, serializedInputPropsWithCustomSchema, imageFormat, serializedResolvedPropsWithCustomSchema, pageIndex, isMainTab, mediaCacheSizeInBytes, }) => {
|
|
7
8
|
const page = await browserReplacer
|
|
8
9
|
.getBrowser()
|
|
9
10
|
.newPage({ context, logLevel, indent, pageIndex, onBrowserLog });
|
|
@@ -28,6 +29,8 @@ const makePage = async ({ context, initialFrame, browserReplacer, logLevel, inde
|
|
|
28
29
|
logLevel,
|
|
29
30
|
onServeUrlVisited: () => undefined,
|
|
30
31
|
isMainTab,
|
|
32
|
+
mediaCacheSizeInBytes,
|
|
33
|
+
initialMemoryAvailable: (0, get_available_memory_1.getAvailableMemory)(logLevel),
|
|
31
34
|
});
|
|
32
35
|
await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
33
36
|
// eslint-disable-next-line max-params
|
package/dist/options/index.d.ts
CHANGED
|
@@ -724,6 +724,24 @@ export declare const allOptions: {
|
|
|
724
724
|
};
|
|
725
725
|
setConfig: (pattern: string | null) => void;
|
|
726
726
|
};
|
|
727
|
+
mediaCacheSizeInBytesOption: {
|
|
728
|
+
name: string;
|
|
729
|
+
cliFlag: "media-cache-size-in-bytes";
|
|
730
|
+
description: () => import("react/jsx-runtime").JSX.Element;
|
|
731
|
+
ssrName: "mediaCacheSizeInBytes";
|
|
732
|
+
docLink: string;
|
|
733
|
+
type: number | null;
|
|
734
|
+
getValue: ({ commandLine }: {
|
|
735
|
+
commandLine: Record<string, unknown>;
|
|
736
|
+
}) => {
|
|
737
|
+
source: string;
|
|
738
|
+
value: number;
|
|
739
|
+
} | {
|
|
740
|
+
source: string;
|
|
741
|
+
value: null;
|
|
742
|
+
};
|
|
743
|
+
setConfig: (size: number | null) => void;
|
|
744
|
+
};
|
|
727
745
|
};
|
|
728
746
|
export type AvailableOptions = keyof typeof allOptions;
|
|
729
747
|
export type TypeOfOption<Type> = Type extends AnyRemotionOption<infer X> ? X : never;
|
package/dist/options/index.js
CHANGED
|
@@ -43,6 +43,7 @@ const separate_audio_1 = require("./separate-audio");
|
|
|
43
43
|
const throw_if_site_exists_1 = require("./throw-if-site-exists");
|
|
44
44
|
const timeout_1 = require("./timeout");
|
|
45
45
|
const video_bitrate_1 = require("./video-bitrate");
|
|
46
|
+
const video_cache_size_1 = require("./video-cache-size");
|
|
46
47
|
const video_codec_1 = require("./video-codec");
|
|
47
48
|
const webhook_custom_data_1 = require("./webhook-custom-data");
|
|
48
49
|
const x264_preset_1 = require("./x264-preset");
|
|
@@ -92,4 +93,5 @@ exports.allOptions = {
|
|
|
92
93
|
audioLatencyHintOption: latency_hint_1.audioLatencyHintOption,
|
|
93
94
|
enableCrossSiteIsolationOption: cross_site_isolation_1.enableCrossSiteIsolationOption,
|
|
94
95
|
imageSequencePatternOption: image_sequence_pattern_1.imageSequencePatternOption,
|
|
96
|
+
mediaCacheSizeInBytesOption: video_cache_size_1.mediaCacheSizeInBytesOption,
|
|
95
97
|
};
|