@remotion/renderer 4.0.532 → 4.0.534
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aac-priming.js +6 -2
- package/dist/browser/BrowserFetcher.d.ts +7 -1
- package/dist/browser/BrowserFetcher.js +33 -13
- package/dist/browser/Connection.js +5 -17
- package/dist/browser/DOMWorld.js +19 -13
- package/dist/browser/devtools-commands.d.ts +13 -1
- package/dist/browser/devtools-types.d.ts +62 -0
- package/dist/browser/get-chrome-download-url.d.ts +1 -1
- package/dist/browser/get-chrome-download-url.js +19 -33
- package/dist/can-use-parallel-encoding.d.ts +0 -1
- package/dist/can-use-parallel-encoding.js +10 -10
- package/dist/client.d.ts +93 -4
- package/dist/client.js +2 -0
- package/dist/compress-assets.d.ts +1 -1
- package/dist/compress-assets.js +1 -1
- package/dist/cycle-browser-tabs.js +9 -1
- package/dist/ensure-browser.js +30 -6
- package/dist/esm/client.mjs +943 -796
- package/dist/esm/index.mjs +4113 -2997
- package/dist/esm/pure.mjs +33 -9
- package/dist/file-extensions.js +4 -1
- package/dist/get-mp4-brand.d.ts +1 -0
- package/dist/get-mp4-brand.js +21 -0
- package/dist/image-format.d.ts +1 -0
- package/dist/image-format.js +8 -4
- package/dist/index.d.ts +14 -1
- package/dist/index.js +4 -0
- package/dist/memory/from-macos-sysctl.d.ts +1 -0
- package/dist/memory/from-macos-sysctl.js +50 -0
- package/dist/memory/from-proc-meminfo.d.ts +1 -1
- package/dist/memory/from-proc-meminfo.js +7 -4
- package/dist/memory/get-available-memory.js +29 -21
- package/dist/mux-video-and-audio.js +8 -2
- package/dist/next-frame-to-render.d.ts +3 -7
- package/dist/next-frame-to-render.js +3 -22
- package/dist/open-browser.js +1 -0
- package/dist/options/allow-html-in-canvas.js +1 -1
- package/dist/options/api-key.js +1 -1
- package/dist/options/ask-ai.js +1 -1
- package/dist/options/audio-bitrate.js +1 -1
- package/dist/options/audio-codec.js +12 -6
- package/dist/options/beep-on-finish.js +1 -1
- package/dist/options/benchmark-concurrencies.js +1 -1
- package/dist/options/binaries-directory.js +1 -1
- package/dist/options/browser-executable.js +1 -1
- package/dist/options/browser.js +1 -1
- package/dist/options/bundle-cache.js +1 -1
- package/dist/options/canvas-tabs.js +1 -1
- package/dist/options/chrome-mode.js +1 -1
- package/dist/options/color-space.js +1 -1
- package/dist/options/concurrency.js +1 -1
- package/dist/options/config.js +1 -1
- package/dist/options/crf.js +1 -1
- package/dist/options/cross-site-isolation.js +1 -1
- package/dist/options/dark-mode.js +1 -1
- package/dist/options/default-coding-agent.js +1 -1
- package/dist/options/default-editor.js +1 -1
- package/dist/options/delete-after.js +1 -1
- package/dist/options/disable-git-source.js +1 -1
- package/dist/options/disable-shared-memory-capture.d.ts +16 -0
- package/dist/options/disable-shared-memory-capture.js +29 -0
- package/dist/options/disable-web-security.js +1 -1
- package/dist/options/disallow-parallel-encoding.js +1 -1
- package/dist/options/enable-cancellation.js +1 -1
- package/dist/options/enable-lambda-insights.js +1 -1
- package/dist/options/enable-multiprocess-on-linux.js +1 -1
- package/dist/options/encoding-buffer-size.js +1 -1
- package/dist/options/encoding-max-rate.js +1 -1
- package/dist/options/enforce-audio.js +1 -1
- package/dist/options/env-file.js +1 -1
- package/dist/options/every-nth-frame.js +1 -1
- package/dist/options/experimental-keep-audio-context-alive.js +1 -1
- package/dist/options/experimental-tracks.d.ts +18 -0
- package/dist/options/experimental-tracks.js +42 -0
- package/dist/options/folder-expiry.js +1 -1
- package/dist/options/for-seamless-aac-concatenation.js +1 -1
- package/dist/options/force-new-studio.js +1 -1
- package/dist/options/frames.js +1 -1
- package/dist/options/gl.js +1 -1
- package/dist/options/gop-size.js +1 -1
- package/dist/options/hardware-acceleration.js +1 -1
- package/dist/options/headless.js +1 -1
- package/dist/options/ignore-certificate-errors.js +1 -1
- package/dist/options/image-sequence-pattern.d.ts +4 -1
- package/dist/options/image-sequence-pattern.js +9 -3
- package/dist/options/image-sequence.js +1 -1
- package/dist/options/index.d.ts +39 -2
- package/dist/options/index.js +4 -0
- package/dist/options/interactivity.js +1 -1
- package/dist/options/ipv4.js +1 -1
- package/dist/options/is-production.js +1 -1
- package/dist/options/jpeg-quality.js +5 -2
- package/dist/options/keyboard-shortcuts.js +1 -1
- package/dist/options/latency-hint.js +1 -1
- package/dist/options/license-key.js +1 -1
- package/dist/options/log-level.js +1 -1
- package/dist/options/metadata.js +1 -1
- package/dist/options/mute.js +1 -1
- package/dist/options/no-open.js +1 -1
- package/dist/options/number-of-gif-loops.js +1 -1
- package/dist/options/number-of-shared-audio-tags.js +1 -1
- package/dist/options/offthreadvideo-cache-size.js +1 -1
- package/dist/options/offthreadvideo-threads.js +1 -1
- package/dist/options/on-browser-download.js +1 -1
- package/dist/options/options-map.d.ts +52 -1
- package/dist/options/options-map.js +4 -0
- package/dist/options/out-dir.js +1 -1
- package/dist/options/override-duration.js +1 -1
- package/dist/options/override-fps.js +1 -1
- package/dist/options/override-height.js +1 -1
- package/dist/options/override-width.js +1 -1
- package/dist/options/overwrite.js +1 -1
- package/dist/options/package-manager.js +1 -1
- package/dist/options/pixel-format.js +1 -1
- package/dist/options/port.js +1 -1
- package/dist/options/prefer-lossless.js +1 -1
- package/dist/options/preview-sample-rate.js +1 -1
- package/dist/options/props.js +1 -1
- package/dist/options/prores-profile.js +1 -1
- package/dist/options/public-dir.js +1 -1
- package/dist/options/public-license-key.js +1 -1
- package/dist/options/public-path.js +1 -1
- package/dist/options/repro.js +1 -1
- package/dist/options/rspack.d.ts +1 -1
- package/dist/options/rspack.js +1 -1
- package/dist/options/runs.js +1 -1
- package/dist/options/sample-rate.js +1 -1
- package/dist/options/scale.js +1 -1
- package/dist/options/separate-audio.js +1 -1
- package/dist/options/skip-skills.js +1 -1
- package/dist/options/still-frame.js +1 -1
- package/dist/options/still-image-format.js +1 -1
- package/dist/options/throw-if-site-exists.js +1 -1
- package/dist/options/timeout.js +1 -1
- package/dist/options/user-agent.js +1 -1
- package/dist/options/version-flag.js +1 -1
- package/dist/options/video-bitrate.js +1 -1
- package/dist/options/video-cache-size.js +1 -1
- package/dist/options/video-codec.js +4 -3
- package/dist/options/video-image-format.js +6 -2
- package/dist/options/webhook-custom-data.js +1 -1
- package/dist/options/webpack-poll.js +1 -1
- package/dist/options/x264-preset.js +1 -1
- package/dist/prespawn-ffmpeg.d.ts +20 -0
- package/dist/prespawn-ffmpeg.js +152 -29
- package/dist/probe-shared-memory-capture.d.ts +8 -0
- package/dist/probe-shared-memory-capture.js +111 -0
- package/dist/puppeteer-screenshot.d.ts +3 -1
- package/dist/puppeteer-screenshot.js +1 -0
- package/dist/pure.d.ts +1 -1
- package/dist/remotion-shared-memory-ffmpeg.d.ts +26 -0
- package/dist/remotion-shared-memory-ffmpeg.js +312 -0
- package/dist/remotion-shared-memory.d.ts +49 -0
- package/dist/remotion-shared-memory.js +359 -0
- package/dist/render-frame-and-retry-target-close.d.ts +7 -3
- package/dist/render-frame-and-retry-target-close.js +23 -4
- package/dist/render-frame-with-option-to-reject.d.ts +6 -2
- package/dist/render-frame-with-option-to-reject.js +207 -115
- package/dist/render-frame.d.ts +6 -6
- package/dist/render-frame.js +4 -1
- package/dist/render-frames.d.ts +7 -0
- package/dist/render-frames.js +20 -18
- package/dist/render-media.d.ts +1 -1
- package/dist/render-media.js +131 -46
- package/dist/render-still.js +1 -0
- package/dist/screenshot-background.d.ts +2 -0
- package/dist/screenshot-background.js +20 -0
- package/dist/screenshot-task.d.ts +4 -2
- package/dist/screenshot-task.js +40 -21
- package/dist/seek-to-frame.js +1 -1
- package/dist/stitch-frames-to-video.js +71 -10
- package/dist/take-frame.d.ts +11 -3
- package/dist/take-frame.js +10 -8
- package/dist/validate-output-filename.d.ts +1 -1
- package/dist/validate-output-filename.js +10 -2
- package/package.json +13 -13
package/dist/esm/pure.mjs
CHANGED
|
@@ -88,6 +88,7 @@ var validCodecs = [
|
|
|
88
88
|
];
|
|
89
89
|
|
|
90
90
|
// src/file-extensions.ts
|
|
91
|
+
import { NoReactInternals } from "remotion/no-react";
|
|
91
92
|
var defaultFileExtensionMap = {
|
|
92
93
|
"h264-mkv": {
|
|
93
94
|
default: "mkv",
|
|
@@ -107,7 +108,7 @@ var defaultFileExtensionMap = {
|
|
|
107
108
|
default: "aac",
|
|
108
109
|
forAudioCodec: {
|
|
109
110
|
aac: {
|
|
110
|
-
possible: ["aac", "3gp", "m4a", "m4b", "mpg", "mpeg"],
|
|
111
|
+
possible: NoReactInternals.ENABLE_V5_BREAKING_CHANGES ? ["aac", "3gp", "m4a", "m4b"] : ["aac", "3gp", "m4a", "m4b", "mpg", "mpeg"],
|
|
111
112
|
default: "aac"
|
|
112
113
|
},
|
|
113
114
|
"pcm-16": {
|
|
@@ -311,13 +312,29 @@ var getExtensionOfFilename = (filename) => {
|
|
|
311
312
|
return extension;
|
|
312
313
|
};
|
|
313
314
|
|
|
315
|
+
// src/validate-output-filename.ts
|
|
316
|
+
import { NoReactInternals as NoReactInternals2 } from "remotion/no-react";
|
|
317
|
+
|
|
318
|
+
// src/get-mp4-brand.ts
|
|
319
|
+
var mp4Brands = {
|
|
320
|
+
m4a: "M4A ",
|
|
321
|
+
m4b: "M4B ",
|
|
322
|
+
"3gp": "3gp4"
|
|
323
|
+
};
|
|
324
|
+
var getMp4BrandForExtension = (extension) => {
|
|
325
|
+
if (extension === null) {
|
|
326
|
+
return null;
|
|
327
|
+
}
|
|
328
|
+
return mp4Brands[extension.toLowerCase()] ?? null;
|
|
329
|
+
};
|
|
330
|
+
|
|
314
331
|
// src/options/separate-audio.tsx
|
|
315
332
|
var DEFAULT = null;
|
|
316
333
|
var cliFlag = "separate-audio-to";
|
|
317
334
|
var separateAudioOption = {
|
|
318
335
|
cliFlag,
|
|
319
336
|
description: () => `If set, the audio will not be included in the main output but rendered as a separate file at the location you pass. If the render contains no audio, a silent audio file is produced even when enforceAudioTrack is false. The muted option still takes precedence. It is recommended to use an absolute path. If a relative path is passed, it is relative to the Remotion Root.`,
|
|
320
|
-
docLink: "https://remotion.dev/docs/
|
|
337
|
+
docLink: "https://www.remotion.dev/docs/options/separate-audio-to",
|
|
321
338
|
getValue: ({ commandLine }) => {
|
|
322
339
|
if (commandLine[cliFlag]) {
|
|
323
340
|
return {
|
|
@@ -424,15 +441,18 @@ var resolveAudioCodec = ({
|
|
|
424
441
|
}) => {
|
|
425
442
|
let derivedFromSeparateAudioToExtension = null;
|
|
426
443
|
if (separateAudioTo) {
|
|
427
|
-
const extension = separateAudioTo.split(".").pop();
|
|
444
|
+
const extension = separateAudioTo.split(".").pop() ?? null;
|
|
428
445
|
for (const [key, value] of Object.entries(extensionMap)) {
|
|
429
446
|
if (value === extension) {
|
|
430
447
|
derivedFromSeparateAudioToExtension = key;
|
|
431
|
-
if (!supportedAudioCodecs[codec].includes(derivedFromSeparateAudioToExtension) && derivedFromSeparateAudioToExtension) {
|
|
432
|
-
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(", ")}`);
|
|
433
|
-
}
|
|
434
448
|
}
|
|
435
449
|
}
|
|
450
|
+
if (getMp4BrandForExtension(extension)) {
|
|
451
|
+
derivedFromSeparateAudioToExtension = "aac";
|
|
452
|
+
}
|
|
453
|
+
if (derivedFromSeparateAudioToExtension && !supportedAudioCodecs[codec].includes(derivedFromSeparateAudioToExtension)) {
|
|
454
|
+
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(", ")}`);
|
|
455
|
+
}
|
|
436
456
|
}
|
|
437
457
|
if (preferLossless) {
|
|
438
458
|
const selected = getDefaultAudioCodec({ codec, preferLossless });
|
|
@@ -494,7 +514,7 @@ var audioCodecOption = {
|
|
|
494
514
|
};
|
|
495
515
|
},
|
|
496
516
|
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.`,
|
|
497
|
-
docLink: "https://www.remotion.dev/docs/
|
|
517
|
+
docLink: "https://www.remotion.dev/docs/options/audio-codec",
|
|
498
518
|
name: "Audio Codec",
|
|
499
519
|
ssrName,
|
|
500
520
|
type: "aac",
|
|
@@ -512,6 +532,10 @@ var validateOutputFilename = ({
|
|
|
512
532
|
if (!defaultFileExtensionMap[codec]) {
|
|
513
533
|
throw new TypeError(`The codec "${codec}" is not supported. Supported codecs are: ${Object.keys(defaultFileExtensionMap).join(", ")}`);
|
|
514
534
|
}
|
|
535
|
+
const normalizedExtension = extension === null ? null : extension.toLowerCase();
|
|
536
|
+
if (NoReactInternals2.ENABLE_V5_BREAKING_CHANGES && codec === "aac" && (normalizedExtension === "mpg" || normalizedExtension === "mpeg")) {
|
|
537
|
+
throw new Error("AAC output with .mpg or .mpeg extensions is not supported. Use .aac for raw ADTS AAC or .m4a for an MPEG-4 audio container.");
|
|
538
|
+
}
|
|
515
539
|
const map = defaultFileExtensionMap[codec];
|
|
516
540
|
const resolvedAudioCodec = resolveAudioCodec({
|
|
517
541
|
codec,
|
|
@@ -520,7 +544,7 @@ var validateOutputFilename = ({
|
|
|
520
544
|
separateAudioTo
|
|
521
545
|
});
|
|
522
546
|
if (resolvedAudioCodec === null) {
|
|
523
|
-
if (
|
|
547
|
+
if (normalizedExtension !== map.default) {
|
|
524
548
|
throw new TypeError(`When using the ${codec} codec, the output filename must end in .${map.default}.`);
|
|
525
549
|
}
|
|
526
550
|
return;
|
|
@@ -529,7 +553,7 @@ var validateOutputFilename = ({
|
|
|
529
553
|
throw new Error(`Audio codec ${resolvedAudioCodec} is not supported for codec ${codec}`);
|
|
530
554
|
}
|
|
531
555
|
const acceptableExtensions = map.forAudioCodec[resolvedAudioCodec].possible;
|
|
532
|
-
if (!acceptableExtensions.includes(
|
|
556
|
+
if (!acceptableExtensions.includes(normalizedExtension) && !separateAudioTo) {
|
|
533
557
|
throw new TypeError(`When using the ${codec} codec with the ${resolvedAudioCodec} audio codec, the output filename must end in one of the following: ${acceptableExtensions.join(", ")}.`);
|
|
534
558
|
}
|
|
535
559
|
};
|
package/dist/file-extensions.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defaultFileExtensionMap = void 0;
|
|
4
|
+
const no_react_1 = require("remotion/no-react");
|
|
4
5
|
exports.defaultFileExtensionMap = {
|
|
5
6
|
'h264-mkv': {
|
|
6
7
|
default: 'mkv',
|
|
@@ -20,7 +21,9 @@ exports.defaultFileExtensionMap = {
|
|
|
20
21
|
default: 'aac',
|
|
21
22
|
forAudioCodec: {
|
|
22
23
|
aac: {
|
|
23
|
-
possible:
|
|
24
|
+
possible: no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES
|
|
25
|
+
? ['aac', '3gp', 'm4a', 'm4b']
|
|
26
|
+
: ['aac', '3gp', 'm4a', 'm4b', 'mpg', 'mpeg'],
|
|
24
27
|
default: 'aac',
|
|
25
28
|
},
|
|
26
29
|
'pcm-16': {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getMp4BrandForExtension: (extension: string | null) => string | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMp4BrandForExtension = void 0;
|
|
4
|
+
// Audio-only AAC renders may be saved as .m4a, .m4b or .3gp. These are
|
|
5
|
+
// ISO BMFF files, but the compressed audio is ADTS, so it must be remuxed
|
|
6
|
+
// rather than copied. Remotion's FFmpeg build has no `ipod` or `3gp` muxer,
|
|
7
|
+
// so the `mp4` muxer is used with the major brand that players use to
|
|
8
|
+
// identify these files.
|
|
9
|
+
const mp4Brands = {
|
|
10
|
+
m4a: 'M4A ',
|
|
11
|
+
m4b: 'M4B ',
|
|
12
|
+
'3gp': '3gp4',
|
|
13
|
+
};
|
|
14
|
+
const getMp4BrandForExtension = (extension) => {
|
|
15
|
+
var _a;
|
|
16
|
+
if (extension === null) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return (_a = mp4Brands[extension.toLowerCase()]) !== null && _a !== void 0 ? _a : null;
|
|
20
|
+
};
|
|
21
|
+
exports.getMp4BrandForExtension = getMp4BrandForExtension;
|
package/dist/image-format.d.ts
CHANGED
|
@@ -8,5 +8,6 @@ export type StillImageFormat = (typeof validStillImageFormats)[number];
|
|
|
8
8
|
export type ImageFormat = 'This type is deprecated, use VideoImageFormat or StillImageFormat instead';
|
|
9
9
|
export declare const DEFAULT_VIDEO_IMAGE_FORMAT: VideoImageFormat;
|
|
10
10
|
export declare const DEFAULT_STILL_IMAGE_FORMAT: StillImageFormat;
|
|
11
|
+
export declare const validateVideoImageFormat: (videoImageFormat: "jpeg" | "none" | "png") => void;
|
|
11
12
|
export declare const validateSelectedPixelFormatAndImageFormatCombination: (pixelFormat: "yuv420p" | "yuv420p10le" | "yuv422p" | "yuv422p10le" | "yuv444p" | "yuv444p10le" | "yuva420p" | "yuva444p10le" | undefined, videoImageFormat: "jpeg" | "none" | "png") => "none" | "valid";
|
|
12
13
|
export declare const validateStillImageFormat: (imageFormat: "jpeg" | "pdf" | "png" | "webp") => void;
|
package/dist/image-format.js
CHANGED
|
@@ -2,22 +2,26 @@
|
|
|
2
2
|
// Keeping the default image format PNG if you don't pass a
|
|
3
3
|
// value to the renderer for backwards compatibility.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.validateStillImageFormat = exports.validateSelectedPixelFormatAndImageFormatCombination = exports.DEFAULT_STILL_IMAGE_FORMAT = exports.DEFAULT_VIDEO_IMAGE_FORMAT = exports.validStillImageFormats = exports.validVideoImageFormats = void 0;
|
|
5
|
+
exports.validateStillImageFormat = exports.validateSelectedPixelFormatAndImageFormatCombination = exports.validateVideoImageFormat = exports.DEFAULT_STILL_IMAGE_FORMAT = exports.DEFAULT_VIDEO_IMAGE_FORMAT = exports.validStillImageFormats = exports.validVideoImageFormats = void 0;
|
|
6
6
|
exports.validVideoImageFormats = ['png', 'jpeg', 'none'];
|
|
7
7
|
exports.validStillImageFormats = ['png', 'jpeg', 'pdf', 'webp'];
|
|
8
8
|
exports.DEFAULT_VIDEO_IMAGE_FORMAT = 'jpeg';
|
|
9
9
|
exports.DEFAULT_STILL_IMAGE_FORMAT = 'png';
|
|
10
|
+
const validateVideoImageFormat = (videoImageFormat) => {
|
|
11
|
+
if (!exports.validVideoImageFormats.includes(videoImageFormat)) {
|
|
12
|
+
throw new TypeError(`Value ${videoImageFormat} is not valid as an image format.`);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
exports.validateVideoImageFormat = validateVideoImageFormat;
|
|
10
16
|
// By returning a value, we improve testability as we can specifically test certain branches
|
|
11
17
|
const validateSelectedPixelFormatAndImageFormatCombination = (pixelFormat, videoImageFormat) => {
|
|
18
|
+
(0, exports.validateVideoImageFormat)(videoImageFormat);
|
|
12
19
|
if (videoImageFormat === 'none') {
|
|
13
20
|
return 'none';
|
|
14
21
|
}
|
|
15
22
|
if (typeof pixelFormat === 'undefined') {
|
|
16
23
|
return 'valid';
|
|
17
24
|
}
|
|
18
|
-
if (!exports.validVideoImageFormats.includes(videoImageFormat)) {
|
|
19
|
-
throw new TypeError(`Value ${videoImageFormat} is not valid as an image format.`);
|
|
20
|
-
}
|
|
21
25
|
if (pixelFormat !== 'yuva420p' && pixelFormat !== 'yuva444p10le') {
|
|
22
26
|
return 'valid';
|
|
23
27
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -115,6 +115,7 @@ export declare const RenderInternals: {
|
|
|
115
115
|
SymbolicateableError: typeof SymbolicateableError;
|
|
116
116
|
getFramesToRender: (frameRange: import("./frame-range").ResolvedFrameRange[] | import("./frame-range").ResolvedFrameRange, everyNthFrame: number) => number[];
|
|
117
117
|
getExtensionOfFilename: (filename: string | null) => string | null;
|
|
118
|
+
getMp4BrandForExtension: (extension: string | null) => string | null;
|
|
118
119
|
getDesiredPort: ({ desiredPort, from, hostsToTry, to, onPortUnavailable, }: {
|
|
119
120
|
desiredPort: number | undefined;
|
|
120
121
|
from: number;
|
|
@@ -152,6 +153,13 @@ export declare const RenderInternals: {
|
|
|
152
153
|
registerErrorSymbolicationLock: () => number;
|
|
153
154
|
unlockErrorSymbolicationLock: (id: number) => void;
|
|
154
155
|
canUseParallelEncoding: (codec: "aac" | "av1" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav") => boolean;
|
|
156
|
+
probeSharedMemoryCapture: ({ browserExecutable, chromeMode, chromiumOptions, binariesDirectory, logLevel, }: {
|
|
157
|
+
browserExecutable: string | null;
|
|
158
|
+
chromeMode: "chrome-for-testing" | "headless-shell";
|
|
159
|
+
chromiumOptions: import("./open-browser").ChromiumOptions;
|
|
160
|
+
binariesDirectory: string | null;
|
|
161
|
+
logLevel: "error" | "info" | "trace" | "verbose" | "warn";
|
|
162
|
+
}) => Promise<boolean>;
|
|
155
163
|
mimeContentType: typeof mimeContentType;
|
|
156
164
|
mimeLookup: typeof mimeLookup;
|
|
157
165
|
validateConcurrency: ({ setting, value, checkIfValidForCurrentMachine, }: {
|
|
@@ -1057,6 +1065,8 @@ export declare const RenderInternals: {
|
|
|
1057
1065
|
browserExecutable: import("./browser-executable").BrowserExecutable;
|
|
1058
1066
|
onBrowserLog: ((log: import("./browser-log").BrowserLog) => void) | null;
|
|
1059
1067
|
onFrameBuffer: ((buffer: Buffer, frame: number) => void | Promise<void>) | null;
|
|
1068
|
+
onFrame: ((frame: import("./remotion-shared-memory").CapturedFrame, frameNumber: number) => void | Promise<void>) | null;
|
|
1069
|
+
remotionSharedMemory: import("./remotion-shared-memory").RemotionSharedMemoryCapture | null;
|
|
1060
1070
|
onDownload: import(".").RenderMediaOnDownload | null;
|
|
1061
1071
|
chromiumOptions: import("./open-browser").ChromiumOptions;
|
|
1062
1072
|
scale: number;
|
|
@@ -1249,13 +1259,16 @@ export declare const RenderInternals: {
|
|
|
1249
1259
|
cliFlag: "image-sequence-pattern";
|
|
1250
1260
|
ssrName: string;
|
|
1251
1261
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
1252
|
-
docLink:
|
|
1262
|
+
docLink: string;
|
|
1253
1263
|
type: string | null;
|
|
1254
1264
|
getValue: ({ commandLine }: {
|
|
1255
1265
|
commandLine: Record<string, unknown>;
|
|
1256
1266
|
}) => {
|
|
1257
1267
|
value: string;
|
|
1258
1268
|
source: string;
|
|
1269
|
+
} | {
|
|
1270
|
+
value: null;
|
|
1271
|
+
source: string;
|
|
1259
1272
|
};
|
|
1260
1273
|
setConfig: (pattern: string | null) => void;
|
|
1261
1274
|
reset: () => void;
|
package/dist/index.js
CHANGED
|
@@ -64,6 +64,7 @@ const get_duration_from_frame_range_1 = require("./get-duration-from-frame-range
|
|
|
64
64
|
const get_extension_from_codec_1 = require("./get-extension-from-codec");
|
|
65
65
|
const get_extension_of_filename_1 = require("./get-extension-of-filename");
|
|
66
66
|
const get_frame_to_render_1 = require("./get-frame-to-render");
|
|
67
|
+
const get_mp4_brand_1 = require("./get-mp4-brand");
|
|
67
68
|
const get_port_1 = require("./get-port");
|
|
68
69
|
const image_format_1 = require("./image-format");
|
|
69
70
|
const is_serve_url_1 = require("./is-serve-url");
|
|
@@ -78,6 +79,7 @@ const perf = __importStar(require("./perf"));
|
|
|
78
79
|
const pixel_format_1 = require("./pixel-format");
|
|
79
80
|
const port_config_1 = require("./port-config");
|
|
80
81
|
const prepare_server_1 = require("./prepare-server");
|
|
82
|
+
const probe_shared_memory_capture_1 = require("./probe-shared-memory-capture");
|
|
81
83
|
const render_frames_1 = require("./render-frames");
|
|
82
84
|
const render_media_1 = require("./render-media");
|
|
83
85
|
const render_still_1 = require("./render-still");
|
|
@@ -164,12 +166,14 @@ exports.RenderInternals = {
|
|
|
164
166
|
SymbolicateableError: symbolicateable_error_1.SymbolicateableError,
|
|
165
167
|
getFramesToRender: get_duration_from_frame_range_1.getFramesToRender,
|
|
166
168
|
getExtensionOfFilename: get_extension_of_filename_1.getExtensionOfFilename,
|
|
169
|
+
getMp4BrandForExtension: get_mp4_brand_1.getMp4BrandForExtension,
|
|
167
170
|
getDesiredPort: get_port_1.getDesiredPort,
|
|
168
171
|
isPathInside: is_path_inside_1.isPathInside,
|
|
169
172
|
execa: execa_1.default,
|
|
170
173
|
registerErrorSymbolicationLock: wait_for_symbolication_error_to_be_done_1.registerErrorSymbolicationLock,
|
|
171
174
|
unlockErrorSymbolicationLock: wait_for_symbolication_error_to_be_done_1.unlockErrorSymbolicationLock,
|
|
172
175
|
canUseParallelEncoding: can_use_parallel_encoding_1.canUseParallelEncoding,
|
|
176
|
+
probeSharedMemoryCapture: probe_shared_memory_capture_1.probeSharedMemoryCapture,
|
|
173
177
|
mimeContentType: mime_types_1.mimeContentType,
|
|
174
178
|
mimeLookup: mime_types_1.mimeLookup,
|
|
175
179
|
validateConcurrency: validate_concurrency_1.validateConcurrency,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getAvailableMemoryFromMacos: (logLevel: "error" | "info" | "trace" | "verbose" | "warn") => number | null;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAvailableMemoryFromMacos = void 0;
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
const node_os_1 = require("node:os");
|
|
6
|
+
const logger_1 = require("../logger");
|
|
7
|
+
const getAvailableMemoryFromMacos = (logLevel) => {
|
|
8
|
+
if ((0, node_os_1.platform)() !== 'darwin') {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
try {
|
|
12
|
+
const output = (0, node_child_process_1.execFileSync)('/usr/sbin/sysctl', [
|
|
13
|
+
'-n',
|
|
14
|
+
'vm.page_free_count',
|
|
15
|
+
'vm.page_pageable_external_count',
|
|
16
|
+
'vm.page_purgeable_count',
|
|
17
|
+
// hw.pagesize can differ from the kernel page size under Rosetta.
|
|
18
|
+
'vm.pagesize',
|
|
19
|
+
'kern.memorystatus_vm_pressure_level',
|
|
20
|
+
], { encoding: 'utf-8', timeout: 1000, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
21
|
+
const values = output.trim().split(/\s+/);
|
|
22
|
+
if (values.length !== 5 || values.some((value) => !/^\d+$/.test(value))) {
|
|
23
|
+
throw new Error('Unexpected macOS memory information from sysctl');
|
|
24
|
+
}
|
|
25
|
+
const numbers = values.map(Number);
|
|
26
|
+
const [free, fileBacked, purgeable, pageSize, pressureLevel] = numbers;
|
|
27
|
+
if (numbers.some((value) => !Number.isSafeInteger(value)) ||
|
|
28
|
+
pageSize === 0 ||
|
|
29
|
+
![1, 2, 4].includes(pressureLevel)) {
|
|
30
|
+
throw new Error('Invalid macOS memory information from sysctl');
|
|
31
|
+
}
|
|
32
|
+
// The sysctl exposes dispatch pressure flags: normal=1, warning=2, critical=4.
|
|
33
|
+
if (pressureLevel === 4) {
|
|
34
|
+
logger_1.Log.verbose({ indent: false, logLevel }, 'macOS memory pressure is critical. Using os.freemem().');
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
// XNU's fully reclaimable pages exclude anonymous and compressed memory:
|
|
38
|
+
// https://github.com/apple-oss-distributions/xnu/blob/main/doc/vm/memorystatus_notify.md
|
|
39
|
+
const availableMemory = (free + fileBacked + purgeable) * pageSize;
|
|
40
|
+
if (!Number.isSafeInteger(availableMemory)) {
|
|
41
|
+
throw new Error('Invalid macOS available memory size');
|
|
42
|
+
}
|
|
43
|
+
return Math.min(availableMemory, (0, node_os_1.totalmem)());
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
logger_1.Log.verbose({ indent: false, logLevel }, 'Could not read reclaimable macOS memory. Using os.freemem().', err);
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
exports.getAvailableMemoryFromMacos = getAvailableMemoryFromMacos;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const getAvailableMemoryFromProcMeminfo: (logLevel: "error" | "info" | "trace" | "verbose" | "warn") => number | null;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getAvailableMemoryFromProcMeminfo = void 0;
|
|
4
4
|
const node_fs_1 = require("node:fs");
|
|
5
5
|
const logger_1 = require("../logger");
|
|
6
|
-
const
|
|
6
|
+
const getAvailableMemoryFromProcMeminfo = (logLevel) => {
|
|
7
7
|
if (!(0, node_fs_1.existsSync)('/proc/meminfo')) {
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
10
|
try {
|
|
11
11
|
const data = (0, node_fs_1.readFileSync)('/proc/meminfo', 'utf-8');
|
|
12
|
-
//
|
|
12
|
+
// MemAvailable includes memory that can be reclaimed without swapping.
|
|
13
13
|
const lines = data.split('\n');
|
|
14
14
|
const memAvailableLine = lines.find((line) => line.startsWith('MemAvailable'));
|
|
15
15
|
// If we couldn't find MemAvailable, return an error
|
|
@@ -23,6 +23,9 @@ const getFreeMemoryFromProcMeminfo = (logLevel) => {
|
|
|
23
23
|
}
|
|
24
24
|
const value = parseInt(matches[1], 10);
|
|
25
25
|
const unit = matches[2].toLowerCase();
|
|
26
|
+
if (!Number.isSafeInteger(value)) {
|
|
27
|
+
throw new Error('Invalid MemAvailable value');
|
|
28
|
+
}
|
|
26
29
|
// Convert the value to bytes based on its unit
|
|
27
30
|
switch (unit) {
|
|
28
31
|
case 'kb':
|
|
@@ -41,4 +44,4 @@ const getFreeMemoryFromProcMeminfo = (logLevel) => {
|
|
|
41
44
|
return null;
|
|
42
45
|
}
|
|
43
46
|
};
|
|
44
|
-
exports.
|
|
47
|
+
exports.getAvailableMemoryFromProcMeminfo = getAvailableMemoryFromProcMeminfo;
|
|
@@ -5,40 +5,48 @@ const node_os_1 = require("node:os");
|
|
|
5
5
|
const logger_1 = require("../logger");
|
|
6
6
|
const from_docker_cgroup_1 = require("./from-docker-cgroup");
|
|
7
7
|
const from_lambda_env_1 = require("./from-lambda-env");
|
|
8
|
+
const from_macos_sysctl_1 = require("./from-macos-sysctl");
|
|
8
9
|
const from_proc_meminfo_1 = require("./from-proc-meminfo");
|
|
9
10
|
const getAvailableMemory = (logLevel) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
let hostMemory = (0, node_os_1.freemem)();
|
|
12
|
+
let source = 'os.freemem()';
|
|
13
|
+
if ((0, node_os_1.platform)() === 'linux') {
|
|
14
|
+
const procInfo = (0, from_proc_meminfo_1.getAvailableMemoryFromProcMeminfo)(logLevel);
|
|
15
|
+
if (procInfo !== null) {
|
|
16
|
+
hostMemory = procInfo;
|
|
17
|
+
source = '/proc/meminfo MemAvailable';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
else if ((0, node_os_1.platform)() === 'darwin') {
|
|
21
|
+
const macosMemory = (0, from_macos_sysctl_1.getAvailableMemoryFromMacos)(logLevel);
|
|
22
|
+
if (macosMemory !== null) {
|
|
23
|
+
hostMemory = macosMemory;
|
|
24
|
+
source = 'macOS sysctl (free, file-backed and purgeable pages)';
|
|
25
|
+
}
|
|
16
26
|
}
|
|
17
|
-
|
|
18
|
-
const cgroupMemory = (0, from_docker_cgroup_1.getAvailableMemoryFromCgroup)();
|
|
19
|
-
if (cgroupMemory !== null) {
|
|
27
|
+
let availableMemory = hostMemory;
|
|
28
|
+
const cgroupMemory = (0, node_os_1.platform)() === 'linux' ? (0, from_docker_cgroup_1.getAvailableMemoryFromCgroup)() : null;
|
|
29
|
+
if (cgroupMemory !== null && Number.isFinite(cgroupMemory)) {
|
|
20
30
|
// There are 2 Docker memory configurations:
|
|
21
31
|
// 1. --memory=[num]
|
|
22
32
|
// 2. Global Docker memory limit
|
|
23
33
|
// If cgroup limit is higher than global memory, the global memory limit still applies
|
|
24
|
-
|
|
25
|
-
const _procInfo = (0, from_proc_meminfo_1.getFreeMemoryFromProcMeminfo)(logLevel);
|
|
26
|
-
if (cgroupMemory > nodeMemory * 1.25 && Number.isFinite(cgroupMemory)) {
|
|
34
|
+
if (cgroupMemory > hostMemory * 1.25) {
|
|
27
35
|
logger_1.Log.warn({ indent: false, logLevel }, 'Detected differing memory amounts:');
|
|
28
36
|
logger_1.Log.warn({ indent: false, logLevel }, `Memory reported by CGroup: ${(cgroupMemory / 1024 / 1024).toFixed(2)} MB`);
|
|
29
|
-
|
|
30
|
-
logger_1.Log.warn({ indent: false, logLevel }, `Memory reported by /proc/meminfo: ${(_procInfo / 1024 / 1024).toFixed(2)} MB`);
|
|
31
|
-
}
|
|
32
|
-
logger_1.Log.warn({ indent: false, logLevel }, `Memory reported by Node: ${(nodeMemory / 1024 / 1024).toFixed(2)} MB`);
|
|
37
|
+
logger_1.Log.warn({ indent: false, logLevel }, `Memory reported by ${source}: ${(hostMemory / 1024 / 1024).toFixed(2)} MB`);
|
|
33
38
|
logger_1.Log.warn({ indent: false, logLevel }, 'You might have inadvertently set the --memory flag of `docker run` to a value that is higher than the global Docker memory limit.');
|
|
34
39
|
logger_1.Log.warn({ indent: false, logLevel }, 'Using the lower amount of memory for calculation.');
|
|
35
40
|
}
|
|
36
|
-
|
|
41
|
+
availableMemory = Math.min(availableMemory, Math.max(0, cgroupMemory));
|
|
42
|
+
source += ', bounded by remaining cgroup memory';
|
|
37
43
|
}
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
|
|
44
|
+
const maxLambdaMemory = (0, from_lambda_env_1.getMaxLambdaMemory)();
|
|
45
|
+
if (maxLambdaMemory !== null && Number.isFinite(maxLambdaMemory)) {
|
|
46
|
+
availableMemory = Math.min(availableMemory, Math.max(0, maxLambdaMemory));
|
|
47
|
+
source += ', bounded by Lambda memory';
|
|
41
48
|
}
|
|
42
|
-
|
|
49
|
+
logger_1.Log.verbose({ indent: false, logLevel }, `Available memory: ${(availableMemory / 1024 / 1024).toFixed(2)} MiB (${source})`);
|
|
50
|
+
return availableMemory;
|
|
43
51
|
};
|
|
44
52
|
exports.getAvailableMemory = getAvailableMemory;
|
|
@@ -6,6 +6,7 @@ const call_ffmpeg_1 = require("./call-ffmpeg");
|
|
|
6
6
|
const convert_number_of_gif_loops_to_ffmpeg_1 = require("./convert-number-of-gif-loops-to-ffmpeg");
|
|
7
7
|
const get_extension_of_filename_1 = require("./get-extension-of-filename");
|
|
8
8
|
const get_fast_start_muxer_1 = require("./get-fast-start-muxer");
|
|
9
|
+
const get_mp4_brand_1 = require("./get-mp4-brand");
|
|
9
10
|
const logger_1 = require("./logger");
|
|
10
11
|
const make_metadata_args_1 = require("./make-metadata-args");
|
|
11
12
|
const parse_ffmpeg_progress_1 = require("./parse-ffmpeg-progress");
|
|
@@ -18,6 +19,7 @@ const muxVideoAndAudio = async ({ videoOutput, audioOutput, output, indent, logL
|
|
|
18
19
|
const fastStartMuxer = outputExtension
|
|
19
20
|
? (0, get_fast_start_muxer_1.getFastStartMuxer)(outputExtension)
|
|
20
21
|
: null;
|
|
22
|
+
const mp4Brand = (0, get_mp4_brand_1.getMp4BrandForExtension)(outputExtension);
|
|
21
23
|
const command = [
|
|
22
24
|
'-hide_banner',
|
|
23
25
|
videoOutput ? '-i' : null,
|
|
@@ -44,8 +46,12 @@ const muxVideoAndAudio = async ({ videoOutput, audioOutput, output, indent, logL
|
|
|
44
46
|
numberOfGifLoops === null
|
|
45
47
|
? null
|
|
46
48
|
: (0, convert_number_of_gif_loops_to_ffmpeg_1.convertNumberOfGifLoopsToFfmpegSyntax)(numberOfGifLoops),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
mp4Brand ? '-f' : null,
|
|
50
|
+
mp4Brand ? 'mp4' : null,
|
|
51
|
+
mp4Brand ? '-brand' : null,
|
|
52
|
+
mp4Brand,
|
|
53
|
+
fastStartMuxer || mp4Brand ? '-movflags' : null,
|
|
54
|
+
fastStartMuxer || mp4Brand ? 'faststart' : null,
|
|
49
55
|
...(0, make_metadata_args_1.makeMetadataArgs)(metadata !== null && metadata !== void 0 ? metadata : {}),
|
|
50
56
|
'-y',
|
|
51
57
|
output,
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
export declare const nextFrameToRenderState: ({ allFramesAndExtraFrames,
|
|
1
|
+
export declare const nextFrameToRenderState: ({ allFramesAndExtraFrames, }: {
|
|
2
2
|
allFramesAndExtraFrames: number[];
|
|
3
|
-
concurrencyOrFramesToRender: number;
|
|
4
3
|
}) => {
|
|
5
|
-
getNextFrame: (
|
|
4
|
+
getNextFrame: () => number;
|
|
6
5
|
returnFrame: (frame: number) => void;
|
|
7
6
|
};
|
|
8
|
-
type
|
|
9
|
-
export type NextFrameToRender = ReturnType<Fn>;
|
|
10
|
-
export declare const partitionedNextFrameToRenderState: Fn;
|
|
11
|
-
export {};
|
|
7
|
+
export type NextFrameToRender = ReturnType<typeof nextFrameToRenderState>;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
5
|
-
const nextFrameToRenderState = ({ allFramesAndExtraFrames,
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7
|
-
concurrencyOrFramesToRender: _concurrency, }) => {
|
|
3
|
+
exports.nextFrameToRenderState = void 0;
|
|
4
|
+
const nextFrameToRenderState = ({ allFramesAndExtraFrames, }) => {
|
|
8
5
|
const rendered = new Map();
|
|
9
6
|
return {
|
|
10
|
-
|
|
11
|
-
getNextFrame: (_pageIndex) => {
|
|
7
|
+
getNextFrame: () => {
|
|
12
8
|
const nextFrame = allFramesAndExtraFrames.find((frame) => {
|
|
13
9
|
return !rendered.has(frame);
|
|
14
10
|
});
|
|
@@ -24,18 +20,3 @@ concurrencyOrFramesToRender: _concurrency, }) => {
|
|
|
24
20
|
};
|
|
25
21
|
};
|
|
26
22
|
exports.nextFrameToRenderState = nextFrameToRenderState;
|
|
27
|
-
const partitionedNextFrameToRenderState = ({ allFramesAndExtraFrames, concurrencyOrFramesToRender: concurrency, }) => {
|
|
28
|
-
const partitions = (0, render_partitions_1.renderPartitions)({
|
|
29
|
-
frames: allFramesAndExtraFrames,
|
|
30
|
-
concurrency,
|
|
31
|
-
});
|
|
32
|
-
return {
|
|
33
|
-
getNextFrame: (pageIndex) => {
|
|
34
|
-
return partitions.getNextFrame(pageIndex);
|
|
35
|
-
},
|
|
36
|
-
returnFrame: () => {
|
|
37
|
-
throw new Error('retrying failed frames for partitioned rendering is not supported. Disable partitioned rendering.');
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
exports.partitionedNextFrameToRenderState = partitionedNextFrameToRenderState;
|
package/dist/open-browser.js
CHANGED
|
@@ -181,6 +181,7 @@ const internalOpenBrowser = async ({ browser, browserExecutable, chromiumOptions
|
|
|
181
181
|
(chromiumOptions === null || chromiumOptions === void 0 ? void 0 : chromiumOptions.userAgent)
|
|
182
182
|
? `--user-agent="${chromiumOptions.userAgent}"`
|
|
183
183
|
: null,
|
|
184
|
+
'--remotion-shared-memory-capture',
|
|
184
185
|
'--remote-debugging-port=0',
|
|
185
186
|
`--user-data-dir=${userDataDir}`,
|
|
186
187
|
].filter(Boolean),
|
|
@@ -10,7 +10,7 @@ exports.allowHtmlInCanvasOption = {
|
|
|
10
10
|
description: () => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["When client-side rendering is enabled in the Studio, allow the experimental Chromium HTML-in-canvas API to be used for capturing frames. See", ' ', jsx_runtime_1.jsx("a", { href: "/docs/client-side-rendering/html-in-canvas", children: "HTML-in-canvas docs" }),
|
|
11
11
|
"."] })),
|
|
12
12
|
ssrName: null,
|
|
13
|
-
docLink: 'https://www.remotion.dev/docs/
|
|
13
|
+
docLink: 'https://www.remotion.dev/docs/options/allow-html-in-canvas',
|
|
14
14
|
type: false,
|
|
15
15
|
getValue: ({ commandLine }) => {
|
|
16
16
|
if (commandLine[cliFlag] !== null) {
|
package/dist/options/api-key.js
CHANGED
|
@@ -11,7 +11,7 @@ exports.apiKeyOption = {
|
|
|
11
11
|
jsx_runtime_1.jsx("code", { children: "@remotion/licensing" }),
|
|
12
12
|
"."] })),
|
|
13
13
|
ssrName: 'apiKey',
|
|
14
|
-
docLink: 'https://www.remotion.dev/docs/
|
|
14
|
+
docLink: 'https://www.remotion.dev/docs/options/api-key',
|
|
15
15
|
type: null,
|
|
16
16
|
getValue: ({ commandLine }) => {
|
|
17
17
|
if (commandLine[cliFlag] !== undefined) {
|
package/dist/options/ask-ai.js
CHANGED
|
@@ -10,7 +10,7 @@ exports.askAIOption = {
|
|
|
10
10
|
cliFlag,
|
|
11
11
|
description: () => (jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: "If the Cmd + I shortcut of the Ask AI modal conflicts with your Studio, you can disable it using this." })),
|
|
12
12
|
ssrName: null,
|
|
13
|
-
docLink: 'https://www.remotion.dev/docs/
|
|
13
|
+
docLink: 'https://www.remotion.dev/docs/options/disable-ask-ai',
|
|
14
14
|
type: false,
|
|
15
15
|
getValue: ({ commandLine }) => {
|
|
16
16
|
if (commandLine[cliFlag] !== undefined) {
|
|
@@ -17,7 +17,7 @@ exports.audioBitrateOption = {
|
|
|
17
17
|
jsx_runtime_1.jsx("code", { children: "320k" })
|
|
18
18
|
] })),
|
|
19
19
|
ssrName: 'audioBitrate',
|
|
20
|
-
docLink: 'https://www.remotion.dev/docs/
|
|
20
|
+
docLink: 'https://www.remotion.dev/docs/options/audio-bitrate',
|
|
21
21
|
type: '0',
|
|
22
22
|
getValue: ({ commandLine }) => {
|
|
23
23
|
if (commandLine[cliFlag]) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.audioCodecOption = exports.getDefaultAudioCodec = exports.resolveAudioCodec = exports.getExtensionFromAudioCodec = exports.defaultAudioCodecs = exports.mapAudioCodecToFfmpegAudioCodecName = exports.supportedAudioCodecs = exports.validAudioCodecs = void 0;
|
|
4
|
+
const get_mp4_brand_1 = require("../get-mp4-brand");
|
|
4
5
|
const separate_audio_1 = require("./separate-audio");
|
|
5
6
|
exports.validAudioCodecs = ['pcm-16', 'aac', 'mp3', 'opus'];
|
|
6
7
|
exports.supportedAudioCodecs = {
|
|
@@ -111,18 +112,23 @@ const getExtensionFromAudioCodec = (audioCodec) => {
|
|
|
111
112
|
};
|
|
112
113
|
exports.getExtensionFromAudioCodec = getExtensionFromAudioCodec;
|
|
113
114
|
const resolveAudioCodec = ({ codec, setting, preferLossless, separateAudioTo, }) => {
|
|
115
|
+
var _a;
|
|
114
116
|
let derivedFromSeparateAudioToExtension = null;
|
|
115
117
|
if (separateAudioTo) {
|
|
116
|
-
const extension = separateAudioTo.split('.').pop();
|
|
118
|
+
const extension = (_a = separateAudioTo.split('.').pop()) !== null && _a !== void 0 ? _a : null;
|
|
117
119
|
for (const [key, value] of Object.entries(extensionMap)) {
|
|
118
120
|
if (value === extension) {
|
|
119
121
|
derivedFromSeparateAudioToExtension = key;
|
|
120
|
-
if (!exports.supportedAudioCodecs[codec].includes(derivedFromSeparateAudioToExtension) &&
|
|
121
|
-
derivedFromSeparateAudioToExtension) {
|
|
122
|
-
throw new Error(`The codec is ${codec} but the audio codec derived from --${separate_audio_1.separateAudioOption.cliFlag} is ${derivedFromSeparateAudioToExtension}. The only supported codecs are: ${exports.supportedAudioCodecs[codec].join(', ')}`);
|
|
123
|
-
}
|
|
124
122
|
}
|
|
125
123
|
}
|
|
124
|
+
// .m4a, .m4b and .3gp are AAC in an MP4 container
|
|
125
|
+
if ((0, get_mp4_brand_1.getMp4BrandForExtension)(extension)) {
|
|
126
|
+
derivedFromSeparateAudioToExtension = 'aac';
|
|
127
|
+
}
|
|
128
|
+
if (derivedFromSeparateAudioToExtension &&
|
|
129
|
+
!exports.supportedAudioCodecs[codec].includes(derivedFromSeparateAudioToExtension)) {
|
|
130
|
+
throw new Error(`The codec is ${codec} but the audio codec derived from --${separate_audio_1.separateAudioOption.cliFlag} is ${derivedFromSeparateAudioToExtension}. The only supported codecs are: ${exports.supportedAudioCodecs[codec].join(', ')}`);
|
|
131
|
+
}
|
|
126
132
|
}
|
|
127
133
|
// Explanation: https://github.com/remotion-dev/remotion/issues/1647
|
|
128
134
|
if (preferLossless) {
|
|
@@ -186,7 +192,7 @@ exports.audioCodecOption = {
|
|
|
186
192
|
};
|
|
187
193
|
},
|
|
188
194
|
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.`,
|
|
189
|
-
docLink: 'https://www.remotion.dev/docs/
|
|
195
|
+
docLink: 'https://www.remotion.dev/docs/options/audio-codec',
|
|
190
196
|
name: 'Audio Codec',
|
|
191
197
|
ssrName,
|
|
192
198
|
type: 'aac',
|
|
@@ -10,7 +10,7 @@ exports.beepOnFinishOption = {
|
|
|
10
10
|
cliFlag,
|
|
11
11
|
description: () => (jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: "Whether the Remotion Studio tab should beep when the render is finished." })),
|
|
12
12
|
ssrName: null,
|
|
13
|
-
docLink: 'https://www.remotion.dev/docs/
|
|
13
|
+
docLink: 'https://www.remotion.dev/docs/options/beep-on-finish',
|
|
14
14
|
type: false,
|
|
15
15
|
getValue: ({ commandLine }) => {
|
|
16
16
|
if (commandLine[cliFlag] !== undefined && commandLine[cliFlag] !== null) {
|