@remotion/renderer 4.0.489 → 4.0.491
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/calculate-asset-positions.js +57 -31
- package/dist/client.d.ts +0 -32
- package/dist/esm/client.mjs +810 -882
- package/dist/esm/index.mjs +49 -27
- package/dist/options/index.d.ts +0 -32
- package/dist/options/index.js +0 -4
- package/package.json +13 -13
package/dist/esm/index.mjs
CHANGED
|
@@ -22102,38 +22102,61 @@ var uncompressMediaAsset = (allRenderAssets, assetToUncompress) => {
|
|
|
22102
22102
|
};
|
|
22103
22103
|
|
|
22104
22104
|
// src/assets/calculate-asset-positions.ts
|
|
22105
|
-
var
|
|
22106
|
-
return a.id === b.id;
|
|
22107
|
-
};
|
|
22108
|
-
var findFrom = (target, renderAsset) => {
|
|
22109
|
-
const index = target.findIndex((a) => areEqual(a, renderAsset));
|
|
22110
|
-
if (index === -1) {
|
|
22111
|
-
return false;
|
|
22112
|
-
}
|
|
22113
|
-
target.splice(index, 1);
|
|
22114
|
-
return true;
|
|
22115
|
-
};
|
|
22116
|
-
var copyAndDeduplicateAssets = (renderAssets) => {
|
|
22105
|
+
var deduplicateAssets = (renderAssets) => {
|
|
22117
22106
|
const onlyAudioAndVideo = onlyAudioAndVideoAssets(renderAssets);
|
|
22107
|
+
const seenIds = new Set;
|
|
22118
22108
|
const deduplicated = [];
|
|
22119
22109
|
for (const renderAsset of onlyAudioAndVideo) {
|
|
22120
|
-
if (!
|
|
22110
|
+
if (!seenIds.has(renderAsset.id)) {
|
|
22111
|
+
seenIds.add(renderAsset.id);
|
|
22121
22112
|
deduplicated.push(renderAsset);
|
|
22122
22113
|
}
|
|
22123
22114
|
}
|
|
22124
22115
|
return deduplicated;
|
|
22125
22116
|
};
|
|
22117
|
+
var indexUncompressedAssets = (renderAssets) => {
|
|
22118
|
+
const referencedAssets = new Set;
|
|
22119
|
+
for (const renderAsset of renderAssets) {
|
|
22120
|
+
if (renderAsset.src.startsWith("same-as")) {
|
|
22121
|
+
referencedAssets.add(renderAsset.src);
|
|
22122
|
+
}
|
|
22123
|
+
}
|
|
22124
|
+
const assetsByReference = new Map;
|
|
22125
|
+
for (const renderAsset of renderAssets) {
|
|
22126
|
+
if (referencedAssets.size === 0) {
|
|
22127
|
+
break;
|
|
22128
|
+
}
|
|
22129
|
+
if (renderAsset.src.startsWith("same-as")) {
|
|
22130
|
+
continue;
|
|
22131
|
+
}
|
|
22132
|
+
const reference = `same-as-${renderAsset.id}-${renderAsset.frame}`;
|
|
22133
|
+
if (referencedAssets.has(reference)) {
|
|
22134
|
+
assetsByReference.set(reference, renderAsset);
|
|
22135
|
+
referencedAssets.delete(reference);
|
|
22136
|
+
}
|
|
22137
|
+
}
|
|
22138
|
+
return assetsByReference;
|
|
22139
|
+
};
|
|
22126
22140
|
var calculateAssetPositions = (frames) => {
|
|
22127
22141
|
const assets = [];
|
|
22142
|
+
const openAssets = new Map;
|
|
22128
22143
|
const flattened = frames.flat(1);
|
|
22144
|
+
const uncompressedAssets = indexUncompressedAssets(flattened);
|
|
22129
22145
|
for (let frame = 0;frame < frames.length; frame++) {
|
|
22130
|
-
const
|
|
22131
|
-
const
|
|
22132
|
-
const
|
|
22146
|
+
const current = deduplicateAssets(frames[frame]);
|
|
22147
|
+
const currentIds = new Set(current.map((a) => a.id));
|
|
22148
|
+
for (const [id, openAsset] of openAssets) {
|
|
22149
|
+
if (!currentIds.has(id)) {
|
|
22150
|
+
openAsset.duration = frame - openAsset.startInVideo;
|
|
22151
|
+
openAssets.delete(id);
|
|
22152
|
+
}
|
|
22153
|
+
}
|
|
22133
22154
|
for (const asset of current) {
|
|
22134
|
-
|
|
22135
|
-
|
|
22136
|
-
|
|
22155
|
+
let openAsset = openAssets.get(asset.id);
|
|
22156
|
+
if (openAsset === undefined) {
|
|
22157
|
+
const uncompressedAsset = uncompressedAssets.get(asset.src);
|
|
22158
|
+
openAsset = {
|
|
22159
|
+
src: resolveAssetSrc(uncompressMediaAsset(uncompressedAsset ? [uncompressedAsset] : flattened, asset).src),
|
|
22137
22160
|
type: asset.type,
|
|
22138
22161
|
duration: null,
|
|
22139
22162
|
id: asset.id,
|
|
@@ -22144,17 +22167,16 @@ var calculateAssetPositions = (frames) => {
|
|
|
22144
22167
|
toneFrequency: asset.toneFrequency,
|
|
22145
22168
|
audioStartFrame: asset.audioStartFrame,
|
|
22146
22169
|
audioStreamIndex: asset.audioStreamIndex
|
|
22147
|
-
}
|
|
22148
|
-
|
|
22149
|
-
|
|
22150
|
-
if (!found)
|
|
22151
|
-
throw new Error("something wrong");
|
|
22152
|
-
if (!findFrom(next, asset)) {
|
|
22153
|
-
found.duration = frame - found.startInVideo + 1;
|
|
22170
|
+
};
|
|
22171
|
+
assets.push(openAsset);
|
|
22172
|
+
openAssets.set(asset.id, openAsset);
|
|
22154
22173
|
}
|
|
22155
|
-
|
|
22174
|
+
openAsset.volume.push(asset.volume);
|
|
22156
22175
|
}
|
|
22157
22176
|
}
|
|
22177
|
+
for (const openAsset of openAssets.values()) {
|
|
22178
|
+
openAsset.duration = frames.length - openAsset.startInVideo;
|
|
22179
|
+
}
|
|
22158
22180
|
for (const asset of assets) {
|
|
22159
22181
|
if (asset.duration === null) {
|
|
22160
22182
|
throw new Error("duration is unexpectedly null");
|
package/dist/options/index.d.ts
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
import type { AnyRemotionOption } from './option';
|
|
2
2
|
export declare const allOptions: {
|
|
3
|
-
allowHtmlInCanvasOption: {
|
|
4
|
-
name: string;
|
|
5
|
-
cliFlag: "allow-html-in-canvas";
|
|
6
|
-
description: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
ssrName: null;
|
|
8
|
-
docLink: string;
|
|
9
|
-
type: boolean;
|
|
10
|
-
getValue: ({ commandLine }: {
|
|
11
|
-
commandLine: Record<string, unknown>;
|
|
12
|
-
}) => {
|
|
13
|
-
value: boolean;
|
|
14
|
-
source: string;
|
|
15
|
-
};
|
|
16
|
-
setConfig(value: boolean): void;
|
|
17
|
-
id: "allow-html-in-canvas";
|
|
18
|
-
};
|
|
19
3
|
audioCodecOption: {
|
|
20
4
|
cliFlag: "audio-codec";
|
|
21
5
|
setConfig: (audioCodec: "aac" | "mp3" | "opus" | "pcm-16" | null) => void;
|
|
@@ -1110,22 +1094,6 @@ export declare const allOptions: {
|
|
|
1110
1094
|
setConfig(value: boolean): void;
|
|
1111
1095
|
id: "disable-interactivity";
|
|
1112
1096
|
};
|
|
1113
|
-
experimentalClientSideRenderingOption: {
|
|
1114
|
-
name: string;
|
|
1115
|
-
cliFlag: "enable-experimental-client-side-rendering";
|
|
1116
|
-
description: () => import("react/jsx-runtime").JSX.Element;
|
|
1117
|
-
ssrName: null;
|
|
1118
|
-
docLink: string;
|
|
1119
|
-
type: boolean;
|
|
1120
|
-
getValue: ({ commandLine }: {
|
|
1121
|
-
commandLine: Record<string, unknown>;
|
|
1122
|
-
}) => {
|
|
1123
|
-
value: boolean;
|
|
1124
|
-
source: string;
|
|
1125
|
-
};
|
|
1126
|
-
setConfig(value: boolean): void;
|
|
1127
|
-
id: "enable-experimental-client-side-rendering";
|
|
1128
|
-
};
|
|
1129
1097
|
keyboardShortcutsOption: {
|
|
1130
1098
|
name: string;
|
|
1131
1099
|
cliFlag: "disable-keyboard-shortcuts";
|
package/dist/options/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.allOptions = void 0;
|
|
4
|
-
const allow_html_in_canvas_1 = require("./allow-html-in-canvas");
|
|
5
4
|
const api_key_1 = require("./api-key");
|
|
6
5
|
const ask_ai_1 = require("./ask-ai");
|
|
7
6
|
const audio_bitrate_1 = require("./audio-bitrate");
|
|
@@ -30,7 +29,6 @@ const encoding_max_rate_1 = require("./encoding-max-rate");
|
|
|
30
29
|
const enforce_audio_1 = require("./enforce-audio");
|
|
31
30
|
const env_file_1 = require("./env-file");
|
|
32
31
|
const every_nth_frame_1 = require("./every-nth-frame");
|
|
33
|
-
const experimental_client_side_rendering_1 = require("./experimental-client-side-rendering");
|
|
34
32
|
const folder_expiry_1 = require("./folder-expiry");
|
|
35
33
|
const for_seamless_aac_concatenation_1 = require("./for-seamless-aac-concatenation");
|
|
36
34
|
const force_new_studio_1 = require("./force-new-studio");
|
|
@@ -94,7 +92,6 @@ const webhook_custom_data_1 = require("./webhook-custom-data");
|
|
|
94
92
|
const webpack_poll_1 = require("./webpack-poll");
|
|
95
93
|
const x264_preset_1 = require("./x264-preset");
|
|
96
94
|
exports.allOptions = {
|
|
97
|
-
allowHtmlInCanvasOption: allow_html_in_canvas_1.allowHtmlInCanvasOption,
|
|
98
95
|
audioCodecOption: audio_codec_1.audioCodecOption,
|
|
99
96
|
benchmarkConcurrenciesOption: benchmark_concurrencies_1.benchmarkConcurrenciesOption,
|
|
100
97
|
browserExecutableOption: browser_executable_1.browserExecutableOption,
|
|
@@ -159,7 +156,6 @@ exports.allOptions = {
|
|
|
159
156
|
isProductionOption: is_production_1.isProductionOption,
|
|
160
157
|
askAIOption: ask_ai_1.askAIOption,
|
|
161
158
|
interactivityOption: interactivity_1.interactivityOption,
|
|
162
|
-
experimentalClientSideRenderingOption: experimental_client_side_rendering_1.experimentalClientSideRenderingOption,
|
|
163
159
|
keyboardShortcutsOption: keyboard_shortcuts_1.keyboardShortcutsOption,
|
|
164
160
|
framesOption: frames_1.framesOption,
|
|
165
161
|
forceNewStudioOption: force_new_studio_1.forceNewStudioOption,
|
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.491",
|
|
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.491",
|
|
26
|
+
"@remotion/streaming": "4.0.491",
|
|
27
27
|
"source-map": "0.8.0-beta.0",
|
|
28
28
|
"ws": "8.21.0",
|
|
29
|
-
"@remotion/licensing": "4.0.
|
|
29
|
+
"@remotion/licensing": "4.0.491"
|
|
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.491",
|
|
44
|
+
"@remotion/eslint-config-internal": "4.0.491",
|
|
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.491",
|
|
50
|
+
"@remotion/compositor-darwin-x64": "4.0.491",
|
|
51
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.491",
|
|
52
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.491",
|
|
53
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.491",
|
|
54
|
+
"@remotion/compositor-linux-x64-musl": "4.0.491",
|
|
55
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.491"
|
|
56
56
|
},
|
|
57
57
|
"keywords": [
|
|
58
58
|
"remotion",
|