@remotion/renderer 4.0.135 → 4.0.136

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,28 @@
1
+ import type { Codec } from './codec';
2
+ export declare const validAudioCodecs: readonly ["pcm-16", "aac", "mp3", "opus"];
3
+ export type AudioCodec = (typeof validAudioCodecs)[number];
4
+ export declare const supportedAudioCodecs: {
5
+ readonly h264: readonly ["aac", "pcm-16", "mp3"];
6
+ readonly 'h264-mkv': readonly ["pcm-16", "mp3"];
7
+ readonly aac: readonly ["aac", "pcm-16"];
8
+ readonly gif: readonly [];
9
+ readonly h265: readonly ["aac", "pcm-16"];
10
+ readonly mp3: readonly ["mp3", "pcm-16"];
11
+ readonly prores: readonly ["aac", "pcm-16"];
12
+ readonly vp8: readonly ["opus", "pcm-16"];
13
+ readonly vp9: readonly ["opus", "pcm-16"];
14
+ readonly wav: readonly ["pcm-16"];
15
+ };
16
+ declare const audioCodecNames: readonly ["pcm_s16le", "libfdk_aac", "libmp3lame", "libopus"];
17
+ type FfmpegAudioCodecName = (typeof audioCodecNames)[number];
18
+ export declare const mapAudioCodecToFfmpegAudioCodecName: (audioCodec: AudioCodec) => FfmpegAudioCodecName;
19
+ export declare const defaultAudioCodecs: {
20
+ [key in Codec]: {
21
+ [k in 'compressed' | 'lossless']: (typeof supportedAudioCodecs)[key][number] | null;
22
+ };
23
+ };
24
+ export declare const getDefaultAudioCodec: ({ codec, preferLossless, }: {
25
+ codec: Codec;
26
+ preferLossless: boolean;
27
+ }) => AudioCodec | null;
28
+ export {};
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDefaultAudioCodec = exports.defaultAudioCodecs = exports.mapAudioCodecToFfmpegAudioCodecName = exports.supportedAudioCodecs = exports.validAudioCodecs = void 0;
4
+ exports.validAudioCodecs = ['pcm-16', 'aac', 'mp3', 'opus'];
5
+ exports.supportedAudioCodecs = {
6
+ h264: ['aac', 'pcm-16', 'mp3'],
7
+ 'h264-mkv': ['pcm-16', 'mp3'],
8
+ aac: ['aac', 'pcm-16'],
9
+ gif: [],
10
+ h265: ['aac', 'pcm-16'],
11
+ mp3: ['mp3', 'pcm-16'],
12
+ prores: ['aac', 'pcm-16'],
13
+ vp8: ['opus', 'pcm-16'],
14
+ vp9: ['opus', 'pcm-16'],
15
+ wav: ['pcm-16'],
16
+ };
17
+ const _satisfies = exports.supportedAudioCodecs;
18
+ if (_satisfies) {
19
+ // Just for type checking
20
+ }
21
+ const audioCodecNames = [
22
+ 'pcm_s16le',
23
+ 'libfdk_aac',
24
+ 'libmp3lame',
25
+ 'libopus',
26
+ ];
27
+ const mapAudioCodecToFfmpegAudioCodecName = (audioCodec) => {
28
+ if (audioCodec === 'aac') {
29
+ return 'libfdk_aac';
30
+ }
31
+ if (audioCodec === 'mp3') {
32
+ return 'libmp3lame';
33
+ }
34
+ if (audioCodec === 'opus') {
35
+ return 'libopus';
36
+ }
37
+ if (audioCodec === 'pcm-16') {
38
+ return 'pcm_s16le';
39
+ }
40
+ throw new Error('unknown audio codec: ' + audioCodec);
41
+ };
42
+ exports.mapAudioCodecToFfmpegAudioCodecName = mapAudioCodecToFfmpegAudioCodecName;
43
+ exports.defaultAudioCodecs = {
44
+ 'h264-mkv': {
45
+ lossless: 'pcm-16',
46
+ compressed: 'pcm-16',
47
+ },
48
+ aac: {
49
+ lossless: 'pcm-16',
50
+ compressed: 'aac',
51
+ },
52
+ gif: {
53
+ lossless: null,
54
+ compressed: null,
55
+ },
56
+ h264: {
57
+ lossless: 'pcm-16',
58
+ compressed: 'aac',
59
+ },
60
+ h265: {
61
+ lossless: 'pcm-16',
62
+ compressed: 'aac',
63
+ },
64
+ mp3: {
65
+ lossless: 'pcm-16',
66
+ compressed: 'mp3',
67
+ },
68
+ prores: {
69
+ lossless: 'pcm-16',
70
+ compressed: 'pcm-16',
71
+ },
72
+ vp8: {
73
+ lossless: 'pcm-16',
74
+ compressed: 'opus',
75
+ },
76
+ vp9: {
77
+ lossless: 'pcm-16',
78
+ compressed: 'opus',
79
+ },
80
+ wav: {
81
+ lossless: 'pcm-16',
82
+ compressed: 'pcm-16',
83
+ },
84
+ };
85
+ const getDefaultAudioCodec = ({ codec, preferLossless, }) => {
86
+ return exports.defaultAudioCodecs[codec][preferLossless ? 'lossless' : 'compressed'];
87
+ };
88
+ exports.getDefaultAudioCodec = getDefaultAudioCodec;
@@ -53,12 +53,12 @@ const download_file_1 = require("../assets/download-file");
53
53
  const logger_1 = require("../logger");
