@remotion/cli 4.0.514 → 4.0.515

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.
@@ -1,9 +1,13 @@
1
+ type CtrlCHandler = () => number | Promise<number>;
1
2
  export declare const cleanupBeforeQuit: ({ indent, logLevel, }: {
2
3
  indent: boolean;
3
4
  logLevel: "error" | "info" | "trace" | "verbose" | "warn";
4
5
  }) => void;
5
6
  export declare const registerCleanupJob: (label: string, job: () => void) => void;
6
- export declare const handleCtrlC: ({ indent, logLevel, }: {
7
+ export declare const registerCtrlCHandler: (handler: CtrlCHandler) => () => void;
8
+ export declare const handleCtrlC: ({ indent, logLevel, exit, }: {
7
9
  indent: boolean;
8
10
  logLevel: "error" | "info" | "trace" | "verbose" | "warn";
9
- }) => void;
11
+ exit?: ((exitCode: number) => void) | undefined;
12
+ }) => () => NodeJS.Process;
13
+ export {};
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handleCtrlC = exports.registerCleanupJob = exports.cleanupBeforeQuit = void 0;
3
+ exports.handleCtrlC = exports.registerCtrlCHandler = exports.registerCleanupJob = exports.cleanupBeforeQuit = void 0;
4
4
  const log_1 = require("./log");
5
5
  const cleanupJobs = [];
