@remotion/renderer 4.0.425 → 4.0.427

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.
Files changed (49) hide show
  1. package/dist/client.d.ts +289 -0
  2. package/dist/esm/client.mjs +1426 -619
  3. package/dist/esm/index.mjs +12 -7
  4. package/dist/index.d.ts +3 -1
  5. package/dist/options/browser.d.ts +19 -0
  6. package/dist/options/browser.js +30 -0
  7. package/dist/options/bundle-cache.d.ts +16 -0
  8. package/dist/options/bundle-cache.js +34 -0
  9. package/dist/options/concurrency.js +22 -1
  10. package/dist/options/config.d.ts +19 -0
  11. package/dist/options/config.js +29 -0
  12. package/dist/options/env-file.d.ts +19 -0
  13. package/dist/options/env-file.js +38 -0
  14. package/dist/options/experimental-client-side-rendering.js +2 -3
  15. package/dist/options/frames.d.ts +17 -0
  16. package/dist/options/frames.js +83 -0
  17. package/dist/options/image-sequence.d.ts +16 -0
  18. package/dist/options/image-sequence.js +30 -0
  19. package/dist/options/index.d.ts +289 -0
  20. package/dist/options/index.js +32 -0
  21. package/dist/options/no-open.d.ts +19 -0
  22. package/dist/options/no-open.js +30 -0
  23. package/dist/options/out-dir.d.ts +19 -0
  24. package/dist/options/out-dir.js +41 -0
  25. package/dist/options/package-manager.d.ts +19 -0
  26. package/dist/options/package-manager.js +47 -0
  27. package/dist/options/port.d.ts +19 -0
  28. package/dist/options/port.js +36 -0
  29. package/dist/options/props.d.ts +19 -0
  30. package/dist/options/props.js +33 -0
  31. package/dist/options/rspack.d.ts +16 -0
  32. package/dist/options/rspack.js +31 -0
  33. package/dist/options/runs.d.ts +16 -0
  34. package/dist/options/runs.js +37 -0
  35. package/dist/options/still-frame.d.ts +19 -0
  36. package/dist/options/still-frame.js +51 -0
  37. package/dist/options/version-flag.d.ts +19 -0
  38. package/dist/options/version-flag.js +29 -0
  39. package/dist/options/webpack-poll.d.ts +19 -0
  40. package/dist/options/webpack-poll.js +43 -0
  41. package/dist/prespawn-ffmpeg.d.ts +1 -0
  42. package/dist/prespawn-ffmpeg.js +4 -3
  43. package/dist/render-frames.d.ts +43 -3
  44. package/dist/render-media.d.ts +4 -2
  45. package/dist/render-media.js +4 -2
  46. package/dist/render-still.d.ts +1 -0
  47. package/dist/render-still.js +5 -1
  48. package/dist/select-composition.d.ts +25 -3
  49. package/package.json +13 -13
