@remotion/vercel 4.0.533 → 4.0.534
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/esm/index.mjs +155 -0
- package/dist/render-media-on-vercel.d.ts +1 -0
- package/package.json +4 -4
package/dist/esm/index.mjs
CHANGED
|
@@ -115,6 +115,80 @@ import { statSync } from "fs";
|
|
|
115
115
|
import { RenderInternals } from "@remotion/renderer";
|
|
116
116
|
|
|
117
117
|
// ../core/dist/esm/no-react.mjs
|
|
118
|
+
var evaluateSourceNumericValue = (expression, config) => {
|
|
119
|
+
if (typeof expression === "number") {
|
|
120
|
+
return expression;
|
|
121
|
+
}
|
|
122
|
+
if (expression.type === "literal") {
|
|
123
|
+
return expression.value;
|
|
124
|
+
}
|
|
125
|
+
if (expression.type === "binary") {
|
|
126
|
+
const left = evaluateSourceNumericValue(expression.left, config);
|
|
127
|
+
const right = evaluateSourceNumericValue(expression.right, config);
|
|
128
|
+
switch (expression.operator) {
|
|
129
|
+
case "+":
|
|
130
|
+
return left + right;
|
|
131
|
+
case "-":
|
|
132
|
+
return left - right;
|
|
133
|
+
case "*":
|
|
134
|
+
return left * right;
|
|
135
|
+
case "/":
|
|
136
|
+
return left / right;
|
|
137
|
+
default:
|
|
138
|
+
throw new Error("Unknown source expression operator");
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const value = expression.binding.type === "constant" ? expression.binding.value : config?.[expression.binding.field] ?? NaN;
|
|
142
|
+
if (expression.type === "video-config-multiplication") {
|
|
143
|
+
return value * expression.multiplier;
|
|
144
|
+
}
|
|
145
|
+
if (expression.type === "video-config-subtraction") {
|
|
146
|
+
return value - expression.subtrahend;
|
|
147
|
+
}
|
|
148
|
+
return value;
|
|
149
|
+
};
|
|
150
|
+
var evaluatedProps = new WeakMap;
|
|
151
|
+
var evaluateSourcePropStatuses = (props, config) => {
|
|
152
|
+
const configKey = config === null ? "" : \`\${config.durationInFrames}:\${config.fps}:\${config.width}:\${config.height}\`;
|
|
153
|
+
const cached = evaluatedProps.get(props) ?? new Map;
|
|
154
|
+
const existing = cached.get(configKey);
|
|
155
|
+
if (existing)
|
|
156
|
+
return existing;
|
|
157
|
+
const result = Object.fromEntries(Object.entries(props).map(([key, status]) => {
|
|
158
|
+
if (status.status === "computed") {
|
|
159
|
+
return [key, status];
|
|
160
|
+
}
|
|
161
|
+
const adjustment = status.keyframeDisplayOffsetAdjustment === null ? null : evaluateSourceNumericValue(status.keyframeDisplayOffsetAdjustment, config);
|
|
162
|
+
const rate = evaluateSourceNumericValue(status.keyframePlaybackRateAdjustment ?? 1, config);
|
|
163
|
+
if (adjustment !== null && !Number.isFinite(adjustment) || !Number.isFinite(rate) || rate <= 0) {
|
|
164
|
+
return [key, { status: "computed" }];
|
|
165
|
+
}
|
|
166
|
+
const timing = {
|
|
167
|
+
keyframeDisplayOffsetAdjustment: adjustment,
|
|
168
|
+
...status.keyframePlaybackRateAdjustment === undefined ? {} : { keyframePlaybackRateAdjustment: rate }
|
|
169
|
+
};
|
|
170
|
+
if (status.status === "static") {
|
|
171
|
+
const value = status.numericExpression === undefined ? status.codeValue : evaluateSourceNumericValue(status.numericExpression, config);
|
|
172
|
+
return [
|
|
173
|
+
key,
|
|
174
|
+
status.numericExpression !== undefined && !Number.isFinite(value) ? { status: "computed" } : { ...status, ...timing, codeValue: value }
|
|
175
|
+
];
|
|
176
|
+
}
|
|
177
|
+
const keyframes = status.keyframes.map((keyframe) => ({
|
|
178
|
+
...keyframe,
|
|
179
|
+
frame: evaluateSourceNumericValue(keyframe.frame, config)
|
|
180
|
+
}));
|
|
181
|
+
if (keyframes.some((keyframe, index) => !Number.isFinite(keyframe.frame) || index > 0 && keyframe.frame <= keyframes[index - 1].frame)) {
|
|
182
|
+
return [key, { status: "computed" }];
|
|
183
|
+
}
|
|
184
|
+
return [key, { ...status, ...timing, keyframes }];
|
|
185
|
+
}));
|
|
186
|
+
cached.set(configKey, result);
|
|
187
|
+
if (cached.size > 8)
|
|
188
|
+
cached.delete(cached.keys().next().value);
|
|
189
|
+
evaluatedProps.set(props, cached);
|
|
190
|
+
return result;
|
|
191
|
+
};
|
|
118
192
|
var NEWTON_ITERATIONS = 4;
|
|
119
193
|
var NEWTON_MIN_SLOPE = 0.001;
|
|
120
194
|
var SUBDIVISION_PRECISION = 0.0000001;
|
|
@@ -2473,6 +2547,8 @@ var getOffthreadVideoSource = ({
|
|
|
2473
2547
|
return \`http://localhost:\${window.remotion_proxyPort}/proxy?src=\${encodeURIComponent(getAbsoluteSrc(src))}&time=\${encodeURIComponent(Math.max(0, currentTime))}&transparent=\${String(transparent)}&toneMapped=\${String(toneMapped)}\`;
|
|
2474
2548
|
};
|
|
2475
2549
|
var NoReactInternals = {
|
|
2550
|
+
evaluateSourceNumericValue,
|
|
2551
|
+
evaluateSourcePropStatuses,
|
|
2476
2552
|
processColor,
|
|
2477
2553
|
truthy,
|
|
2478
2554
|
validateFps,
|
|
@@ -2620,6 +2696,80 @@ import { RenderInternals } from "@remotion/renderer";
|
|
|
2620
2696
|
import { put } from "@vercel/blob";
|
|
2621
2697
|
|
|
2622
2698
|
// ../core/dist/esm/no-react.mjs
|
|
2699
|
+
var evaluateSourceNumericValue = (expression, config) => {
|
|
2700
|
+
if (typeof expression === "number") {
|
|
2701
|
+
return expression;
|
|
2702
|
+
}
|
|
2703
|
+
if (expression.type === "literal") {
|
|
2704
|
+
return expression.value;
|
|
2705
|
+
}
|
|
2706
|
+
if (expression.type === "binary") {
|
|
2707
|
+
const left = evaluateSourceNumericValue(expression.left, config);
|
|
2708
|
+
const right = evaluateSourceNumericValue(expression.right, config);
|
|
2709
|
+
switch (expression.operator) {
|
|
2710
|
+
case "+":
|
|
2711
|
+
return left + right;
|
|
2712
|
+
case "-":
|
|
2713
|
+
return left - right;
|
|
2714
|
+
case "*":
|
|
2715
|
+
return left * right;
|
|
2716
|
+
case "/":
|
|
2717
|
+
return left / right;
|
|
2718
|
+
default:
|
|
2719
|
+
throw new Error("Unknown source expression operator");
|
|
2720
|
+
}
|
|
2721
|
+
}
|
|
2722
|
+
const value = expression.binding.type === "constant" ? expression.binding.value : config?.[expression.binding.field] ?? NaN;
|
|
2723
|
+
if (expression.type === "video-config-multiplication") {
|
|
2724
|
+
return value * expression.multiplier;
|
|
2725
|
+
}
|
|
2726
|
+
if (expression.type === "video-config-subtraction") {
|
|
2727
|
+
return value - expression.subtrahend;
|
|
2728
|
+
}
|
|
2729
|
+
return value;
|
|
2730
|
+
};
|
|
2731
|
+
var evaluatedProps = new WeakMap;
|
|
2732
|
+
var evaluateSourcePropStatuses = (props, config) => {
|
|
2733
|
+
const configKey = config === null ? "" : \`\${config.durationInFrames}:\${config.fps}:\${config.width}:\${config.height}\`;
|
|
2734
|
+
const cached = evaluatedProps.get(props) ?? new Map;
|
|
2735
|
+
const existing = cached.get(configKey);
|
|
2736
|
+
if (existing)
|
|
2737
|
+
return existing;
|
|
2738
|
+
const result = Object.fromEntries(Object.entries(props).map(([key, status]) => {
|
|
2739
|
+
if (status.status === "computed") {
|
|
2740
|
+
return [key, status];
|
|
2741
|
+
}
|
|
2742
|
+
const adjustment = status.keyframeDisplayOffsetAdjustment === null ? null : evaluateSourceNumericValue(status.keyframeDisplayOffsetAdjustment, config);
|
|
2743
|
+
const rate = evaluateSourceNumericValue(status.keyframePlaybackRateAdjustment ?? 1, config);
|
|
2744
|
+
if (adjustment !== null && !Number.isFinite(adjustment) || !Number.isFinite(rate) || rate <= 0) {
|
|
2745
|
+
return [key, { status: "computed" }];
|
|
2746
|
+
}
|
|
2747
|
+
const timing = {
|
|
2748
|
+
keyframeDisplayOffsetAdjustment: adjustment,
|
|
2749
|
+
...status.keyframePlaybackRateAdjustment === undefined ? {} : { keyframePlaybackRateAdjustment: rate }
|
|
2750
|
+
};
|
|
2751
|
+
if (status.status === "static") {
|
|
2752
|
+
const value = status.numericExpression === undefined ? status.codeValue : evaluateSourceNumericValue(status.numericExpression, config);
|
|
2753
|
+
return [
|
|
2754
|
+
key,
|
|
2755
|
+
status.numericExpression !== undefined && !Number.isFinite(value) ? { status: "computed" } : { ...status, ...timing, codeValue: value }
|
|
2756
|
+
];
|
|
2757
|
+
}
|
|
2758
|
+
const keyframes = status.keyframes.map((keyframe) => ({
|
|
2759
|
+
...keyframe,
|
|
2760
|
+
frame: evaluateSourceNumericValue(keyframe.frame, config)
|
|
2761
|
+
}));
|
|
2762
|
+
if (keyframes.some((keyframe, index) => !Number.isFinite(keyframe.frame) || index > 0 && keyframe.frame <= keyframes[index - 1].frame)) {
|
|
2763
|
+
return [key, { status: "computed" }];
|
|
2764
|
+
}
|
|
2765
|
+
return [key, { ...status, ...timing, keyframes }];
|
|
2766
|
+
}));
|
|
2767
|
+
cached.set(configKey, result);
|
|
2768
|
+
if (cached.size > 8)
|
|
2769
|
+
cached.delete(cached.keys().next().value);
|
|
2770
|
+
evaluatedProps.set(props, cached);
|
|
2771
|
+
return result;
|
|
2772
|
+
};
|
|
2623
2773
|
var NEWTON_ITERATIONS = 4;
|
|
2624
2774
|
var NEWTON_MIN_SLOPE = 0.001;
|
|
2625
2775
|
var SUBDIVISION_PRECISION = 0.0000001;
|
|
@@ -4978,6 +5128,8 @@ var getOffthreadVideoSource = ({
|
|
|
4978
5128
|
return \`http://localhost:\${window.remotion_proxyPort}/proxy?src=\${encodeURIComponent(getAbsoluteSrc(src))}&time=\${encodeURIComponent(Math.max(0, currentTime))}&transparent=\${String(transparent)}&toneMapped=\${String(toneMapped)}\`;
|
|
4979
5129
|
};
|
|
4980
5130
|
var NoReactInternals = {
|
|
5131
|
+
evaluateSourceNumericValue,
|
|
5132
|
+
evaluateSourcePropStatuses,
|
|
4981
5133
|
processColor,
|
|
4982
5134
|
truthy,
|
|
4983
5135
|
validateFps,
|
|
@@ -5132,6 +5284,7 @@ try {
|
|
|
5132
5284
|
preferLossless: config.preferLossless,
|
|
5133
5285
|
enforceAudioTrack: config.enforceAudioTrack,
|
|
5134
5286
|
disallowParallelEncoding: config.disallowParallelEncoding,
|
|
5287
|
+
disableSharedMemoryCapture: config.disableSharedMemoryCapture,
|
|
5135
5288
|
concurrency: config.concurrency,
|
|
5136
5289
|
binariesDirectory: config.binariesDirectory,
|
|
5137
5290
|
metadata: config.metadata,
|
|
@@ -5625,6 +5778,7 @@ var internalRenderMediaOnVercel = async (options) => {
|
|
|
5625
5778
|
preferLossless = false,
|
|
5626
5779
|
enforceAudioTrack = false,
|
|
5627
5780
|
disallowParallelEncoding = false,
|
|
5781
|
+
disableSharedMemoryCapture = false,
|
|
5628
5782
|
concurrency,
|
|
5629
5783
|
metadata,
|
|
5630
5784
|
licenseKey,
|
|
@@ -5674,6 +5828,7 @@ var internalRenderMediaOnVercel = async (options) => {
|
|
|
5674
5828
|
preferLossless,
|
|
5675
5829
|
enforceAudioTrack,
|
|
5676
5830
|
disallowParallelEncoding,
|
|
5831
|
+
disableSharedMemoryCapture,
|
|
5677
5832
|
concurrency: concurrency ?? null,
|
|
5678
5833
|
metadata: metadata ?? null,
|
|
5679
5834
|
licenseKey: licenseKey ?? null,
|
|
@@ -19,6 +19,7 @@ type RenderMediaOnVercelBaseOptions = {
|
|
|
19
19
|
preferLossless?: boolean;
|
|
20
20
|
enforceAudioTrack?: boolean;
|
|
21
21
|
disallowParallelEncoding?: boolean;
|
|
22
|
+
disableSharedMemoryCapture?: boolean;
|
|
22
23
|
concurrency?: number | string | null;
|
|
23
24
|
metadata?: Record<string, string> | null;
|
|
24
25
|
licenseKey?: string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/vercel",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.534",
|
|
4
4
|
"description": "Render Remotion videos on Vercel Sandbox",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@remotion/renderer": "4.0.
|
|
27
|
-
"remotion": "4.0.
|
|
26
|
+
"@remotion/renderer": "4.0.534",
|
|
27
|
+
"remotion": "4.0.534"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@vercel/sandbox": ">=1.0.0"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"./package.json": "./package.json"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
41
|
+
"@remotion/eslint-config-internal": "4.0.534",
|
|
42
42
|
"@vercel/blob": "2.3.0",
|
|
43
43
|
"@vercel/sandbox": "1.6.0",
|
|
44
44
|
"eslint": "9.19.0",
|