6
+ let ctrlCHandler = null;
6
7
  const cleanupBeforeQuit = ({ indent, logLevel, }) => {
7
8
  log_1.Log.verbose({ indent, logLevel }, 'Cleaning up...');
8
9
  const time = Date.now();
@@ -17,11 +18,45 @@ const registerCleanupJob = (label, job) => {
17
18
  cleanupJobs.push({ job, label });
18
19
  };
19
20
  exports.registerCleanupJob = registerCleanupJob;
20
- const handleCtrlC = ({ indent, logLevel, }) => {
21
- process.on('SIGINT', () => {
21
+ const registerCtrlCHandler = (handler) => {
22
+ ctrlCHandler = handler;
23
+ return () => {
24
+ if (ctrlCHandler === handler) {
25
+ ctrlCHandler = null;
26
+ }
27
+ };
28
+ };
29
+ exports.registerCtrlCHandler = registerCtrlCHandler;
30
+ const handleCtrlC = ({ indent, logLevel, exit = process.exit, }) => {
31
+ let handlingCtrlC = false;
32
+ let forceExited = false;
33
+ const listener = async () => {
34
+ if (handlingCtrlC) {
35
+ forceExited = true;
36
+ exit(130);
37
+ return;
38
+ }
39
+ handlingCtrlC = true;
22
40
  log_1.Log.info({ indent: false, logLevel });
41
+ let exitCode = 0;
42
+ const handler = ctrlCHandler;
43
+ ctrlCHandler = null;
44
+ try {
45
+ if (handler) {
46
+ exitCode = await handler();
47
+ }
48
+ }
49
+ catch (err) {
50
+ log_1.Log.error({ indent: false, logLevel }, err instanceof Error ? err.message : String(err));
51
+ exitCode = 1;
52
+ }
53
+ if (forceExited) {
54
+ return;
55
+ }
23
56
  (0, exports.cleanupBeforeQuit)({ indent, logLevel });
24
- process.exit(0);
25
- });
57
+ exit(exitCode);
58
+ };
59
+ process.on('SIGINT', listener);
60
+ return () => process.removeListener('SIGINT', listener);
26
61
  };
27
62
  exports.handleCtrlC = handleCtrlC;
@@ -404,6 +404,10 @@ type FlatConfig = RemotionConfigObject & RemotionBundlingOptions & {
404
404
  * Set whether S3 buckets should be allowed to expire.
405
405
  */
406
406
  setEnableFolderExpiry: (value: boolean | null) => void;
407
+ /**
408
+ * Allow `npx remotion lambda render` to cancel a render when Ctrl+C is pressed.
409
+ */
410
+ setEnableCancellation: (value: boolean) => void;
407
411
  /**
408
412
  * Set whether Lambda Insights should be enabled when deploying a function.
409
413
  */
@@ -17,7 +17,7 @@ const preview_server_1 = require("./preview-server");
17
17
  const still_frame_1 = require("./still-frame");
18
18
  const webpack_caching_1 = require("./webpack-caching");
19
19
  const webpack_poll_1 = require("./webpack-poll");
20
- const { allowHtmlInCanvasOption, benchmarkConcurrenciesOption, concurrencyOption, offthreadVideoCacheSizeInBytesOption, x264Option, audioBitrateOption, videoBitrateOption, scaleOption, crfOption, jpegQualityOption, enforceAudioOption, overwriteOption, chromeModeOption, mutedOption, videoCodecOption, colorSpaceOption, disallowParallelEncodingOption, deleteAfterOption, folderExpiryOption, enableMultiprocessOnLinuxOption, glOption, gopSizeOption, headlessOption, numberOfGifLoopsOption, beepOnFinishOption, encodingMaxRateOption, encodingBufferSizeOption, reproOption, enableLambdaInsights, logLevelOption, delayRenderTimeoutInMillisecondsOption, publicDirOption, binariesDirectoryOption, preferLosslessOption, framesOption, forSeamlessAacConcatenationOption, audioCodecOption, publicPathOption, hardwareAccelerationOption, audioLatencyHintOption, enableCrossSiteIsolationOption, imageSequencePatternOption, darkModeOption, defaultCodingAgentOption, defaultEditorOption, askAIOption, publicLicenseKeyOption, interactivityOption, keyboardShortcutsOption, forceNewStudioOption, experimentalKeepAudioContextAliveOption, numberOfSharedAudioTagsOption, ipv4Option, pixelFormatOption, browserExecutableOption, everyNthFrameOption, proResProfileOption, stillImageFormatOption, videoImageFormatOption, userAgentOption, disableWebSecurityOption, ignoreCertificateErrorsOption, overrideHeightOption, overrideWidthOption, overrideFpsOption, overrideDurationOption, rspackOption, outDirOption, webpackPollOption, imageSequenceOption, bundleCacheOption, envFileOption, runsOption, noOpenOption, sampleRateOption, previewSampleRateOption, } = client_1.BrowserSafeApis.options;
20
+ const { allowHtmlInCanvasOption, benchmarkConcurrenciesOption, concurrencyOption, offthreadVideoCacheSizeInBytesOption, x264Option, audioBitrateOption, videoBitrateOption, scaleOption, crfOption, jpegQualityOption, enforceAudioOption, overwriteOption, chromeModeOption, mutedOption, videoCodecOption, colorSpaceOption, disallowParallelEncodingOption, deleteAfterOption, folderExpiryOption, enableCancellationOption, enableMultiprocessOnLinuxOption, glOption, gopSizeOption, headlessOption, numberOfGifLoopsOption, beepOnFinishOption, encodingMaxRateOption, encodingBufferSizeOption, reproOption, enableLambdaInsights, logLevelOption, delayRenderTimeoutInMillisecondsOption, publicDirOption, binariesDirectoryOption, preferLosslessOption, framesOption, forSeamlessAacConcatenationOption, audioCodecOption, publicPathOption, hardwareAccelerationOption, audioLatencyHintOption, enableCrossSiteIsolationOption, imageSequencePatternOption, darkModeOption, defaultCodingAgentOption, defaultEditorOption, askAIOption, publicLicenseKeyOption, interactivityOption, keyboardShortcutsOption, forceNewStudioOption, experimentalKeepAudioContextAliveOption, numberOfSharedAudioTagsOption, ipv4Option, pixelFormatOption, browserExecutableOption, everyNthFrameOption, proResProfileOption, stillImageFormatOption, videoImageFormatOption, userAgentOption, disableWebSecurityOption, ignoreCertificateErrorsOption, overrideHeightOption, overrideWidthOption, overrideFpsOption, overrideDurationOption, rspackOption, outDirOption, webpackPollOption, imageSequenceOption, bundleCacheOption, envFileOption, runsOption, noOpenOption, sampleRateOption, previewSampleRateOption, } = client_1.BrowserSafeApis.options;
21
21
  exports.Config = {
22
22
  get Bundling() {
23
23
  throw new Error('The config format has changed. Change `Config.Bundling.*()` calls to `Config.*()` in your config file.');
@@ -115,6 +115,7 @@ exports.Config = {
115
115
  setDisallowParallelEncoding: disallowParallelEncodingOption.setConfig,
116
116
  setBeepOnFinish: beepOnFinishOption.setConfig,
117
117
  setEnableFolderExpiry: folderExpiryOption.setConfig,
118
+ setEnableCancellation: enableCancellationOption.setConfig,
118
119
  setRepro: reproOption.setConfig,
119
120
  setLambdaInsights: enableLambdaInsights.setConfig,
120
121
  setBinariesDirectory: binariesDirectoryOption.setConfig,
@@ -0,0 +1,4 @@
1
+ export declare const getVideoImageFormat: ({ codec, uiImageFormat, }: {
2
+ codec: import("@remotion/renderer").CodecOrUndefined;
3
+ uiImageFormat: "jpeg" | "none" | "png" | null;
4
+ }) => "jpeg" | "none" | "png";
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getVideoImageFormat = void 0;
4
+ const client_1 = require("@remotion/renderer/client");
5
+ const pure_1 = require("@remotion/renderer/pure");
6
+ const parsed_cli_1 = require("./parsed-cli");
7
+ const getVideoImageFormat = ({ codec, uiImageFormat, }) => {
8
+ if (uiImageFormat !== null) {
9
+ return uiImageFormat;
10
+ }
11
+ const configured = client_1.BrowserSafeApis.options.videoImageFormatOption.getValue({
12
+ commandLine: parsed_cli_1.parsedCli,
13
+ }).value;
14
+ if (configured !== null) {
15
+ return configured;
16
+ }
17
+ if (pure_1.NoReactAPIs.isAudioCodec(codec)) {
18
+ return 'none';
19
+ }
20
+ if (codec === 'h264' ||
21
+ codec === 'h264-mkv' ||
22
+ codec === 'h264-ts' ||
23
+ codec === 'h265' ||
24
+ codec === 'av1' ||
25
+ codec === 'vp8' ||
26
+ codec === 'vp9' ||
27
+ codec === 'prores' ||
28
+ codec === 'gif') {
29
+ return 'jpeg';
30
+ }
31
+ if (codec === undefined) {
32
+ return 'png';
33
+ }
34
+ throw new Error('Unrecognized codec ' + codec);
35
+ };
36
+ exports.getVideoImageFormat = getVideoImageFormat;
package/dist/index.d.ts CHANGED
@@ -186,4 +186,10 @@ export declare const CliInternals: {
186
186
  disableGitSource: boolean;
187
187
  logLevel: "error" | "info" | "trace" | "verbose" | "warn";
188
188
  }) => import("@remotion/studio-shared").GitSource | null;
189
+ handleCtrlC: ({ indent, logLevel, exit, }: {
190
+ indent: boolean;
191
+ logLevel: "error" | "info" | "trace" | "verbose" | "warn";
192
+ exit?: ((exitCode: number) => void) | undefined;
193
+ }) => () => NodeJS.Process;
194
+ registerCtrlCHandler: (handler: () => number | Promise<number>) => () => void;
189
195
  };
package/dist/index.js CHANGED
@@ -203,4 +203,6 @@ exports.CliInternals = {
203
203
  makeHyperlink: make_link_1.makeHyperlink,
204
204
  supportsHyperlink: is_supported_1.supportsHyperlink,
205
205
  getGitSource: get_github_repository_1.getGitSource,
206
+ handleCtrlC: cleanup_before_quit_1.handleCtrlC,
207
+ registerCtrlCHandler: cleanup_before_quit_1.registerCtrlCHandler,
206
208
  };
@@ -182,6 +182,21 @@ declare const allowHtmlInCanvasOption: {
182
182
  };
183
183
  setConfig: (value: boolean | null) => void;
184
184
  id: "enable-folder-expiry";
185
+ }, enableCancellationOption: {
186
+ name: string;
187
+ cliFlag: "enable-cancellation";
188
+ description: () => import("react/jsx-runtime").JSX.Element;
189
+ ssrName: null;
190
+ docLink: string;
191
+ type: boolean;
192
+ setConfig: (value: boolean) => void;
193
+ getValue: ({ commandLine }: {
194
+ commandLine: Record<string, unknown>;
195
+ }) => {
196
+ value: boolean;
197
+ source: string;
198
+ };
199
+ id: "enable-cancellation";
185
200
  }, enableMultiprocessOnLinuxOption: {
186
201
  name: string;
187
202
  cliFlag: "enable-multiprocess-on-linux";
@@ -1313,6 +1328,7 @@ export type CommandLineOptions = {
1313
1328
  [ipv4Option.cliFlag]: TypeOfOption<typeof ipv4Option> | null;
1314
1329
  [deleteAfterOption.cliFlag]: TypeOfOption<typeof deleteAfterOption>;
1315
1330
  [folderExpiryOption.cliFlag]: TypeOfOption<typeof folderExpiryOption>;
1331
+ [enableCancellationOption.cliFlag]: TypeOfOption<typeof enableCancellationOption> | null;
1316
1332
  [enableMultiprocessOnLinuxOption.cliFlag]: TypeOfOption<typeof enableMultiprocessOnLinuxOption>;
1317
1333
  [reproOption.cliFlag]: TypeOfOption<typeof reproOption> | null;
1318
1334
  [imageSequencePatternOption.cliFlag]: TypeOfOption<typeof imageSequencePatternOption>;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.quietFlagProvided = exports.parsedCli = exports.BooleanFlags = void 0;
7
7
  const client_1 = require("@remotion/renderer/client");
8
8
  const minimist_1 = __importDefault(require("minimist"));
9
- const { allowHtmlInCanvasOption, benchmarkConcurrenciesOption, beepOnFinishOption, colorSpaceOption, concurrencyOption, disallowParallelEncodingOption, offthreadVideoCacheSizeInBytesOption, encodingBufferSizeOption, encodingMaxRateOption, deleteAfterOption, folderExpiryOption, enableMultiprocessOnLinuxOption, numberOfGifLoopsOption, x264Option, enforceAudioOption, jpegQualityOption, audioBitrateOption, videoBitrateOption, audioCodecOption, publicPathOption, audioLatencyHintOption, darkModeOption, defaultCodingAgentOption, defaultEditorOption, publicLicenseKeyOption, forceNewStudioOption, experimentalKeepAudioContextAliveOption, numberOfSharedAudioTagsOption, ipv4Option, pixelFormatOption, browserExecutableOption, everyNthFrameOption, proResProfileOption, userAgentOption, disableWebSecurityOption, ignoreCertificateErrorsOption, overrideHeightOption, overrideWidthOption, overrideFpsOption, overrideDurationOption, outDirOption, packageManagerOption, webpackPollOption, keyboardShortcutsOption, interactivityOption, imageSequencePatternOption, scaleOption, overwriteOption, crfOption, logLevelOption, videoCodecOption, stillFrameOption, imageSequenceOption, versionFlagOption, bundleCacheOption, envFileOption, glOption, gopSizeOption, runsOption, reproOption, mutedOption, headlessOption, disableGitSourceOption, delayRenderTimeoutInMillisecondsOption, framesOption, forSeamlessAacConcatenationOption, isProductionOption, noOpenOption, portOption, propsOption, configOption, browserOption, sampleRateOption, previewSampleRateOption, rspackOption, skipSkillsOption, } = client_1.BrowserSafeApis.options;
9
+ const { allowHtmlInCanvasOption, benchmarkConcurrenciesOption, beepOnFinishOption, colorSpaceOption, concurrencyOption, disallowParallelEncodingOption, offthreadVideoCacheSizeInBytesOption, encodingBufferSizeOption, encodingMaxRateOption, deleteAfterOption, folderExpiryOption, enableCancellationOption, enableMultiprocessOnLinuxOption, numberOfGifLoopsOption, x264Option, enforceAudioOption, jpegQualityOption, audioBitrateOption, videoBitrateOption, audioCodecOption, publicPathOption, audioLatencyHintOption, darkModeOption, defaultCodingAgentOption, defaultEditorOption, publicLicenseKeyOption, forceNewStudioOption, experimentalKeepAudioContextAliveOption, numberOfSharedAudioTagsOption, ipv4Option, pixelFormatOption, browserExecutableOption, everyNthFrameOption, proResProfileOption, userAgentOption, disableWebSecurityOption, ignoreCertificateErrorsOption, overrideHeightOption, overrideWidthOption, overrideFpsOption, overrideDurationOption, outDirOption, packageManagerOption, webpackPollOption, keyboardShortcutsOption, interactivityOption, imageSequencePatternOption, scaleOption, overwriteOption, crfOption, logLevelOption, videoCodecOption, stillFrameOption, imageSequenceOption, versionFlagOption, bundleCacheOption, envFileOption, glOption, gopSizeOption, runsOption, reproOption, mutedOption, headlessOption, disableGitSourceOption, delayRenderTimeoutInMillisecondsOption, framesOption, forSeamlessAacConcatenationOption, isProductionOption, noOpenOption, portOption, propsOption, configOption, browserOption, sampleRateOption, previewSampleRateOption, rspackOption, skipSkillsOption, } = client_1.BrowserSafeApis.options;
10
10
  exports.BooleanFlags = [
11
11
  allowHtmlInCanvasOption.cliFlag,
12
12
  overwriteOption.cliFlag,
@@ -27,6 +27,7 @@ exports.BooleanFlags = [
27
27
  disableGitSourceOption.cliFlag,
28
28
  disallowParallelEncodingOption.cliFlag,
29
29
  forSeamlessAacConcatenationOption.cliFlag,
30
+ enableCancellationOption.cliFlag,
30
31
  reproOption.cliFlag,
31
32
  isProductionOption.cliFlag,
32
33
  forceNewStudioOption.cliFlag,
@@ -56,6 +57,7 @@ exports.parsedCli = (0, minimist_1.default)(process.argv.slice(2), {
56
57
  [forceNewStudioOption.cliFlag]: null,
57
58
  [experimentalKeepAudioContextAliveOption.cliFlag]: null,
58
59
  [mutedOption.cliFlag]: null,
60
+ [enableCancellationOption.cliFlag]: null,
59
61
  [rspackOption.cliFlag]: null,
60
62
  },
61
63
  });
package/dist/skills.js CHANGED
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.skillsCommand = exports.printSkillsHelp = void 0;
4
4
  const node_child_process_1 = require("node:child_process");
5
+ const studio_server_1 = require("@remotion/studio-server");
5
6
  const chalk_1 = require("./chalk");
6
7
  const log_1 = require("./log");
7
8
  const remotion_skill_names_1 = require("./remotion-skill-names");
@@ -47,6 +48,7 @@ const skillsCommand = (args, logLevel, { cwd, environment, }) => {
47
48
  cwd,
48
49
  env: environment,
49
50
  stdio: 'inherit',
51
+ ...studio_server_1.StudioServerInternals.getPackageManagerSpawnOptions(),
50
52
  });
51
53
  return new Promise((resolve, reject) => {
52
54
  child.on('exit', (code) => {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/cli"
4
4
  },
5
5
  "name": "@remotion/cli",
6
- "version": "4.0.514",
6
+ "version": "4.0.515",
7
7
  "description": "Control Remotion features using the `npx remotion` command",
8
8
  "main": "dist/index.js",
9
9
  "bin": {
@@ -37,18 +37,18 @@
37
37
  "license": "SEE LICENSE IN LICENSE.md",
38
38
  "dependencies": {
39
39
  "@babel/parser": "7.24.1",
40
- "@remotion/bundler": "4.0.514",
41
- "@remotion/media-utils": "4.0.514",
42
- "@remotion/player": "4.0.514",
43
- "@remotion/renderer": "4.0.514",
44
- "@remotion/studio-shared": "4.0.514",
45
- "@remotion/studio-server": "4.0.514",
46
- "@remotion/studio": "4.0.514",
40
+ "@remotion/bundler": "4.0.515",
41
+ "@remotion/media-utils": "4.0.515",
42
+ "@remotion/player": "4.0.515",
43
+ "@remotion/renderer": "4.0.515",
44
+ "@remotion/studio-shared": "4.0.515",
45
+ "@remotion/studio-server": "4.0.515",
46
+ "@remotion/studio": "4.0.515",
47
47
  "dotenv": "17.3.1",
48
48
  "minimist": "1.2.6",
49
49
  "prompts": "2.4.2",
50
50
  "semver": "7.5.3",
51
- "remotion": "4.0.514"
51
+ "remotion": "4.0.515"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "react": ">=16.8.0",
@@ -60,14 +60,14 @@
60
60
  "@types/prettier": "2.7.2",
61
61
  "@types/semver": "7.5.3",
62
62
  "@types/node": "20.12.14",
63
- "@remotion/zod-types": "4.0.514",
64
- "@remotion/tailwind-v4": "4.0.514",
65
- "@remotion/enable-scss": "4.0.514",
66
- "@remotion/skia": "4.0.514",
63
+ "@remotion/zod-types": "4.0.515",
64
+ "@remotion/tailwind-v4": "4.0.515",
65
+ "@remotion/enable-scss": "4.0.515",
66
+ "@remotion/skia": "4.0.515",
67
67
  "react": "19.2.3",
68
68
  "react-dom": "19.2.3",
69
69
  "zod": "4.4.3",
70
- "@remotion/eslint-config-internal": "4.0.514",
70
+ "@remotion/eslint-config-internal": "4.0.515",
71
71
  "eslint": "9.19.0",
72
72
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
73
73
  },