@remotion/serverless-client 4.0.438 → 4.0.440
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 +177 -2
- package/dist/validate-outname.d.ts +1 -1
- package/package.json +5 -5
package/dist/esm/index.mjs
CHANGED
|
@@ -197,6 +197,10 @@ var PERCENTAGE = NUMBER + "%";
|
|
|
197
197
|
function call(...args) {
|
|
198
198
|
return "\\(\\s*(" + args.join(")\\s*,\\s*(") + ")\\s*\\)";
|
|
199
199
|
}
|
|
200
|
+
var MODERN_VALUE = "(?:none|[-+]?\\d*\\.?\\d+(?:%|deg|rad|grad|turn)?)";
|
|
201
|
+
function modernColorCall(name) {
|
|
202
|
+
return new RegExp(name + "\\(\\s*(" + MODERN_VALUE + ")\\s+(" + MODERN_VALUE + ")\\s+(" + MODERN_VALUE + ")(?:\\s*\\/\\s*(" + MODERN_VALUE + "))?\\s*\\)");
|
|
203
|
+
}
|
|
200
204
|
function getMatchers() {
|
|
201
205
|
const cachedMatchers = {
|
|
202
206
|
rgb: undefined,
|
|
@@ -207,7 +211,12 @@ function getMatchers() {
|
|
|
207
211
|
hex4: undefined,
|
|
208
212
|
hex5: undefined,
|
|
209
213
|
hex6: undefined,
|
|
210
|
-
hex8: undefined
|
|
214
|
+
hex8: undefined,
|
|
215
|
+
oklch: undefined,
|
|
216
|
+
oklab: undefined,
|
|
217
|
+
lab: undefined,
|
|
218
|
+
lch: undefined,
|
|
219
|
+
hwb: undefined
|
|
211
220
|
};
|
|
212
221
|
if (cachedMatchers.rgb === undefined) {
|
|
213
222
|
cachedMatchers.rgb = new RegExp("rgb" + call(NUMBER, NUMBER, NUMBER));
|
|
@@ -218,6 +227,11 @@ function getMatchers() {
|
|
|
218
227
|
cachedMatchers.hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
|
219
228
|
cachedMatchers.hex6 = /^#([0-9a-fA-F]{6})$/;
|
|
220
229
|
cachedMatchers.hex8 = /^#([0-9a-fA-F]{8})$/;
|
|
230
|
+
cachedMatchers.oklch = modernColorCall("oklch");
|
|
231
|
+
cachedMatchers.oklab = modernColorCall("oklab");
|
|
232
|
+
cachedMatchers.lab = modernColorCall("lab");
|
|
233
|
+
cachedMatchers.lch = modernColorCall("lch");
|
|
234
|
+
cachedMatchers.hwb = modernColorCall("hwb");
|
|
221
235
|
}
|
|
222
236
|
return cachedMatchers;
|
|
223
237
|
}
|
|
@@ -281,6 +295,96 @@ function parsePercentage(str) {
|
|
|
281
295
|
}
|
|
282
296
|
return int / 100;
|
|
283
297
|
}
|
|
298
|
+
function parseModernComponent(str, percentScale) {
|
|
299
|
+
if (str === "none")
|
|
300
|
+
return 0;
|
|
301
|
+
if (str.endsWith("%")) {
|
|
302
|
+
return Number.parseFloat(str) / 100 * percentScale;
|
|
303
|
+
}
|
|
304
|
+
return Number.parseFloat(str);
|
|
305
|
+
}
|
|
306
|
+
function parseHueAngle(str) {
|
|
307
|
+
if (str === "none")
|
|
308
|
+
return 0;
|
|
309
|
+
if (str.endsWith("rad")) {
|
|
310
|
+
return Number.parseFloat(str) * 180 / Math.PI;
|
|
311
|
+
}
|
|
312
|
+
if (str.endsWith("grad"))
|
|
313
|
+
return Number.parseFloat(str) * 0.9;
|
|
314
|
+
if (str.endsWith("turn"))
|
|
315
|
+
return Number.parseFloat(str) * 360;
|
|
316
|
+
return Number.parseFloat(str);
|
|
317
|
+
}
|
|
318
|
+
function parseModernAlpha(str) {
|
|
319
|
+
if (str === undefined || str === "none")
|
|
320
|
+
return 1;
|
|
321
|
+
if (str.endsWith("%")) {
|
|
322
|
+
return Math.max(0, Math.min(1, Number.parseFloat(str) / 100));
|
|
323
|
+
}
|
|
324
|
+
return Math.max(0, Math.min(1, Number.parseFloat(str)));
|
|
325
|
+
}
|
|
326
|
+
function linearToSrgb(c) {
|
|
327
|
+
if (c <= 0.0031308)
|
|
328
|
+
return 12.92 * c;
|
|
329
|
+
return 1.055 * c ** (1 / 2.4) - 0.055;
|
|
330
|
+
}
|
|
331
|
+
function clamp01(v) {
|
|
332
|
+
return Math.max(0, Math.min(1, v));
|
|
333
|
+
}
|
|
334
|
+
function rgbFloatToInt(r, g, b, alpha) {
|
|
335
|
+
const ri = Math.round(clamp01(r) * 255);
|
|
336
|
+
const gi = Math.round(clamp01(g) * 255);
|
|
337
|
+
const bi = Math.round(clamp01(b) * 255);
|
|
338
|
+
const ai = Math.round(clamp01(alpha) * 255);
|
|
339
|
+
return (ri << 24 | gi << 16 | bi << 8 | ai) >>> 0;
|
|
340
|
+
}
|
|
341
|
+
function oklabToSrgb(L, a, b) {
|
|
342
|
+
const l_ = L + 0.3963377774 * a + 0.2158037573 * b;
|
|
343
|
+
const m_ = L - 0.1055613458 * a - 0.0638541728 * b;
|
|
344
|
+
const s_ = L - 0.0894841775 * a - 1.291485548 * b;
|
|
345
|
+
const l = l_ * l_ * l_;
|
|
346
|
+
const m = m_ * m_ * m_;
|
|
347
|
+
const s = s_ * s_ * s_;
|
|
348
|
+
const rLin = 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s;
|
|
349
|
+
const gLin = -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s;
|
|
350
|
+
const bLin = -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s;
|
|
351
|
+
return [linearToSrgb(rLin), linearToSrgb(gLin), linearToSrgb(bLin)];
|
|
352
|
+
}
|
|
353
|
+
function labToSrgb(L, a, b) {
|
|
354
|
+
const epsilon = 216 / 24389;
|
|
355
|
+
const kappa = 24389 / 27;
|
|
356
|
+
const Xn = 0.95047;
|
|
357
|
+
const Yn = 1;
|
|
358
|
+
const Zn = 1.08883;
|
|
359
|
+
const fy = (L + 16) / 116;
|
|
360
|
+
const fx = a / 500 + fy;
|
|
361
|
+
const fz = fy - b / 200;
|
|
362
|
+
const fx3 = fx * fx * fx;
|
|
363
|
+
const fz3 = fz * fz * fz;
|
|
364
|
+
const xr = fx3 > epsilon ? fx3 : (116 * fx - 16) / kappa;
|
|
365
|
+
const yr = L > kappa * epsilon ? ((L + 16) / 116) ** 3 : L / kappa;
|
|
366
|
+
const zr = fz3 > epsilon ? fz3 : (116 * fz - 16) / kappa;
|
|
367
|
+
const X = xr * Xn;
|
|
368
|
+
const Y = yr * Yn;
|
|
369
|
+
const Z = zr * Zn;
|
|
370
|
+
const rLin = 3.2404542 * X - 1.5371385 * Y - 0.4985314 * Z;
|
|
371
|
+
const gLin = -0.969266 * X + 1.8760108 * Y + 0.041556 * Z;
|
|
372
|
+
const bLin = 0.0556434 * X - 0.2040259 * Y + 1.0572252 * Z;
|
|
373
|
+
return [linearToSrgb(rLin), linearToSrgb(gLin), linearToSrgb(bLin)];
|
|
374
|
+
}
|
|
375
|
+
function hwbToSrgb(h, w, bk) {
|
|
376
|
+
if (w + bk >= 1) {
|
|
377
|
+
const gray = w / (w + bk);
|
|
378
|
+
return [gray, gray, gray];
|
|
379
|
+
}
|
|
380
|
+
const q = 1;
|
|
381
|
+
const p = 0;
|
|
382
|
+
const r = hue2rgb(p, q, h + 1 / 3);
|
|
383
|
+
const g = hue2rgb(p, q, h);
|
|
384
|
+
const bl = hue2rgb(p, q, h - 1 / 3);
|
|
385
|
+
const factor = 1 - w - bk;
|
|
386
|
+
return [r * factor + w, g * factor + w, bl * factor + w];
|
|
387
|
+
}
|
|
284
388
|
var colorNames = {
|
|
285
389
|
transparent: 0,
|
|
286
390
|
aliceblue: 4042850303,
|
|
@@ -479,6 +583,58 @@ function normalizeColor(color) {
|
|
|
479
583
|
return (hslToRgb(parse360(match[1]), parsePercentage(match[2]), parsePercentage(match[3])) | parse1(match[4])) >>> 0;
|
|
480
584
|
}
|
|
481
585
|
}
|
|
586
|
+
if (matchers.oklch) {
|
|
587
|
+
if (match = matchers.oklch.exec(color)) {
|
|
588
|
+
const L = parseModernComponent(match[1], 1);
|
|
589
|
+
const C = parseModernComponent(match[2], 0.4);
|
|
590
|
+
const H = parseHueAngle(match[3]);
|
|
591
|
+
const alpha = parseModernAlpha(match[4]);
|
|
592
|
+
const hRad = H * Math.PI / 180;
|
|
593
|
+
const [r, g, b] = oklabToSrgb(L, C * Math.cos(hRad), C * Math.sin(hRad));
|
|
594
|
+
return rgbFloatToInt(r, g, b, alpha);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
if (matchers.oklab) {
|
|
598
|
+
if (match = matchers.oklab.exec(color)) {
|
|
599
|
+
const L = parseModernComponent(match[1], 1);
|
|
600
|
+
const a = parseModernComponent(match[2], 0.4);
|
|
601
|
+
const b = parseModernComponent(match[3], 0.4);
|
|
602
|
+
const alpha = parseModernAlpha(match[4]);
|
|
603
|
+
const [r, g, bl] = oklabToSrgb(L, a, b);
|
|
604
|
+
return rgbFloatToInt(r, g, bl, alpha);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
if (matchers.lab) {
|
|
608
|
+
if (match = matchers.lab.exec(color)) {
|
|
609
|
+
const L = parseModernComponent(match[1], 100);
|
|
610
|
+
const a = parseModernComponent(match[2], 125);
|
|
611
|
+
const b = parseModernComponent(match[3], 125);
|
|
612
|
+
const alpha = parseModernAlpha(match[4]);
|
|
613
|
+
const [r, g, bl] = labToSrgb(L, a, b);
|
|
614
|
+
return rgbFloatToInt(r, g, bl, alpha);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
if (matchers.lch) {
|
|
618
|
+
if (match = matchers.lch.exec(color)) {
|
|
619
|
+
const L = parseModernComponent(match[1], 100);
|
|
620
|
+
const C = parseModernComponent(match[2], 150);
|
|
621
|
+
const H = parseHueAngle(match[3]);
|
|
622
|
+
const alpha = parseModernAlpha(match[4]);
|
|
623
|
+
const hRad = H * Math.PI / 180;
|
|
624
|
+
const [r, g, bl] = labToSrgb(L, C * Math.cos(hRad), C * Math.sin(hRad));
|
|
625
|
+
return rgbFloatToInt(r, g, bl, alpha);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
if (matchers.hwb) {
|
|
629
|
+
if (match = matchers.hwb.exec(color)) {
|
|
630
|
+
const H = parseHueAngle(match[1]);
|
|
631
|
+
const W = parseModernComponent(match[2], 1);
|
|
632
|
+
const B = parseModernComponent(match[3], 1);
|
|
633
|
+
const alpha = parseModernAlpha(match[4]);
|
|
634
|
+
const [r, g, bl] = hwbToSrgb(H / 360, W, B);
|
|
635
|
+
return rgbFloatToInt(r, g, bl, alpha);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
482
638
|
throw new Error(`invalid color string ${color} provided`);
|
|
483
639
|
}
|
|
484
640
|
function processColor(color) {
|
|
@@ -523,6 +679,7 @@ var validCodecs = [
|
|
|
523
679
|
"h265",
|
|
524
680
|
"vp8",
|
|
525
681
|
"vp9",
|
|
682
|
+
"av1",
|
|
526
683
|
"mp3",
|
|
527
684
|
"aac",
|
|
528
685
|
"wav",
|
|
@@ -843,7 +1000,7 @@ var validateFramesPerFunction = ({
|
|
|
843
1000
|
import * as tty from "tty";
|
|
844
1001
|
|
|
845
1002
|
// ../core/dist/esm/version.mjs
|
|
846
|
-
var VERSION = "4.0.
|
|
1003
|
+
var VERSION = "4.0.440";
|
|
847
1004
|
|
|
848
1005
|
// ../renderer/dist/esm/error-handling.mjs
|
|
849
1006
|
var isColorSupported = () => {
|
|
@@ -1658,6 +1815,10 @@ var support = {
|
|
|
1658
1815
|
video: true,
|
|
1659
1816
|
audio: true
|
|
1660
1817
|
},
|
|
1818
|
+
av1: {
|
|
1819
|
+
video: true,
|
|
1820
|
+
audio: true
|
|
1821
|
+
},
|
|
1661
1822
|
mp3: {
|
|
1662
1823
|
audio: true,
|
|
1663
1824
|
video: false
|
|
@@ -1697,6 +1858,7 @@ var validCodecs2 = [
|
|
|
1697
1858
|
"h265",
|
|
1698
1859
|
"vp8",
|
|
1699
1860
|
"vp9",
|
|
1861
|
+
"av1",
|
|
1700
1862
|
"mp3",
|
|
1701
1863
|
"aac",
|
|
1702
1864
|
"wav",
|
|
@@ -1752,6 +1914,14 @@ var defaultFileExtensionMap = {
|
|
|
1752
1914
|
"pcm-16": { possible: ["mkv"], default: "mkv" }
|
|
1753
1915
|
}
|
|
1754
1916
|
},
|
|
1917
|
+
av1: {
|
|
1918
|
+
default: "mp4",
|
|
1919
|
+
forAudioCodec: {
|
|
1920
|
+
aac: { possible: ["mp4", "mkv"], default: "mp4" },
|
|
1921
|
+
opus: { possible: ["webm", "mkv"], default: "webm" },
|
|
1922
|
+
"pcm-16": { possible: ["mkv"], default: "mkv" }
|
|
1923
|
+
}
|
|
1924
|
+
},
|
|
1755
1925
|
mp3: {
|
|
1756
1926
|
default: "mp3",
|
|
1757
1927
|
forAudioCodec: {
|
|
@@ -1947,6 +2117,7 @@ var supportedAudioCodecs = {
|
|
|
1947
2117
|
avi: [],
|
|
1948
2118
|
gif: [],
|
|
1949
2119
|
h265: ["aac", "pcm-16"],
|
|
2120
|
+
av1: ["aac", "opus", "pcm-16"],
|
|
1950
2121
|
mp3: ["mp3", "pcm-16"],
|
|
1951
2122
|
prores: ["aac", "pcm-16"],
|
|
1952
2123
|
vp8: ["opus", "pcm-16"],
|
|
@@ -1982,6 +2153,10 @@ var defaultAudioCodecs = {
|
|
|
1982
2153
|
lossless: "pcm-16",
|
|
1983
2154
|
compressed: "aac"
|
|
1984
2155
|
},
|
|
2156
|
+
av1: {
|
|
2157
|
+
lossless: "pcm-16",
|
|
2158
|
+
compressed: "aac"
|
|
2159
|
+
},
|
|
1985
2160
|
mp3: {
|
|
1986
2161
|
lossless: "pcm-16",
|
|
1987
2162
|
compressed: "mp3"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { OutNameInputWithoutCredentials } from './constants';
|
|
2
2
|
export declare const validateOutname: ({ outName, codec, audioCodecSetting, separateAudioTo, bucketNamePrefix, }: {
|
|
3
3
|
outName: OutNameInputWithoutCredentials | null | undefined;
|
|
4
|
-
codec: "aac" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav" | null;
|
|
4
|
+
codec: "aac" | "av1" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav" | null;
|
|
5
5
|
audioCodecSetting: "aac" | "mp3" | "opus" | "pcm-16" | null;
|
|
6
6
|
separateAudioTo: string | null;
|
|
7
7
|
bucketNamePrefix: string;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/serverless-client"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/serverless-client",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.440",
|
|
7
7
|
"main": "dist",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"scripts": {
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"remotion": "4.0.
|
|
28
|
-
"@remotion/streaming": "4.0.
|
|
29
|
-
"@remotion/renderer": "4.0.
|
|
30
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
27
|
+
"remotion": "4.0.440",
|
|
28
|
+
"@remotion/streaming": "4.0.440",
|
|
29
|
+
"@remotion/renderer": "4.0.440",
|
|
30
|
+
"@remotion/eslint-config-internal": "4.0.440",
|
|
31
31
|
"eslint": "9.19.0",
|
|
32
32
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
33
33
|
},
|