@remotion/renderer 4.0.532 → 4.0.533
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 +6 -0
- package/dist/compress-assets.d.ts +1 -1
- package/dist/compress-assets.js +1 -1
- package/dist/esm/client.mjs +8 -2
- package/dist/esm/index.mjs +27 -9
- package/dist/index.d.ts +3 -0
- package/dist/options/image-sequence-pattern.d.ts +3 -0
- package/dist/options/image-sequence-pattern.js +8 -2
- package/dist/options/index.d.ts +3 -0
- package/dist/options/options-map.d.ts +3 -0
- package/dist/render-frame-and-retry-target-close.d.ts +3 -2
- package/dist/render-frame-and-retry-target-close.js +4 -1
- package/dist/render-frame-with-option-to-reject.d.ts +3 -2
- package/dist/render-frame-with-option-to-reject.js +15 -14
- package/dist/render-frame.d.ts +3 -2
- package/dist/render-frame.js +2 -1
- package/dist/render-frames.d.ts +4 -0
- package/dist/render-frames.js +5 -0
- package/package.json +13 -13
package/dist/client.d.ts
CHANGED
|
@@ -1283,6 +1283,9 @@ export declare const BrowserSafeApis: {
|
|
|
1283
1283
|
}) => {
|
|
1284
1284
|
value: string;
|
|
1285
1285
|
source: string;
|
|
1286
|
+
} | {
|
|
1287
|
+
value: null;
|
|
1288
|
+
source: string;
|
|
1286
1289
|
};
|
|
1287
1290
|
setConfig: (pattern: string | null) => void;
|
|
1288
1291
|
reset: () => void;
|
|
@@ -3107,6 +3110,9 @@ export declare const BrowserSafeApis: {
|
|
|
3107
3110
|
}) => {
|
|
3108
3111
|
value: string;
|
|
3109
3112
|
source: string;
|
|
3113
|
+
} | {
|
|
3114
|
+
value: null;
|
|
3115
|
+
source: string;
|
|
3110
3116
|
};
|
|
3111
3117
|
setConfig: (pattern: string | null) => void;
|
|
3112
3118
|
reset: () => void;
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Since we track the `src` property for every frame, Node.JS can run out of memory easily. Instead of duplicating the src for every frame, we save memory by replacing the full base 64 encoded data with a string `same-as-[asset-id]-[frame]` referencing a previous asset with the same src.
|
|
4
4
|
*/
|
|
5
5
|
import type { AudioOrVideoAsset } from 'remotion/no-react';
|
|
6
|
-
export declare const compressAsset: (previousRenderAssets:
|
|
6
|
+
export declare const compressAsset: (previousRenderAssets: ReadonlyMap<string, AudioOrVideoAsset>, newRenderAsset: AudioOrVideoAsset) => AudioOrVideoAsset;
|
|
7
7
|
export declare const isAssetCompressed: (src: string) => boolean;
|
package/dist/compress-assets.js
CHANGED
|
@@ -9,7 +9,7 @@ const compressAsset = (previousRenderAssets, newRenderAsset) => {
|
|
|
9
9
|
if (newRenderAsset.src.length < 400) {
|
|
10
10
|
return newRenderAsset;
|
|
11
11
|
}
|
|
12
|
-
const assetWithSameSrc = previousRenderAssets.
|
|
12
|
+
const assetWithSameSrc = previousRenderAssets.get(newRenderAsset.src);
|
|
13
13
|
if (!assetWithSameSrc) {
|
|
14
14
|
return newRenderAsset;
|
|
15
15
|
}
|
package/dist/esm/client.mjs
CHANGED
|
@@ -3066,6 +3066,12 @@ var imageSequencePatternOption = {
|
|
|
3066
3066
|
docLink: null,
|
|
3067
3067
|
type: "string",
|
|
3068
3068
|
getValue: ({ commandLine }) => {
|
|
3069
|
+
if (commandLine[cliFlag46] !== undefined) {
|
|
3070
|
+
return {
|
|
3071
|
+
value: commandLine[cliFlag46],
|
|
3072
|
+
source: "cli"
|
|
3073
|
+
};
|
|
3074
|
+
}
|
|
3069
3075
|
if (currentImageSequencePattern !== null) {
|
|
3070
3076
|
return {
|
|
3071
3077
|
value: currentImageSequencePattern,
|
|
@@ -3073,8 +3079,8 @@ var imageSequencePatternOption = {
|
|
|
3073
3079
|
};
|
|
3074
3080
|
}
|
|
3075
3081
|
return {
|
|
3076
|
-
value:
|
|
3077
|
-
source: "
|
|
3082
|
+
value: null,
|
|
3083
|
+
source: "default"
|
|
3078
3084
|
};
|
|
3079
3085
|
},
|
|
3080
3086
|
setConfig: (pattern) => {
|
package/dist/esm/index.mjs
CHANGED
|
@@ -7429,7 +7429,7 @@ var compressAsset = (previousRenderAssets, newRenderAsset) => {
|
|
|
7429
7429
|
if (newRenderAsset.src.length < 400) {
|
|
7430
7430
|
return newRenderAsset;
|
|
7431
7431
|
}
|
|
7432
|
-
const assetWithSameSrc = previousRenderAssets.
|
|
7432
|
+
const assetWithSameSrc = previousRenderAssets.get(newRenderAsset.src);
|
|
7433
7433
|
if (!assetWithSameSrc) {
|
|
7434
7434
|
return newRenderAsset;
|
|
7435
7435
|
}
|
|
@@ -20534,6 +20534,7 @@ var renderFrameWithOptionToReject = async ({
|
|
|
20534
20534
|
scale,
|
|
20535
20535
|
countType,
|
|
20536
20536
|
assets,
|
|
20537
|
+
assetIndex,
|
|
20537
20538
|
framesToRender,
|
|
20538
20539
|
onArtifact,
|
|
20539
20540
|
onDownload,
|
|
@@ -20617,24 +20618,20 @@ var renderFrameWithOptionToReject = async ({
|
|
|
20617
20618
|
}
|
|
20618
20619
|
await onFrameBuffer(buffer2, frame);
|
|
20619
20620
|
}
|
|
20620
|
-
const onlyAvailableAssets = assets.filter(truthy);
|
|
20621
|
-
const previousAudioRenderAssets = onlyAvailableAssets.map((a) => a.audioAndVideoAssets).flat(2);
|
|
20622
|
-
const previousArtifactAssets = onlyAvailableAssets.map((a) => a.artifactAssets).flat(2);
|
|
20623
20621
|
const audioAndVideoAssets = onlyAudioAndVideoAssets(collectedAssets);
|
|
20624
20622
|
const artifactAssets = onlyArtifact({
|
|
20625
20623
|
assets: collectedAssets,
|
|
20626
20624
|
frameBuffer: buffer2
|
|
20627
20625
|
});
|
|
20628
20626
|
for (const artifact of artifactAssets) {
|
|
20629
|
-
|
|
20630
|
-
|
|
20631
|
-
|
|
20632
|
-
}
|
|
20627
|
+
const previousFrame = assetIndex.firstArtifactFrameByFilename.get(artifact.filename);
|
|
20628
|
+
if (previousFrame !== undefined) {
|
|
20629
|
+
return Promise.reject(new Error(`An artifact with output "${artifact.filename}" was already registered at frame ${previousFrame}, but now registered again at frame ${artifact.frame}. Artifacts must have unique names. https://remotion.dev/docs/artifacts`));
|
|
20633
20630
|
}
|
|
20634
20631
|
onArtifact?.(artifact);
|
|
20635
20632
|
}
|
|
20636
20633
|
const compressedAssets = audioAndVideoAssets.map((asset) => {
|
|
20637
|
-
return compressAsset(
|
|
20634
|
+
return compressAsset(assetIndex.firstAssetBySrc, asset);
|
|
20638
20635
|
});
|
|
20639
20636
|
const inlineAudioAssets = onlyInlineAudio(collectedAssets);
|
|
20640
20637
|
const outputFrame = allFramesAndExtraFrames[0] + allFramesAndExtraFrames.indexOf(frame);
|
|
@@ -20649,6 +20646,16 @@ var renderFrameWithOptionToReject = async ({
|
|
|
20649
20646
|
}),
|
|
20650
20647
|
inlineAudioAssets
|
|
20651
20648
|
});
|
|
20649
|
+
for (const asset of compressedAssets) {
|
|
20650
|
+
if (asset.src.length >= 400 && !assetIndex.firstAssetBySrc.has(asset.src)) {
|
|
20651
|
+
assetIndex.firstAssetBySrc.set(asset.src, asset);
|
|
20652
|
+
}
|
|
20653
|
+
}
|
|
20654
|
+
for (const artifact of artifactAssets) {
|
|
20655
|
+
if (!assetIndex.firstArtifactFrameByFilename.has(artifact.filename)) {
|
|
20656
|
+
assetIndex.firstArtifactFrameByFilename.set(artifact.filename, artifact.frame);
|
|
20657
|
+
}
|
|
20658
|
+
}
|
|
20652
20659
|
for (const renderAsset of compressedAssets) {
|
|
20653
20660
|
downloadAndMapAssetsToFileUrl({
|
|
20654
20661
|
renderAsset,
|
|
@@ -20691,6 +20698,7 @@ var renderFrame = ({
|
|
|
20691
20698
|
indent,
|
|
20692
20699
|
logLevel,
|
|
20693
20700
|
assets,
|
|
20701
|
+
assetIndex,
|
|
20694
20702
|
countType,
|
|
20695
20703
|
downloadMap,
|
|
20696
20704
|
frameDir,
|
|
@@ -20730,6 +20738,7 @@ var renderFrame = ({
|
|
|
20730
20738
|
onFrameBuffer,
|
|
20731
20739
|
outputDir,
|
|
20732
20740
|
assets,
|
|
20741
|
+
assetIndex,
|
|
20733
20742
|
binariesDirectory,
|
|
20734
20743
|
cancelSignal,
|
|
20735
20744
|
countType,
|
|
@@ -20764,6 +20773,7 @@ var renderFrameAndRetryTargetClose = async ({
|
|
|
20764
20773
|
retriesLeft,
|
|
20765
20774
|
attempt,
|
|
20766
20775
|
assets,
|
|
20776
|
+
assetIndex,
|
|
20767
20777
|
imageFormat,
|
|
20768
20778
|
binariesDirectory,
|
|
20769
20779
|
cancelSignal,
|
|
@@ -20811,6 +20821,7 @@ var renderFrameAndRetryTargetClose = async ({
|
|
|
20811
20821
|
allFramesAndExtraFrames,
|
|
20812
20822
|
attempt,
|
|
20813
20823
|
assets,
|
|
20824
|
+
assetIndex,
|
|
20814
20825
|
binariesDirectory,
|
|
20815
20826
|
cancelSignal,
|
|
20816
20827
|
countType,
|
|
@@ -20876,6 +20887,7 @@ var renderFrameAndRetryTargetClose = async ({
|
|
|
20876
20887
|
retriesLeft: actualRetriesLeft,
|
|
20877
20888
|
attempt: attempt + 1,
|
|
20878
20889
|
assets,
|
|
20890
|
+
assetIndex,
|
|
20879
20891
|
imageFormat,
|
|
20880
20892
|
binariesDirectory,
|
|
20881
20893
|
cancelSignal,
|
|
@@ -20924,6 +20936,7 @@ var renderFrameAndRetryTargetClose = async ({
|
|
|
20924
20936
|
retriesLeft: retriesLeft - 1,
|
|
20925
20937
|
attempt: attempt + 1,
|
|
20926
20938
|
assets,
|
|
20939
|
+
assetIndex,
|
|
20927
20940
|
binariesDirectory,
|
|
20928
20941
|
cancelSignal,
|
|
20929
20942
|
composition,
|
|
@@ -21187,6 +21200,10 @@ var innerRenderFrames = async ({
|
|
|
21187
21200
|
resolvedConcurrency
|
|
21188
21201
|
});
|
|
21189
21202
|
const assets = [];
|
|
21203
|
+
const assetIndex = {
|
|
21204
|
+
firstAssetBySrc: new Map,
|
|
21205
|
+
firstArtifactFrameByFilename: new Map
|
|
21206
|
+
};
|
|
21190
21207
|
const stoppedSignal = { stopped: false };
|
|
21191
21208
|
cancelSignal?.(() => {
|
|
21192
21209
|
stoppedSignal.stopped = true;
|
|
@@ -21215,6 +21232,7 @@ var innerRenderFrames = async ({
|
|
|
21215
21232
|
retriesLeft: MAX_RETRIES_PER_FRAME,
|
|
21216
21233
|
attempt: 1,
|
|
21217
21234
|
assets,
|
|
21235
|
+
assetIndex,
|
|
21218
21236
|
binariesDirectory,
|
|
21219
21237
|
cancelSignal,
|
|
21220
21238
|
composition,
|
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,12 @@ exports.imageSequencePatternOption = {
|
|
|
17
17
|
docLink: null,
|
|
18
18
|
type: 'string',
|
|
19
19
|
getValue: ({ commandLine }) => {
|
|
20
|
+
if (commandLine[cliFlag] !== undefined) {
|
|
21
|
+
return {
|
|
22
|
+
value: commandLine[cliFlag],
|
|
23
|
+
source: 'cli',
|
|
24
|
+
};
|
|
25
|
+
}
|
|
20
26
|
if (currentImageSequencePattern !== null) {
|
|
21
27
|
return {
|
|
22
28
|
value: currentImageSequencePattern,
|
|
@@ -24,8 +30,8 @@ exports.imageSequencePatternOption = {
|
|
|
24
30
|
};
|
|
25
31
|
}
|
|
26
32
|
return {
|
|
27
|
-
value:
|
|
28
|
-
source: '
|
|
33
|
+
value: null,
|
|
34
|
+
source: 'default',
|
|
29
35
|
};
|
|
30
36
|
},
|
|
31
37
|
setConfig: (pattern) => {
|
package/dist/options/index.d.ts
CHANGED
|
@@ -6,9 +6,9 @@ import type { Page } from './browser/BrowserPage';
|
|
|
6
6
|
import type { CountType } from './get-frame-padded-index';
|
|
7
7
|
import type { CancelSignal } from './make-cancel-signal';
|
|
8
8
|
import type { Pool } from './pool';
|
|
9
|
-
import type { FrameAndAssets, OnArtifact } from './render-frames';
|
|
9
|
+
import type { AssetIndex, FrameAndAssets, OnArtifact } from './render-frames';
|
|
10
10
|
import type { BrowserReplacer } from './replace-browser';
|
|
11
|
-
export declare const renderFrameAndRetryTargetClose: ({ retriesLeft, attempt, assets, imageFormat, binariesDirectory, cancelSignal, composition, countType, downloadMap, frameDir, framesToRender, jpegQuality, onArtifact, onDownload, onError, outputDir, poolPromise, scale, stoppedSignal, timeoutInMilliseconds, indent, logLevel, makeBrowser, makeNewPage, browserReplacer, concurrencyOrFramesToRender, framesRenderedObj, lastFrame, onFrameBuffer, onFrameUpdate, nextFrameToRender, imageSequencePattern, trimLeftOffset, trimRightOffset, allFramesAndExtraFrames, }: {
|
|
11
|
+
export declare const renderFrameAndRetryTargetClose: ({ retriesLeft, attempt, assets, assetIndex, imageFormat, binariesDirectory, cancelSignal, composition, countType, downloadMap, frameDir, framesToRender, jpegQuality, onArtifact, onDownload, onError, outputDir, poolPromise, scale, stoppedSignal, timeoutInMilliseconds, indent, logLevel, makeBrowser, makeNewPage, browserReplacer, concurrencyOrFramesToRender, framesRenderedObj, lastFrame, onFrameBuffer, onFrameUpdate, nextFrameToRender, imageSequencePattern, trimLeftOffset, trimRightOffset, allFramesAndExtraFrames, }: {
|
|
12
12
|
retriesLeft: number;
|
|
13
13
|
attempt: number;
|
|
14
14
|
imageFormat: "jpeg" | "none" | "png";
|
|
@@ -20,6 +20,7 @@ export declare const renderFrameAndRetryTargetClose: ({ retriesLeft, attempt, as
|
|
|
20
20
|
scale: number;
|
|
21
21
|
countType: CountType;
|
|
22
22
|
assets: FrameAndAssets[];
|
|
23
|
+
assetIndex: AssetIndex;
|
|
23
24
|
framesToRender: number[];
|
|
24
25
|
onArtifact: OnArtifact | null;
|
|
25
26
|
onDownload: RenderMediaOnDownload | null;
|
|
@@ -7,7 +7,7 @@ const is_delay_render_error_with_retry_1 = require("./is-delay-render-error-with
|
|
|
7
7
|
const logger_1 = require("./logger");
|
|
8
8
|
const make_cancel_signal_1 = require("./make-cancel-signal");
|
|
9
9
|
const render_frame_1 = require("./render-frame");
|
|
10
|
-
const renderFrameAndRetryTargetClose = async ({ retriesLeft, attempt, assets, imageFormat, binariesDirectory, cancelSignal, composition, countType, downloadMap, frameDir, framesToRender, jpegQuality, onArtifact, onDownload, onError, outputDir, poolPromise, scale, stoppedSignal, timeoutInMilliseconds, indent, logLevel, makeBrowser, makeNewPage, browserReplacer, concurrencyOrFramesToRender, framesRenderedObj, lastFrame, onFrameBuffer, onFrameUpdate, nextFrameToRender, imageSequencePattern, trimLeftOffset, trimRightOffset, allFramesAndExtraFrames, }) => {
|
|
10
|
+
const renderFrameAndRetryTargetClose = async ({ retriesLeft, attempt, assets, assetIndex, imageFormat, binariesDirectory, cancelSignal, composition, countType, downloadMap, frameDir, framesToRender, jpegQuality, onArtifact, onDownload, onError, outputDir, poolPromise, scale, stoppedSignal, timeoutInMilliseconds, indent, logLevel, makeBrowser, makeNewPage, browserReplacer, concurrencyOrFramesToRender, framesRenderedObj, lastFrame, onFrameBuffer, onFrameUpdate, nextFrameToRender, imageSequencePattern, trimLeftOffset, trimRightOffset, allFramesAndExtraFrames, }) => {
|
|
11
11
|
var _a;
|
|
12
12
|
const currentPool = await poolPromise;
|
|
13
13
|
if (stoppedSignal.stopped) {
|
|
@@ -23,6 +23,7 @@ const renderFrameAndRetryTargetClose = async ({ retriesLeft, attempt, assets, im
|
|
|
23
23
|
allFramesAndExtraFrames,
|
|
24
24
|
attempt,
|
|
25
25
|
assets,
|
|
26
|
+
assetIndex,
|
|
26
27
|
binariesDirectory,
|
|
27
28
|
cancelSignal,
|
|
28
29
|
countType,
|
|
@@ -90,6 +91,7 @@ const renderFrameAndRetryTargetClose = async ({ retriesLeft, attempt, assets, im
|
|
|
90
91
|
retriesLeft: actualRetriesLeft,
|
|
91
92
|
attempt: attempt + 1,
|
|
92
93
|
assets,
|
|
94
|
+
assetIndex,
|
|
93
95
|
imageFormat,
|
|
94
96
|
binariesDirectory,
|
|
95
97
|
cancelSignal,
|
|
@@ -141,6 +143,7 @@ const renderFrameAndRetryTargetClose = async ({ retriesLeft, attempt, assets, im
|
|
|
141
143
|
retriesLeft: retriesLeft - 1,
|
|
142
144
|
attempt: attempt + 1,
|
|
143
145
|
assets,
|
|
146
|
+
assetIndex,
|
|
144
147
|
binariesDirectory,
|
|
145
148
|
cancelSignal,
|
|
146
149
|
composition,
|
|
@@ -3,8 +3,8 @@ import type { DownloadMap } from './assets/download-map';
|
|
|
3
3
|
import type { Page } from './browser/BrowserPage';
|
|
4
4
|
import type { CountType } from './get-frame-padded-index';
|
|
5
5
|
import type { CancelSignal } from './make-cancel-signal';
|
|
6
|
-
import type { FrameAndAssets, OnArtifact } from './render-frames';
|
|
7
|
-
export declare const renderFrameWithOptionToReject: ({ reject, width, height, compId, attempt, stoppedSignal, indent, logLevel, timeoutInMilliseconds, outputDir, onFrameBuffer, imageFormat, onError, lastFrame, jpegQuality, frameDir, scale, countType, assets, framesToRender, onArtifact, onDownload, downloadMap, binariesDirectory, cancelSignal, framesRenderedObj, onFrameUpdate, frame, page, imageSequencePattern, fps, trimLeftOffset, trimRightOffset, allFramesAndExtraFrames, }: {
|
|
6
|
+
import type { AssetIndex, FrameAndAssets, OnArtifact } from './render-frames';
|
|
7
|
+
export declare const renderFrameWithOptionToReject: ({ reject, width, height, compId, attempt, stoppedSignal, indent, logLevel, timeoutInMilliseconds, outputDir, onFrameBuffer, imageFormat, onError, lastFrame, jpegQuality, frameDir, scale, countType, assets, assetIndex, framesToRender, onArtifact, onDownload, downloadMap, binariesDirectory, cancelSignal, framesRenderedObj, onFrameUpdate, frame, page, imageSequencePattern, fps, trimLeftOffset, trimRightOffset, allFramesAndExtraFrames, }: {
|
|
8
8
|
reject: (err: Error) => void;
|
|
9
9
|
width: number;
|
|
10
10
|
height: number;
|
|
@@ -26,6 +26,7 @@ export declare const renderFrameWithOptionToReject: ({ reject, width, height, co
|
|
|
26
26
|
scale: number;
|
|
27
27
|
countType: CountType;
|
|
28
28
|
assets: FrameAndAssets[];
|
|
29
|
+
assetIndex: AssetIndex;
|
|
29
30
|
framesToRender: number[];
|
|
30
31
|
onArtifact: OnArtifact | null;
|
|
31
32
|
onDownload: RenderMediaOnDownload | null;
|
|
@@ -14,8 +14,7 @@ const get_frame_padded_index_1 = require("./get-frame-padded-index");
|
|
|
14
14
|
const logger_1 = require("./logger");
|
|
15
15
|
const seek_to_frame_1 = require("./seek-to-frame");
|
|
16
16
|
const take_frame_1 = require("./take-frame");
|
|
17
|
-
const
|
|
18
|
-
const renderFrameWithOptionToReject = async ({ reject, width, height, compId, attempt, stoppedSignal, indent, logLevel, timeoutInMilliseconds, outputDir, onFrameBuffer, imageFormat, onError, lastFrame, jpegQuality, frameDir, scale, countType, assets, framesToRender, onArtifact, onDownload, downloadMap, binariesDirectory, cancelSignal, framesRenderedObj, onFrameUpdate, frame, page, imageSequencePattern, fps, trimLeftOffset, trimRightOffset, allFramesAndExtraFrames, }) => {
|
|
17
|
+
const renderFrameWithOptionToReject = async ({ reject, width, height, compId, attempt, stoppedSignal, indent, logLevel, timeoutInMilliseconds, outputDir, onFrameBuffer, imageFormat, onError, lastFrame, jpegQuality, frameDir, scale, countType, assets, assetIndex, framesToRender, onArtifact, onDownload, downloadMap, binariesDirectory, cancelSignal, framesRenderedObj, onFrameUpdate, frame, page, imageSequencePattern, fps, trimLeftOffset, trimRightOffset, allFramesAndExtraFrames, }) => {
|
|
19
18
|
const startTime = performance.now();
|
|
20
19
|
const index = framesToRender.indexOf(frame);
|
|
21
20
|
const assetsOnly = index === -1;
|
|
@@ -85,28 +84,20 @@ const renderFrameWithOptionToReject = async ({ reject, width, height, compId, at
|
|
|
85
84
|
}
|
|
86
85
|
await onFrameBuffer(buffer, frame);
|
|
87
86
|
}
|
|
88
|
-
const onlyAvailableAssets = assets.filter(truthy_1.truthy);
|
|
89
|
-
const previousAudioRenderAssets = onlyAvailableAssets
|
|
90
|
-
.map((a) => a.audioAndVideoAssets)
|
|
91
|
-
.flat(2);
|
|
92
|
-
const previousArtifactAssets = onlyAvailableAssets
|
|
93
|
-
.map((a) => a.artifactAssets)
|
|
94
|
-
.flat(2);
|
|
95
87
|
const audioAndVideoAssets = (0, filter_asset_types_1.onlyAudioAndVideoAssets)(collectedAssets);
|
|
96
88
|
const artifactAssets = (0, filter_asset_types_1.onlyArtifact)({
|
|
97
89
|
assets: collectedAssets,
|
|
98
90
|
frameBuffer: buffer,
|
|
99
91
|
});
|
|
100
92
|
for (const artifact of artifactAssets) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
93
|
+
const previousFrame = assetIndex.firstArtifactFrameByFilename.get(artifact.filename);
|
|
94
|
+
if (previousFrame !== undefined) {
|
|
95
|
+
return Promise.reject(new Error(`An artifact with output "${artifact.filename}" was already registered at frame ${previousFrame}, but now registered again at frame ${artifact.frame}. Artifacts must have unique names. https://remotion.dev/docs/artifacts`));
|
|
105
96
|
}
|
|
106
97
|
onArtifact === null || onArtifact === void 0 ? void 0 : onArtifact(artifact);
|
|
107
98
|
}
|
|
108
99
|
const compressedAssets = audioAndVideoAssets.map((asset) => {
|
|
109
|
-
return (0, compress_assets_1.compressAsset)(
|
|
100
|
+
return (0, compress_assets_1.compressAsset)(assetIndex.firstAssetBySrc, asset);
|
|
110
101
|
});
|
|
111
102
|
const inlineAudioAssets = (0, filter_asset_types_1.onlyInlineAudio)(collectedAssets);
|
|
112
103
|
const outputFrame = allFramesAndExtraFrames[0] + allFramesAndExtraFrames.indexOf(frame);
|
|
@@ -121,6 +112,16 @@ const renderFrameWithOptionToReject = async ({ reject, width, height, compId, at
|
|
|
121
112
|
}),
|
|
122
113
|
inlineAudioAssets,
|
|
123
114
|
});
|
|
115
|
+
for (const asset of compressedAssets) {
|
|
116
|
+
if (asset.src.length >= 400 && !assetIndex.firstAssetBySrc.has(asset.src)) {
|
|
117
|
+
assetIndex.firstAssetBySrc.set(asset.src, asset);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
for (const artifact of artifactAssets) {
|
|
121
|
+
if (!assetIndex.firstArtifactFrameByFilename.has(artifact.filename)) {
|
|
122
|
+
assetIndex.firstArtifactFrameByFilename.set(artifact.filename, artifact.frame);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
124
125
|
for (const renderAsset of compressedAssets) {
|
|
125
126
|
(0, download_and_map_assets_to_file_1.downloadAndMapAssetsToFileUrl)({
|
|
126
127
|
renderAsset,
|
package/dist/render-frame.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import type { DownloadMap } from './assets/download-map';
|
|
|
4
4
|
import type { Page } from './browser/BrowserPage';
|
|
5
5
|
import type { CountType } from './get-frame-padded-index';
|
|
6
6
|
import type { CancelSignal } from './make-cancel-signal';
|
|
7
|
-
import type { FrameAndAssets, OnArtifact } from './render-frames';
|
|
8
|
-
export declare const renderFrame: ({ attempt, binariesDirectory, cancelSignal, imageFormat, indent, logLevel, assets, countType, downloadMap, frameDir, framesToRender, jpegQuality, onArtifact, onDownload, scale, composition, onError, outputDir, stoppedSignal, timeoutInMilliseconds, lastFrame, onFrameBuffer, onFrameUpdate, framesRenderedObj, frame, page, imageSequencePattern, trimLeftOffset, trimRightOffset, allFramesAndExtraFrames, }: {
|
|
7
|
+
import type { AssetIndex, FrameAndAssets, OnArtifact } from './render-frames';
|
|
8
|
+
export declare const renderFrame: ({ attempt, binariesDirectory, cancelSignal, imageFormat, indent, logLevel, assets, assetIndex, countType, downloadMap, frameDir, framesToRender, jpegQuality, onArtifact, onDownload, scale, composition, onError, outputDir, stoppedSignal, timeoutInMilliseconds, lastFrame, onFrameBuffer, onFrameUpdate, framesRenderedObj, frame, page, imageSequencePattern, trimLeftOffset, trimRightOffset, allFramesAndExtraFrames, }: {
|
|
9
9
|
attempt: number;
|
|
10
10
|
indent: boolean;
|
|
11
11
|
logLevel: "error" | "info" | "trace" | "verbose" | "warn";
|
|
@@ -17,6 +17,7 @@ export declare const renderFrame: ({ attempt, binariesDirectory, cancelSignal, i
|
|
|
17
17
|
scale: number;
|
|
18
18
|
countType: CountType;
|
|
19
19
|
assets: FrameAndAssets[];
|
|
20
|
+
assetIndex: AssetIndex;
|
|
20
21
|
framesToRender: number[];
|
|
21
22
|
onArtifact: OnArtifact | null;
|
|
22
23
|
onDownload: RenderMediaOnDownload | null;
|
package/dist/render-frame.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.renderFrame = void 0;
|
|
4
4
|
const render_frame_with_option_to_reject_1 = require("./render-frame-with-option-to-reject");
|
|
5
|
-
const renderFrame = ({ attempt, binariesDirectory, cancelSignal, imageFormat, indent, logLevel, assets, countType, downloadMap, frameDir, framesToRender, jpegQuality, onArtifact, onDownload, scale, composition, onError, outputDir, stoppedSignal, timeoutInMilliseconds, lastFrame, onFrameBuffer, onFrameUpdate, framesRenderedObj, frame, page, imageSequencePattern, trimLeftOffset, trimRightOffset, allFramesAndExtraFrames, }) => {
|
|
5
|
+
const renderFrame = ({ attempt, binariesDirectory, cancelSignal, imageFormat, indent, logLevel, assets, assetIndex, countType, downloadMap, frameDir, framesToRender, jpegQuality, onArtifact, onDownload, scale, composition, onError, outputDir, stoppedSignal, timeoutInMilliseconds, lastFrame, onFrameBuffer, onFrameUpdate, framesRenderedObj, frame, page, imageSequencePattern, trimLeftOffset, trimRightOffset, allFramesAndExtraFrames, }) => {
|
|
6
6
|
return new Promise((resolve, reject) => {
|
|
7
7
|
(0, render_frame_with_option_to_reject_1.renderFrameWithOptionToReject)({
|
|
8
8
|
reject,
|
|
@@ -18,6 +18,7 @@ const renderFrame = ({ attempt, binariesDirectory, cancelSignal, imageFormat, in
|
|
|
18
18
|
onFrameBuffer,
|
|
19
19
|
outputDir,
|
|
20
20
|
assets,
|
|
21
|
+
assetIndex,
|
|
21
22
|
binariesDirectory,
|
|
22
23
|
cancelSignal,
|
|
23
24
|
countType,
|
package/dist/render-frames.d.ts
CHANGED
|
@@ -57,6 +57,10 @@ export type FrameAndAssets = {
|
|
|
57
57
|
artifactAssets: ArtifactWithoutContent[];
|
|
58
58
|
inlineAudioAssets: InlineAudioAsset[];
|
|
59
59
|
};
|
|
60
|
+
export type AssetIndex = {
|
|
61
|
+
firstAssetBySrc: Map<string, AudioOrVideoAsset>;
|
|
62
|
+
firstArtifactFrameByFilename: Map<string, number>;
|
|
63
|
+
};
|
|
60
64
|
type Prettify<T> = {
|
|
61
65
|
[K in keyof T]: T[K];
|
|
62
66
|
} & {};
|
package/dist/render-frames.js
CHANGED
|
@@ -126,6 +126,10 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
|
|
|
126
126
|
resolvedConcurrency,
|
|
127
127
|
});
|
|
128
128
|
const assets = [];
|
|
129
|
+
const assetIndex = {
|
|
130
|
+
firstAssetBySrc: new Map(),
|
|
131
|
+
firstArtifactFrameByFilename: new Map(),
|
|
132
|
+
};
|
|
129
133
|
const stoppedSignal = { stopped: false };
|
|
130
134
|
cancelSignal === null || cancelSignal === void 0 ? void 0 : cancelSignal(() => {
|
|
131
135
|
stoppedSignal.stopped = true;
|
|
@@ -163,6 +167,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
|
|
|
163
167
|
retriesLeft: MAX_RETRIES_PER_FRAME,
|
|
164
168
|
attempt: 1,
|
|
165
169
|
assets,
|
|
170
|
+
assetIndex,
|
|
166
171
|
binariesDirectory,
|
|
167
172
|
cancelSignal,
|
|
168
173
|
composition,
|
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.
|
|
6
|
+
"version": "4.0.533",
|
|
7
7
|
"description": "Render Remotion videos using Node.js or Bun",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"execa": "5.1.1",
|
|
25
|
-
"remotion": "4.0.
|
|
26
|
-
"@remotion/streaming": "4.0.
|
|
25
|
+
"remotion": "4.0.533",
|
|
26
|
+
"@remotion/streaming": "4.0.533",
|
|
27
27
|
"source-map": "0.8.0",
|
|
28
28
|
"ws": "8.21.0",
|
|
29
|
-
"@remotion/licensing": "4.0.
|
|
29
|
+
"@remotion/licensing": "4.0.533"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": ">=16.8.0",
|
|
@@ -40,19 +40,19 @@
|
|
|
40
40
|
"react-dom": "19.2.3",
|
|
41
41
|
"@typescript/native-preview": "7.0.0-dev.20260217.1",
|
|
42
42
|
"@types/ws": "8.5.10",
|
|
43
|
-
"@remotion/example-videos": "4.0.
|
|
44
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
43
|
+
"@remotion/example-videos": "4.0.533",
|
|
44
|
+
"@remotion/eslint-config-internal": "4.0.533",
|
|
45
45
|
"eslint": "9.19.0",
|
|
46
46
|
"@types/node": "20.12.14"
|
|
47
47
|
},
|
|
48
48
|
"optionalDependencies": {
|
|
49
|
-
"@remotion/compositor-darwin-arm64": "4.0.
|
|
50
|
-
"@remotion/compositor-darwin-x64": "4.0.
|
|
51
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.
|
|
52
|
-
"@remotion/compositor-linux-arm64-musl": "4.0.
|
|
53
|
-
"@remotion/compositor-linux-x64-gnu": "4.0.
|
|
54
|
-
"@remotion/compositor-linux-x64-musl": "4.0.
|
|
55
|
-
"@remotion/compositor-win32-x64-msvc": "4.0.
|
|
49
|
+
"@remotion/compositor-darwin-arm64": "4.0.533",
|
|
50
|
+
"@remotion/compositor-darwin-x64": "4.0.533",
|
|
51
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.533",
|
|
52
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.533",
|
|
53
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.533",
|
|
54
|
+
"@remotion/compositor-linux-x64-musl": "4.0.533",
|
|
55
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.533"
|
|
56
56
|
},
|
|
57
57
|
"keywords": [
|
|
58
58
|
"remotion",
|