@remotion/renderer 4.0.267 → 4.0.269

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.
@@ -0,0 +1,3095 @@
1
+ var __create = Object.create;
2
+ var __getProtoOf = Object.getPrototypeOf;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __toESM = (mod, isNodeMode, target) => {
7
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
8
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
9
+ for (let key of __getOwnPropNames(mod))
10
+ if (!__hasOwnProp.call(to, key))
11
+ __defProp(to, key, {
12
+ get: () => mod[key],
13
+ enumerable: true
14
+ });
15
+ return to;
16
+ };
17
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
18
+ var __export = (target, all) => {
19
+ for (var name in all)
20
+ __defProp(target, name, {
21
+ get: all[name],
22
+ enumerable: true,
23
+ configurable: true,
24
+ set: (newValue) => all[name] = () => newValue
25
+ });
26
+ };
27
+ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
28
+
29
+ // ../../node_modules/.pnpm/react@19.0.0/node_modules/react/cjs/react-jsx-runtime.production.js
30
+ var exports_react_jsx_runtime_production = {};
31
+ __export(exports_react_jsx_runtime_production, {
32
+ jsxs: () => $jsxs,
33
+ jsx: () => $jsx,
34
+ Fragment: () => $Fragment
35
+ });
36
+ function jsxProd(type, config, maybeKey) {
37
+ var key = null;
38
+ maybeKey !== undefined && (key = "" + maybeKey);
39
+ config.key !== undefined && (key = "" + config.key);
40
+ if ("key" in config) {
41
+ maybeKey = {};
42
+ for (var propName in config)
43
+ propName !== "key" && (maybeKey[propName] = config[propName]);
44
+ } else
45
+ maybeKey = config;
46
+ config = maybeKey.ref;
47
+ return {
48
+ $$typeof: REACT_ELEMENT_TYPE,
49
+ type,
50
+ key,
51
+ ref: config !== undefined ? config : null,
52
+ props: maybeKey
53
+ };
54
+ }
55
+ var REACT_ELEMENT_TYPE, REACT_FRAGMENT_TYPE, $Fragment, $jsx, $jsxs;
56
+ var init_react_jsx_runtime_production = __esm(() => {
57
+ REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element");
58
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
59
+ $Fragment = REACT_FRAGMENT_TYPE;
60
+ $jsx = jsxProd;
61
+ $jsxs = jsxProd;
62
+ });
63
+
64
+ // ../../node_modules/.pnpm/react@19.0.0/node_modules/react/jsx-runtime.js
65
+ var require_jsx_runtime = __commonJS((exports, module) => {
66
+ init_react_jsx_runtime_production();
67
+ if (true) {
68
+ module.exports = exports_react_jsx_runtime_production;
69
+ } else {
70
+ }
71
+ });
72
+
73
+ // src/browser/TimeoutSettings.ts
74
+ var DEFAULT_TIMEOUT = 30000;
75
+
76
+ class TimeoutSettings {
77
+ #defaultTimeout;
78
+ #defaultNavigationTimeout;
79
+ constructor() {
80
+ this.#defaultTimeout = null;
81
+ this.#defaultNavigationTimeout = null;
82
+ }
83
+ setDefaultTimeout(timeout) {
84
+ this.#defaultTimeout = timeout;
85
+ }
86
+ setDefaultNavigationTimeout(timeout) {
87
+ this.#defaultNavigationTimeout = timeout;
88
+ }
89
+ navigationTimeout() {
90
+ if (this.#defaultNavigationTimeout !== null) {
91
+ return this.#defaultNavigationTimeout;
92
+ }
93
+ if (this.#defaultTimeout !== null) {
94
+ return this.#defaultTimeout;
95
+ }
96
+ return DEFAULT_TIMEOUT;
97
+ }
98
+ timeout() {
99
+ if (this.#defaultTimeout !== null) {
100
+ return this.#defaultTimeout;
101
+ }
102
+ return DEFAULT_TIMEOUT;
103
+ }
104
+ }
105
+
106
+ // src/codec.ts
107
+ var validCodecs = [
108
+ "h264",
109
+ "h265",
110
+ "vp8",
111
+ "vp9",
112
+ "mp3",
113
+ "aac",
114
+ "wav",
115
+ "prores",
116
+ "h264-mkv",
117
+ "h264-ts",
118
+ "gif"
119
+ ];
120
+ var DEFAULT_CODEC = "h264";
121
+
122
+ // src/crf.ts
123
+ var defaultCrfMap = {
124
+ h264: 18,
125
+ h265: 23,
126
+ vp8: 9,
127
+ vp9: 28,
128
+ prores: null,
129
+ gif: null,
130
+ "h264-mkv": 18,
131
+ "h264-ts": 18,
132
+ aac: null,
133
+ mp3: null,
134
+ wav: null
135
+ };
136
+ var getDefaultCrfForCodec = (codec) => {
137
+ const val = defaultCrfMap[codec];
138
+ if (val === undefined) {
139
+ throw new TypeError(`Got unexpected codec "${codec}"`);
140
+ }
141
+ return val;
142
+ };
143
+ var crfRanges = {
144
+ h264: [1, 51],
145
+ h265: [0, 51],
146
+ vp8: [4, 63],
147
+ vp9: [0, 63],
148
+ prores: [0, 0],
149
+ gif: [0, 0],
150
+ "h264-mkv": [1, 51],
151
+ "h264-ts": [1, 51],
152
+ aac: [0, 0],
153
+ mp3: [0, 0],
154
+ wav: [0, 0]
155
+ };
156
+ var getValidCrfRanges = (codec) => {
157
+ const val = crfRanges[codec];
158
+ if (val === undefined) {
159
+ throw new TypeError(`Got unexpected codec "${codec}"`);
160
+ }
161
+ return val;
162
+ };
163
+
164
+ // src/codec-supports-media.ts
165
+ var codecSupportsVideoBitrateMap = {
166
+ "h264-mkv": true,
167
+ "h264-ts": true,
168
+ aac: false,
169
+ gif: false,
170
+ h264: true,
171
+ h265: true,
172
+ mp3: false,
173
+ prores: false,
174
+ vp8: true,
175
+ vp9: true,
176
+ wav: false
177
+ };
178
+ var codecSupportsCrf = (codec) => {
179
+ const range = getValidCrfRanges(codec);
180
+ return range[0] !== range[1];
181
+ };
182
+ var codecSupportsVideoBitrate = (codec) => {
183
+ return codecSupportsVideoBitrateMap[codec];
184
+ };
185
+
186
+ // src/file-extensions.ts
187
+ var defaultFileExtensionMap = {
188
+ "h264-mkv": {
189
+ default: "mkv",
190
+ forAudioCodec: {
191
+ "pcm-16": { possible: ["mkv"], default: "mkv" },
192
+ mp3: { possible: ["mkv"], default: "mkv" }
193
+ }
194
+ },
195
+ "h264-ts": {
196
+ default: "ts",
197
+ forAudioCodec: {
198
+ "pcm-16": { possible: ["ts"], default: "ts" },
199
+ aac: { possible: ["ts"], default: "ts" }
200
+ }
201
+ },
202
+ aac: {
203
+ default: "aac",
204
+ forAudioCodec: {
205
+ aac: {
206
+ possible: ["aac", "3gp", "m4a", "m4b", "mpg", "mpeg"],
207
+ default: "aac"
208
+ },
209
+ "pcm-16": {
210
+ possible: ["wav"],
211
+ default: "wav"
212
+ }
213
+ }
214
+ },
215
+ gif: {
216
+ default: "gif",
217
+ forAudioCodec: {}
218
+ },
219
+ h264: {
220
+ default: "mp4",
221
+ forAudioCodec: {
222
+ "pcm-16": { possible: ["mkv", "mov"], default: "mkv" },
223
+ aac: { possible: ["mp4", "mkv", "mov"], default: "mp4" },
224
+ mp3: { possible: ["mp4", "mkv", "mov"], default: "mp4" }
225
+ }
226
+ },
227
+ h265: {
228
+ default: "mp4",
229
+ forAudioCodec: {
230
+ aac: { possible: ["mp4", "mkv", "hevc"], default: "mp4" },
231
+ "pcm-16": { possible: ["mkv"], default: "mkv" }
232
+ }
233
+ },
234
+ mp3: {
235
+ default: "mp3",
236
+ forAudioCodec: {
237
+ mp3: { possible: ["mp3"], default: "mp3" },
238
+ "pcm-16": { possible: ["wav"], default: "wav" }
239
+ }
240
+ },
241
+ prores: {
242
+ default: "mov",
243
+ forAudioCodec: {
244
+ aac: { possible: ["mov", "mkv", "mxf"], default: "mov" },
245
+ "pcm-16": { possible: ["mov", "mkv", "mxf"], default: "mov" }
246
+ }
247
+ },
248
+ vp8: {
249
+ default: "webm",
250
+ forAudioCodec: {
251
+ "pcm-16": { possible: ["mkv"], default: "mkv" },
252
+ opus: { possible: ["webm"], default: "webm" }
253
+ }
254
+ },
255
+ vp9: {
256
+ default: "webm",
257
+ forAudioCodec: {
258
+ "pcm-16": { possible: ["mkv"], default: "mkv" },
259
+ opus: { possible: ["webm"], default: "webm" }
260
+ }
261
+ },
262
+ wav: {
263
+ default: "wav",
264
+ forAudioCodec: {
265
+ "pcm-16": { possible: ["wav"], default: "wav" }
266
+ }
267
+ }
268
+ };
269
+
270
+ // src/get-extension-from-codec.ts
271
+ var getFileExtensionFromCodec = (codec, audioCodec) => {
272
+ if (!validCodecs.includes(codec)) {
273
+ throw new Error(`Codec must be one of the following: ${validCodecs.join(", ")}, but got ${codec}`);
274
+ }
275
+ const map = defaultFileExtensionMap[codec];
276
+ if (audioCodec === null) {
277
+ return map.default;
278
+ }
279
+ const typedAudioCodec = audioCodec;
280
+ if (!(typedAudioCodec in map.forAudioCodec)) {
281
+ throw new Error(`Audio codec ${typedAudioCodec} is not supported for codec ${codec}`);
282
+ }
283
+ return map.forAudioCodec[audioCodec].default;
284
+ };
285
+ var makeFileExtensionMap = () => {
286
+ const map = {};
287
+ Object.keys(defaultFileExtensionMap).forEach((_codec) => {
288
+ const codec = _codec;
289
+ const fileExtMap = defaultFileExtensionMap[codec];
290
+ const audioCodecs = Object.keys(fileExtMap.forAudioCodec);
291
+ const possibleExtensionsForAudioCodec = audioCodecs.map((audioCodec) => fileExtMap.forAudioCodec[audioCodec].possible);
292
+ const allPossibleExtensions = [
293
+ fileExtMap.default,
294
+ ...possibleExtensionsForAudioCodec.flat(1)
295
+ ];
296
+ for (const extension of allPossibleExtensions) {
297
+ if (!map[extension]) {
298
+ map[extension] = [];
299
+ }
300
+ if (!map[extension].includes(codec)) {
301
+ map[extension].push(codec);
302
+ }
303
+ }
304
+ });
305
+ return map;
306
+ };
307
+ var defaultCodecsForFileExtension = {
308
+ "3gp": "aac",
309
+ aac: "aac",
310
+ gif: "gif",
311
+ hevc: "h265",
312
+ m4a: "aac",
313
+ m4b: "aac",
314
+ mkv: "h264-mkv",
315
+ mov: "prores",
316
+ mp3: "mp3",
317
+ mp4: "h264",
318
+ mpeg: "aac",
319
+ mpg: "aac",
320
+ mxf: "prores",
321
+ wav: "wav",
322
+ webm: "vp8",
323
+ ts: "h264-ts"
324
+ };
325
+
326
+ // src/image-format.ts
327
+ var validVideoImageFormats = ["png", "jpeg", "none"];
328
+ var validStillImageFormats = ["png", "jpeg", "pdf", "webp"];
329
+
330
+ // src/jpeg-quality.ts
331
+ var DEFAULT_JPEG_QUALITY = 80;
332
+ var validateJpegQuality = (q) => {
333
+ if (typeof q !== "undefined" && typeof q !== "number") {
334
+ throw new Error(`JPEG Quality option must be a number or undefined. Got ${typeof q} (${JSON.stringify(q)})`);
335
+ }
336
+ if (typeof q === "undefined") {
337
+ return;
338
+ }
339
+ if (!Number.isFinite(q)) {
340
+ throw new RangeError(`JPEG Quality must be a finite number, but is ${q}`);
341
+ }
342
+ if (Number.isNaN(q)) {
343
+ throw new RangeError(`JPEG Quality is NaN, but must be a real number`);
344
+ }
345
+ if (q > 100 || q < 0) {
346
+ throw new RangeError("JPEG Quality option must be between 0 and 100.");
347
+ }
348
+ };
349
+
350
+ // src/log-level.ts
351
+ var logLevels = ["trace", "verbose", "info", "warn", "error"];
352
+ var getNumberForLogLevel = (level) => {
353
+ return logLevels.indexOf(level);
354
+ };
355
+ var isValidLogLevel = (level) => {
356
+ return getNumberForLogLevel(level) > -1;
357
+ };
358
+
359
+ // src/options/api-key.tsx
360
+ var jsx_runtime = __toESM(require_jsx_runtime(), 1);
361
+ var currentApiKey = null;
362
+ var cliFlag = "api-key";
363
+ var apiKeyOption = {
364
+ name: "API key",
365
+ cliFlag,
366
+ description: () => /* @__PURE__ */ jsx_runtime.jsxs(jsx_runtime.Fragment, {
367
+ children: [
368
+ "API key for sending a usage event using ",
369
+ /* @__PURE__ */ jsx_runtime.jsx("code", {
370
+ children: "@remotion/licensing"
371
+ }),
372
+ "."
373
+ ]
374
+ }),
375
+ ssrName: "apiKey",
376
+ docLink: "https://www.remotion.dev/docs/licensing",
377
+ type: null,
378
+ getValue: ({ commandLine }) => {
379
+ if (commandLine[cliFlag] !== undefined) {
380
+ return {
381
+ source: "cli",
382
+ value: commandLine[cliFlag]
383
+ };
384
+ }
385
+ return {
386
+ source: "default",
387
+ value: currentApiKey
388
+ };
389
+ },
390
+ setConfig: (value) => {
391
+ currentApiKey = value;
392
+ }
393
+ };
394
+
395
+ // src/options/audio-bitrate.tsx
396
+ var jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
397
+ var cliFlag2 = "audio-bitrate";
398
+ var audioBitrate = null;
399
+ var audioBitrateOption = {
400
+ name: "Audio Bitrate",
401
+ cliFlag: cliFlag2,
402
+ description: () => /* @__PURE__ */ jsx_runtime2.jsxs(jsx_runtime2.Fragment, {
403
+ children: [
404
+ "Specify the target bitrate for the generated video. The syntax for FFmpeg",
405
+ "'",
406
+ "s ",
407
+ /* @__PURE__ */ jsx_runtime2.jsx("code", {
408
+ children: "-b:a"
409
+ }),
410
+ " parameter should be used. FFmpeg may encode the video in a way that will not result in the exact audio bitrate specified. Example values: ",
411
+ /* @__PURE__ */ jsx_runtime2.jsx("code", {
412
+ children: "512K"
413
+ }),
414
+ " for 512 kbps, ",
415
+ /* @__PURE__ */ jsx_runtime2.jsx("code", {
416
+ children: "1M"
417
+ }),
418
+ " for 1 Mbps. Default: ",
419
+ /* @__PURE__ */ jsx_runtime2.jsx("code", {
420
+ children: "320k"
421
+ })
422
+ ]
423
+ }),
424
+ ssrName: "audioBitrate",
425
+ docLink: "https://www.remotion.dev/docs/renderer/render-media#audiobitrate-",
426
+ type: "0",
427
+ getValue: ({ commandLine }) => {
428
+ if (commandLine[cliFlag2]) {
429
+ return {
430
+ value: commandLine[cliFlag2],
431
+ source: "cli"
432
+ };
433
+ }
434
+ if (audioBitrate) {
435
+ return {
436
+ value: audioBitrate,
437
+ source: "config file"
438
+ };
439
+ }
440
+ return {
441
+ value: null,
442
+ source: "default"
443
+ };
444
+ },
445
+ setConfig: (value) => {
446
+ audioBitrate = value;
447
+ }
448
+ };
449
+
450
+ // src/options/separate-audio.tsx
451
+ var DEFAULT = null;
452
+ var cliFlag3 = "separate-audio-to";
453
+ var separateAudioOption = {
454
+ cliFlag: cliFlag3,
455
+ description: () => `If set, the audio will not be included in the main output but rendered as a separate file at the location you pass. It is recommended to use an absolute path. If a relative path is passed, it is relative to the Remotion Root.`,
456
+ docLink: "https://remotion.dev/docs/renderer/render-media",
457
+ getValue: ({ commandLine }) => {
458
+ if (commandLine[cliFlag3]) {
459
+ return {
460
+ source: "cli",
461
+ value: commandLine[cliFlag3]
462
+ };
463
+ }
464
+ return {
465
+ source: "default",
466
+ value: DEFAULT
467
+ };
468
+ },
469
+ name: "Separate audio to",
470
+ setConfig: () => {
471
+ throw new Error("Not implemented");
472
+ },
473
+ ssrName: "separateAudioTo",
474
+ type: "string"
475
+ };
476
+
477
+ // src/options/audio-codec.tsx
478
+ var validAudioCodecs = ["pcm-16", "aac", "mp3", "opus"];
479
+ var supportedAudioCodecs = {
480
+ h264: ["aac", "pcm-16", "mp3"],
481
+ "h264-mkv": ["pcm-16", "mp3"],
482
+ "h264-ts": ["pcm-16", "aac"],
483
+ aac: ["aac", "pcm-16"],
484
+ avi: [],
485
+ gif: [],
486
+ h265: ["aac", "pcm-16"],
487
+ mp3: ["mp3", "pcm-16"],
488
+ prores: ["aac", "pcm-16"],
489
+ vp8: ["opus", "pcm-16"],
490
+ vp9: ["opus", "pcm-16"],
491
+ wav: ["pcm-16"]
492
+ };
493
+ var _satisfies = supportedAudioCodecs;
494
+ if (_satisfies) {
495
+ }
496
+ var cliFlag4 = "audio-codec";
497
+ var ssrName = "audioCodec";
498
+ var defaultAudioCodecs = {
499
+ "h264-mkv": {
500
+ lossless: "pcm-16",
501
+ compressed: "pcm-16"
502
+ },
503
+ "h264-ts": {
504
+ lossless: "pcm-16",
505
+ compressed: "aac"
506
+ },
507
+ aac: {
508
+ lossless: "pcm-16",
509
+ compressed: "aac"
510
+ },
511
+ gif: {
512
+ lossless: null,
513
+ compressed: null
514
+ },
515
+ h264: {
516
+ lossless: "pcm-16",
517
+ compressed: "aac"
518
+ },
519
+ h265: {
520
+ lossless: "pcm-16",
521
+ compressed: "aac"
522
+ },
523
+ mp3: {
524
+ lossless: "pcm-16",
525
+ compressed: "mp3"
526
+ },
527
+ prores: {
528
+ lossless: "pcm-16",
529
+ compressed: "pcm-16"
530
+ },
531
+ vp8: {
532
+ lossless: "pcm-16",
533
+ compressed: "opus"
534
+ },
535
+ vp9: {
536
+ lossless: "pcm-16",
537
+ compressed: "opus"
538
+ },
539
+ wav: {
540
+ lossless: "pcm-16",
541
+ compressed: "pcm-16"
542
+ }
543
+ };
544
+ var extensionMap = {
545
+ aac: "aac",
546
+ mp3: "mp3",
547
+ opus: "opus",
548
+ "pcm-16": "wav"
549
+ };
550
+ var getExtensionFromAudioCodec = (audioCodec) => {
551
+ if (extensionMap[audioCodec]) {
552
+ return extensionMap[audioCodec];
553
+ }
554
+ throw new Error(`Unsupported audio codec: ${audioCodec}`);
555
+ };
556
+ var resolveAudioCodec = ({
557
+ codec,
558
+ setting,
559
+ preferLossless,
560
+ separateAudioTo
561
+ }) => {
562
+ let derivedFromSeparateAudioToExtension = null;
563
+ if (separateAudioTo) {
564
+ const extension = separateAudioTo.split(".").pop();
565
+ for (const [key, value] of Object.entries(extensionMap)) {
566
+ if (value === extension) {
567
+ derivedFromSeparateAudioToExtension = key;
568
+ if (!supportedAudioCodecs[codec].includes(derivedFromSeparateAudioToExtension) && derivedFromSeparateAudioToExtension) {
569
+ throw new Error(`The codec is ${codec} but the audio codec derived from --${separateAudioOption.cliFlag} is ${derivedFromSeparateAudioToExtension}. The only supported codecs are: ${supportedAudioCodecs[codec].join(", ")}`);
570
+ }
571
+ }
572
+ }
573
+ }
574
+ if (preferLossless) {
575
+ const selected = getDefaultAudioCodec({ codec, preferLossless });
576
+ if (derivedFromSeparateAudioToExtension && selected !== derivedFromSeparateAudioToExtension) {
577
+ throw new Error(`The audio codec derived from --${separateAudioOption.cliFlag} is ${derivedFromSeparateAudioToExtension}, but does not match the audio codec derived from the "Prefer lossless" option (${selected}). Remove any conflicting options.`);
578
+ }
579
+ return selected;
580
+ }
581
+ if (setting === null) {
582
+ if (derivedFromSeparateAudioToExtension) {
583
+ return derivedFromSeparateAudioToExtension;
584
+ }
585
+ return getDefaultAudioCodec({ codec, preferLossless });
586
+ }
587
+ if (derivedFromSeparateAudioToExtension !== setting && derivedFromSeparateAudioToExtension) {
588
+ throw new Error(`The audio codec derived from --${separateAudioOption.cliFlag} is ${derivedFromSeparateAudioToExtension}, but does not match the audio codec derived from your ${audioCodecOption.name} setting (${setting}). Remove any conflicting options.`);
589
+ }
590
+ return setting;
591
+ };
592
+ var getDefaultAudioCodec = ({
593
+ codec,
594
+ preferLossless
595
+ }) => {
596
+ return defaultAudioCodecs[codec][preferLossless ? "lossless" : "compressed"];
597
+ };
598
+ var _audioCodec = null;
599
+ var audioCodecOption = {
600
+ cliFlag: cliFlag4,
601
+ setConfig: (audioCodec) => {
602
+ if (audioCodec === null) {
603
+ _audioCodec = null;
604
+ return;
605
+ }
606
+ if (!validAudioCodecs.includes(audioCodec)) {
607
+ throw new Error(`Audio codec must be one of the following: ${validAudioCodecs.join(", ")}, but got ${audioCodec}`);
608
+ }
609
+ _audioCodec = audioCodec;
610
+ },
611
+ getValue: ({ commandLine }) => {
612
+ if (commandLine[cliFlag4]) {
613
+ const codec = commandLine[cliFlag4];
614
+ if (!validAudioCodecs.includes(commandLine[cliFlag4])) {
615
+ throw new Error(`Audio codec must be one of the following: ${validAudioCodecs.join(", ")}, but got ${codec}`);
616
+ }
617
+ return {
618
+ source: "cli",
619
+ value: commandLine[cliFlag4]
620
+ };
621
+ }
622
+ if (_audioCodec !== null) {
623
+ return {
624
+ source: "config",
625
+ value: _audioCodec
626
+ };
627
+ }
628
+ return {
629
+ source: "default",
630
+ value: null
631
+ };
632
+ },
633
+ description: () => `Set the format of the audio that is embedded in the video. Not all codec and audio codec combinations are supported and certain combinations require a certain file extension and container format. See the table in the docs to see possible combinations.`,
634
+ docLink: "https://www.remotion.dev/docs/encoding/#audio-codec",
635
+ name: "Audio Codec",
636
+ ssrName,
637
+ type: "aac"
638
+ };
639
+
640
+ // src/options/beep-on-finish.tsx
641
+ var jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
642
+ var beepOnFinish = false;
643
+ var cliFlag5 = "beep-on-finish";
644
+ var beepOnFinishOption = {
645
+ name: "Beep on finish",
646
+ cliFlag: cliFlag5,
647
+ description: () => /* @__PURE__ */ jsx_runtime3.jsx(jsx_runtime3.Fragment, {
648
+ children: "Whether the Remotion Studio tab should beep when the render is finished."
649
+ }),
650
+ ssrName: null,
651
+ docLink: "https://www.remotion.dev/docs/config#setbeeponfinish",
652
+ type: false,
653
+ getValue: ({ commandLine }) => {
654
+ if (commandLine[cliFlag5] !== undefined) {
655
+ return {
656
+ value: commandLine[cliFlag5],
657
+ source: "cli"
658
+ };
659
+ }
660
+ if (beepOnFinish !== false) {
661
+ return {
662
+ value: beepOnFinish,
663
+ source: "config"
664
+ };
665
+ }
666
+ return {
667
+ value: false,
668
+ source: "default"
669
+ };
670
+ },
671
+ setConfig(value) {
672
+ beepOnFinish = value;
673
+ }
674
+ };
675
+
676
+ // src/options/binaries-directory.tsx
677
+ var jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
678
+ var cliFlag6 = "binaries-directory";
679
+ var currentDirectory = null;
680
+ var binariesDirectoryOption = {
681
+ name: "Binaries Directory",
682
+ cliFlag: cliFlag6,
683
+ description: () => /* @__PURE__ */ jsx_runtime4.jsxs(jsx_runtime4.Fragment, {
684
+ children: [
685
+ "The directory where the platform-specific binaries and libraries that Remotion needs are located. Those include an ",
686
+ /* @__PURE__ */ jsx_runtime4.jsx("code", {
687
+ children: "ffmpeg"
688
+ }),
689
+ " and",
690
+ " ",
691
+ /* @__PURE__ */ jsx_runtime4.jsx("code", {
692
+ children: "ffprobe"
693
+ }),
694
+ " binary, a Rust binary for various tasks, and various shared libraries. If the value is set to ",
695
+ /* @__PURE__ */ jsx_runtime4.jsx("code", {
696
+ children: "null"
697
+ }),
698
+ ", which is the default, then the path of a platform-specific package located at",
699
+ " ",
700
+ /* @__PURE__ */ jsx_runtime4.jsx("code", {
701
+ children: "node_modules/@remotion/compositor-*"
702
+ }),
703
+ " is selected.",
704
+ /* @__PURE__ */ jsx_runtime4.jsx("br", {}),
705
+ "This option is useful in environments where Remotion is not officially supported to run like bundled serverless functions or Electron."
706
+ ]
707
+ }),
708
+ ssrName: "binariesDirectory",
709
+ docLink: "https://www.remotion.dev/docs/renderer",
710
+ type: "",
711
+ getValue: ({ commandLine }) => {
712
+ if (commandLine[cliFlag6] !== undefined) {
713
+ return {
714
+ source: "cli",
715
+ value: commandLine[cliFlag6]
716
+ };
717
+ }
718
+ if (currentDirectory !== null) {
719
+ return {
720
+ source: "config",
721
+ value: currentDirectory
722
+ };
723
+ }
724
+ return {
725
+ source: "default",
726
+ value: null
727
+ };
728
+ },
729
+ setConfig: (value) => {
730
+ currentDirectory = value;
731
+ }
732
+ };
733
+
734
+ // src/options/chrome-mode.tsx
735
+ var jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
736
+ var validChromeModeOptions = [
737
+ "headless-shell",
738
+ "chrome-for-testing"
739
+ ];
740
+ var cliFlag7 = "chrome-mode";
741
+ var configSelection = null;
742
+ var chromeModeOption = {
743
+ cliFlag: cliFlag7,
744
+ name: "Chrome Mode",
745
+ ssrName: "chromeMode",
746
+ description: () => {
747
+ return /* @__PURE__ */ jsx_runtime5.jsxs(jsx_runtime5.Fragment, {
748
+ children: [
749
+ "One of",
750
+ " ",
751
+ validChromeModeOptions.map((option, i) => /* @__PURE__ */ jsx_runtime5.jsxs("code", {
752
+ children: [
753
+ option,
754
+ i === validChromeModeOptions.length - 1 ? "" : ", "
755
+ ]
756
+ }, option)),
757
+ ". Default ",
758
+ /* @__PURE__ */ jsx_runtime5.jsx("code", {
759
+ children: "headless-shell"
760
+ }),
761
+ ".",
762
+ " ",
763
+ /* @__PURE__ */ jsx_runtime5.jsxs("a", {
764
+ href: "https://remotion.dev/docs/miscellaneous/chrome-headless-shell",
765
+ children: [
766
+ "Use ",
767
+ /* @__PURE__ */ jsx_runtime5.jsx("code", {
768
+ children: "chrome-for-testing"
769
+ }),
770
+ " to take advantage of GPU drivers on Linux."
771
+ ]
772
+ })
773
+ ]
774
+ });
775
+ },
776
+ docLink: "https://www.remotion.dev/chrome-for-testing",
777
+ getValue: ({ commandLine }) => {
778
+ if (commandLine[cliFlag7]) {
779
+ if (!validChromeModeOptions.includes(commandLine[cliFlag7])) {
780
+ throw new Error(`Invalid \`--${cliFlag7}\` value passed. Accepted values: ${validChromeModeOptions.map((l) => `'${l}'`).join(", ")}.`);
781
+ }
782
+ return {
783
+ value: commandLine[cliFlag7],
784
+ source: "cli"
785
+ };
786
+ }
787
+ if (configSelection !== null) {
788
+ return {
789
+ value: configSelection,
790
+ source: "config"
791
+ };
792
+ }
793
+ return {
794
+ value: "headless-shell",
795
+ source: "default"
796
+ };
797
+ },
798
+ setConfig: (newChromeMode) => {
799
+ configSelection = newChromeMode;
800
+ },
801
+ type: "headless-shell"
802
+ };
803
+
804
+ // src/options/color-space.tsx
805
+ var jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
806
+ import { NoReactInternals } from "remotion/no-react";
807
+ var validV4ColorSpaces = ["default", "bt709", "bt2020-ncl"];
808
+ var validV5ColorSpaces = ["bt601", "bt709", "bt2020-ncl"];
809
+ var validColorSpaces = NoReactInternals.ENABLE_V5_BREAKING_CHANGES ? validV5ColorSpaces : validV4ColorSpaces;
810
+ var DEFAULT_COLOR_SPACE = NoReactInternals.ENABLE_V5_BREAKING_CHANGES ? "bt709" : "default";
811
+ var colorSpace = DEFAULT_COLOR_SPACE;
812
+ var cliFlag8 = "color-space";
813
+ var colorSpaceOption = {
814
+ name: "Color space",
815
+ cliFlag: "color-space",
816
+ description: () => /* @__PURE__ */ jsx_runtime6.jsxs(jsx_runtime6.Fragment, {
817
+ children: [
818
+ "Color space to use for the video. Acceptable values:",
819
+ " ",
820
+ /* @__PURE__ */ jsx_runtime6.jsxs("code", {
821
+ children: [
822
+ '"',
823
+ DEFAULT_COLOR_SPACE,
824
+ '"'
825
+ ]
826
+ }),
827
+ "(default since 5.0),",
828
+ " ",
829
+ NoReactInternals.ENABLE_V5_BREAKING_CHANGES ? /* @__PURE__ */ jsx_runtime6.jsxs("code", {
830
+ children: [
831
+ '"',
832
+ "bt601",
833
+ '"',
834
+ ", "
835
+ ]
836
+ }) : /* @__PURE__ */ jsx_runtime6.jsxs(jsx_runtime6.Fragment, {
837
+ children: [
838
+ /* @__PURE__ */ jsx_runtime6.jsxs("code", {
839
+ children: [
840
+ '"',
841
+ "bt709",
842
+ '"'
843
+ ]
844
+ }),
845
+ " ",
846
+ "(since v4.0.28),",
847
+ " "
848
+ ]
849
+ }),
850
+ /* @__PURE__ */ jsx_runtime6.jsxs("code", {
851
+ children: [
852
+ '"',
853
+ "bt2020-ncl",
854
+ '"'
855
+ ]
856
+ }),
857
+ " ",
858
+ "(since v4.0.88),",
859
+ " ",
860
+ /* @__PURE__ */ jsx_runtime6.jsxs("code", {
861
+ children: [
862
+ '"',
863
+ "bt2020-cl",
864
+ '"'
865
+ ]
866
+ }),
867
+ " ",
868
+ "(since v4.0.88), .",
869
+ /* @__PURE__ */ jsx_runtime6.jsx("br", {}),
870
+ "For best color accuracy, it is recommended to also use",
871
+ " ",
872
+ /* @__PURE__ */ jsx_runtime6.jsxs("code", {
873
+ children: [
874
+ '"',
875
+ "png",
876
+ '"'
877
+ ]
878
+ }),
879
+ " ",
880
+ "as the image format to have accurate color transformations throughout.",
881
+ /* @__PURE__ */ jsx_runtime6.jsx("br", {}),
882
+ "Only since v4.0.83, colorspace conversion is actually performed, previously it would only tag the metadata of the video."
883
+ ]
884
+ }),
885
+ docLink: "https://www.remotion.dev/docs/renderer/render-media#colorspace",
886
+ ssrName: "colorSpace",
887
+ type: DEFAULT_COLOR_SPACE,
888
+ getValue: ({ commandLine }) => {
889
+ if (commandLine[cliFlag8] !== undefined) {
890
+ return {
891
+ source: "cli",
892
+ value: commandLine[cliFlag8]
893
+ };
894
+ }
895
+ if (colorSpace !== DEFAULT_COLOR_SPACE) {
896
+ return {
897
+ source: "config",
898
+ value: colorSpace
899
+ };
900
+ }
901
+ return {
902
+ source: "default",
903
+ value: DEFAULT_COLOR_SPACE
904
+ };
905
+ },
906
+ setConfig: (value) => {
907
+ colorSpace = value ?? DEFAULT_COLOR_SPACE;
908
+ }
909
+ };
910
+
911
+ // src/options/crf.tsx
912
+ var jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
913
+ var currentCrf;
914
+ var validateCrf = (newCrf) => {
915
+ if (typeof newCrf !== "number" && newCrf !== undefined) {
916
+ throw new TypeError("The CRF must be a number or undefined.");
917
+ }
918
+ };
919
+ var cliFlag9 = "crf";
920
+ var crfOption = {
921
+ name: "CRF",
922
+ cliFlag: cliFlag9,
923
+ description: () => /* @__PURE__ */ jsx_runtime7.jsx(jsx_runtime7.Fragment, {
924
+ children: "No matter which codec you end up using, there's always a tradeoff between file size and video quality. You can control it by setting the CRF (Constant Rate Factor). The lower the number, the better the quality, the higher the number, the smaller the file is – of course at the cost of quality."
925
+ }),
926
+ ssrName: "crf",
927
+ docLink: "https://www.remotion.dev/docs/encoding/#controlling-quality-using-the-crf-setting",
928
+ type: 0,
929
+ getValue: ({ commandLine }) => {
930
+ if (commandLine[cliFlag9] !== undefined) {
931
+ validateCrf(commandLine[cliFlag9]);
932
+ return {
933
+ source: "cli",
934
+ value: commandLine[cliFlag9]
935
+ };
936
+ }
937
+ if (currentCrf !== null) {
938
+ return {
939
+ source: "config",
940
+ value: currentCrf
941
+ };
942
+ }
943
+ return {
944
+ source: "default",
945
+ value: undefined
946
+ };
947
+ },
948
+ setConfig: (crf) => {
949
+ validateCrf(crf);
950
+ currentCrf = crf;
951
+ }
952
+ };
953
+
954
+ // src/options/delete-after.tsx
955
+ var jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
956
+ var cliFlag10 = "delete-after";
957
+ var deleteAfter = null;
958
+ var deleteAfterOption = {
959
+ name: "Lambda render expiration",
960
+ cliFlag: cliFlag10,
961
+ description: () => {
962
+ return /* @__PURE__ */ jsx_runtime8.jsxs(jsx_runtime8.Fragment, {
963
+ children: [
964
+ "Automatically delete the render after a certain period. Accepted values are ",
965
+ /* @__PURE__ */ jsx_runtime8.jsx("code", {
966
+ children: "1-day"
967
+ }),
968
+ ", ",
969
+ /* @__PURE__ */ jsx_runtime8.jsx("code", {
970
+ children: "3-days"
971
+ }),
972
+ ", ",
973
+ /* @__PURE__ */ jsx_runtime8.jsx("code", {
974
+ children: "7-days"
975
+ }),
976
+ " and",
977
+ " ",
978
+ /* @__PURE__ */ jsx_runtime8.jsx("code", {
979
+ children: "30-days"
980
+ }),
981
+ ".",
982
+ /* @__PURE__ */ jsx_runtime8.jsx("br", {}),
983
+ " For this to work, your bucket needs to have",
984
+ " ",
985
+ /* @__PURE__ */ jsx_runtime8.jsx("a", {
986
+ href: "/docs/lambda/autodelete",
987
+ children: "lifecycles enabled"
988
+ }),
989
+ "."
990
+ ]
991
+ });
992
+ },
993
+ ssrName: "deleteAfter",
994
+ docLink: "https://www.remotion.dev/docs/lambda/autodelete",
995
+ type: "1-day",
996
+ getValue: ({ commandLine }) => {
997
+ if (commandLine[cliFlag10] !== undefined) {
998
+ return {
999
+ source: "cli",
1000
+ value: commandLine[cliFlag10]
1001
+ };
1002
+ }
1003
+ if (deleteAfter !== null) {
1004
+ return {
1005
+ source: "config",
1006
+ value: deleteAfter
1007
+ };
1008
+ }
1009
+ return {
1010
+ source: "default",
1011
+ value: null
1012
+ };
1013
+ },
1014
+ setConfig: (value) => {
1015
+ deleteAfter = value;
1016
+ }
1017
+ };
1018
+
1019
+ // src/options/disable-git-source.tsx
1020
+ var DEFAULT2 = false;
1021
+ var cliFlag11 = "disable-git-source";
1022
+ var disableGitSourceOption = {
1023
+ cliFlag: cliFlag11,
1024
+ description: () => `Disables the Git Source being connected to the Remotion Studio. Clicking on stack traces and certain menu items will be disabled.`,
1025
+ docLink: "https://remotion.dev/docs/bundle",
1026
+ getValue: ({ commandLine }) => {
1027
+ if (commandLine[cliFlag11]) {
1028
+ return {
1029
+ source: "cli",
1030
+ value: commandLine[cliFlag11]
1031
+ };
1032
+ }
1033
+ return {
1034
+ source: "default",
1035
+ value: DEFAULT2
1036
+ };
1037
+ },
1038
+ name: "Disable Git source",
1039
+ setConfig: () => {
1040
+ throw new Error("Not implemented");
1041
+ },
1042
+ ssrName: "disableGitSource",
1043
+ type: false
1044
+ };
1045
+
1046
+ // src/options/enable-lambda-insights.tsx
1047
+ var jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
1048
+ var cliFlag12 = "enable-lambda-insights";
1049
+ var option = false;
1050
+ var enableLambdaInsights = {
1051
+ name: "Enable Lambda Insights",
1052
+ cliFlag: cliFlag12,
1053
+ description: () => /* @__PURE__ */ jsx_runtime9.jsxs(jsx_runtime9.Fragment, {
1054
+ children: [
1055
+ "Enable",
1056
+ " ",
1057
+ /* @__PURE__ */ jsx_runtime9.jsx("a", {
1058
+ href: "https://remotion.dev/docs/lambda/insights",
1059
+ children: "Lambda Insights in AWS CloudWatch"
1060
+ }),
1061
+ ". For this to work, you may have to update your role permission."
1062
+ ]
1063
+ }),
1064
+ ssrName: "enableLambdaInsights",
1065
+ docLink: "https://www.remotion.dev/docs/lambda/insights",
1066
+ type: false,
1067
+ setConfig: (value) => {
1068
+ option = value;
1069
+ },
1070
+ getValue: ({ commandLine }) => {
1071
+ if (commandLine[cliFlag12] !== undefined) {
1072
+ return {
1073
+ value: commandLine[cliFlag12],
1074
+ source: "cli"
1075
+ };
1076
+ }
1077
+ if (option) {
1078
+ return {
1079
+ value: option,
1080
+ source: "config"
1081
+ };
1082
+ }
1083
+ return {
1084
+ value: false,
1085
+ source: "default"
1086
+ };
1087
+ }
1088
+ };
1089
+
1090
+ // src/options/enable-multiprocess-on-linux.tsx
1091
+ var jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
1092
+ var DEFAULT_VALUE = true;
1093
+ var multiProcessOnLinux = DEFAULT_VALUE;
1094
+ var cliFlag13 = "enable-multiprocess-on-linux";
1095
+ var enableMultiprocessOnLinuxOption = {
1096
+ name: "Enable Multiprocess on Linux",
1097
+ cliFlag: cliFlag13,
1098
+ description: () => /* @__PURE__ */ jsx_runtime10.jsxs(jsx_runtime10.Fragment, {
1099
+ children: [
1100
+ "Removes the ",
1101
+ /* @__PURE__ */ jsx_runtime10.jsx("code", {
1102
+ children: "--single-process"
1103
+ }),
1104
+ " flag that gets passed to Chromium on Linux by default. This will make the render faster because multiple processes can be used, but may cause issues with some Linux distributions or if window server libraries are missing.",
1105
+ /* @__PURE__ */ jsx_runtime10.jsx("br", {}),
1106
+ "Default: ",
1107
+ /* @__PURE__ */ jsx_runtime10.jsx("code", {
1108
+ children: "false"
1109
+ }),
1110
+ " until v4.0.136, then ",
1111
+ /* @__PURE__ */ jsx_runtime10.jsx("code", {
1112
+ children: "true"
1113
+ }),
1114
+ " from v4.0.137 on because newer Chrome versions ",
1115
+ "don't",
1116
+ " allow rendering with the ",
1117
+ /* @__PURE__ */ jsx_runtime10.jsx("code", {
1118
+ children: "--single-process"
1119
+ }),
1120
+ " flag. ",
1121
+ /* @__PURE__ */ jsx_runtime10.jsx("br", {}),
1122
+ "This flag will be removed in Remotion v5.0."
1123
+ ]
1124
+ }),
1125
+ ssrName: "chromiumOptions.enableMultiprocessOnLinux",
1126
+ docLink: "https://www.remotion.dev/docs/chromium-flags",
1127
+ type: false,
1128
+ getValue: ({ commandLine }) => {
1129
+ if (commandLine[cliFlag13] !== undefined) {
1130
+ return {
1131
+ source: "cli",
1132
+ value: commandLine[cliFlag13]
1133
+ };
1134
+ }
1135
+ if (multiProcessOnLinux !== false) {
1136
+ return {
1137
+ source: "config",
1138
+ value: multiProcessOnLinux
1139
+ };
1140
+ }
1141
+ return {
1142
+ source: "default",
1143
+ value: DEFAULT_VALUE
1144
+ };
1145
+ },
1146
+ setConfig: (value) => {
1147
+ multiProcessOnLinux = value;
1148
+ }
1149
+ };
1150
+
1151
+ // src/options/encoding-buffer-size.tsx
1152
+ var jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
1153
+ var encodingBufferSize = null;
1154
+ var setEncodingBufferSize = (bitrate) => {
1155
+ encodingBufferSize = bitrate;
1156
+ };
1157
+ var cliFlag14 = "buffer-size";
1158
+ var encodingBufferSizeOption = {
1159
+ name: "FFmpeg -bufsize flag",
1160
+ cliFlag: cliFlag14,
1161
+ description: () => /* @__PURE__ */ jsx_runtime11.jsxs(jsx_runtime11.Fragment, {
1162
+ children: [
1163
+ "The value for the ",
1164
+ /* @__PURE__ */ jsx_runtime11.jsx("code", {
1165
+ children: "-bufsize"
1166
+ }),
1167
+ " flag of FFmpeg. Should be used in conjunction with the encoding max rate flag."
1168
+ ]
1169
+ }),
1170
+ ssrName: "encodingBufferSize",
1171
+ docLink: "https://www.remotion.dev/docs/renderer/render-media#encodingbuffersize",
1172
+ type: "",
1173
+ getValue: ({ commandLine }) => {
1174
+ if (commandLine[cliFlag14] !== undefined) {
1175
+ return {
1176
+ value: commandLine[cliFlag14],
1177
+ source: "cli"
1178
+ };
1179
+ }
1180
+ if (encodingBufferSize !== null) {
1181
+ return {
1182
+ value: encodingBufferSize,
1183
+ source: "config"
1184
+ };
1185
+ }
1186
+ return {
1187
+ value: null,
1188
+ source: "default"
1189
+ };
1190
+ },
1191
+ setConfig: setEncodingBufferSize
1192
+ };
1193
+
1194
+ // src/options/encoding-max-rate.tsx
1195
+ var jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
1196
+ var encodingMaxRate = null;
1197
+ var cliFlag15 = "max-rate";
1198
+ var encodingMaxRateOption = {
1199
+ name: "FFmpeg -maxrate flag",
1200
+ cliFlag: cliFlag15,
1201
+ description: () => /* @__PURE__ */ jsx_runtime12.jsxs(jsx_runtime12.Fragment, {
1202
+ children: [
1203
+ "The value for the ",
1204
+ /* @__PURE__ */ jsx_runtime12.jsx("code", {
1205
+ children: "-maxrate"
1206
+ }),
1207
+ " flag of FFmpeg. Should be used in conjunction with the encoding buffer size flag."
1208
+ ]
1209
+ }),
1210
+ ssrName: "encodingMaxRate",
1211
+ docLink: "https://www.remotion.dev/docs/renderer/render-media#encodingmaxrate",
1212
+ type: "",
1213
+ getValue: ({ commandLine }) => {
1214
+ if (commandLine[cliFlag15] !== undefined) {
1215
+ return {
1216
+ value: commandLine[cliFlag15],
1217
+ source: "cli"
1218
+ };
1219
+ }
1220
+ if (encodingMaxRate !== null) {
1221
+ return {
1222
+ value: encodingMaxRate,
1223
+ source: "config"
1224
+ };
1225
+ }
1226
+ return {
1227
+ value: null,
1228
+ source: "default"
1229
+ };
1230
+ },
1231
+ setConfig: (newMaxRate) => {
1232
+ encodingMaxRate = newMaxRate;
1233
+ }
1234
+ };
1235
+
1236
+ // src/options/enforce-audio.tsx
1237
+ var jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
1238
+ var DEFAULT_ENFORCE_AUDIO_TRACK = false;
1239
+ var enforceAudioTrackState = DEFAULT_ENFORCE_AUDIO_TRACK;
1240
+ var cliFlag16 = "enforce-audio-track";
1241
+ var enforceAudioOption = {
1242
+ name: "Enforce Audio Track",
1243
+ cliFlag: cliFlag16,
1244
+ description: () => /* @__PURE__ */ jsx_runtime13.jsx(jsx_runtime13.Fragment, {
1245
+ children: "Render a silent audio track if there would be none otherwise."
1246
+ }),
1247
+ ssrName: "enforceAudioTrack",
1248
+ docLink: "https://www.remotion.dev/docs/config#setenforceaudiotrack-",
1249
+ type: false,
1250
+ getValue: ({ commandLine }) => {
1251
+ if (commandLine[cliFlag16]) {
1252
+ return {
1253
+ source: "cli",
1254
+ value: true
1255
+ };
1256
+ }
1257
+ if (enforceAudioTrackState !== DEFAULT_ENFORCE_AUDIO_TRACK) {
1258
+ return {
1259
+ source: "config",
1260
+ value: enforceAudioTrackState
1261
+ };
1262
+ }
1263
+ return {
1264
+ source: "default",
1265
+ value: DEFAULT_ENFORCE_AUDIO_TRACK
1266
+ };
1267
+ },
1268
+ setConfig: (value) => {
1269
+ enforceAudioTrackState = value;
1270
+ }
1271
+ };
1272
+
1273
+ // src/options/folder-expiry.tsx
1274
+ var jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
1275
+ var enableFolderExpiry = null;
1276
+ var cliFlag17 = "enable-folder-expiry";
1277
+ var folderExpiryOption = {
1278
+ name: "Lambda render expiration",
1279
+ cliFlag: cliFlag17,
1280
+ description: () => {
1281
+ return /* @__PURE__ */ jsx_runtime14.jsxs(jsx_runtime14.Fragment, {
1282
+ children: [
1283
+ "When deploying sites, enable or disable S3 Lifecycle policies which allow for renders to auto-delete after a certain time. Default is",
1284
+ " ",
1285
+ /* @__PURE__ */ jsx_runtime14.jsx("code", {
1286
+ children: "null"
1287
+ }),
1288
+ ", which does not change any lifecycle policies of the S3 bucket. See: ",
1289
+ /* @__PURE__ */ jsx_runtime14.jsx("a", {
1290
+ href: "/docs/lambda/autodelete",
1291
+ children: "Lambda autodelete"
1292
+ }),
1293
+ "."
1294
+ ]
1295
+ });
1296
+ },
1297
+ ssrName: "enableFolderExpiry",
1298
+ docLink: "https://www.remotion.dev/docs/lambda/autodelete",
1299
+ type: false,
1300
+ getValue: ({ commandLine }) => {
1301
+ if (commandLine[cliFlag17] !== undefined) {
1302
+ return {
1303
+ source: "cli",
1304
+ value: commandLine[cliFlag17]
1305
+ };
1306
+ }
1307
+ if (enableFolderExpiry !== null) {
1308
+ return {
1309
+ source: "config",
1310
+ value: enableFolderExpiry
1311
+ };
1312
+ }
1313
+ return {
1314
+ source: "default",
1315
+ value: null
1316
+ };
1317
+ },
1318
+ setConfig: (value) => {
1319
+ enableFolderExpiry = value;
1320
+ }
1321
+ };
1322
+
1323
+ // src/options/for-seamless-aac-concatenation.tsx
1324
+ var jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
1325
+ var DEFAULT3 = false;
1326
+ var forSeamlessAacConcatenation = DEFAULT3;
1327
+ var cliFlag18 = "for-seamless-aac-concatenation";
1328
+ var forSeamlessAacConcatenationOption = {
1329
+ name: "For seamless AAC concatenation",
1330
+ cliFlag: cliFlag18,
1331
+ description: () => /* @__PURE__ */ jsx_runtime15.jsxs(jsx_runtime15.Fragment, {
1332
+ children: [
1333
+ "If enabled, the audio is trimmed to the nearest AAC frame, which is required for seamless concatenation of AAC files. This is a requirement if you later want to combine multiple video snippets seamlessly.",
1334
+ /* @__PURE__ */ jsx_runtime15.jsx("br", {}),
1335
+ /* @__PURE__ */ jsx_runtime15.jsx("br", {}),
1336
+ " This option is used internally. There is currently no documentation yet for to concatenate the audio chunks."
1337
+ ]
1338
+ }),
1339
+ docLink: "https://remotion.dev/docs/renderer",
1340
+ getValue: ({ commandLine }) => {
1341
+ if (commandLine[cliFlag18]) {
1342
+ return {
1343
+ source: "cli",
1344
+ value: true
1345
+ };
1346
+ }
1347
+ if (forSeamlessAacConcatenation !== DEFAULT3) {
1348
+ return {
1349
+ source: "config",
1350
+ value: forSeamlessAacConcatenation
1351
+ };
1352
+ }
1353
+ return {
1354
+ source: "default",
1355
+ value: DEFAULT3
1356
+ };
1357
+ },
1358
+ setConfig: (value) => {
1359
+ forSeamlessAacConcatenation = value;
1360
+ },
1361
+ ssrName: "forSeamlessAacConcatenation",
1362
+ type: false
1363
+ };
1364
+
1365
+ // src/options/gl.tsx
1366
+ var jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
1367
+ var validOpenGlRenderers = [
1368
+ "swangle",
1369
+ "angle",
1370
+ "egl",
1371
+ "swiftshader",
1372
+ "vulkan",
1373
+ "angle-egl"
1374
+ ];
1375
+ var DEFAULT_OPENGL_RENDERER = null;
1376
+ var openGlRenderer = DEFAULT_OPENGL_RENDERER;
1377
+ var AngleChangelog = () => {
1378
+ return /* @__PURE__ */ jsx_runtime16.jsxs("details", {
1379
+ style: { fontSize: "0.9em", marginBottom: "1em" },
1380
+ children: [
1381
+ /* @__PURE__ */ jsx_runtime16.jsx("summary", {
1382
+ children: "Changelog"
1383
+ }),
1384
+ /* @__PURE__ */ jsx_runtime16.jsxs("ul", {
1385
+ children: [
1386
+ /* @__PURE__ */ jsx_runtime16.jsxs("li", {
1387
+ children: [
1388
+ "From Remotion v2.6.7 until v3.0.7, the default for Remotion Lambda was",
1389
+ " ",
1390
+ /* @__PURE__ */ jsx_runtime16.jsx("code", {
1391
+ children: "swiftshader"
1392
+ }),
1393
+ ", but from v3.0.8 the default is",
1394
+ " ",
1395
+ /* @__PURE__ */ jsx_runtime16.jsx("code", {
1396
+ children: "swangle"
1397
+ }),
1398
+ " (Swiftshader on Angle) since Chrome 101 added support for it."
1399
+ ]
1400
+ }),
1401
+ /* @__PURE__ */ jsx_runtime16.jsxs("li", {
1402
+ children: [
1403
+ "From Remotion v2.4.3 until v2.6.6, the default was ",
1404
+ /* @__PURE__ */ jsx_runtime16.jsx("code", {
1405
+ children: "angle"
1406
+ }),
1407
+ ", however it turns out to have a small memory leak that could crash long Remotion renders."
1408
+ ]
1409
+ })
1410
+ ]
1411
+ })
1412
+ ]
1413
+ });
1414
+ };
1415
+ var cliFlag19 = "gl";
1416
+ var glOption = {
1417
+ cliFlag: cliFlag19,
1418
+ docLink: "https://www.remotion.dev/docs/chromium-flags#--gl",
1419
+ name: "OpenGL renderer",
1420
+ type: "angle",
1421
+ ssrName: "gl",
1422
+ description: () => {
1423
+ return /* @__PURE__ */ jsx_runtime16.jsxs(jsx_runtime16.Fragment, {
1424
+ children: [
1425
+ /* @__PURE__ */ jsx_runtime16.jsx(AngleChangelog, {}),
1426
+ /* @__PURE__ */ jsx_runtime16.jsxs("p", {
1427
+ children: [
1428
+ "Select the OpenGL renderer backend for Chromium. ",
1429
+ /* @__PURE__ */ jsx_runtime16.jsx("br", {}),
1430
+ "Accepted values:"
1431
+ ]
1432
+ }),
1433
+ /* @__PURE__ */ jsx_runtime16.jsxs("ul", {
1434
+ children: [
1435
+ /* @__PURE__ */ jsx_runtime16.jsx("li", {
1436
+ children: /* @__PURE__ */ jsx_runtime16.jsx("code", {
1437
+ children: '"angle"'
1438
+ })
1439
+ }),
1440
+ /* @__PURE__ */ jsx_runtime16.jsx("li", {
1441
+ children: /* @__PURE__ */ jsx_runtime16.jsx("code", {
1442
+ children: '"egl"'
1443
+ })
1444
+ }),
1445
+ /* @__PURE__ */ jsx_runtime16.jsx("li", {
1446
+ children: /* @__PURE__ */ jsx_runtime16.jsx("code", {
1447
+ children: '"swiftshader"'
1448
+ })
1449
+ }),
1450
+ /* @__PURE__ */ jsx_runtime16.jsx("li", {
1451
+ children: /* @__PURE__ */ jsx_runtime16.jsx("code", {
1452
+ children: '"swangle"'
1453
+ })
1454
+ }),
1455
+ /* @__PURE__ */ jsx_runtime16.jsxs("li", {
1456
+ children: [
1457
+ /* @__PURE__ */ jsx_runtime16.jsx("code", {
1458
+ children: '"vulkan"'
1459
+ }),
1460
+ " (",
1461
+ /* @__PURE__ */ jsx_runtime16.jsx("em", {
1462
+ children: "from Remotion v4.0.41"
1463
+ }),
1464
+ ")"
1465
+ ]
1466
+ }),
1467
+ /* @__PURE__ */ jsx_runtime16.jsxs("li", {
1468
+ children: [
1469
+ /* @__PURE__ */ jsx_runtime16.jsx("code", {
1470
+ children: '"angle-egl"'
1471
+ }),
1472
+ " (",
1473
+ /* @__PURE__ */ jsx_runtime16.jsx("em", {
1474
+ children: "from Remotion v4.0.51"
1475
+ }),
1476
+ ")"
1477
+ ]
1478
+ })
1479
+ ]
1480
+ }),
1481
+ /* @__PURE__ */ jsx_runtime16.jsxs("p", {
1482
+ children: [
1483
+ "The default is ",
1484
+ /* @__PURE__ */ jsx_runtime16.jsx("code", {
1485
+ children: "null"
1486
+ }),
1487
+ ", letting Chrome decide, except on Lambda where the default is ",
1488
+ /* @__PURE__ */ jsx_runtime16.jsx("code", {
1489
+ children: '"swangle"'
1490
+ })
1491
+ ]
1492
+ })
1493
+ ]
1494
+ });
1495
+ },
1496
+ getValue: ({ commandLine }) => {
1497
+ if (commandLine[cliFlag19]) {
1498
+ validateOpenGlRenderer(commandLine[cliFlag19]);
1499
+ return {
1500
+ value: commandLine[cliFlag19],
1501
+ source: "cli"
1502
+ };
1503
+ }
1504
+ if (openGlRenderer !== DEFAULT_OPENGL_RENDERER) {
1505
+ return {
1506
+ value: openGlRenderer,
1507
+ source: "config"
1508
+ };
1509
+ }
1510
+ return {
1511
+ value: DEFAULT_OPENGL_RENDERER,
1512
+ source: "default"
1513
+ };
1514
+ },
1515
+ setConfig: (value) => {
1516
+ validateOpenGlRenderer(value);
1517
+ openGlRenderer = value;
1518
+ }
1519
+ };
1520
+ var validateOpenGlRenderer = (option2) => {
1521
+ if (option2 === null) {
1522
+ return null;
1523
+ }
1524
+ if (!validOpenGlRenderers.includes(option2)) {
1525
+ throw new TypeError(`${option2} is not a valid GL backend. Accepted values: ${validOpenGlRenderers.join(", ")}`);
1526
+ }
1527
+ return option2;
1528
+ };
1529
+
1530
+ // src/options/hardware-acceleration.tsx
1531
+ var hardwareAccelerationOptions = [
1532
+ "disable",
1533
+ "if-possible",
1534
+ "required"
1535
+ ];
1536
+ var cliFlag20 = "hardware-acceleration";
1537
+ var currentValue = null;
1538
+ var hardwareAccelerationOption = {
1539
+ name: "Hardware Acceleration",
1540
+ cliFlag: cliFlag20,
1541
+ description: () => `
1542
+ One of
1543
+ ${new Intl.ListFormat("en", { type: "disjunction" }).format(hardwareAccelerationOptions.map((a) => JSON.stringify(a)))}
1544
+ . Default "disable". Encode using a hardware-accelerated encoder if
1545
+ available. If set to "required" and no hardware-accelerated encoder is
1546
+ available, then the render will fail.
1547
+ `,
1548
+ ssrName: "hardwareAcceleration",
1549
+ docLink: "https://www.remotion.dev/docs/encoding",
1550
+ type: "disable",
1551
+ getValue: ({ commandLine }) => {
1552
+ if (commandLine[cliFlag20] !== undefined) {
1553
+ const value = commandLine[cliFlag20];
1554
+ if (!hardwareAccelerationOptions.includes(value)) {
1555
+ throw new Error(`Invalid value for --${cliFlag20}: ${value}`);
1556
+ }
1557
+ return {
1558
+ source: "cli",
1559
+ value
1560
+ };
1561
+ }
1562
+ if (currentValue !== null) {
1563
+ return {
1564
+ source: "config",
1565
+ value: currentValue
1566
+ };
1567
+ }
1568
+ return {
1569
+ source: "default",
1570
+ value: "disable"
1571
+ };
1572
+ },
1573
+ setConfig: (value) => {
1574
+ if (!hardwareAccelerationOptions.includes(value)) {
1575
+ throw new Error(`Invalid value for --${cliFlag20}: ${value}`);
1576
+ }
1577
+ currentValue = value;
1578
+ }
1579
+ };
1580
+
1581
+ // src/options/headless.tsx
1582
+ var jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
1583
+ var DEFAULT4 = true;
1584
+ var headlessMode = DEFAULT4;
1585
+ var cliFlag21 = "disable-headless";
1586
+ var headlessOption = {
1587
+ name: "Disable Headless Mode",
1588
+ cliFlag: cliFlag21,
1589
+ description: () => /* @__PURE__ */ jsx_runtime17.jsxs(jsx_runtime17.Fragment, {
1590
+ children: [
1591
+ "Deprecated - will be removed in 5.0.0. With the migration to",
1592
+ " ",
1593
+ /* @__PURE__ */ jsx_runtime17.jsx("a", {
1594
+ href: "/docs/miscellaneous/chrome-headless-shell",
1595
+ children: "Chrome Headless Shell"
1596
+ }),
1597
+ ", this option is not functional anymore.",
1598
+ /* @__PURE__ */ jsx_runtime17.jsx("br", {}),
1599
+ /* @__PURE__ */ jsx_runtime17.jsx("br", {}),
1600
+ " If disabled, the render will open an actual Chrome window where you can see the render happen. The default is headless mode."
1601
+ ]
1602
+ }),
1603
+ ssrName: "headless",
1604
+ docLink: "https://www.remotion.dev/docs/chromium-flags#--disable-headless",
1605
+ type: false,
1606
+ getValue: ({ commandLine }) => {
1607
+ if (commandLine[cliFlag21] !== undefined) {
1608
+ return {
1609
+ source: "cli",
1610
+ value: !commandLine[cliFlag21]
1611
+ };
1612
+ }
1613
+ if (headlessMode !== DEFAULT4) {
1614
+ return {
1615
+ source: "config",
1616
+ value: headlessMode
1617
+ };
1618
+ }
1619
+ return {
1620
+ source: "default",
1621
+ value: headlessMode
1622
+ };
1623
+ },
1624
+ setConfig: (value) => {
1625
+ headlessMode = value;
1626
+ }
1627
+ };
1628
+
1629
+ // src/options/jpeg-quality.tsx
1630
+ var jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
1631
+ var defaultValue = DEFAULT_JPEG_QUALITY;
1632
+ var quality = defaultValue;
1633
+ var setJpegQuality = (q) => {
1634
+ validateJpegQuality(q);
1635
+ if (q === 0 || q === undefined) {
1636
+ quality = defaultValue;
1637
+ return;
1638
+ }
1639
+ quality = q;
1640
+ };
1641
+ var cliFlag22 = "jpeg-quality";
1642
+ var jpegQualityOption = {
1643
+ name: "JPEG Quality",
1644
+ cliFlag: cliFlag22,
1645
+ description: () => /* @__PURE__ */ jsx_runtime18.jsx(jsx_runtime18.Fragment, {
1646
+ children: "Sets the quality of the generated JPEG images. Must be an integer between 0 and 100. Default: 80."
1647
+ }),
1648
+ ssrName: "jpegQuality",
1649
+ docLink: "https://www.remotion.dev/docs/renderer/render-media#jpeg-quality",
1650
+ type: 0,
1651
+ setConfig: setJpegQuality,
1652
+ getValue: ({ commandLine }) => {
1653
+ if (commandLine[cliFlag22] !== undefined) {
1654
+ validateJpegQuality(commandLine[cliFlag22]);
1655
+ return {
1656
+ source: "cli",
1657
+ value: commandLine[cliFlag22]
1658
+ };
1659
+ }
1660
+ if (quality !== defaultValue) {
1661
+ return {
1662
+ source: "config",
1663
+ value: quality
1664
+ };
1665
+ }
1666
+ return {
1667
+ source: "default",
1668
+ value: defaultValue
1669
+ };
1670
+ }
1671
+ };
1672
+
1673
+ // src/options/log-level.tsx
1674
+ var jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
1675
+ var logLevel = "info";
1676
+ var cliFlag23 = "log";
1677
+ var logLevelOption = {
1678
+ cliFlag: cliFlag23,
1679
+ name: "Log Level",
1680
+ ssrName: "logLevel",
1681
+ description: () => /* @__PURE__ */ jsx_runtime19.jsxs(jsx_runtime19.Fragment, {
1682
+ children: [
1683
+ "One of ",
1684
+ /* @__PURE__ */ jsx_runtime19.jsx("code", {
1685
+ children: "trace"
1686
+ }),
1687
+ ", ",
1688
+ /* @__PURE__ */ jsx_runtime19.jsx("code", {
1689
+ children: "verbose"
1690
+ }),
1691
+ ", ",
1692
+ /* @__PURE__ */ jsx_runtime19.jsx("code", {
1693
+ children: "info"
1694
+ }),
1695
+ ",",
1696
+ " ",
1697
+ /* @__PURE__ */ jsx_runtime19.jsx("code", {
1698
+ children: "warn"
1699
+ }),
1700
+ ", ",
1701
+ /* @__PURE__ */ jsx_runtime19.jsx("code", {
1702
+ children: "error"
1703
+ }),
1704
+ ".",
1705
+ /* @__PURE__ */ jsx_runtime19.jsx("br", {}),
1706
+ " Determines how much info is being logged to the console.",
1707
+ /* @__PURE__ */ jsx_runtime19.jsx("br", {}),
1708
+ /* @__PURE__ */ jsx_runtime19.jsx("br", {}),
1709
+ " Default ",
1710
+ /* @__PURE__ */ jsx_runtime19.jsx("code", {
1711
+ children: "info"
1712
+ }),
1713
+ "."
1714
+ ]
1715
+ }),
1716
+ docLink: "https://www.remotion.dev/docs/troubleshooting/debug-failed-render",
1717
+ getValue: ({ commandLine }) => {
1718
+ if (commandLine[cliFlag23]) {
1719
+ if (!isValidLogLevel(commandLine[cliFlag23])) {
1720
+ throw new Error(`Invalid \`--log\` value passed. Accepted values: ${logLevels.map((l) => `'${l}'`).join(", ")}.`);
1721
+ }
1722
+ return { value: commandLine[cliFlag23], source: "cli" };
1723
+ }
1724
+ if (logLevel !== "info") {
1725
+ return { value: logLevel, source: "config" };
1726
+ }
1727
+ return { value: "info", source: "default" };
1728
+ },
1729
+ setConfig: (newLogLevel) => {
1730
+ logLevel = newLogLevel;
1731
+ },
1732
+ type: "error"
1733
+ };
1734
+
1735
+ // src/options/metadata.tsx
1736
+ var jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
1737
+ var metadata = {};
1738
+ var cliFlag24 = "metadata";
1739
+ var metadataOption = {
1740
+ name: "Metadata",
1741
+ cliFlag: cliFlag24,
1742
+ description: (mode) => {
1743
+ if (mode === "ssr") {
1744
+ return /* @__PURE__ */ jsx_runtime20.jsxs(jsx_runtime20.Fragment, {
1745
+ children: [
1746
+ "An object containing metadata to be embedded in the video. See",
1747
+ " ",
1748
+ /* @__PURE__ */ jsx_runtime20.jsx("a", {
1749
+ href: "/docs/metadata",
1750
+ children: "here"
1751
+ }),
1752
+ " for which metadata is accepted."
1753
+ ]
1754
+ });
1755
+ }
1756
+ return /* @__PURE__ */ jsx_runtime20.jsxs(jsx_runtime20.Fragment, {
1757
+ children: [
1758
+ "Metadata to be embedded in the video. See",
1759
+ " ",
1760
+ /* @__PURE__ */ jsx_runtime20.jsx("a", {
1761
+ href: "/docs/metadata",
1762
+ children: "here"
1763
+ }),
1764
+ " for which metadata is accepted.",
1765
+ /* @__PURE__ */ jsx_runtime20.jsx("br", {}),
1766
+ "The parameter must be in the format of ",
1767
+ /* @__PURE__ */ jsx_runtime20.jsx("code", {
1768
+ children: "--metadata key=value"
1769
+ }),
1770
+ " ",
1771
+ "and can be passed multiple times."
1772
+ ]
1773
+ });
1774
+ },
1775
+ docLink: "https://www.remotion.dev/docs/metadata",
1776
+ type: {},
1777
+ getValue: ({ commandLine }) => {
1778
+ if (commandLine[cliFlag24] !== undefined) {
1779
+ const val = commandLine[cliFlag24];
1780
+ const array = typeof val === "string" ? [val] : val;
1781
+ const keyValues = array.map((a) => {
1782
+ if (!a.includes("=")) {
1783
+ throw new Error(`"metadata" must be in the format of key=value, but got ${a}`);
1784
+ }
1785
+ const splitted = a.split("=");
1786
+ if (splitted.length !== 2) {
1787
+ throw new Error(`"metadata" must be in the format of key=value, but got ${a}`);
1788
+ }
1789
+ return [splitted[0], splitted[1]];
1790
+ });
1791
+ const value = Object.fromEntries(keyValues);
1792
+ return {
1793
+ source: "config",
1794
+ value
1795
+ };
1796
+ }
1797
+ return {
1798
+ source: "config",
1799
+ value: metadata
1800
+ };
1801
+ },
1802
+ setConfig: (newMetadata) => {
1803
+ metadata = newMetadata;
1804
+ },
1805
+ ssrName: "metadata"
1806
+ };
1807
+
1808
+ // src/options/mute.tsx
1809
+ var jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
1810
+ var DEFAULT_MUTED_STATE = false;
1811
+ var mutedState = DEFAULT_MUTED_STATE;
1812
+ var cliFlag25 = "muted";
1813
+ var mutedOption = {
1814
+ name: "Muted",
1815
+ cliFlag: cliFlag25,
1816
+ description: () => /* @__PURE__ */ jsx_runtime21.jsx(jsx_runtime21.Fragment, {
1817
+ children: "The Audio of the video will be omitted."
1818
+ }),
1819
+ ssrName: "muted",
1820
+ docLink: "https://www.remotion.dev/docs/using-audio/#muted-property",
1821
+ type: false,
1822
+ getValue: ({ commandLine }) => {
1823
+ if (commandLine[cliFlag25] !== null) {
1824
+ return {
1825
+ source: "cli",
1826
+ value: commandLine[cliFlag25]
1827
+ };
1828
+ }
1829
+ if (mutedState !== DEFAULT_MUTED_STATE) {
1830
+ return {
1831
+ source: "config",
1832
+ value: mutedState
1833
+ };
1834
+ }
1835
+ return {
1836
+ source: "config",
1837
+ value: mutedState
1838
+ };
1839
+ },
1840
+ setConfig: () => {
1841
+ mutedState = true;
1842
+ }
1843
+ };
1844
+
1845
+ // src/options/number-of-gif-loops.tsx
1846
+ var jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
1847
+ var currentLoop = null;
1848
+ var validate = (newLoop) => {
1849
+ if (newLoop !== null && typeof newLoop !== "number") {
1850
+ throw new Error("--number-of-gif-loops flag must be a number.");
1851
+ }
1852
+ };
1853
+ var cliFlag26 = "number-of-gif-loops";
1854
+ var numberOfGifLoopsOption = {
1855
+ name: "Number of GIF loops",
1856
+ cliFlag: cliFlag26,
1857
+ description: () => {
1858
+ return /* @__PURE__ */ jsx_runtime22.jsxs(jsx_runtime22.Fragment, {
1859
+ children: [
1860
+ "Allows you to set the number of loops as follows:",
1861
+ /* @__PURE__ */ jsx_runtime22.jsxs("ul", {
1862
+ children: [
1863
+ /* @__PURE__ */ jsx_runtime22.jsxs("li", {
1864
+ children: [
1865
+ /* @__PURE__ */ jsx_runtime22.jsx("code", {
1866
+ children: "null"
1867
+ }),
1868
+ " (or omitting in the CLI) plays the GIF indefinitely."
1869
+ ]
1870
+ }),
1871
+ /* @__PURE__ */ jsx_runtime22.jsxs("li", {
1872
+ children: [
1873
+ /* @__PURE__ */ jsx_runtime22.jsx("code", {
1874
+ children: "0"
1875
+ }),
1876
+ " disables looping"
1877
+ ]
1878
+ }),
1879
+ /* @__PURE__ */ jsx_runtime22.jsxs("li", {
1880
+ children: [
1881
+ /* @__PURE__ */ jsx_runtime22.jsx("code", {
1882
+ children: "1"
1883
+ }),
1884
+ " loops the GIF once (plays twice in total)"
1885
+ ]
1886
+ }),
1887
+ /* @__PURE__ */ jsx_runtime22.jsxs("li", {
1888
+ children: [
1889
+ /* @__PURE__ */ jsx_runtime22.jsx("code", {
1890
+ children: "2"
1891
+ }),
1892
+ " loops the GIF twice (plays three times in total) and so on."
1893
+ ]
1894
+ })
1895
+ ]
1896
+ })
1897
+ ]
1898
+ });
1899
+ },
1900
+ ssrName: "numberOfGifLoops",
1901
+ docLink: "https://www.remotion.dev/docs/render-as-gif#changing-the-number-of-loops",
1902
+ type: 0,
1903
+ getValue: ({ commandLine }) => {
1904
+ if (commandLine[cliFlag26] !== undefined) {
1905
+ validate(commandLine[cliFlag26]);
1906
+ return {
1907
+ value: commandLine[cliFlag26],
1908
+ source: "cli"
1909
+ };
1910
+ }
1911
+ if (currentLoop !== null) {
1912
+ return {
1913
+ value: currentLoop,
1914
+ source: "config"
1915
+ };
1916
+ }
1917
+ return {
1918
+ value: null,
1919
+ source: "default"
1920
+ };
1921
+ },
1922
+ setConfig: (newLoop) => {
1923
+ validate(newLoop);
1924
+ currentLoop = newLoop;
1925
+ }
1926
+ };
1927
+
1928
+ // src/options/offthreadvideo-cache-size.tsx
1929
+ var jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
1930
+ var offthreadVideoCacheSizeInBytes = null;
1931
+ var cliFlag27 = "offthreadvideo-cache-size-in-bytes";
1932
+ var offthreadVideoCacheSizeInBytesOption = {
1933
+ name: "OffthreadVideo cache size",
1934
+ cliFlag: cliFlag27,
1935
+ description: () => /* @__PURE__ */ jsx_runtime23.jsxs(jsx_runtime23.Fragment, {
1936
+ children: [
1937
+ "From v4.0, Remotion has a cache for",
1938
+ " ",
1939
+ /* @__PURE__ */ jsx_runtime23.jsx("a", {
1940
+ href: "https://remotion.dev/docs/offthreadvideo",
1941
+ children: /* @__PURE__ */ jsx_runtime23.jsx("code", {
1942
+ children: "<OffthreadVideo>"
1943
+ })
1944
+ }),
1945
+ " ",
1946
+ "frames. The default is ",
1947
+ /* @__PURE__ */ jsx_runtime23.jsx("code", {
1948
+ children: "null"
1949
+ }),
1950
+ ", corresponding to half of the system memory available when the render starts.",
1951
+ /* @__PURE__ */ jsx_runtime23.jsx("br", {}),
1952
+ " This option allows to override the size of the cache. The higher it is, the faster the render will be, but the more memory will be used.",
1953
+ /* @__PURE__ */ jsx_runtime23.jsx("br", {}),
1954
+ "The used value will be printed when running in verbose mode.",
1955
+ /* @__PURE__ */ jsx_runtime23.jsx("br", {}),
1956
+ "Default: ",
1957
+ /* @__PURE__ */ jsx_runtime23.jsx("code", {
1958
+ children: "null"
1959
+ })
1960
+ ]
1961
+ }),
1962
+ ssrName: "offthreadVideoCacheSizeInBytes",
1963
+ docLink: "https://www.remotion.dev/docs/offthreadvideo",
1964
+ type: 0,
1965
+ getValue: ({ commandLine }) => {
1966
+ if (commandLine[cliFlag27] !== undefined) {
1967
+ return {
1968
+ source: "cli",
1969
+ value: commandLine[cliFlag27]
1970
+ };
1971
+ }
1972
+ if (offthreadVideoCacheSizeInBytes !== null) {
1973
+ return {
1974
+ source: "config",
1975
+ value: offthreadVideoCacheSizeInBytes
1976
+ };
1977
+ }
1978
+ return {
1979
+ source: "default",
1980
+ value: null
1981
+ };
1982
+ },
1983
+ setConfig: (size) => {
1984
+ offthreadVideoCacheSizeInBytes = size ?? null;
1985
+ }
1986
+ };
1987
+
1988
+ // src/options/offthreadvideo-threads.tsx
1989
+ var jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
1990
+ var value = null;
1991
+ var cliFlag28 = "offthreadvideo-video-threads";
1992
+ var offthreadVideoThreadsOption = {
1993
+ name: "OffthreadVideo threads",
1994
+ cliFlag: cliFlag28,
1995
+ description: () => /* @__PURE__ */ jsx_runtime24.jsxs(jsx_runtime24.Fragment, {
1996
+ children: [
1997
+ "The number of threads that",
1998
+ /* @__PURE__ */ jsx_runtime24.jsx("a", {
1999
+ href: "https://remotion.dev/docs/offthreadvideo",
2000
+ children: /* @__PURE__ */ jsx_runtime24.jsx("code", {
2001
+ children: "<OffthreadVideo>"
2002
+ })
2003
+ }),
2004
+ " ",
2005
+ "can start to extract frames. frames. The default is",
2006
+ " ",
2007
+ DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS,
2008
+ ". Increase carefully, as too much threads may cause instability."
2009
+ ]
2010
+ }),
2011
+ ssrName: "offthreadVideoThreads",
2012
+ docLink: "https://www.remotion.dev/docs/offthreadvideo",
2013
+ type: 0,
2014
+ getValue: ({ commandLine }) => {
2015
+ if (commandLine[cliFlag28] !== undefined) {
2016
+ return {
2017
+ source: "cli",
2018
+ value: commandLine[cliFlag28]
2019
+ };
2020
+ }
2021
+ if (value !== null) {
2022
+ return {
2023
+ source: "config",
2024
+ value
2025
+ };
2026
+ }
2027
+ return {
2028
+ source: "default",
2029
+ value: null
2030
+ };
2031
+ },
2032
+ setConfig: (size) => {
2033
+ value = size ?? null;
2034
+ }
2035
+ };
2036
+ var DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS = 2;
2037
+
2038
+ // src/options/on-browser-download.tsx
2039
+ var jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
2040
+ var cliFlag29 = "on-browser-download";
2041
+ var onBrowserDownloadOption = {
2042
+ name: "Browser download callback function",
2043
+ cliFlag: cliFlag29,
2044
+ description: () => /* @__PURE__ */ jsx_runtime25.jsxs(jsx_runtime25.Fragment, {
2045
+ children: [
2046
+ "Gets called when no compatible local browser is detected on the system and this API needs to download a browser. Return a callback to observe progress.",
2047
+ " ",
2048
+ /* @__PURE__ */ jsx_runtime25.jsx("a", {
2049
+ href: "/docs/renderer/ensure-browser#onbrowserdownload",
2050
+ children: "See here for how to use this option."
2051
+ })
2052
+ ]
2053
+ }),
2054
+ ssrName: "onBrowserDownload",
2055
+ docLink: "https://www.remotion.dev/docs/renderer/ensure-browser",
2056
+ type: undefined,
2057
+ getValue: () => {
2058
+ throw new Error("does not support config file");
2059
+ },
2060
+ setConfig: () => {
2061
+ throw new Error("does not support config file");
2062
+ }
2063
+ };
2064
+
2065
+ // src/options/overwrite.tsx
2066
+ var jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
2067
+ var shouldOverwrite = null;
2068
+ var cliFlag30 = "overwrite";
2069
+ var validate2 = (value2) => {
2070
+ if (typeof value2 !== "boolean") {
2071
+ throw new Error(`overwriteExisting must be a boolean but got ${typeof value2} (${value2})`);
2072
+ }
2073
+ };
2074
+ var overwriteOption = {
2075
+ name: "Overwrite output",
2076
+ cliFlag: cliFlag30,
2077
+ description: () => /* @__PURE__ */ jsx_runtime26.jsxs(jsx_runtime26.Fragment, {
2078
+ children: [
2079
+ "If set to ",
2080
+ /* @__PURE__ */ jsx_runtime26.jsx("code", {
2081
+ children: "false"
2082
+ }),
2083
+ ", will prevent rendering to a path that already exists. Default is ",
2084
+ /* @__PURE__ */ jsx_runtime26.jsx("code", {
2085
+ children: "true"
2086
+ }),
2087
+ "."
2088
+ ]
2089
+ }),
2090
+ ssrName: "overwrite",
2091
+ docLink: "https://www.remotion.dev/docs/config#setoverwriteoutput",
2092
+ type: false,
2093
+ getValue: ({ commandLine }, defaultValue2) => {
2094
+ if (commandLine[cliFlag30] !== undefined) {
2095
+ validate2(commandLine[cliFlag30]);
2096
+ return {
2097
+ source: "cli",
2098
+ value: commandLine[cliFlag30]
2099
+ };
2100
+ }
2101
+ if (shouldOverwrite !== null) {
2102
+ return {
2103
+ source: "config",
2104
+ value: shouldOverwrite
2105
+ };
2106
+ }
2107
+ return {
2108
+ source: "default",
2109
+ value: defaultValue2
2110
+ };
2111
+ },
2112
+ setConfig: (value2) => {
2113
+ validate2(value2);
2114
+ shouldOverwrite = value2;
2115
+ }
2116
+ };
2117
+
2118
+ // src/options/prefer-lossless.tsx
2119
+ var jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
2120
+ var cliFlag31 = "prefer-lossless";
2121
+ var input = false;
2122
+ var preferLosslessAudioOption = {
2123
+ name: "Prefer lossless",
2124
+ cliFlag: cliFlag31,
2125
+ description: () => /* @__PURE__ */ jsx_runtime27.jsxs(jsx_runtime27.Fragment, {
2126
+ children: [
2127
+ "Uses a lossless audio codec, if one is available for the codec. If you set",
2128
+ /* @__PURE__ */ jsx_runtime27.jsx("code", {
2129
+ children: "audioCodec"
2130
+ }),
2131
+ ", it takes priority over",
2132
+ " ",
2133
+ /* @__PURE__ */ jsx_runtime27.jsx("code", {
2134
+ children: "preferLossless"
2135
+ }),
2136
+ "."
2137
+ ]
2138
+ }),
2139
+ docLink: "https://www.remotion.dev/docs/encoding",
2140
+ type: false,
2141
+ ssrName: "preferLossless",
2142
+ getValue: ({ commandLine }) => {
2143
+ if (commandLine[cliFlag31]) {
2144
+ return { value: true, source: "cli" };
2145
+ }
2146
+ if (input === true) {
2147
+ return { value: true, source: "config" };
2148
+ }
2149
+ return { value: false, source: "default" };
2150
+ },
2151
+ setConfig: (val) => {
2152
+ input = val;
2153
+ }
2154
+ };
2155
+
2156
+ // src/options/public-dir.tsx
2157
+ var jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
2158
+ var cliFlag32 = "public-dir";
2159
+ var currentPublicDir = null;
2160
+ var publicDirOption = {
2161
+ name: "Public Directory",
2162
+ cliFlag: cliFlag32,
2163
+ description: () => {
2164
+ return /* @__PURE__ */ jsx_runtime28.jsxs(jsx_runtime28.Fragment, {
2165
+ children: [
2166
+ "Define the location of the",
2167
+ " ",
2168
+ /* @__PURE__ */ jsx_runtime28.jsx("a", {
2169
+ href: "/docs/terminology/public-dir",
2170
+ children: /* @__PURE__ */ jsx_runtime28.jsx("code", {
2171
+ children: "public/ directory"
2172
+ })
2173
+ }),
2174
+ ". If not defined, Remotion will assume the location is the `public` folder in your Remotion root."
2175
+ ]
2176
+ });
2177
+ },
2178
+ ssrName: "publicDir",
2179
+ docLink: "https://www.remotion.dev/docs/terminology/public-dir",
2180
+ getValue: ({ commandLine }) => {
2181
+ if (commandLine[cliFlag32] !== undefined) {
2182
+ return {
2183
+ source: "cli",
2184
+ value: commandLine[cliFlag32]
2185
+ };
2186
+ }
2187
+ if (currentPublicDir !== null) {
2188
+ return {
2189
+ source: "config",
2190
+ value: currentPublicDir
2191
+ };
2192
+ }
2193
+ return {
2194
+ source: "default",
2195
+ value: null
2196
+ };
2197
+ },
2198
+ setConfig: (value2) => {
2199
+ currentPublicDir = value2;
2200
+ },
2201
+ type: ""
2202
+ };
2203
+
2204
+ // src/options/public-path.tsx
2205
+ var jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
2206
+ var cliFlag33 = "public-path";
2207
+ var currentPublicPath = null;
2208
+ var publicPathOption = {
2209
+ name: "Public Path",
2210
+ cliFlag: cliFlag33,
2211
+ description: () => {
2212
+ return /* @__PURE__ */ jsx_runtime29.jsxs(jsx_runtime29.Fragment, {
2213
+ children: [
2214
+ "The path of the URL where the bundle is going to be hosted. By default it is ",
2215
+ /* @__PURE__ */ jsx_runtime29.jsx("code", {
2216
+ children: "/"
2217
+ }),
2218
+ ", meaning that the bundle is going to be hosted at the root of the domain (e.g. ",
2219
+ /* @__PURE__ */ jsx_runtime29.jsx("code", {
2220
+ children: "https://localhost:3000/"
2221
+ }),
2222
+ "). If you are deploying to a subdirectory (e.g. ",
2223
+ /* @__PURE__ */ jsx_runtime29.jsx("code", {
2224
+ children: "/sites/my-site/"
2225
+ }),
2226
+ "), you should set this to the subdirectory."
2227
+ ]
2228
+ });
2229
+ },
2230
+ ssrName: "publicPath",
2231
+ docLink: "https://www.remotion.dev/docs/renderer",
2232
+ getValue: ({ commandLine }) => {
2233
+ if (commandLine[cliFlag33] !== undefined) {
2234
+ return {
2235
+ source: "cli",
2236
+ value: commandLine[cliFlag33]
2237
+ };
2238
+ }
2239
+ if (currentPublicPath !== null) {
2240
+ return {
2241
+ source: "config",
2242
+ value: currentPublicPath
2243
+ };
2244
+ }
2245
+ return {
2246
+ source: "default",
2247
+ value: null
2248
+ };
2249
+ },
2250
+ setConfig: (value2) => {
2251
+ currentPublicPath = value2;
2252
+ },
2253
+ type: ""
2254
+ };
2255
+
2256
+ // src/options/repro.tsx
2257
+ var jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
2258
+ var enableRepro = false;
2259
+ var setRepro = (should) => {
2260
+ enableRepro = should;
2261
+ };
2262
+ var cliFlag34 = "repro";
2263
+ var reproOption = {
2264
+ name: "Create reproduction",
2265
+ cliFlag: cliFlag34,
2266
+ description: () => /* @__PURE__ */ jsx_runtime30.jsx(jsx_runtime30.Fragment, {
2267
+ children: "Create a ZIP that you can submit to Remotion if asked for a reproduction."
2268
+ }),
2269
+ ssrName: "repro",
2270
+ docLink: "https://www.remotion.dev/docs/render-media#repro",
2271
+ type: false,
2272
+ getValue: ({ commandLine }) => {
2273
+ if (commandLine[cliFlag34] !== undefined) {
2274
+ return {
2275
+ value: commandLine[cliFlag34],
2276
+ source: "cli"
2277
+ };
2278
+ }
2279
+ if (enableRepro) {
2280
+ return {
2281
+ value: enableRepro,
2282
+ source: "config"
2283
+ };
2284
+ }
2285
+ return {
2286
+ value: false,
2287
+ source: "default"
2288
+ };
2289
+ },
2290
+ setConfig: setRepro
2291
+ };
2292
+
2293
+ // src/options/scale.tsx
2294
+ var jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
2295
+ var currentScale = 1;
2296
+ var cliFlag35 = "scale";
2297
+ var validateScale = (value2) => {
2298
+ if (typeof value2 !== "number") {
2299
+ throw new Error("scale must be a number.");
2300
+ }
2301
+ };
2302
+ var scaleOption = {
2303
+ name: "Scale",
2304
+ cliFlag: cliFlag35,
2305
+ description: () => /* @__PURE__ */ jsx_runtime31.jsxs(jsx_runtime31.Fragment, {
2306
+ children: [
2307
+ "Scales the output by a factor. For example, a 1280x720px frame will become a 1920x1080px frame with a scale factor of ",
2308
+ /* @__PURE__ */ jsx_runtime31.jsx("code", {
2309
+ children: "1.5"
2310
+ }),
2311
+ ". Vector elements like fonts and HTML markups will be rendered with extra details."
2312
+ ]
2313
+ }),
2314
+ ssrName: "scale",
2315
+ docLink: "https://www.remotion.dev/docs/scaling",
2316
+ type: 0,
2317
+ getValue: ({ commandLine }) => {
2318
+ if (commandLine[cliFlag35] !== undefined) {
2319
+ validateScale(commandLine[cliFlag35]);
2320
+ return {
2321
+ source: "cli",
2322
+ value: commandLine[cliFlag35]
2323
+ };
2324
+ }
2325
+ if (currentScale !== null) {
2326
+ return {
2327
+ source: "config",
2328
+ value: currentScale
2329
+ };
2330
+ }
2331
+ return {
2332
+ source: "default",
2333
+ value: 1
2334
+ };
2335
+ },
2336
+ setConfig: (scale) => {
2337
+ currentScale = scale;
2338
+ }
2339
+ };
2340
+
2341
+ // src/options/throw-if-site-exists.tsx
2342
+ var DEFAULT5 = false;
2343
+ var cliFlag36 = "throw-if-site-exists";
2344
+ var throwIfSiteExistsOption = {
2345
+ cliFlag: cliFlag36,
2346
+ description: () => `Prevents accidential update of an existing site. If there are any files in the subfolder where the site should be placed, the function will throw.`,
2347
+ docLink: "https://remotion.dev/docs/lambda/deploy-site",
2348
+ getValue: ({ commandLine }) => {
2349
+ if (commandLine[cliFlag36]) {
2350
+ return {
2351
+ source: "cli",
2352
+ value: commandLine[cliFlag36]
2353
+ };
2354
+ }
2355
+ return {
2356
+ source: "default",
2357
+ value: DEFAULT5
2358
+ };
2359
+ },
2360
+ name: "Throw if site exists",
2361
+ setConfig: () => {
2362
+ throw new Error("Not implemented");
2363
+ },
2364
+ ssrName: "throwIfSiteExists",
2365
+ type: false
2366
+ };
2367
+
2368
+ // src/options/timeout.tsx
2369
+ var jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
2370
+ var currentTimeout = DEFAULT_TIMEOUT;
2371
+ var validate3 = (value2) => {
2372
+ if (typeof value2 !== "number") {
2373
+ throw new Error("--timeout flag / setDelayRenderTimeoutInMilliseconds() must be a number, but got " + JSON.stringify(value2));
2374
+ }
2375
+ };
2376
+ var cliFlag37 = "timeout";
2377
+ var delayRenderTimeoutInMillisecondsOption = {
2378
+ name: "delayRender() timeout",
2379
+ cliFlag: cliFlag37,
2380
+ description: () => /* @__PURE__ */ jsx_runtime32.jsxs(jsx_runtime32.Fragment, {
2381
+ children: [
2382
+ "A number describing how long the render may take to resolve all",
2383
+ " ",
2384
+ /* @__PURE__ */ jsx_runtime32.jsx("a", {
2385
+ href: "https://remotion.dev/docs/delay-render",
2386
+ children: /* @__PURE__ */ jsx_runtime32.jsx("code", {
2387
+ children: "delayRender()"
2388
+ })
2389
+ }),
2390
+ " ",
2391
+ "calls ",
2392
+ /* @__PURE__ */ jsx_runtime32.jsx("a", {
2393
+ href: "https://remotion.dev/docs/timeout",
2394
+ children: "before it times out"
2395
+ }),
2396
+ ". Default: ",
2397
+ /* @__PURE__ */ jsx_runtime32.jsx("code", {
2398
+ children: "30000"
2399
+ })
2400
+ ]
2401
+ }),
2402
+ ssrName: "timeoutInMilliseconds",
2403
+ docLink: "https://www.remotion.dev/docs/timeout",
2404
+ type: 0,
2405
+ getValue: ({ commandLine }) => {
2406
+ if (commandLine[cliFlag37] !== undefined) {
2407
+ return {
2408
+ source: "cli",
2409
+ value: commandLine[cliFlag37]
2410
+ };
2411
+ }
2412
+ if (currentTimeout !== null) {
2413
+ validate3(currentTimeout);
2414
+ return {
2415
+ source: "config",
2416
+ value: currentTimeout
2417
+ };
2418
+ }
2419
+ return {
2420
+ source: "default",
2421
+ value: DEFAULT_TIMEOUT
2422
+ };
2423
+ },
2424
+ setConfig: (value2) => {
2425
+ validate3(value2);
2426
+ currentTimeout = value2;
2427
+ }
2428
+ };
2429
+
2430
+ // src/options/video-bitrate.tsx
2431
+ var jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
2432
+ var videoBitrate = null;
2433
+ var cliFlag38 = "video-bitrate";
2434
+ var videoBitrateOption = {
2435
+ name: "Video Bitrate",
2436
+ cliFlag: cliFlag38,
2437
+ description: () => /* @__PURE__ */ jsx_runtime33.jsxs(jsx_runtime33.Fragment, {
2438
+ children: [
2439
+ "Specify the target bitrate for the generated video. The syntax for FFmpeg",
2440
+ "'",
2441
+ "s",
2442
+ /* @__PURE__ */ jsx_runtime33.jsx("code", {
2443
+ children: "-b:v"
2444
+ }),
2445
+ " parameter should be used. FFmpeg may encode the video in a way that will not result in the exact video bitrate specified. Example values: ",
2446
+ /* @__PURE__ */ jsx_runtime33.jsx("code", {
2447
+ children: "512K"
2448
+ }),
2449
+ " for 512 kbps, ",
2450
+ /* @__PURE__ */ jsx_runtime33.jsx("code", {
2451
+ children: "1M"
2452
+ }),
2453
+ " for 1 Mbps."
2454
+ ]
2455
+ }),
2456
+ ssrName: "videoBitrate",
2457
+ docLink: "https://www.remotion.dev/docs/renderer/render-media#videobitrate-",
2458
+ type: "",
2459
+ getValue: ({ commandLine }) => {
2460
+ if (commandLine[cliFlag38] !== undefined) {
2461
+ return {
2462
+ source: "cli",
2463
+ value: commandLine[cliFlag38]
2464
+ };
2465
+ }
2466
+ if (videoBitrate !== null) {
2467
+ return {
2468
+ source: "config",
2469
+ value: videoBitrate
2470
+ };
2471
+ }
2472
+ return {
2473
+ source: "default",
2474
+ value: null
2475
+ };
2476
+ },
2477
+ setConfig: (bitrate) => {
2478
+ videoBitrate = bitrate;
2479
+ }
2480
+ };
2481
+
2482
+ // src/path-normalize.ts
2483
+ var SLASH = 47;
2484
+ var DOT = 46;
2485
+ var assertPath = (path) => {
2486
+ const t = typeof path;
2487
+ if (t !== "string") {
2488
+ throw new TypeError(`Expected a string, got a ${t}`);
2489
+ }
2490
+ };
2491
+ var posixNormalize = (path, allowAboveRoot) => {
2492
+ let res = "";
2493
+ let lastSegmentLength = 0;
2494
+ let lastSlash = -1;
2495
+ let dots = 0;
2496
+ let code;
2497
+ for (let i = 0;i <= path.length; ++i) {
2498
+ if (i < path.length) {
2499
+ code = path.charCodeAt(i);
2500
+ } else if (code === SLASH) {
2501
+ break;
2502
+ } else {
2503
+ code = SLASH;
2504
+ }
2505
+ if (code === SLASH) {
2506
+ if (lastSlash === i - 1 || dots === 1) {
2507
+ } else if (lastSlash !== i - 1 && dots === 2) {
2508
+ if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== DOT || res.charCodeAt(res.length - 2) !== DOT) {
2509
+ if (res.length > 2) {
2510
+ const lastSlashIndex = res.lastIndexOf("/");
2511
+ if (lastSlashIndex !== res.length - 1) {
2512
+ if (lastSlashIndex === -1) {
2513
+ res = "";
2514
+ lastSegmentLength = 0;
2515
+ } else {
2516
+ res = res.slice(0, lastSlashIndex);
2517
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
2518
+ }
2519
+ lastSlash = i;
2520
+ dots = 0;
2521
+ continue;
2522
+ }
2523
+ } else if (res.length === 2 || res.length === 1) {
2524
+ res = "";
2525
+ lastSegmentLength = 0;
2526
+ lastSlash = i;
2527
+ dots = 0;
2528
+ continue;
2529
+ }
2530
+ }
2531
+ if (allowAboveRoot) {
2532
+ if (res.length > 0) {
2533
+ res += "/..";
2534
+ } else {
2535
+ res = "..";
2536
+ }
2537
+ lastSegmentLength = 2;
2538
+ }
2539
+ } else {
2540
+ if (res.length > 0) {
2541
+ res += "/" + path.slice(lastSlash + 1, i);
2542
+ } else {
2543
+ res = path.slice(lastSlash + 1, i);
2544
+ }
2545
+ lastSegmentLength = i - lastSlash - 1;
2546
+ }
2547
+ lastSlash = i;
2548
+ dots = 0;
2549
+ } else if (code === DOT && dots !== -1) {
2550
+ ++dots;
2551
+ } else {
2552
+ dots = -1;
2553
+ }
2554
+ }
2555
+ return res;
2556
+ };
2557
+ var decode = (s) => {
2558
+ try {
2559
+ return decodeURIComponent(s);
2560
+ } catch {
2561
+ return s;
2562
+ }
2563
+ };
2564
+ var pathNormalize = (p) => {
2565
+ assertPath(p);
2566
+ let path = p;
2567
+ if (path.length === 0) {
2568
+ return ".";
2569
+ }
2570
+ const isAbsolute = path.charCodeAt(0) === SLASH;
2571
+ const trailingSeparator = path.charCodeAt(path.length - 1) === SLASH;
2572
+ path = decode(path);
2573
+ path = posixNormalize(path, !isAbsolute);
2574
+ if (path.length === 0 && !isAbsolute) {
2575
+ path = ".";
2576
+ }
2577
+ if (path.length > 0 && trailingSeparator) {
2578
+ path += "/";
2579
+ }
2580
+ if (isAbsolute) {
2581
+ return "/" + path;
2582
+ }
2583
+ return path;
2584
+ };
2585
+
2586
+ // src/get-extension-of-filename.ts
2587
+ var getExtensionOfFilename = (filename) => {
2588
+ if (filename === null) {
2589
+ return null;
2590
+ }
2591
+ const filenameArr = pathNormalize(filename).split(".");
2592
+ const hasExtension = filenameArr.length >= 2;
2593
+ const filenameArrLength = filenameArr.length;
2594
+ const extension = hasExtension ? filenameArr[filenameArrLength - 1] : null;
2595
+ return extension;
2596
+ };
2597
+
2598
+ // src/options/video-codec.tsx
2599
+ var jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
2600
+ var codec;
2601
+ var setCodec = (newCodec) => {
2602
+ if (newCodec === undefined) {
2603
+ codec = undefined;
2604
+ return;
2605
+ }
2606
+ if (!validCodecs.includes(newCodec)) {
2607
+ throw new Error(`Codec must be one of the following: ${validCodecs.join(", ")}, but got ${newCodec}`);
2608
+ }
2609
+ codec = newCodec;
2610
+ };
2611
+ var getOutputCodecOrUndefined = () => {
2612
+ return codec;
2613
+ };
2614
+ var deriveCodecsFromFilename = (extension) => {
2615
+ if (extension === null) {
2616
+ return { possible: [], default: null };
2617
+ }
2618
+ return {
2619
+ default: defaultCodecsForFileExtension[extension] ?? null,
2620
+ possible: makeFileExtensionMap()[extension] ?? []
2621
+ };
2622
+ };
2623
+ var cliFlag39 = "codec";
2624
+ var videoCodecOption = {
2625
+ name: "Codec",
2626
+ cliFlag: cliFlag39,
2627
+ description: () => /* @__PURE__ */ jsx_runtime34.jsx(jsx_runtime34.Fragment, {
2628
+ children: "H264 works well in most cases, but sometimes it's worth going for a different codec. WebM achieves higher compression but is slower to render. WebM, GIF and ProRes support transparency."
2629
+ }),
2630
+ ssrName: "codec",
2631
+ docLink: "https://www.remotion.dev/docs/encoding/#choosing-a-codec",
2632
+ type: "",
2633
+ getValue: ({ commandLine }, {
2634
+ compositionCodec,
2635
+ configFile,
2636
+ downloadName,
2637
+ outName,
2638
+ uiCodec
2639
+ }) => {
2640
+ if (uiCodec) {
2641
+ return { value: uiCodec, source: "via UI" };
2642
+ }
2643
+ const downloadNameExtension = getExtensionOfFilename(downloadName);
2644
+ const outNameExtension = getExtensionOfFilename(outName);
2645
+ const derivedDownloadCodecs = deriveCodecsFromFilename(downloadNameExtension);
2646
+ const derivedOutNameCodecs = deriveCodecsFromFilename(outNameExtension);
2647
+ if (derivedDownloadCodecs.possible.length > 0 && derivedOutNameCodecs.possible.length > 0 && derivedDownloadCodecs.possible.join("") !== derivedOutNameCodecs.possible.join("")) {
2648
+ throw new TypeError(`The download name is ${downloadName} but the output name is ${outName}. The file extensions must match`);
2649
+ }
2650
+ const cliArgument = commandLine[cliFlag39];
2651
+ if (cliArgument) {
2652
+ if (derivedDownloadCodecs.possible.length > 0 && derivedDownloadCodecs.possible.indexOf(cliArgument) === -1) {
2653
+ throw new TypeError(`The download name is ${downloadName} but --codec=${cliArgument} was passed. The download name implies a codec of ${derivedDownloadCodecs.possible.join(" or ")} which does not align with the --codec flag.`);
2654
+ }
2655
+ if (derivedOutNameCodecs.possible.length > 0 && derivedOutNameCodecs.possible.indexOf(cliArgument) === -1) {
2656
+ throw new TypeError(`The out name is ${outName} but --codec=${cliArgument} was passed. The out name implies a codec of ${derivedOutNameCodecs.possible.join(" or ")} which does not align with the --codec flag.`);
2657
+ }
2658
+ return { value: cliArgument, source: "from --codec flag" };
2659
+ }
2660
+ if (derivedDownloadCodecs.possible.length > 0) {
2661
+ return {
2662
+ value: derivedDownloadCodecs.default,
2663
+ source: "derived from download name"
2664
+ };
2665
+ }
2666
+ if (derivedOutNameCodecs.possible.length > 0) {
2667
+ return {
2668
+ value: derivedOutNameCodecs.default,
2669
+ source: "derived from out name"
2670
+ };
2671
+ }
2672
+ if (compositionCodec) {
2673
+ return { value: compositionCodec, source: "via calculateMetadata" };
2674
+ }
2675
+ if (configFile) {
2676
+ return {
2677
+ value: configFile,
2678
+ source: "Config file"
2679
+ };
2680
+ }
2681
+ return { value: DEFAULT_CODEC, source: "default" };
2682
+ },
2683
+ setConfig: setCodec
2684
+ };
2685
+
2686
+ // src/options/webhook-custom-data.tsx
2687
+ var jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
2688
+ var cliFlag40 = "webhook-custom-data";
2689
+ var webhookCustomDataOption = {
2690
+ name: "Webhook custom data",
2691
+ cliFlag: cliFlag40,
2692
+ description: (type) => /* @__PURE__ */ jsx_runtime35.jsxs(jsx_runtime35.Fragment, {
2693
+ children: [
2694
+ "Pass up to 1,024 bytes of a JSON-serializable object to the webhook. This data will be included in the webhook payload.",
2695
+ " ",
2696
+ type === "cli" ? "Alternatively, pass a file path pointing to a JSON file" : null
2697
+ ]
2698
+ }),
2699
+ ssrName: "customData",
2700
+ docLink: "https://www.remotion.dev/docs/lambda/webhooks",
2701
+ type: {},
2702
+ getValue: () => {
2703
+ throw new Error("Option resolution not implemented");
2704
+ },
2705
+ setConfig: () => {
2706
+ throw new Error("Not implemented");
2707
+ }
2708
+ };
2709
+
2710
+ // src/options/x264-preset.tsx
2711
+ var jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
2712
+ var x264PresetOptions = [
2713
+ "ultrafast",
2714
+ "superfast",
2715
+ "veryfast",
2716
+ "faster",
2717
+ "fast",
2718
+ "medium",
2719
+ "slow",
2720
+ "slower",
2721
+ "veryslow",
2722
+ "placebo"
2723
+ ];
2724
+ var preset = null;
2725
+ var cliFlag41 = "x264-preset";
2726
+ var DEFAULT_PRESET = "medium";
2727
+ var x264Option = {
2728
+ name: "x264 Preset",
2729
+ cliFlag: cliFlag41,
2730
+ description: () => /* @__PURE__ */ jsx_runtime36.jsxs(jsx_runtime36.Fragment, {
2731
+ children: [
2732
+ "Sets a x264 preset profile. Only applies to videos rendered with",
2733
+ " ",
2734
+ /* @__PURE__ */ jsx_runtime36.jsx("code", {
2735
+ children: "h264"
2736
+ }),
2737
+ " codec.",
2738
+ /* @__PURE__ */ jsx_runtime36.jsx("br", {}),
2739
+ "Possible values: ",
2740
+ /* @__PURE__ */ jsx_runtime36.jsx("code", {
2741
+ children: "superfast"
2742
+ }),
2743
+ ", ",
2744
+ /* @__PURE__ */ jsx_runtime36.jsx("code", {
2745
+ children: "veryfast"
2746
+ }),
2747
+ ",",
2748
+ " ",
2749
+ /* @__PURE__ */ jsx_runtime36.jsx("code", {
2750
+ children: "faster"
2751
+ }),
2752
+ ", ",
2753
+ /* @__PURE__ */ jsx_runtime36.jsx("code", {
2754
+ children: "fast"
2755
+ }),
2756
+ ", ",
2757
+ /* @__PURE__ */ jsx_runtime36.jsx("code", {
2758
+ children: "medium"
2759
+ }),
2760
+ ",",
2761
+ " ",
2762
+ /* @__PURE__ */ jsx_runtime36.jsx("code", {
2763
+ children: "slow"
2764
+ }),
2765
+ ", ",
2766
+ /* @__PURE__ */ jsx_runtime36.jsx("code", {
2767
+ children: "slower"
2768
+ }),
2769
+ ", ",
2770
+ /* @__PURE__ */ jsx_runtime36.jsx("code", {
2771
+ children: "veryslow"
2772
+ }),
2773
+ ",",
2774
+ " ",
2775
+ /* @__PURE__ */ jsx_runtime36.jsx("code", {
2776
+ children: "placebo"
2777
+ }),
2778
+ ".",
2779
+ /* @__PURE__ */ jsx_runtime36.jsx("br", {}),
2780
+ "Default: ",
2781
+ /* @__PURE__ */ jsx_runtime36.jsx("code", {
2782
+ children: DEFAULT_PRESET
2783
+ })
2784
+ ]
2785
+ }),
2786
+ ssrName: "x264Preset",
2787
+ docLink: "https://www.remotion.dev/docs/renderer/render-media",
2788
+ type: "fast",
2789
+ getValue: ({ commandLine }) => {
2790
+ const value2 = commandLine[cliFlag41];
2791
+ if (typeof value2 !== "undefined") {
2792
+ return { value: value2, source: "cli" };
2793
+ }
2794
+ if (preset !== null) {
2795
+ return { value: preset, source: "config" };
2796
+ }
2797
+ return { value: null, source: "default" };
2798
+ },
2799
+ setConfig: (profile) => {
2800
+ preset = profile;
2801
+ }
2802
+ };
2803
+
2804
+ // src/options/index.tsx
2805
+ var allOptions = {
2806
+ audioCodecOption,
2807
+ scaleOption,
2808
+ crfOption,
2809
+ jpegQualityOption,
2810
+ videoBitrateOption,
2811
+ audioBitrateOption,
2812
+ enforceAudioOption,
2813
+ mutedOption,
2814
+ videoCodecOption,
2815
+ offthreadVideoCacheSizeInBytesOption,
2816
+ offthreadVideoThreadsOption,
2817
+ webhookCustomDataOption,
2818
+ colorSpaceOption,
2819
+ deleteAfterOption,
2820
+ folderExpiryOption,
2821
+ enableMultiprocessOnLinuxOption,
2822
+ glOption,
2823
+ enableLambdaInsights,
2824
+ encodingMaxRateOption,
2825
+ encodingBufferSizeOption,
2826
+ beepOnFinishOption,
2827
+ numberOfGifLoopsOption,
2828
+ reproOption,
2829
+ preferLosslessOption: preferLosslessAudioOption,
2830
+ x264Option,
2831
+ logLevelOption,
2832
+ delayRenderTimeoutInMillisecondsOption,
2833
+ headlessOption,
2834
+ overwriteOption,
2835
+ binariesDirectoryOption,
2836
+ forSeamlessAacConcatenationOption,
2837
+ separateAudioOption,
2838
+ publicPathOption,
2839
+ publicDirOption,
2840
+ onBrowserDownloadOption,
2841
+ throwIfSiteExistsOption,
2842
+ disableGitSourceOption,
2843
+ metadataOption,
2844
+ hardwareAccelerationOption,
2845
+ chromeModeOption,
2846
+ apiKeyOption
2847
+ };
2848
+
2849
+ // src/options/options-map.ts
2850
+ var optionsMap = {
2851
+ renderMedia: {
2852
+ offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,
2853
+ offthreadVideoThreads: offthreadVideoThreadsOption,
2854
+ videoBitrate: videoBitrateOption,
2855
+ numberOfGifLoops: numberOfGifLoopsOption,
2856
+ repro: reproOption,
2857
+ x264Preset: x264Option,
2858
+ audioBitrate: audioBitrateOption,
2859
+ colorSpace: colorSpaceOption,
2860
+ codec: videoCodecOption,
2861
+ jpegQuality: jpegQualityOption,
2862
+ encodingMaxRate: encodingMaxRateOption,
2863
+ encodingBufferSize: encodingBufferSizeOption,
2864
+ muted: mutedOption,
2865
+ logLevel: logLevelOption,
2866
+ timeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption,
2867
+ binariesDirectory: binariesDirectoryOption,
2868
+ forSeamlessAacConcatenation: forSeamlessAacConcatenationOption,
2869
+ separateAudioTo: separateAudioOption,
2870
+ audioCodec: audioCodecOption,
2871
+ onBrowserDownload: onBrowserDownloadOption,
2872
+ hardwareAcceleration: hardwareAccelerationOption,
2873
+ chromeMode: chromeModeOption
2874
+ },
2875
+ stitchFramesToVideo: {
2876
+ separateAudioTo: separateAudioOption,
2877
+ hardwareAcceleration: hardwareAccelerationOption
2878
+ },
2879
+ renderStill: {
2880
+ offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,
2881
+ offthreadVideoThreads: offthreadVideoThreadsOption,
2882
+ jpegQuality: jpegQualityOption,
2883
+ logLevel: logLevelOption,
2884
+ timeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption,
2885
+ binariesDirectory: binariesDirectoryOption,
2886
+ onBrowserDownload: onBrowserDownloadOption,
2887
+ chromeMode: chromeModeOption
2888
+ },
2889
+ getCompositions: {
2890
+ offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,
2891
+ offthreadVideoThreads: offthreadVideoThreadsOption,
2892
+ logLevel: logLevelOption,
2893
+ timeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption,
2894
+ binariesDirectory: binariesDirectoryOption,
2895
+ onBrowserDownload: onBrowserDownloadOption,
2896
+ chromeMode: chromeModeOption
2897
+ },
2898
+ selectComposition: {
2899
+ offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,
2900
+ offthreadVideoThreads: offthreadVideoThreadsOption,
2901
+ logLevel: logLevelOption,
2902
+ timeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption,
2903
+ binariesDirectory: binariesDirectoryOption,
2904
+ onBrowserDownload: onBrowserDownloadOption,
2905
+ chromeMode: chromeModeOption
2906
+ },
2907
+ renderFrames: {
2908
+ forSeamlessAacConcatenation: forSeamlessAacConcatenationOption,
2909
+ offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,
2910
+ offthreadVideoThreads: offthreadVideoThreadsOption,
2911
+ jpegQuality: jpegQualityOption,
2912
+ logLevel: logLevelOption,
2913
+ timeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption,
2914
+ binariesDirectory: binariesDirectoryOption,
2915
+ onBrowserDownload: onBrowserDownloadOption,
2916
+ chromeMode: chromeModeOption
2917
+ },
2918
+ renderMediaOnLambda: {
2919
+ offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,
2920
+ offthreadVideoThreads: offthreadVideoThreadsOption,
2921
+ videoBitrate: videoBitrateOption,
2922
+ numberOfGifLoops: numberOfGifLoopsOption,
2923
+ preferLossless: preferLosslessAudioOption,
2924
+ audioBitrate: audioBitrateOption,
2925
+ deleteAfter: deleteAfterOption,
2926
+ x264Preset: x264Option,
2927
+ encodingMaxRate: encodingMaxRateOption,
2928
+ encodingBufferSize: encodingBufferSizeOption,
2929
+ colorSpace: colorSpaceOption,
2930
+ muted: mutedOption,
2931
+ logLevel: logLevelOption,
2932
+ timeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption,
2933
+ apiKey: apiKeyOption
2934
+ },
2935
+ renderStillOnLambda: {
2936
+ offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,
2937
+ offthreadVideoThreads: offthreadVideoThreadsOption,
2938
+ jpegQuality: jpegQualityOption,
2939
+ logLevel: logLevelOption,
2940
+ deleteAfter: deleteAfterOption,
2941
+ scale: scaleOption,
2942
+ timeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption,
2943
+ apiKey: apiKeyOption
2944
+ },
2945
+ getCompositionsOnLambda: {
2946
+ offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,
2947
+ offthreadVideoThreads: offthreadVideoThreadsOption,
2948
+ logLevel: logLevelOption,
2949
+ timeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption
2950
+ },
2951
+ renderMediaOnCloudRun: {
2952
+ offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,
2953
+ offthreadVideoThreads: offthreadVideoThreadsOption,
2954
+ numberOfGifLoops: numberOfGifLoopsOption,
2955
+ preferLossless: preferLosslessAudioOption,
2956
+ colorSpace: colorSpaceOption,
2957
+ audioBitrate: audioBitrateOption,
2958
+ videoBitrate: videoBitrateOption,
2959
+ x264Preset: x264Option,
2960
+ encodingMaxRate: encodingMaxRateOption,
2961
+ encodingBufferSize: encodingBufferSizeOption,
2962
+ muted: mutedOption,
2963
+ logLevel: logLevelOption,
2964
+ delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption,
2965
+ enforceAudioTrack: enforceAudioOption,
2966
+ scale: scaleOption,
2967
+ crf: crfOption,
2968
+ jpegQuality: jpegQualityOption
2969
+ },
2970
+ renderStillOnCloudRun: {
2971
+ offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,
2972
+ offthreadVideoThreads: offthreadVideoThreadsOption,
2973
+ logLevel: logLevelOption,
2974
+ scale: scaleOption,
2975
+ jpegQuality: jpegQualityOption,
2976
+ delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption
2977
+ },
2978
+ ensureBrowser: {
2979
+ logLevel: logLevelOption,
2980
+ onBrowserDownload: onBrowserDownloadOption,
2981
+ chromeMode: chromeModeOption
2982
+ },
2983
+ openBrowser: {
2984
+ logLevel: logLevelOption,
2985
+ onBrowserDownload: onBrowserDownloadOption,
2986
+ chromeMode: chromeModeOption
2987
+ },
2988
+ deploySiteLambda: {
2989
+ logLevel: logLevelOption,
2990
+ throwIfSiteExists: throwIfSiteExistsOption
2991
+ },
2992
+ deploySiteCloudRun: {
2993
+ logLevel: logLevelOption
2994
+ }
2995
+ };
2996
+
2997
+ // src/pixel-format.ts
2998
+ var validPixelFormats = [
2999
+ "yuv420p",
3000
+ "yuva420p",
3001
+ "yuv422p",
3002
+ "yuv444p",
3003
+ "yuv420p10le",
3004
+ "yuv422p10le",
3005
+ "yuv444p10le",
3006
+ "yuva444p10le"
3007
+ ];
3008
+ var DEFAULT_PIXEL_FORMAT = "yuv420p";
3009
+ var validPixelFormatsForCodec = (codec2) => {
3010
+ if (codec2 === "vp8" || codec2 === "vp9") {
3011
+ return validPixelFormats;
3012
+ }
3013
+ return validPixelFormats.filter((format) => format !== "yuva420p");
3014
+ };
3015
+
3016
+ // src/prores-profile.ts
3017
+ var proResProfileOptions = [
3018
+ "4444-xq",
3019
+ "4444",
3020
+ "hq",
3021
+ "standard",
3022
+ "light",
3023
+ "proxy"
3024
+ ];
3025
+
3026
+ // src/validate-output-filename.ts
3027
+ var validateOutputFilename = ({
3028
+ codec: codec2,
3029
+ audioCodecSetting,
3030
+ extension,
3031
+ preferLossless,
3032
+ separateAudioTo
3033
+ }) => {
3034
+ if (!defaultFileExtensionMap[codec2]) {
3035
+ throw new TypeError(`The codec "${codec2}" is not supported. Supported codecs are: ${Object.keys(defaultFileExtensionMap).join(", ")}`);
3036
+ }
3037
+ const map = defaultFileExtensionMap[codec2];
3038
+ const resolvedAudioCodec = resolveAudioCodec({
3039
+ codec: codec2,
3040
+ preferLossless,
3041
+ setting: audioCodecSetting,
3042
+ separateAudioTo
3043
+ });
3044
+ if (resolvedAudioCodec === null) {
3045
+ if (extension !== map.default) {
3046
+ throw new TypeError(`When using the ${codec2} codec, the output filename must end in .${map.default}.`);
3047
+ }
3048
+ return;
3049
+ }
3050
+ if (!(resolvedAudioCodec in map.forAudioCodec)) {
3051
+ throw new Error(`Audio codec ${resolvedAudioCodec} is not supported for codec ${codec2}`);
3052
+ }
3053
+ const acceptableExtensions = map.forAudioCodec[resolvedAudioCodec].possible;
3054
+ if (!acceptableExtensions.includes(extension) && !separateAudioTo) {
3055
+ throw new TypeError(`When using the ${codec2} codec with the ${resolvedAudioCodec} audio codec, the output filename must end in one of the following: ${acceptableExtensions.join(", ")}.`);
3056
+ }
3057
+ };
3058
+
3059
+ // src/client.ts
3060
+ var BrowserSafeApis = {
3061
+ getFileExtensionFromCodec,
3062
+ validCodecs,
3063
+ validAudioCodecs,
3064
+ getDefaultCrfForCodec,
3065
+ getValidCrfRanges,
3066
+ proResProfileOptions,
3067
+ x264PresetOptions,
3068
+ hardwareAccelerationOptions,
3069
+ validPixelFormats,
3070
+ validOpenGlRenderers,
3071
+ validPixelFormatsForCodec,
3072
+ validVideoImageFormats,
3073
+ validStillImageFormats,
3074
+ DEFAULT_PIXEL_FORMAT,
3075
+ DEFAULT_TIMEOUT,
3076
+ DEFAULT_JPEG_QUALITY,
3077
+ DEFAULT_COLOR_SPACE,
3078
+ supportedAudioCodecs,
3079
+ defaultFileExtensionMap,
3080
+ defaultAudioCodecs,
3081
+ defaultCodecsForFileExtension,
3082
+ validateOutputFilename,
3083
+ options: allOptions,
3084
+ validColorSpaces,
3085
+ optionsMap,
3086
+ codecSupportsCrf,
3087
+ codecSupportsVideoBitrate,
3088
+ logLevels,
3089
+ getOutputCodecOrUndefined,
3090
+ getExtensionFromAudioCodec,
3091
+ validChromeModeOptions
3092
+ };
3093
+ export {
3094
+ BrowserSafeApis
3095
+ };