@@ -20134,11 +20134,12 @@ var prespawnFfmpeg = (options) => {
20134
20134
  let exitCode = {
20135
20135
  type: "running"
20136
20136
  };
20137
- task.on("exit", (code) => {
20138
- if (typeof code === "number" && code > 0) {
20137
+ task.on("exit", (code, signal) => {
20138
+ if (typeof code === "number" && code > 0 || signal) {
20139
20139
  exitCode = {
20140
20140
  type: "quit-with-error",
20141
- exitCode: code,
20141
+ exitCode: code ?? 1,
20142
+ signal: signal ?? null,
20142
20143
  stderr: ffmpegOutput
20143
20144
  };
20144
20145
  } else {
@@ -21962,10 +21963,10 @@ var internalRenderMediaRaw = ({
21962
21963
  const id = startPerfMeasure("piping");
21963
21964
  const exitStatus = preStitcher?.getExitStatus();
21964
21965
  if (exitStatus?.type === "quit-successfully") {
21965
- throw new Error(`FFmpeg already quit while trying to pipe frame ${frame} to it. Stderr: ${exitStatus.stderr}}`);
21966
+ throw new Error(`FFmpeg already quit while trying to pipe frame ${frame} to it. Stderr: ${exitStatus.stderr}`);
21966
21967
  }
21967
21968
  if (exitStatus?.type === "quit-with-error") {
21968
- throw new Error(`FFmpeg quit with code ${exitStatus.exitCode} while piping frame ${frame}. Stderr: ${exitStatus.stderr}}`);
21969
+ throw new Error(`FFmpeg quit with code ${exitStatus.exitCode}${exitStatus.signal ? ` (signal ${exitStatus.signal})` : ""} while piping frame ${frame}. Stderr: ${exitStatus.stderr}`);
21969
21970
  }
21970
21971
  stitcherFfmpeg?.stdin?.write(buffer);
21971
21972
  stopPerfMeasure(id);
@@ -22064,7 +22065,8 @@ var internalRenderMediaRaw = ({
22064
22065
  slowestFrames.sort((a, b) => b.time - a.time);
22065
22066
  const result = {
22066
22067
  buffer,
22067
- slowestFrames
22068
+ slowestFrames,
22069
+ contentType: mimeLookup("file." + getFileExtensionFromCodec(codec, audioCodec)) || "application/octet-stream"
22068
22070
  };
22069
22071
  const sendTelemetryAndResolve = () => {
22070
22072
  if (licenseKey === null) {
@@ -22497,7 +22499,10 @@ var innerRenderStill = async ({
22497
22499
  onArtifact?.(artifact);
22498
22500
  }
22499
22501
  await cleanup();
22500
- return { buffer: output ? null : buffer };
22502
+ return {
22503
+ buffer: output ? null : buffer,
22504
+ contentType: mimeLookup("file." + imageFormat) || "application/octet-stream"
22505
+ };
22501
22506
  };
22502
22507
  var internalRenderStillRaw = (options) => {
22503
22508
  const cleanup = [];
package/dist/index.d.ts CHANGED
@@ -40,7 +40,7 @@ export { X264Preset } from './options/x264-preset';
40
40
  export { PixelFormat } from './pixel-format';
41
41
  export { RemotionServer } from './prepare-server';
42
42
  export { OnArtifact, RenderFramesOptions, renderFrames } from './render-frames';
43
- export { InternalRenderMediaOptions, RenderMediaOnProgress, RenderMediaOptions, SlowFrame, StitchingState, renderMedia, } from './render-media';
43
+ export { InternalRenderMediaOptions, RenderMediaOnProgress, RenderMediaOptions, RenderMediaProgress, SlowFrame, StitchingState, renderMedia, } from './render-media';
44
44
  export { RenderStillOptions, renderStill } from './render-still';
45
45
  export { SelectCompositionOptions, selectComposition, } from './select-composition';
46
46
  export { EmittedArtifact } from './serialize-artifact';
@@ -652,6 +652,7 @@ export declare const RenderInternals: {
652
652
  };
653
653
  }, "apiKey">>) => Promise<{
654
654
  buffer: Buffer | null;
655
+ contentType: string;
655
656
  }>;
656
657
  internalOpenBrowser: ({ browser, browserExecutable, chromiumOptions, forceDeviceScaleFactor, indent, viewport, logLevel, onBrowserDownload, chromeMode, }: {
657
658
  browserExecutable: string | null;
@@ -1219,6 +1220,7 @@ export declare const RenderInternals: {
1219
1220
  internalRenderMedia: (args_0: import("./render-media").InternalRenderMediaOptions) => Promise<{
1220
1221
  buffer: Buffer | null;
1221
1222
  slowestFrames: import("./render-media").SlowFrame[];
1223
+ contentType: string;
1222
1224
  }>;
1223
1225
  validOpenGlRenderers: readonly ["swangle", "angle", "egl", "swiftshader", "vulkan", "angle-egl"];
1224
1226
  isIpV6Supported: (flattened: import("os").NetworkInterfaceInfo[]) => boolean;
@@ -0,0 +1,19 @@
1
+ export declare const browserOption: {
2
+ name: string;
3
+ cliFlag: "browser";
4
+ description: () => import("react/jsx-runtime").JSX.Element;
5
+ ssrName: null;
6
+ docLink: string;
7
+ getValue: ({ commandLine }: {
8
+ commandLine: Record<string, unknown>;
9
+ }) => {
10
+ source: string;
11
+ value: string;
12
+ } | {
13
+ source: string;
14
+ value: null;
15
+ };
16
+ setConfig: () => never;
17
+ type: string | null;
18
+ id: "browser";
19
+ };
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.browserOption = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const cliFlag = 'browser';
6
+ exports.browserOption = {
7
+ name: 'Browser',
8
+ cliFlag,
9
+ description: () => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["Specify the browser which should be used for opening a tab. The default browser will be used by default. Pass an absolute path or", ' ', jsx_runtime_1.jsx("code", { children: "\"chrome\"" }),
10
+ " to use Chrome. If Chrome is selected as the browser and you are on macOS, Remotion will try to reuse an existing tab."] })),
11
+ ssrName: null,
12
+ docLink: 'https://www.remotion.dev/docs/cli/studio#--browser',
13
+ getValue: ({ commandLine }) => {
14
+ if (commandLine[cliFlag] !== undefined) {
15
+ return {
16
+ source: 'cli',
17
+ value: commandLine[cliFlag],
18
+ };
19
+ }
20
+ return {
21
+ source: 'default',
22
+ value: null,
23
+ };
24
+ },
25
+ setConfig: () => {
26
+ throw new Error('setBrowser is not supported. Pass --browser via the CLI instead.');
27
+ },
28
+ type: '',
29
+ id: cliFlag,
30
+ };
@@ -0,0 +1,16 @@
1
+ export declare const bundleCacheOption: {
2
+ name: string;
3
+ cliFlag: "bundle-cache";
4
+ description: () => import("react/jsx-runtime").JSX.Element;
5
+ ssrName: null;
6
+ docLink: string;
7
+ getValue: ({ commandLine }: {
8
+ commandLine: Record<string, unknown>;
9
+ }) => {
10
+ source: string;
11
+ value: boolean;
12
+ };
13
+ setConfig: (value: boolean) => void;
14
+ type: boolean;
15
+ id: "bundle-cache";
16
+ };
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bundleCacheOption = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const cliFlag = 'bundle-cache';
6
+ let cachingEnabled = true;
7
+ exports.bundleCacheOption = {
8
+ name: 'Webpack Bundle Caching',
9
+ cliFlag,
10
+ description: () => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["Enable or disable Webpack caching. This flag is enabled by default, use", ' ', jsx_runtime_1.jsx("code", { children: "--bundle-cache=false" }),
11
+ " to disable caching."] })),
12
+ ssrName: null,
13
+ docLink: 'https://www.remotion.dev/docs/config#setcachingenabled',
14
+ getValue: ({ commandLine }) => {
15
+ if (commandLine[cliFlag] !== undefined && commandLine[cliFlag] !== null) {
16
+ return {
17
+ source: 'cli',
18
+ value: Boolean(commandLine[cliFlag]),
19
+ };
20
+ }
21
+ return {
22
+ source: cachingEnabled ? 'default' : 'config',
23
+ value: cachingEnabled,
24
+ };
25
+ },
26
+ setConfig: (value) => {
27
+ if (typeof value !== 'boolean') {
28
+ throw new TypeError(`Value for "${cliFlag}" must be a boolean, but got ${typeof value}.`);
29
+ }
30
+ cachingEnabled = value;
31
+ },
32
+ type: true,
33
+ id: cliFlag,
34
+ };
@@ -4,6 +4,24 @@ exports.concurrencyOption = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  let currentConcurrency = null;
6
6
  const cliFlag = 'concurrency';
7
+ // Browser-safe validation that does not pull in Node.js modules
8
+ // (validate-concurrency.ts imports node:child_process via get-cpu-count.ts)
9
+ const validateConcurrencyValue = (value, setting) => {
10
+ if (typeof value === 'undefined' || value === null) {
11
+ return;
12
+ }
13
+ if (typeof value !== 'number' && typeof value !== 'string') {
14
+ throw new Error(setting + ' must a number or a string but is ' + value);
15
+ }
16
+ if (typeof value === 'number') {
17
+ if (value % 1 !== 0) {
18
+ throw new Error(setting + ' must be an integer, but is ' + value);
19
+ }
20
+ }
21
+ else if (!/^\d+(\.\d+)?%$/.test(value)) {
22
+ throw new Error(`${setting} must be a number or percentage, but is ${JSON.stringify(value)}`);
23
+ }
24
+ };
7
25
  exports.concurrencyOption = {
8
26
  name: 'Concurrency',
9
27
  cliFlag,
@@ -17,9 +35,11 @@ exports.concurrencyOption = {
17
35
  type: null,
18
36
  getValue: ({ commandLine }) => {
19
37
  if (commandLine[cliFlag] !== undefined) {
38
+ const value = commandLine[cliFlag];
39
+ validateConcurrencyValue(value, 'concurrency');
20
40
  return {
21
41
  source: 'cli',
22
- value: commandLine[cliFlag],
42
+ value,
23
43
  };
24
44
  }
25
45
  if (currentConcurrency !== null) {
@@ -34,6 +54,7 @@ exports.concurrencyOption = {
34
54
  };
35
55
  },
36
56
  setConfig: (value) => {
57
+ validateConcurrencyValue(value, 'Config.setConcurrency');
37
58
  currentConcurrency = value;
38
59
  },
39
60
  id: cliFlag,
@@ -0,0 +1,19 @@
1
+ export declare const configOption: {
2
+ name: string;
3
+ cliFlag: "config";
4
+ description: () => import("react/jsx-runtime").JSX.Element;
5
+ ssrName: null;
6
+ docLink: string;
7
+ getValue: ({ commandLine }: {
8
+ commandLine: Record<string, unknown>;
9
+ }) => {
10
+ source: string;
11
+ value: string;
12
+ } | {
13
+ source: string;
14
+ value: null;
15
+ };
16
+ setConfig: () => never;
17
+ type: string | null;
18
+ id: "config";
19
+ };
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.configOption = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const cliFlag = 'config';
6
+ exports.configOption = {
7
+ name: 'Config file',
8
+ cliFlag,
9
+ description: () => jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: "Specify a location for the Remotion config file." }),
10
+ ssrName: null,
11
+ docLink: 'https://www.remotion.dev/docs/config',
12
+ getValue: ({ commandLine }) => {
13
+ if (commandLine[cliFlag] !== undefined) {
14
+ return {
15
+ source: 'cli',
16
+ value: commandLine[cliFlag],
17
+ };
18
+ }
19
+ return {
20
+ source: 'default',
21
+ value: null,
22
+ };
23
+ },
24
+ setConfig: () => {
25
+ throw new Error('setConfig is not supported. Pass --config via the CLI instead.');
26
+ },
27
+ type: '',
28
+ id: cliFlag,
29
+ };
@@ -0,0 +1,19 @@
1
+ export declare const envFileOption: {
2
+ name: string;
3
+ cliFlag: "env-file";
4
+ description: () => import("react/jsx-runtime").JSX.Element;
5
+ ssrName: null;
6
+ docLink: string;
7
+ getValue: ({ commandLine }: {
8
+ commandLine: Record<string, unknown>;
9
+ }) => {
10
+ source: string;
11
+ value: string;
12
+ } | {
13
+ source: string;
14
+ value: null;
15
+ };
16
+ setConfig: (value: string | null) => void;
17
+ type: string | null;
18
+ id: "env-file";
19
+ };
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.envFileOption = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const cliFlag = 'env-file';
6
+ let envFileLocation = null;
7
+ exports.envFileOption = {
8
+ name: 'Env File',
9
+ cliFlag,
10
+ description: () => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["Specify a location for a dotenv file. Default ",
11
+ jsx_runtime_1.jsx("code", { children: ".env" }),
12
+ "."] })),
13
+ ssrName: null,
14
+ docLink: 'https://www.remotion.dev/docs/cli/render#--env-file',
15
+ getValue: ({ commandLine }) => {
16
+ if (commandLine[cliFlag] !== undefined) {
17
+ return {
18
+ source: 'cli',
19
+ value: commandLine[cliFlag],
20
+ };
21
+ }
22
+ if (envFileLocation !== null) {
23
+ return {
24
+ source: 'config',
25
+ value: envFileLocation,
26
+ };
27
+ }
28
+ return {
29
+ source: 'default',
30
+ value: null,
31
+ };
32
+ },
33
+ setConfig: (value) => {
34
+ envFileLocation = value;
35
+ },
36
+ type: '',
37
+ id: cliFlag,
38
+ };
@@ -12,10 +12,9 @@ exports.experimentalClientSideRenderingOption = {
12
12
  docLink: 'https://www.remotion.dev/docs/client-side-rendering',
13
13
  type: false,
14
14
  getValue: ({ commandLine }) => {
15
- if (commandLine[cliFlag] !== undefined) {
16
- experimentalClientSideRenderingEnabled = true;
15
+ if (commandLine[cliFlag] !== null) {
17
16
  return {
18
- value: experimentalClientSideRenderingEnabled,
17
+ value: commandLine[cliFlag],
19
18
  source: 'cli',
20
19
  };
21
20
  }
@@ -0,0 +1,17 @@
1
+ import type { FrameRange } from '../frame-range';
2
+ export declare const framesOption: {
3
+ name: string;
4
+ cliFlag: "frames";
5
+ description: () => import("react/jsx-runtime").JSX.Element;
6
+ ssrName: "frameRange";
7
+ docLink: string;
8
+ type: FrameRange | null;
9
+ getValue: ({ commandLine }: {
10
+ commandLine: Record<string, unknown>;
11
+ }) => {
12
+ source: string;
13
+ value: FrameRange | null;
14
+ };
15
+ setConfig: (value: FrameRange | null) => void;
16
+ id: "frames";
17
+ };
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.framesOption = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const frame_range_1 = require("../frame-range");
6
+ const cliFlag = 'frames';
7
+ let frameRange = null;
8
+ const parseFrameRangeFromCli = (newFrameRange) => {
9
+ if (typeof newFrameRange === 'number') {
10
+ if (newFrameRange < 0) {
11
+ return [0, Math.abs(newFrameRange)];
12
+ }
13
+ return newFrameRange;
14
+ }
15
+ if (typeof newFrameRange === 'string') {
16
+ if (newFrameRange.trim() === '') {
17
+ throw new Error('--frames flag must be a single number, or 2 numbers separated by `-`');
18
+ }
19
+ const parts = newFrameRange.split('-');
20
+ if (parts.length > 2 || parts.length <= 0) {
21
+ throw new Error(`--frames flag must be a number or 2 numbers separated by '-', instead got ${parts.length} numbers`);
22
+ }
23
+ if (parts.length === 1) {
24
+ const value = Number(parts[0]);
25
+ if (isNaN(value)) {
26
+ throw new Error('--frames flag must be a single number, or 2 numbers separated by `-`');
27
+ }
28
+ return value;
29
+ }
30
+ const [firstPart, secondPart] = parts;
31
+ if (secondPart === '' && firstPart !== '') {
32
+ const start = Number(firstPart);
33
+ if (isNaN(start)) {
34
+ throw new Error('--frames flag must be a single number, or 2 numbers separated by `-`');
35
+ }
36
+ return [start, null];
37
+ }
38
+ const parsed = parts.map((f) => Number(f));
39
+ const [first, second] = parsed;
40
+ for (const value of parsed) {
41
+ if (isNaN(value)) {
42
+ throw new Error('--frames flag must be a single number, or 2 numbers separated by `-`');
43
+ }
44
+ }
45
+ if (second < first) {
46
+ throw new Error('The second number of the --frames flag number should be greater or equal than first number');
47
+ }
48
+ return [first, second];
49
+ }
50
+ throw new Error('--frames flag must be a single number, or 2 numbers separated by `-`');
51
+ };
52
+ exports.framesOption = {
53
+ name: 'Frame Range',
54
+ cliFlag,
55
+ description: () => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["Render a subset of a video. Pass a single number to render a still, or a range (e.g. ",
56
+ jsx_runtime_1.jsx("code", { children: "0-9" }),
57
+ ") to render a subset of frames. Pass", ' ', jsx_runtime_1.jsx("code", { children: "100-" }),
58
+ " to render from frame 100 to the end."] })),
59
+ ssrName: 'frameRange',
60
+ docLink: 'https://www.remotion.dev/docs/config#setframerange',
61
+ type: null,
62
+ getValue: ({ commandLine }) => {
63
+ if (commandLine[cliFlag] !== undefined) {
64
+ const value = parseFrameRangeFromCli(commandLine[cliFlag]);
65
+ (0, frame_range_1.validateFrameRange)(value);
66
+ return {
67
+ source: 'cli',
68
+ value,
69
+ };
70
+ }
71
+ return {
72
+ source: 'config',
73
+ value: frameRange,
74
+ };
75
+ },
76
+ setConfig: (value) => {
77
+ if (value !== null) {
78
+ (0, frame_range_1.validateFrameRange)(value);
79
+ }
80
+ frameRange = value;
81
+ },
82
+ id: cliFlag,
83
+ };
@@ -0,0 +1,16 @@
1
+ export declare const imageSequenceOption: {
2
+ name: string;
3
+ cliFlag: "sequence";
4
+ description: () => import("react/jsx-runtime").JSX.Element;
5
+ ssrName: null;
6
+ docLink: string;
7
+ getValue: ({ commandLine }: {
8
+ commandLine: Record<string, unknown>;
9
+ }) => {
10
+ source: string;
11
+ value: boolean;
12
+ };
13
+ setConfig: (value: boolean) => void;
14
+ type: boolean;
15
+ id: "sequence";
16
+ };
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.imageSequenceOption = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const cliFlag = 'sequence';
6
+ let imageSequence = false;
7
+ exports.imageSequenceOption = {
8
+ name: 'Image Sequence',
9
+ cliFlag,
10
+ description: () => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["Pass this flag to output an image sequence instead of a video. The default image format is JPEG. See", ' ', jsx_runtime_1.jsx("a", { href: "/docs/config#setimagesequence", children: jsx_runtime_1.jsx("code", { children: "setImageSequence()" }) }), ' ', "for more details."] })),
11
+ ssrName: null,
12
+ docLink: 'https://www.remotion.dev/docs/config#setimagesequence',
13
+ getValue: ({ commandLine }) => {
14
+ if (commandLine[cliFlag] !== undefined) {
15
+ return {
16
+ source: 'cli',
17
+ value: Boolean(commandLine[cliFlag]),
18
+ };
19
+ }
20
+ return {
21
+ source: imageSequence ? 'config' : 'default',
22
+ value: imageSequence,
23
+ };
24
+ },
25
+ setConfig: (value) => {
26
+ imageSequence = value;
27
+ },
28
+ type: false,
29
+ id: cliFlag,
30
+ };