@remotion/renderer 4.0.355 → 4.0.356
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/assets/types.d.ts +1 -1
- package/dist/browser/Browser.d.ts +7 -4
- package/dist/browser/Browser.js +6 -3
- package/dist/browser/BrowserPage.d.ts +10 -2
- package/dist/browser/BrowserPage.js +9 -16
- package/dist/browser/Target.d.ts +3 -2
- package/dist/browser/Target.js +2 -1
- package/dist/default-on-log.d.ts +2 -0
- package/dist/default-on-log.js +8 -0
- package/dist/esm/error-handling.mjs +22 -14
- package/dist/esm/index.mjs +120 -97
- package/dist/get-browser-instance.d.ts +3 -2
- package/dist/get-browser-instance.js +3 -1
- package/dist/get-compositions.d.ts +2 -0
- package/dist/get-compositions.js +4 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +2 -0
- package/dist/logger.d.ts +1 -0
- package/dist/logger.js +24 -24
- package/dist/make-page.d.ts +3 -2
- package/dist/make-page.js +2 -2
- package/dist/render-frames.d.ts +2 -0
- package/dist/render-frames.js +6 -2
- package/dist/render-media.d.ts +2 -0
- package/dist/render-media.js +7 -13
- package/dist/render-still.d.ts +2 -0
- package/dist/render-still.js +4 -1
- package/dist/select-composition.js +2 -0
- package/dist/test-gpu.d.ts +3 -1
- package/dist/test-gpu.js +2 -1
- package/dist/validate-even-dimensions-with-codec.js +16 -23
- package/package.json +12 -12
package/dist/esm/index.mjs
CHANGED
|
@@ -383,6 +383,23 @@ var verboseTag = (str) => {
|
|
|
383
383
|
return isColorSupported() ? chalk.bgBlack(` ${str} `) : `[${str}]`;
|
|
384
384
|
};
|
|
385
385
|
var Log = {
|
|
386
|
+
formatLogs: (logLevel, options, args) => {
|
|
387
|
+
return [
|
|
388
|
+
options.indent ? INDENT_TOKEN : null,
|
|
389
|
+
options.tag ? verboseTag(options.tag) : null
|
|
390
|
+
].filter(truthy).concat(args.map((a) => {
|
|
391
|
+
if (logLevel === "warn") {
|
|
392
|
+
return chalk.yellow(a);
|
|
393
|
+
}
|
|
394
|
+
if (logLevel === "error") {
|
|
395
|
+
return chalk.red(a);
|
|
396
|
+
}
|
|
397
|
+
if (logLevel === "verbose" || logLevel === "trace") {
|
|
398
|
+
return chalk.gray(a);
|
|
399
|
+
}
|
|
400
|
+
return a;
|
|
401
|
+
}));
|
|
402
|
+
},
|
|
386
403
|
trace: (options, ...args) => {
|
|
387
404
|
writeInRepro("trace", ...args);
|
|
388
405
|
if (isEqualOrBelowLogLevel(options.logLevel, "trace")) {
|
|
@@ -390,10 +407,7 @@ var Log = {
|
|
|
390
407
|
return process.stdout.write(`
|
|
391
408
|
`);
|
|
392
409
|
}
|
|
393
|
-
return console.log(...
|
|
394
|
-
options.indent ? INDENT_TOKEN : null,
|
|
395
|
-
options.tag ? verboseTag(options.tag) : null
|
|
396
|
-
].filter(truthy).concat(args.map((a) => chalk.gray(a))));
|
|
410
|
+
return console.log(...Log.formatLogs("trace", options, args));
|
|
397
411
|
}
|
|
398
412
|
},
|
|
399
413
|
verbose: (options, ...args) => {
|
|
@@ -403,10 +417,7 @@ var Log = {
|
|
|
403
417
|
return process.stdout.write(`
|
|
404
418
|
`);
|
|
405
419
|
}
|
|
406
|
-
return console.log(...
|
|
407
|
-
options.indent ? INDENT_TOKEN : null,
|
|
408
|
-
options.tag ? verboseTag(options.tag) : null
|
|
409
|
-
].filter(truthy).concat(args.map((a) => chalk.gray(a))));
|
|
420
|
+
return console.log(...Log.formatLogs("verbose", options, args));
|
|
410
421
|
}
|
|
411
422
|
},
|
|
412
423
|
info: (options, ...args) => {
|
|
@@ -416,7 +427,7 @@ var Log = {
|
|
|
416
427
|
return process.stdout.write(`
|
|
417
428
|
`);
|
|
418
429
|
}
|
|
419
|
-
return console.log(...
|
|
430
|
+
return console.log(...Log.formatLogs("info", options, args));
|
|
420
431
|
}
|
|
421
432
|
},
|
|
422
433
|
warn: (options, ...args) => {
|
|
@@ -426,7 +437,7 @@ var Log = {
|
|
|
426
437
|
return process.stdout.write(`
|
|
427
438
|
`);
|
|
428
439
|
}
|
|
429
|
-
return console.warn(...
|
|
440
|
+
return console.warn(...Log.formatLogs("warn", options, args));
|
|
430
441
|
}
|
|
431
442
|
},
|
|
432
443
|
error: (options, ...args) => {
|
|
@@ -436,10 +447,7 @@ var Log = {
|
|
|
436
447
|
return process.stdout.write(`
|
|
437
448
|
`);
|
|
438
449
|
}
|
|
439
|
-
return console.error(...
|
|
440
|
-
options.indent ? INDENT_TOKEN : null,
|
|
441
|
-
options.tag ? verboseTag(options.tag) : null
|
|
442
|
-
].filter(truthy).concat(args.map((a) => chalk.red(a))));
|
|
450
|
+
return console.error(...Log.formatLogs("error", options, args));
|
|
443
451
|
}
|
|
444
452
|
}
|
|
445
453
|
};
|
|
@@ -2736,7 +2744,8 @@ class Page extends EventEmitter {
|
|
|
2736
2744
|
logLevel,
|
|
2737
2745
|
indent,
|
|
2738
2746
|
pageIndex,
|
|
2739
|
-
onBrowserLog
|
|
2747
|
+
onBrowserLog,
|
|
2748
|
+
onLog
|
|
2740
2749
|
}) {
|
|
2741
2750
|
const page = new Page({
|
|
2742
2751
|
client,
|
|
@@ -2746,7 +2755,8 @@ class Page extends EventEmitter {
|
|
|
2746
2755
|
logLevel,
|
|
2747
2756
|
indent,
|
|
2748
2757
|
pageIndex,
|
|
2749
|
-
onBrowserLog
|
|
2758
|
+
onBrowserLog,
|
|
2759
|
+
onLog
|
|
2750
2760
|
});
|
|
2751
2761
|
await page.#initialize();
|
|
2752
2762
|
await page.setViewport(defaultViewport);
|
|
@@ -2765,6 +2775,7 @@ class Page extends EventEmitter {
|
|
|
2765
2775
|
indent;
|
|
2766
2776
|
pageIndex;
|
|
2767
2777
|
onBrowserLog;
|
|
2778
|
+
onLog;
|
|
2768
2779
|
constructor({
|
|
2769
2780
|
client,
|
|
2770
2781
|
target,
|
|
@@ -2773,7 +2784,8 @@ class Page extends EventEmitter {
|
|
|
2773
2784
|
logLevel,
|
|
2774
2785
|
indent,
|
|
2775
2786
|
pageIndex,
|
|
2776
|
-
onBrowserLog
|
|
2787
|
+
onBrowserLog,
|
|
2788
|
+
onLog
|
|
2777
2789
|
}) {
|
|
2778
2790
|
super();
|
|
2779
2791
|
this.#client = client;
|
|
@@ -2787,6 +2799,7 @@ class Page extends EventEmitter {
|
|
|
2787
2799
|
this.indent = indent;
|
|
2788
2800
|
this.pageIndex = pageIndex;
|
|
2789
2801
|
this.onBrowserLog = onBrowserLog;
|
|
2802
|
+
this.onLog = onLog;
|
|
2790
2803
|
client.on("Target.attachedToTarget", (event) => {
|
|
2791
2804
|
switch (event.targetInfo.type) {
|
|
2792
2805
|
case "iframe":
|
|
@@ -2839,19 +2852,11 @@ class Page extends EventEmitter {
|
|
|
2839
2852
|
const tabInfo = `Tab ${this.pageIndex}`;
|
|
2840
2853
|
const tagInfo = [origPosition?.name, isDelayRenderClear ? null : file].filter(truthy).join("@");
|
|
2841
2854
|
const tag = [tabInfo, log.tag, log.tag ? null : tagInfo].filter(truthy).join(", ");
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
}, log.previewString);
|
|
2848
|
-
} else {
|
|
2849
|
-
Log[logLevel]({
|
|
2850
|
-
logLevel,
|
|
2851
|
-
tag,
|
|
2852
|
-
indent
|
|
2853
|
-
}, log.previewString);
|
|
2854
|
-
}
|
|
2855
|
+
this.onLog({
|
|
2856
|
+
logLevel: log.logLevel,
|
|
2857
|
+
tag,
|
|
2858
|
+
previewString: log.previewString
|
|
2859
|
+
});
|
|
2855
2860
|
} else if (log.type === "error") {
|
|
2856
2861
|
if (log.text.includes("Failed to load resource:")) {
|
|
2857
2862
|
Log.error({ logLevel, tag: url, indent }, log.text.replace(/\(\)$/, ""));
|
|
@@ -3519,7 +3524,8 @@ class Target {
|
|
|
3519
3524
|
logLevel,
|
|
3520
3525
|
indent,
|
|
3521
3526
|
pageIndex,
|
|
3522
|
-
onBrowserLog
|
|
3527
|
+
onBrowserLog,
|
|
3528
|
+
onLog
|
|
3523
3529
|
}) {
|
|
3524
3530
|
if (isPagetTarget(this.#targetInfo) && !this.#pagePromise) {
|
|
3525
3531
|
this.#pagePromise = this.#sessionFactory().then((client) => {
|
|
@@ -3532,7 +3538,8 @@ class Target {
|
|
|
3532
3538
|
logLevel,
|
|
3533
3539
|
indent,
|
|
3534
3540
|
pageIndex,
|
|
3535
|
-
onBrowserLog
|
|
3541
|
+
onBrowserLog,
|
|
3542
|
+
onLog
|
|
3536
3543
|
});
|
|
3537
3544
|
});
|
|
3538
3545
|
}
|
|
@@ -3672,14 +3679,16 @@ class HeadlessBrowser extends EventEmitter {
|
|
|
3672
3679
|
logLevel,
|
|
3673
3680
|
indent,
|
|
3674
3681
|
pageIndex,
|
|
3675
|
-
onBrowserLog
|
|
3682
|
+
onBrowserLog,
|
|
3683
|
+
onLog
|
|
3676
3684
|
}) {
|
|
3677
3685
|
return this.#defaultContext.newPage({
|
|
3678
3686
|
context,
|
|
3679
3687
|
logLevel,
|
|
3680
3688
|
indent,
|
|
3681
3689
|
pageIndex,
|
|
3682
|
-
onBrowserLog
|
|
3690
|
+
onBrowserLog,
|
|
3691
|
+
onLog
|
|
3683
3692
|
});
|
|
3684
3693
|
}
|
|
3685
3694
|
async _createPageInContext({
|
|
@@ -3687,7 +3696,8 @@ class HeadlessBrowser extends EventEmitter {
|
|
|
3687
3696
|
logLevel,
|
|
3688
3697
|
indent,
|
|
3689
3698
|
pageIndex,
|
|
3690
|
-
onBrowserLog
|
|
3699
|
+
onBrowserLog,
|
|
3700
|
+
onLog
|
|
3691
3701
|
}) {
|
|
3692
3702
|
const {
|
|
3693
3703
|
value: { targetId }
|
|
@@ -3708,7 +3718,8 @@ class HeadlessBrowser extends EventEmitter {
|
|
|
3708
3718
|
logLevel,
|
|
3709
3719
|
indent,
|
|
3710
3720
|
pageIndex,
|
|
3711
|
-
onBrowserLog
|
|
3721
|
+
onBrowserLog,
|
|
3722
|
+
onLog
|
|
3712
3723
|
});
|
|
3713
3724
|
if (!page) {
|
|
3714
3725
|
throw new Error(`Failed to create a page for context`);
|
|
@@ -3795,14 +3806,16 @@ class BrowserContext extends EventEmitter {
|
|
|
3795
3806
|
logLevel,
|
|
3796
3807
|
indent,
|
|
3797
3808
|
pageIndex,
|
|
3798
|
-
onBrowserLog
|
|
3809
|
+
onBrowserLog,
|
|
3810
|
+
onLog
|
|
3799
3811
|
}) {
|
|
3800
3812
|
return this.#browser._createPageInContext({
|
|
3801
3813
|
context,
|
|
3802
3814
|
logLevel,
|
|
3803
3815
|
indent,
|
|
3804
3816
|
pageIndex,
|
|
3805
|
-
onBrowserLog
|
|
3817
|
+
onBrowserLog,
|
|
3818
|
+
onLog
|
|
3806
3819
|
});
|
|
3807
3820
|
}
|
|
3808
3821
|
browser() {
|
|
@@ -4658,6 +4671,11 @@ var defaultBrowserDownloadProgress = ({
|
|
|
4658
4671
|
};
|
|
4659
4672
|
};
|
|
4660
4673
|
|
|
4674
|
+
// src/default-on-log.ts
|
|
4675
|
+
var defaultOnLog = ({ logLevel, tag, previewString }) => {
|
|
4676
|
+
Log[logLevel]({ logLevel, tag, indent: false }, previewString);
|
|
4677
|
+
};
|
|
4678
|
+
|
|
4661
4679
|
// src/open-browser.ts
|
|
4662
4680
|
import fs9 from "node:fs";
|
|
4663
4681
|
import os3 from "node:os";
|
|
@@ -5353,7 +5371,8 @@ var getPageAndCleanupFn = async ({
|
|
|
5353
5371
|
onBrowserDownload,
|
|
5354
5372
|
chromeMode,
|
|
5355
5373
|
pageIndex,
|
|
5356
|
-
onBrowserLog
|
|
5374
|
+
onBrowserLog,
|
|
5375
|
+
onLog
|
|
5357
5376
|
}) => {
|
|
5358
5377
|
if (passedInInstance) {
|
|
5359
5378
|
const page = await passedInInstance.newPage({
|
|
@@ -5361,7 +5380,8 @@ var getPageAndCleanupFn = async ({
|
|
|
5361
5380
|
logLevel,
|
|
5362
5381
|
indent,
|
|
5363
5382
|
pageIndex,
|
|
5364
|
-
onBrowserLog
|
|
5383
|
+
onBrowserLog,
|
|
5384
|
+
onLog
|
|
5365
5385
|
});
|
|
5366
5386
|
return {
|
|
5367
5387
|
page,
|
|
@@ -5391,7 +5411,8 @@ var getPageAndCleanupFn = async ({
|
|
|
5391
5411
|
logLevel,
|
|
5392
5412
|
indent,
|
|
5393
5413
|
pageIndex,
|
|
5394
|
-
onBrowserLog
|
|
5414
|
+
onBrowserLog,
|
|
5415
|
+
onLog
|
|
5395
5416
|
});
|
|
5396
5417
|
return {
|
|
5397
5418
|
page: browserPage,
|
|
@@ -16724,7 +16745,8 @@ var internalGetCompositionsRaw = async ({
|
|
|
16724
16745
|
onBrowserDownload,
|
|
16725
16746
|
chromeMode,
|
|
16726
16747
|
offthreadVideoThreads,
|
|
16727
|
-
mediaCacheSizeInBytes
|
|
16748
|
+
mediaCacheSizeInBytes,
|
|
16749
|
+
onLog
|
|
16728
16750
|
}) => {
|
|
16729
16751
|
const { page, cleanupPage } = await getPageAndCleanupFn({
|
|
16730
16752
|
passedInInstance: puppeteerInstance,
|
|
@@ -16736,7 +16758,8 @@ var internalGetCompositionsRaw = async ({
|
|
|
16736
16758
|
onBrowserDownload,
|
|
16737
16759
|
chromeMode,
|
|
16738
16760
|
pageIndex: 0,
|
|
16739
|
-
onBrowserLog
|
|
16761
|
+
onBrowserLog,
|
|
16762
|
+
onLog
|
|
16740
16763
|
});
|
|
16741
16764
|
const cleanup = [cleanupPage];
|
|
16742
16765
|
return new Promise((resolve2, reject) => {
|
|
@@ -16842,7 +16865,8 @@ var getCompositions = (serveUrlOrWebpackUrl, config) => {
|
|
|
16842
16865
|
}),
|
|
16843
16866
|
chromeMode: chromeMode ?? "headless-shell",
|
|
16844
16867
|
offthreadVideoThreads: offthreadVideoThreads ?? null,
|
|
16845
|
-
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null
|
|
16868
|
+
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
|
|
16869
|
+
onLog: defaultOnLog
|
|
16846
16870
|
});
|
|
16847
16871
|
};
|
|
16848
16872
|
|
|
@@ -17808,9 +17832,10 @@ var makePage = async ({
|
|
|
17808
17832
|
serializedResolvedPropsWithCustomSchema,
|
|
17809
17833
|
pageIndex,
|
|
17810
17834
|
isMainTab,
|
|
17811
|
-
mediaCacheSizeInBytes
|
|
17835
|
+
mediaCacheSizeInBytes,
|
|
17836
|
+
onLog
|
|
17812
17837
|
}) => {
|
|
17813
|
-
const page = await browserReplacer.getBrowser().newPage({ context, logLevel, indent, pageIndex, onBrowserLog });
|
|
17838
|
+
const page = await browserReplacer.getBrowser().newPage({ context, logLevel, indent, pageIndex, onBrowserLog, onLog });
|
|
17814
17839
|
pagesArray.push(page);
|
|
17815
17840
|
await page.setViewport({
|
|
17816
17841
|
width: composition.width,
|
|
@@ -18790,7 +18815,8 @@ var innerRenderFrames = async ({
|
|
|
18790
18815
|
onArtifact,
|
|
18791
18816
|
binariesDirectory,
|
|
18792
18817
|
imageSequencePattern,
|
|
18793
|
-
mediaCacheSizeInBytes
|
|
18818
|
+
mediaCacheSizeInBytes,
|
|
18819
|
+
onLog
|
|
18794
18820
|
}) => {
|
|
18795
18821
|
if (outputDir) {
|
|
18796
18822
|
if (!fs14.existsSync(outputDir)) {
|
|
@@ -18837,7 +18863,8 @@ var innerRenderFrames = async ({
|
|
|
18837
18863
|
timeoutInMilliseconds,
|
|
18838
18864
|
pageIndex,
|
|
18839
18865
|
isMainTab: pageIndex === 0,
|
|
18840
|
-
mediaCacheSizeInBytes
|
|
18866
|
+
mediaCacheSizeInBytes,
|
|
18867
|
+
onLog
|
|
18841
18868
|
});
|
|
18842
18869
|
};
|
|
18843
18870
|
const getPool = async () => {
|
|
@@ -18980,7 +19007,8 @@ var internalRenderFramesRaw = ({
|
|
|
18980
19007
|
chromeMode,
|
|
18981
19008
|
offthreadVideoThreads,
|
|
18982
19009
|
imageSequencePattern,
|
|
18983
|
-
mediaCacheSizeInBytes
|
|
19010
|
+
mediaCacheSizeInBytes,
|
|
19011
|
+
onLog
|
|
18984
19012
|
}) => {
|
|
18985
19013
|
validateDimension(composition.height, "height", "in the `config` object passed to `renderFrames()`");
|
|
18986
19014
|
validateDimension(composition.width, "width", "in the `config` object passed to `renderFrames()`");
|
|
@@ -19084,7 +19112,8 @@ var internalRenderFramesRaw = ({
|
|
|
19084
19112
|
chromeMode,
|
|
19085
19113
|
offthreadVideoThreads,
|
|
19086
19114
|
imageSequencePattern,
|
|
19087
|
-
mediaCacheSizeInBytes
|
|
19115
|
+
mediaCacheSizeInBytes,
|
|
19116
|
+
onLog
|
|
19088
19117
|
});
|
|
19089
19118
|
})
|
|
19090
19119
|
]).then((res) => {
|
|
@@ -19213,7 +19242,8 @@ var renderFrames = (options) => {
|
|
|
19213
19242
|
chromeMode: chromeMode ?? "headless-shell",
|
|
19214
19243
|
offthreadVideoThreads: offthreadVideoThreads ?? null,
|
|
19215
19244
|
imageSequencePattern: imageSequencePattern ?? null,
|
|
19216
|
-
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null
|
|
19245
|
+
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
|
|
19246
|
+
onLog: defaultOnLog
|
|
19217
19247
|
});
|
|
19218
19248
|
};
|
|
19219
19249
|
|
|
@@ -19671,40 +19701,35 @@ var validateEvenDimensionsWithCodec = ({
|
|
|
19671
19701
|
indent,
|
|
19672
19702
|
logLevel
|
|
19673
19703
|
}) => {
|
|
19674
|
-
let actualWidth = width * scale;
|
|
19675
|
-
let actualHeight = height * scale;
|
|
19676
19704
|
if (wantsImageSequence) {
|
|
19677
19705
|
return {
|
|
19678
|
-
actualWidth,
|
|
19679
|
-
actualHeight
|
|
19706
|
+
actualWidth: width,
|
|
19707
|
+
actualHeight: height
|
|
19680
19708
|
};
|
|
19681
19709
|
}
|
|
19682
19710
|
if (codec !== "h264-mkv" && codec !== "h264" && codec !== "h265" && codec !== "h264-ts") {
|
|
19683
19711
|
return {
|
|
19684
|
-
actualWidth,
|
|
19685
|
-
actualHeight
|
|
19712
|
+
actualWidth: width,
|
|
19713
|
+
actualHeight: height
|
|
19686
19714
|
};
|
|
19687
19715
|
}
|
|
19688
|
-
|
|
19689
|
-
|
|
19690
|
-
|
|
19716
|
+
let heightEvenDimensions = height;
|
|
19717
|
+
while (Math.round(heightEvenDimensions * scale) % 2 !== 0) {
|
|
19718
|
+
heightEvenDimensions--;
|
|
19691
19719
|
}
|
|
19692
|
-
|
|
19693
|
-
|
|
19694
|
-
|
|
19720
|
+
let widthEvenDimensions = width;
|
|
19721
|
+
while (Math.round(widthEvenDimensions * scale) % 2 !== 0) {
|
|
19722
|
+
widthEvenDimensions--;
|
|
19695
19723
|
}
|
|
19696
|
-
|
|
19697
|
-
|
|
19698
|
-
Log.verbose({ indent, logLevel }, `Rounding width down to an even number from ${actualWidth} to ${actualWidth - 1} for ${displayName} codec compatibility`);
|
|
19699
|
-
actualWidth -= 1;
|
|
19724
|
+
if (widthEvenDimensions !== width) {
|
|
19725
|
+
Log.verbose({ indent, logLevel }, `Rounding width to an even number from ${width} to ${widthEvenDimensions}`);
|
|
19700
19726
|
}
|
|
19701
|
-
if (
|
|
19702
|
-
Log.verbose({ indent, logLevel }, `Rounding height
|
|
19703
|
-
actualHeight -= 1;
|
|
19727
|
+
if (heightEvenDimensions !== height) {
|
|
19728
|
+
Log.verbose({ indent, logLevel }, `Rounding height to an even number from ${height} to ${heightEvenDimensions}`);
|
|
19704
19729
|
}
|
|
19705
19730
|
return {
|
|
19706
|
-
actualWidth,
|
|
19707
|
-
actualHeight
|
|
19731
|
+
actualWidth: widthEvenDimensions,
|
|
19732
|
+
actualHeight: heightEvenDimensions
|
|
19708
19733
|
};
|
|
19709
19734
|
};
|
|
19710
19735
|
|
|
@@ -21333,7 +21358,8 @@ var internalRenderMediaRaw = ({
|
|
|
21333
21358
|
hardwareAcceleration,
|
|
21334
21359
|
chromeMode,
|
|
21335
21360
|
offthreadVideoThreads,
|
|
21336
|
-
mediaCacheSizeInBytes
|
|
21361
|
+
mediaCacheSizeInBytes,
|
|
21362
|
+
onLog
|
|
21337
21363
|
}) => {
|
|
21338
21364
|
const pixelFormat = userPixelFormat ?? compositionWithPossibleUnevenDimensions.defaultPixelFormat ?? DEFAULT_PIXEL_FORMAT;
|
|
21339
21365
|
if (repro) {
|
|
@@ -21448,21 +21474,7 @@ var internalRenderMediaRaw = ({
|
|
|
21448
21474
|
if (onCtrlCExit && workingDir) {
|
|
21449
21475
|
onCtrlCExit(`Delete ${workingDir}`, () => deleteDirectory(workingDir));
|
|
21450
21476
|
}
|
|
21451
|
-
const {
|
|
21452
|
-
actualWidth: widthEvenDimensionsUndivided,
|
|
21453
|
-
actualHeight: heightEvenDimensionsUndivided
|
|
21454
|
-
} = validateEvenDimensionsWithCodec({
|
|
21455
|
-
codec,
|
|
21456
|
-
height: compositionWithPossibleUnevenDimensions.height,
|
|
21457
|
-
scale,
|
|
21458
|
-
width: compositionWithPossibleUnevenDimensions.width,
|
|
21459
|
-
wantsImageSequence: false,
|
|
21460
|
-
indent,
|
|
21461
|
-
logLevel
|
|
21462
|
-
});
|
|
21463
|
-
const heightEvenDimensions = Math.round(heightEvenDimensionsUndivided / scale);
|
|
21464
|
-
const widthEvenDimensions = Math.round(widthEvenDimensionsUndivided / scale);
|
|
21465
|
-
const { actualWidth, actualHeight } = validateEvenDimensionsWithCodec({
|
|
21477
|
+
const { actualWidth: widthEvenDimensions, actualHeight: heightEvenDimensions } = validateEvenDimensionsWithCodec({
|
|
21466
21478
|
codec,
|
|
21467
21479
|
height: compositionWithPossibleUnevenDimensions.height,
|
|
21468
21480
|
scale,
|
|
@@ -21471,6 +21483,8 @@ var internalRenderMediaRaw = ({
|
|
|
21471
21483
|
indent,
|
|
21472
21484
|
logLevel
|
|
21473
21485
|
});
|
|
21486
|
+
const actualWidth = widthEvenDimensions * scale;
|
|
21487
|
+
const actualHeight = heightEvenDimensions * scale;
|
|
21474
21488
|
const composition = {
|
|
21475
21489
|
...compositionWithPossibleUnevenDimensions,
|
|
21476
21490
|
height: heightEvenDimensions,
|
|
@@ -21653,7 +21667,8 @@ var internalRenderMediaRaw = ({
|
|
|
21653
21667
|
onArtifact,
|
|
21654
21668
|
chromeMode,
|
|
21655
21669
|
imageSequencePattern: null,
|
|
21656
|
-
mediaCacheSizeInBytes
|
|
21670
|
+
mediaCacheSizeInBytes,
|
|
21671
|
+
onLog
|
|
21657
21672
|
});
|
|
21658
21673
|
return renderFramesProc;
|
|
21659
21674
|
}).then((renderFramesReturn) => {
|
|
@@ -21911,7 +21926,8 @@ var renderMedia = ({
|
|
|
21911
21926
|
compositionStart: compositionStart ?? 0,
|
|
21912
21927
|
hardwareAcceleration: hardwareAcceleration ?? "disable",
|
|
21913
21928
|
chromeMode: chromeMode ?? "headless-shell",
|
|
21914
|
-
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null
|
|
21929
|
+
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
|
|
21930
|
+
onLog: defaultOnLog
|
|
21915
21931
|
});
|
|
21916
21932
|
};
|
|
21917
21933
|
|
|
@@ -21945,7 +21961,8 @@ var innerRenderStill = async ({
|
|
|
21945
21961
|
onBrowserDownload,
|
|
21946
21962
|
onArtifact,
|
|
21947
21963
|
chromeMode,
|
|
21948
|
-
mediaCacheSizeInBytes
|
|
21964
|
+
mediaCacheSizeInBytes,
|
|
21965
|
+
onLog
|
|
21949
21966
|
}) => {
|
|
21950
21967
|
validateDimension(composition.height, "height", "in the `config` object passed to `renderStill()`");
|
|
21951
21968
|
validateDimension(composition.width, "width", "in the `config` object passed to `renderStill()`");
|
|
@@ -21996,7 +22013,8 @@ var innerRenderStill = async ({
|
|
|
21996
22013
|
logLevel,
|
|
21997
22014
|
indent,
|
|
21998
22015
|
pageIndex: 0,
|
|
21999
|
-
onBrowserLog
|
|
22016
|
+
onBrowserLog,
|
|
22017
|
+
onLog
|
|
22000
22018
|
});
|
|
22001
22019
|
await page.setViewport({
|
|
22002
22020
|
width: composition.width,
|
|
@@ -22246,7 +22264,8 @@ var renderStill = (options) => {
|
|
|
22246
22264
|
onArtifact: onArtifact ?? null,
|
|
22247
22265
|
chromeMode: chromeMode ?? "headless-shell",
|
|
22248
22266
|
offthreadVideoThreads: offthreadVideoThreads ?? null,
|
|
22249
|
-
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null
|
|
22267
|
+
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
|
|
22268
|
+
onLog: defaultOnLog
|
|
22250
22269
|
});
|
|
22251
22270
|
};
|
|
22252
22271
|
|
|
@@ -22384,7 +22403,8 @@ var internalSelectCompositionRaw = async (options) => {
|
|
|
22384
22403
|
onBrowserDownload,
|
|
22385
22404
|
chromeMode,
|
|
22386
22405
|
pageIndex: 0,
|
|
22387
|
-
onBrowserLog
|
|
22406
|
+
onBrowserLog,
|
|
22407
|
+
onLog: RenderInternals.defaultOnLog
|
|
22388
22408
|
}),
|
|
22389
22409
|
makeOrReuseServer(options.server, {
|
|
22390
22410
|
webpackConfigOrServeUrl: serveUrlOrWebpackUrl,
|
|
@@ -22514,7 +22534,8 @@ var getChromiumGpuInformation = async ({
|
|
|
22514
22534
|
chromiumOptions,
|
|
22515
22535
|
timeoutInMilliseconds,
|
|
22516
22536
|
onBrowserDownload,
|
|
22517
|
-
chromeMode
|
|
22537
|
+
chromeMode,
|
|
22538
|
+
onLog
|
|
22518
22539
|
}) => {
|
|
22519
22540
|
const { page, cleanupPage: cleanup } = await getPageAndCleanupFn({
|
|
22520
22541
|
passedInInstance: undefined,
|
|
@@ -22526,7 +22547,8 @@ var getChromiumGpuInformation = async ({
|
|
|
22526
22547
|
onBrowserDownload,
|
|
22527
22548
|
chromeMode,
|
|
22528
22549
|
pageIndex: 0,
|
|
22529
|
-
onBrowserLog: null
|
|
22550
|
+
onBrowserLog: null,
|
|
22551
|
+
onLog
|
|
22530
22552
|
});
|
|
22531
22553
|
await page.goto({ url: "chrome://gpu", timeout: 12000 });
|
|
22532
22554
|
const { value } = await puppeteerEvaluateWithCatch({
|
|
@@ -23078,7 +23100,8 @@ var RenderInternals = {
|
|
|
23078
23100
|
DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS,
|
|
23079
23101
|
canConcatVideoSeamlessly,
|
|
23080
23102
|
canConcatAudioSeamlessly,
|
|
23081
|
-
internalCombineChunks
|
|
23103
|
+
internalCombineChunks,
|
|
23104
|
+
defaultOnLog
|
|
23082
23105
|
};
|
|
23083
23106
|
checkRuntimeVersion("info", false);
|
|
23084
23107
|
export {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { BrowserExecutable } from './browser-executable';
|
|
2
2
|
import type { BrowserLog } from './browser-log';
|
|
3
3
|
import type { HeadlessBrowser } from './browser/Browser';
|
|
4
|
-
import type { Page } from './browser/BrowserPage';
|
|
4
|
+
import type { OnLog, Page } from './browser/BrowserPage';
|
|
5
5
|
import type { LogLevel } from './log-level';
|
|
6
6
|
import type { ChromiumOptions } from './open-browser';
|
|
7
7
|
import type { ChromeMode } from './options/chrome-mode';
|
|
8
8
|
import type { OnBrowserDownload } from './options/on-browser-download';
|
|
9
|
-
export declare const getPageAndCleanupFn: ({ passedInInstance, browserExecutable, chromiumOptions, forceDeviceScaleFactor, indent, logLevel, onBrowserDownload, chromeMode, pageIndex, onBrowserLog, }: {
|
|
9
|
+
export declare const getPageAndCleanupFn: ({ passedInInstance, browserExecutable, chromiumOptions, forceDeviceScaleFactor, indent, logLevel, onBrowserDownload, chromeMode, pageIndex, onBrowserLog, onLog, }: {
|
|
10
10
|
passedInInstance: HeadlessBrowser | undefined;
|
|
11
11
|
browserExecutable: BrowserExecutable | null;
|
|
12
12
|
chromiumOptions: ChromiumOptions;
|
|
@@ -17,6 +17,7 @@ export declare const getPageAndCleanupFn: ({ passedInInstance, browserExecutable
|
|
|
17
17
|
chromeMode: ChromeMode;
|
|
18
18
|
pageIndex: number;
|
|
19
19
|
onBrowserLog: null | ((log: BrowserLog) => void);
|
|
20
|
+
onLog: OnLog;
|
|
20
21
|
}) => Promise<{
|
|
21
22
|
cleanupPage: () => Promise<void>;
|
|
22
23
|
page: Page;
|
|
@@ -4,7 +4,7 @@ exports.getPageAndCleanupFn = void 0;
|
|
|
4
4
|
const browser_1 = require("./browser");
|
|
5
5
|
const logger_1 = require("./logger");
|
|
6
6
|
const open_browser_1 = require("./open-browser");
|
|
7
|
-
const getPageAndCleanupFn = async ({ passedInInstance, browserExecutable, chromiumOptions, forceDeviceScaleFactor, indent, logLevel, onBrowserDownload, chromeMode, pageIndex, onBrowserLog, }) => {
|
|
7
|
+
const getPageAndCleanupFn = async ({ passedInInstance, browserExecutable, chromiumOptions, forceDeviceScaleFactor, indent, logLevel, onBrowserDownload, chromeMode, pageIndex, onBrowserLog, onLog, }) => {
|
|
8
8
|
if (passedInInstance) {
|
|
9
9
|
const page = await passedInInstance.newPage({
|
|
10
10
|
context: () => null,
|
|
@@ -12,6 +12,7 @@ const getPageAndCleanupFn = async ({ passedInInstance, browserExecutable, chromi
|
|
|
12
12
|
indent,
|
|
13
13
|
pageIndex,
|
|
14
14
|
onBrowserLog,
|
|
15
|
+
onLog,
|
|
15
16
|
});
|
|
16
17
|
return {
|
|
17
18
|
page,
|
|
@@ -44,6 +45,7 @@ const getPageAndCleanupFn = async ({ passedInInstance, browserExecutable, chromi
|
|
|
44
45
|
indent,
|
|
45
46
|
pageIndex,
|
|
46
47
|
onBrowserLog,
|
|
48
|
+
onLog,
|
|
47
49
|
});
|
|
48
50
|
return {
|
|
49
51
|
page: browserPage,
|
|
@@ -2,6 +2,7 @@ import type { VideoConfig } from 'remotion/no-react';
|
|
|
2
2
|
import type { BrowserExecutable } from './browser-executable';
|
|
3
3
|
import type { BrowserLog } from './browser-log';
|
|
4
4
|
import type { HeadlessBrowser } from './browser/Browser';
|
|
5
|
+
import type { OnLog } from './browser/BrowserPage';
|
|
5
6
|
import type { ChromiumOptions } from './open-browser';
|
|
6
7
|
import type { ToOptions } from './options/option';
|
|
7
8
|
import type { optionsMap } from './options/options-map';
|
|
@@ -18,6 +19,7 @@ type InternalGetCompositionsOptions = {
|
|
|
18
19
|
server: RemotionServer | undefined;
|
|
19
20
|
indent: boolean;
|
|
20
21
|
serveUrlOrWebpackUrl: string;
|
|
22
|
+
onLog: OnLog;
|
|
21
23
|
} & ToOptions<typeof optionsMap.getCompositions>;
|
|
22
24
|
export type GetCompositionsOptions = RequiredInputPropsInV5 & {
|
|
23
25
|
envVariables?: Record<string, string>;
|
package/dist/get-compositions.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.getCompositions = exports.internalGetCompositions = void 0;
|
|
|
4
4
|
const no_react_1 = require("remotion/no-react");
|
|
5
5
|
const TimeoutSettings_1 = require("./browser/TimeoutSettings");
|
|
6
6
|
const browser_download_progress_bar_1 = require("./browser/browser-download-progress-bar");
|
|
7
|
+
const default_on_log_1 = require("./default-on-log");
|
|
7
8
|
const handle_javascript_exception_1 = require("./error-handling/handle-javascript-exception");
|
|
8
9
|
const find_closest_package_json_1 = require("./find-closest-package-json");
|
|
9
10
|
const get_browser_instance_1 = require("./get-browser-instance");
|
|
@@ -80,7 +81,7 @@ const innerGetCompositions = async ({ envVariables, serializedInputPropsWithCust
|
|
|
80
81
|
};
|
|
81
82
|
});
|
|
82
83
|
};
|
|
83
|
-
const internalGetCompositionsRaw = async ({ browserExecutable, chromiumOptions, envVariables, indent, serializedInputPropsWithCustomSchema, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, offthreadVideoCacheSizeInBytes, binariesDirectory, onBrowserDownload, chromeMode, offthreadVideoThreads, mediaCacheSizeInBytes, }) => {
|
|
84
|
+
const internalGetCompositionsRaw = async ({ browserExecutable, chromiumOptions, envVariables, indent, serializedInputPropsWithCustomSchema, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, offthreadVideoCacheSizeInBytes, binariesDirectory, onBrowserDownload, chromeMode, offthreadVideoThreads, mediaCacheSizeInBytes, onLog, }) => {
|
|
84
85
|
const { page, cleanupPage } = await (0, get_browser_instance_1.getPageAndCleanupFn)({
|
|
85
86
|
passedInInstance: puppeteerInstance,
|
|
86
87
|
browserExecutable,
|
|
@@ -92,6 +93,7 @@ const internalGetCompositionsRaw = async ({ browserExecutable, chromiumOptions,
|
|
|
92
93
|
chromeMode,
|
|
93
94
|
pageIndex: 0,
|
|
94
95
|
onBrowserLog,
|
|
96
|
+
onLog,
|
|
95
97
|
});
|
|
96
98
|
const cleanup = [cleanupPage];
|
|
97
99
|
return new Promise((resolve, reject) => {
|
|
@@ -188,6 +190,7 @@ const getCompositions = (serveUrlOrWebpackUrl, config) => {
|
|
|
188
190
|
chromeMode: chromeMode !== null && chromeMode !== void 0 ? chromeMode : 'headless-shell',
|
|
189
191
|
offthreadVideoThreads: offthreadVideoThreads !== null && offthreadVideoThreads !== void 0 ? offthreadVideoThreads : null,
|
|
190
192
|
mediaCacheSizeInBytes: mediaCacheSizeInBytes !== null && mediaCacheSizeInBytes !== void 0 ? mediaCacheSizeInBytes : null,
|
|
193
|
+
onLog: default_on_log_1.defaultOnLog,
|
|
191
194
|
});
|
|
192
195
|
};
|
|
193
196
|
exports.getCompositions = getCompositions;
|