54
54
  const get_download_destination_1 = require("./get-download-destination");
55
55
  const downloadURLs = {
56
- linux: 'https://github.com/Alex313031/thorium/releases/download/M117.0.5938.157/thorium-browser_117.0.5938.157_amd64.zip',
57
- mac: 'https://github.com/Alex313031/Thorium-MacOS/releases/download/M116.0.5845.169/Thorium_MacOS_X64.dmg',
58
- mac_arm: 'https://github.com/Alex313031/Thorium-MacOS/releases/download/M116.0.5845.169/Thorium_MacOS_ARM.dmg',
59
- win64: 'https://github.com/Alex313031/Thorium-Win/releases/download/M117.0.5938.157/Thorium_117.0.5938.157.zip',
56
+ linux: 'https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.86/linux64/chrome-headless-shell-linux64.zip',
57
+ 'mac-x64': 'https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.86/mac-x64/chrome-headless-shell-mac-x64.zip',
58
+ 'mac-arm64': 'https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.86/mac-arm64/chrome-headless-shell-mac-arm64.zip',
59
+ win64: 'https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.86/win64/chrome-headless-shell-win64.zip',
60
60
  };
61
- function getThoriumDownloadUrl(platform) {
61
+ function getChromeDownloadUrl(platform) {
62
62
  return downloadURLs[platform];
63
63
  }
64
64
  const readdirAsync = fs.promises.readdir;
@@ -76,7 +76,7 @@ const getPlatform = () => {
76
76
  const platform = os.platform();
77
77
  switch (platform) {
78
78
  case 'darwin':
79
- return os.arch() === 'arm64' ? 'mac_arm' : 'mac';
79
+ return os.arch() === 'arm64' ? 'mac-arm64' : 'mac-x64';
80
80
  case 'linux':
81
81
  return 'linux';
82
82
  case 'win32':
@@ -85,13 +85,13 @@ const getPlatform = () => {
85
85
  (0, assert_1.assert)(false, 'Unsupported platform: ' + platform);
86
86
  }
87
87
  };
88
- const destination = '.thorium';
88
+ const destination = '.chrome_headless_shell';
89
89
  const getDownloadsFolder = () => {
90
90
  return path.join((0, get_download_destination_1.getDownloadsCacheDir)(), destination);
91
91
  };
92
92
  const downloadBrowser = async (options) => {
93
93
  const platform = getPlatform();
94
- const downloadURL = getThoriumDownloadUrl(platform);
94
+ const downloadURL = getChromeDownloadUrl(platform);
95
95
  const fileName = downloadURL.split('/').pop();
96
96
  (0, assert_1.assert)(fileName, `A malformed download URL was found: ${downloadURL}.`);
97
97
  const downloadsFolder = getDownloadsFolder();
@@ -120,7 +120,7 @@ const downloadBrowser = async (options) => {
120
120
  onProgress: (progress) => {
121
121
  if (progress.downloaded > lastProgress + 10000000) {
122
122
  lastProgress = progress.downloaded;
123
- logger_1.Log.info({ indent: options.indent, logLevel: options.logLevel }, `Downloading Thorium - ${toMegabytes(progress.downloaded)}/${toMegabytes(progress.totalSize)}`);
123
+ logger_1.Log.info({ indent: options.indent, logLevel: options.logLevel }, `Downloading Chrome Headless Shell - ${toMegabytes(progress.downloaded)}/${toMegabytes(progress.totalSize)}`);
124
124
  }
125
125
  },
126
126
  indent: options.indent,
@@ -145,14 +145,13 @@ const getExecutablePath = () => {
145
145
  const downloadsFolder = getDownloadsFolder();
146
146
  const platform = getPlatform();
147
147
  const folderPath = getFolderPath(downloadsFolder, platform);
148
- if (platform === 'mac' || platform === 'mac_arm') {
149
- return path.join(folderPath, 'Thorium.app', 'Contents', 'MacOS', 'Thorium');
150
- }
151
- if (platform === 'linux') {
152
- return path.join(folderPath, 'thorium');
148
+ if (platform === 'mac-x64' ||
149
+ platform === 'mac-arm64' ||
150
+ platform === 'linux') {
151
+ return path.join(folderPath, `chrome-headless-shell-${platform}`, 'chrome-headless-shell');
153
152
  }
154
153
  if (platform === 'win64') {
155
- return path.join(folderPath, 'BIN', 'thorium.exe');
154
+ return path.join(folderPath, `chrome-headless-shell-${platform}`, 'chrome-headless-shell.exe');
156
155
  }
157
156
  throw new Error('Can not download browser for platform: ' + platform);
158
157
  };
@@ -161,7 +160,7 @@ const getRevisionInfo = () => {
161
160
  const downloadsFolder = getDownloadsFolder();
162
161
  const platform = getPlatform();
163
162
  const folderPath = getFolderPath(downloadsFolder, platform);
164
- const url = getThoriumDownloadUrl(platform);
163
+ const url = getChromeDownloadUrl(platform);
165
164
  const local = fs.existsSync(folderPath);
166
165
  return {
167
166
  executablePath,
@@ -0,0 +1 @@
1
+ export declare const checkNodeVersionAndWarnAboutRosetta: () => void;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkNodeVersionAndWarnAboutRosetta = void 0;
4
+ const checkNodeVersionAndWarnAboutRosetta = () => {
5
+ const version = process.version.replace('v', '').split('.');
6
+ const majorVersion = Number(version[0]);
7
+ const requiredNodeVersion = 16;
8
+ if (majorVersion < 16) {
9
+ throw new Error(`Remotion requires at least Node ${requiredNodeVersion}. You currently have ${process.version}. Update your node version to ${requiredNodeVersion} to use Remotion.`);
10
+ }
11
+ };
12
+ exports.checkNodeVersionAndWarnAboutRosetta = checkNodeVersionAndWarnAboutRosetta;
@@ -38,8 +38,13 @@ exports.gLibCErrorMessage = gLibCErrorMessage;
38
38
  const checkLibCRequirement = (logLevel, indent) => {
39
39
  const { report } = process;
40
40
  if (report) {
41
+ const rep = report.getReport();
42
+ if (typeof rep === 'string') {
43
+ logger_1.Log.warn({ logLevel, indent }, 'Bun limitation: process.report.getReport() ' + rep);
44
+ return;
45
+ }
41
46
  // @ts-expect-error no types
42
- const { glibcVersionRuntime } = report.getReport().header;
47
+ const { glibcVersionRuntime } = rep.header;
43
48
  if (!glibcVersionRuntime) {
44
49
  return;
45
50
  }
package/dist/client.d.ts CHANGED
@@ -464,19 +464,19 @@ export declare const BrowserSafeApis: {
464
464
  cliFlag: "gl";
465
465
  docLink: string;
466
466
  name: string;
467
- type: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
467
+ type: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
468
468
  ssrName: string;
469
469
  description: () => import("react/jsx-runtime").JSX.Element;
470
470
  getValue: ({ commandLine }: {
471
471
  commandLine: Record<string, unknown>;
472
472
  }) => {
473
- value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
473
+ value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
474
474
  source: string;
475
475
  } | {
476
476
  value: null;
477
477
  source: string;
478
478
  };
479
- setConfig: (value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
479
+ setConfig: (value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
480
480
  };
481
481
  enableLambdaInsights: {
482
482
  name: string;
@@ -9,6 +9,7 @@ const path_1 = __importDefault(require("path"));
9
9
  const logger_1 = require("../logger");
10
10
  let warned = false;
11
11
  function isMusl({ indent, logLevel, }) {
12
+ var _a;
12
13
  // @ts-expect-error bun no types
13
14
  if (!process.report && typeof Bun !== 'undefined') {
14
15
  if (!warned) {
@@ -17,8 +18,16 @@ function isMusl({ indent, logLevel, }) {
17
18
  warned = true;
18
19
  return false;
19
20
  }
21
+ const report = (_a = process.report) === null || _a === void 0 ? void 0 : _a.getReport();
22
+ if (report && typeof report === 'string') {
23
+ if (!warned) {
24
+ logger_1.Log.warn({ indent, logLevel }, 'Bun limitation: Could not determine if your Windows is using musl or glibc. Assuming glibc.');
25
+ }
26
+ warned = true;
27
+ return false;
28
+ }
20
29
  // @ts-expect-error no types
21
- const { glibcVersionRuntime } = process.report.getReport().header;
30
+ const { glibcVersionRuntime } = report.header;
22
31
  return !glibcVersionRuntime;
23
32
  }
24
33
  exports.isMusl = isMusl;
@@ -0,0 +1,18 @@
1
+ import type { Codec } from './codec';
2
+ import type { LogLevel } from './log-level';
3
+ import type { CancelSignal } from './make-cancel-signal';
4
+ export declare const createCombinedVideo: ({ addRemotionMetadata, binariesDirectory, cancelSignal, codec, filelistDir, files, fps, indent, logLevel, numberOfGifLoops, onProgress, output, seamless, }: {
5
+ fps: number;
6
+ codec: Codec;
7
+ filelistDir: string;
8
+ numberOfGifLoops: number | null;
9
+ output: string;
10
+ indent: boolean;
11
+ logLevel: LogLevel;
12
+ onProgress: (p: number) => void;
13
+ files: string[];
14
+ addRemotionMetadata: boolean;
15
+ binariesDirectory: string | null;
16
+ cancelSignal: CancelSignal | undefined;
17
+ seamless: boolean;
18
+ }) => Promise<string | undefined>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createCombinedVideo = void 0;
4
+ const combine_video_streams_1 = require("./combine-video-streams");
5
+ const combine_video_streams_seamlessly_1 = require("./combine-video-streams-seamlessly");
6
+ const createCombinedVideo = async ({ addRemotionMetadata, binariesDirectory, cancelSignal, codec, filelistDir, files, fps, indent, logLevel, numberOfGifLoops, onProgress, output, seamless, }) => {
7
+ if (seamless) {
8
+ return (0, combine_video_streams_seamlessly_1.combineVideoStreamsSeamlessly)({
9
+ files,
10
+ });
11
+ }
12
+ await (0, combine_video_streams_1.combineVideoStreams)({
13
+ addRemotionMetadata,
14
+ binariesDirectory,
15
+ cancelSignal,
16
+ codec,
17
+ filelistDir,
18
+ files,
19
+ fps,
20
+ indent,
21
+ logLevel,
22
+ numberOfGifLoops,
23
+ onProgress,
24
+ output,
25
+ });
26
+ };
27
+ exports.createCombinedVideo = createCombinedVideo;
@@ -0,0 +1,3 @@
1
+ import type { Codec } from './codec';
2
+ import type { PixelFormat } from './pixel-format';
3
+ export declare const warnAboutM2Bug: (codec: Codec | null, pixelFormat: PixelFormat | null) => void;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.warnAboutM2Bug = void 0;
4
+ const node_os_1 = require("node:os");
5
+ const warnAboutM2Bug = (codec, pixelFormat) => {
6
+ const isM2 = (0, node_os_1.cpus)().find((c) => c.model.includes('Apple M2'));
7
+ if (codec === 'prores' && pixelFormat === 'yuv422p10le' && isM2) {
8
+ console.warn();
9
+ console.warn('⚠️ Known issue: Apple M2 CPUs currently suffer from a bug where transparent ProRes videos have flickering. https://github.com/remotion-dev/remotion/issues/1929');
10
+ }
11
+ };
12
+ exports.warnAboutM2Bug = warnAboutM2Bug;
@@ -0,0 +1,2 @@
1
+ import type { AudioCodec } from './audio-codec';
2
+ export declare const getExtensionFromAudioCodec: (audioCodec: AudioCodec) => "mp3" | "aac" | "wav" | "opus";
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getExtensionFromAudioCodec = void 0;
4
+ const getExtensionFromAudioCodec = (audioCodec) => {
5
+ if (audioCodec === 'aac') {
6
+ return 'aac';
7
+ }
8
+ if (audioCodec === 'opus') {
9
+ return 'opus';
10
+ }
11
+ if (audioCodec === 'mp3') {
12
+ return 'mp3';
13
+ }
14
+ if (audioCodec === 'pcm-16') {
15
+ return 'wav';
16
+ }
17
+ throw new Error(`Unsupported audio codec: ${audioCodec}`);
18
+ };
19
+ exports.getExtensionFromAudioCodec = getExtensionFromAudioCodec;
package/dist/index.d.ts CHANGED
@@ -142,8 +142,8 @@ export declare const RenderInternals: {
142
142
  validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
143
143
  DEFAULT_BROWSER: "chrome";
144
144
  validateFrameRange: (frameRange: import("./frame-range").FrameRange | null) => void;
145
- DEFAULT_OPENGL_RENDERER: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
146
- validateOpenGlRenderer: (option: unknown) => "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
145
+ DEFAULT_OPENGL_RENDERER: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
146
+ validateOpenGlRenderer: (option: unknown) => "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
147
147
  validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "h264-ts", "gif"];
148
148
  DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
149
149
  validateJpegQuality: (q: unknown) => void;
@@ -0,0 +1,2 @@
1
+ import type { Codec } from './codec';
2
+ export declare const isAudioCodec: (codec: Codec | undefined | null) => boolean;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isAudioCodec = void 0;
4
+ const isAudioCodec = (codec) => {
5
+ return codec === 'mp3' || codec === 'aac' || codec === 'wav';
6
+ };
7
+ exports.isAudioCodec = isAudioCodec;
@@ -94,7 +94,7 @@ const internalOpenBrowser = async ({ browser, browserExecutable, chromiumOptions
94
94
  '--enable-blink-features=IdleDetection',
95
95
  '--export-tagged-pdf',
96
96
  '--intensive-wake-up-throttling-policy=0',
97
- ((_c = chromiumOptions.headless) !== null && _c !== void 0 ? _c : true) ? '--headless' : null,
97
+ ((_c = chromiumOptions.headless) !== null && _c !== void 0 ? _c : true) ? '--headless=old' : null,
98
98
  '--no-sandbox',
99
99
  '--disable-setuid-sandbox',
100
100
  ...customGlRenderer,
@@ -1,19 +1,19 @@
1
1
  export declare const validOpenGlRenderers: readonly ["swangle", "angle", "egl", "swiftshader", "vulkan", "angle-egl"];
2
2
  export type OpenGlRenderer = (typeof validOpenGlRenderers)[number];
3
3
  export declare const DEFAULT_OPENGL_RENDERER: OpenGlRenderer | null;
4
- export declare const getChromiumOpenGlRenderer: () => "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
4
+ export declare const getChromiumOpenGlRenderer: () => "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
5
5
  export declare const setChromiumOpenGlRenderer: (renderer: OpenGlRenderer) => void;
6
6
  export declare const glOption: {
7
7
  cliFlag: "gl";
8
8
  docLink: string;
9
9
  name: string;
10
- type: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
10
+ type: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
11
11
  ssrName: string;
12
12
  description: () => import("react/jsx-runtime").JSX.Element;
13
13
  getValue: ({ commandLine }: {
14
14
  commandLine: Record<string, unknown>;
15
15
  }) => {
16
- value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
16
+ value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
17
17
  source: string;
18
18
  } | {
19
19
  value: null;
@@ -245,19 +245,19 @@ export declare const allOptions: {
245
245
  cliFlag: "gl";
246
246
  docLink: string;
247
247
  name: string;
248
- type: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
248
+ type: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
249
249
  ssrName: string;
250
250
  description: () => import("react/jsx-runtime").JSX.Element;
251
251
  getValue: ({ commandLine }: {
252
252
  commandLine: Record<string, unknown>;
253
253
  }) => {
254
- value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
254
+ value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
255
255
  source: string;
256
256
  } | {
257
257
  value: null;
258
258
  source: string;
259
259
  };
260
- setConfig: (value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
260
+ setConfig: (value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
261
261
  };
262
262
  enableLambdaInsights: {
263
263
  name: string;
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
3
2
  import type { RenderAssetInfo } from './assets/download-map';
4
3
  import type { Codec } from './codec';
@@ -0,0 +1,22 @@
1
+ import type { Codec } from './codec';
2
+ export declare const x264PresetOptions: readonly ["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow", "placebo"];
3
+ export type X264Preset = (typeof x264PresetOptions)[number];
4
+ export declare const validateSelectedCodecAndPresetCombination: ({ codec, x264Preset, }: {
5
+ codec: Codec;
6
+ x264Preset: X264Preset | undefined;
7
+ }) => void;
8
+ export declare const x264Option: {
9
+ name: string;
10
+ cliFlag: "x264-preset";
11
+ description: () => import("react/jsx-runtime").JSX.Element;
12
+ ssrName: "x264Preset";
13
+ docLink: string;
14
+ type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
15
+ getValue: ({ commandLine }: {
16
+ commandLine: Record<string, unknown>;
17
+ }) => {
18
+ value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
19
+ source: string;
20
+ };
21
+ setConfig: (profile: X264Preset | undefined) => void;
22
+ };
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.x264Option = exports.validateSelectedCodecAndPresetCombination = exports.x264PresetOptions = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ exports.x264PresetOptions = [
6
+ 'ultrafast',
7
+ 'superfast',
8
+ 'veryfast',
9
+ 'faster',
10
+ 'fast',
11
+ 'medium',
12
+ 'slow',
13
+ 'slower',
14
+ 'veryslow',
15
+ 'placebo',
16
+ ];
17
+ let preset;
18
+ const validateSelectedCodecAndPresetCombination = ({ codec, x264Preset, }) => {
19
+ if (typeof x264Preset !== 'undefined' &&
20
+ codec !== 'h264' &&
21
+ codec !== 'h264-mkv') {
22
+ throw new TypeError(`You have set a x264 preset but the codec is "${codec}". Set the codec to "h264" or remove the Preset profile.`);
23
+ }
24
+ if (x264Preset !== undefined &&
25
+ !exports.x264PresetOptions.includes(x264Preset)) {
26
+ throw new TypeError(`The Preset profile "${x264Preset}" is not valid. Valid options are ${exports.x264PresetOptions
27
+ .map((p) => `"${p}"`)
28
+ .join(', ')}`);
29
+ }
30
+ };
31
+ exports.validateSelectedCodecAndPresetCombination = validateSelectedCodecAndPresetCombination;
32
+ const cliFlag = 'x264-preset';
33
+ const DEFAULT_PRESET = 'medium';
34
+ exports.x264Option = {
35
+ name: 'x264 Preset',
36
+ cliFlag,
37
+ description: () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Sets a x264 preset profile. Only applies to videos rendered with", ' ', (0, jsx_runtime_1.jsx)("code", { children: "h264" }), " codec.", (0, jsx_runtime_1.jsx)("br", {}), "Possible values: ", (0, jsx_runtime_1.jsx)("code", { children: "superfast" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "veryfast" }), ",", ' ', (0, jsx_runtime_1.jsx)("code", { children: "faster" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "fast" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "medium" }), ",", ' ', (0, jsx_runtime_1.jsx)("code", { children: "slow" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "slower" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "veryslow" }), ",", ' ', (0, jsx_runtime_1.jsx)("code", { children: "placebo" }), ".", (0, jsx_runtime_1.jsx)("br", {}), "Default: ", (0, jsx_runtime_1.jsx)("code", { children: DEFAULT_PRESET })] })),
38
+ ssrName: 'x264Preset',
39
+ docLink: 'https://www.remotion.dev/docs/renderer/render-media',
40
+ type: 'fast',
41
+ getValue: ({ commandLine }) => {
42
+ const value = commandLine[cliFlag];
43
+ if (typeof value !== 'undefined') {
44
+ return { value: value, source: 'cli' };
45
+ }
46
+ if (typeof preset !== 'undefined') {
47
+ return { value: preset, source: 'config' };
48
+ }
49
+ return { value: DEFAULT_PRESET, source: 'default' };
50
+ },
51
+ setConfig: (profile) => {
52
+ preset = profile;
53
+ },
54
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "4.0.135",
3
+ "version": "4.0.136",
4
4
  "description": "Renderer for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "extract-zip": "2.0.1",
19
19
  "source-map": "^0.8.0-beta.0",
20
20
  "ws": "8.7.0",
21
- "remotion": "4.0.135"
21
+ "remotion": "4.0.136"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": ">=16.8.0",
@@ -40,13 +40,13 @@
40
40
  "vitest": "0.31.1"
41
41
  },
42
42
  "optionalDependencies": {
43
- "@remotion/compositor-darwin-arm64": "4.0.135",
44
- "@remotion/compositor-darwin-x64": "4.0.135",
45
- "@remotion/compositor-linux-arm64-gnu": "4.0.135",
46
- "@remotion/compositor-linux-arm64-musl": "4.0.135",
47
- "@remotion/compositor-linux-x64-gnu": "4.0.135",
48
- "@remotion/compositor-linux-x64-musl": "4.0.135",
49
- "@remotion/compositor-win32-x64-msvc": "4.0.135"
43
+ "@remotion/compositor-darwin-x64": "4.0.136",
44
+ "@remotion/compositor-darwin-arm64": "4.0.136",
45
+ "@remotion/compositor-linux-arm64-musl": "4.0.136",
46
+ "@remotion/compositor-linux-arm64-gnu": "4.0.136",
47
+ "@remotion/compositor-linux-x64-gnu": "4.0.136",
48
+ "@remotion/compositor-linux-x64-musl": "4.0.136",
49
+ "@remotion/compositor-win32-x64-msvc": "4.0.136"
50
50
  },
51
51
  "keywords": [
52
52
  "remotion",