@remotion/cli 4.0.115 → 4.0.116

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 (51) hide show
  1. package/dist/benchmark.js +24 -17
  2. package/dist/bundle.js +11 -13
  3. package/dist/cleanup-before-quit.js +1 -1
  4. package/dist/cloudrun-command.js +5 -5
  5. package/dist/code-frame.d.ts +2 -2
  6. package/dist/code-frame.js +17 -17
  7. package/dist/composition-prompts.d.ts +2 -1
  8. package/dist/composition-prompts.js +4 -4
  9. package/dist/compositions.js +11 -11
  10. package/dist/config/chromium-flags.d.ts +0 -2
  11. package/dist/config/chromium-flags.js +1 -8
  12. package/dist/config/index.d.ts +0 -7
  13. package/dist/config/index.js +6 -39
  14. package/dist/ffmpeg.d.ts +2 -2
  15. package/dist/ffmpeg.js +2 -5
  16. package/dist/get-cli-options.d.ts +4 -10
  17. package/dist/get-cli-options.js +4 -18
  18. package/dist/get-composition-id.js +3 -3
  19. package/dist/get-config-file-name.js +1 -1
  20. package/dist/get-env.js +11 -11
  21. package/dist/get-input-props.js +5 -5
  22. package/dist/get-render-defaults.js +8 -4
  23. package/dist/gpu.d.ts +1 -1
  24. package/dist/gpu.js +11 -7
  25. package/dist/index.d.ts +12 -20
  26. package/dist/index.js +12 -13
  27. package/dist/initialize-cli.js +4 -2
  28. package/dist/lambda-command.js +5 -5
  29. package/dist/load-config.js +4 -4
  30. package/dist/log.d.ts +2 -4
  31. package/dist/parse-command-line.js +4 -21
  32. package/dist/print-compositions.d.ts +2 -1
  33. package/dist/print-compositions.js +6 -6
  34. package/dist/print-error.js +4 -4
  35. package/dist/print-help.d.ts +2 -1
  36. package/dist/print-help.js +43 -43
  37. package/dist/render-flows/render.js +4 -4
  38. package/dist/render-flows/still.js +3 -3
  39. package/dist/render-queue/process-still.js +3 -5
  40. package/dist/render-queue/process-video.js +2 -4
  41. package/dist/render-queue/queue.js +4 -5
  42. package/dist/render.js +19 -12
  43. package/dist/setup-cache.js +3 -3
  44. package/dist/show-compositions-picker.d.ts +3 -3
  45. package/dist/show-compositions-picker.js +4 -4
  46. package/dist/still.js +20 -12
  47. package/dist/studio.js +3 -3
  48. package/dist/upgrade.d.ts +2 -1
  49. package/dist/upgrade.js +6 -7
  50. package/dist/versions.js +17 -18
  51. package/package.json +10 -10
@@ -1,14 +1,11 @@
1
- import type { FrameRange, LogLevel } from '@remotion/renderer';
2
- export declare const getAndValidateAbsoluteOutputFile: (relativeOutputLocation: string, overwrite: boolean) => string;
1
+ import type { LogLevel } from '@remotion/renderer';
2
+ export declare const getAndValidateAbsoluteOutputFile: (relativeOutputLocation: string, overwrite: boolean, logLevel: LogLevel) => string;
3
3
  export declare const getCliOptions: (options: {
4
- isLambda: boolean;
5
- type: 'still' | 'series' | 'get-compositions';
6
- remotionRoot: string;
4
+ isStill: boolean;
7
5
  logLevel: LogLevel;
8
6
  }) => {
9
- puppeteerTimeout: number;
10
7
  concurrency: string | number | null;
11
- frameRange: FrameRange | null;
8
+ frameRange: import("@remotion/renderer").FrameRange | null;
12
9
  shouldOutputImageSequence: boolean;
13
10
  inputProps: Record<string, unknown>;
14
11
  envVariables: Record<string, string>;
@@ -17,12 +14,9 @@ export declare const getCliOptions: (options: {
17
14
  everyNthFrame: number;
18
15
  stillFrame: number;
19
16
  browserExecutable: import("@remotion/renderer").BrowserExecutable;
20
- logLevel: "verbose" | "info" | "warn" | "error";
21
17
  userAgent: string | null;
22
- headless: boolean;
23
18
  disableWebSecurity: boolean;
24
19
  ignoreCertificateErrors: boolean;
25
- overwrite: boolean;
26
20
  publicDir: string | null;
27
21
  ffmpegOverride: import("@remotion/renderer").FfmpegOverrideFn;
28
22
  height: number | null;
@@ -20,39 +20,29 @@ const getAndValidateFrameRange = (logLevel, indent) => {
20
20
  }
21
21
  return frameRange;
22
22
  };
23
- const getAndValidateAbsoluteOutputFile = (relativeOutputLocation, overwrite) => {
23
+ const getAndValidateAbsoluteOutputFile = (relativeOutputLocation, overwrite, logLevel) => {
24
24
  const absoluteOutputFile = node_path_1.default.resolve(process.cwd(), relativeOutputLocation);
25
25
  if (node_fs_1.default.existsSync(absoluteOutputFile) && !overwrite) {
26
- log_1.Log.error(`File at ${absoluteOutputFile} already exists. Use --overwrite to overwrite.`);
26
+ log_1.Log.error({ indent: false, logLevel }, `File at ${absoluteOutputFile} already exists. Use --overwrite to overwrite.`);
27
27
  process.exit(1);
28
28
  }
29
29
  return absoluteOutputFile;
30
30
  };
31
31
  exports.getAndValidateAbsoluteOutputFile = getAndValidateAbsoluteOutputFile;
32
- const getAndValidateShouldOutputImageSequence = ({ frameRange, }) => {
33
- const shouldOutputImageSequence = config_1.ConfigInternals.getShouldOutputImageSequence(frameRange);
34
- return shouldOutputImageSequence;
35
- };
36
32
  const getProResProfile = () => {
37
33
  const proResProfile = config_1.ConfigInternals.getProResProfile();
38
34
  return proResProfile;
39
35
  };
40
36
  const getCliOptions = (options) => {
41
37
  const frameRange = getAndValidateFrameRange(options.logLevel, false);
42
- const shouldOutputImageSequence = options.type === 'still'
38
+ const shouldOutputImageSequence = options.isStill
43
39
  ? true
44
- : getAndValidateShouldOutputImageSequence({
45
- frameRange,
46
- });
47
- const overwrite = config_1.ConfigInternals.getShouldOverwrite({
48
- defaultValue: !options.isLambda,
49
- });
40
+ : config_1.ConfigInternals.getShouldOutputImageSequence(frameRange);
50
41
  const pixelFormat = config_1.ConfigInternals.getPixelFormat();
51
42
  const proResProfile = getProResProfile();
52
43
  const browserExecutable = config_1.ConfigInternals.getBrowserExecutable();
53
44
  const disableWebSecurity = config_1.ConfigInternals.getChromiumDisableWebSecurity();
54
45
  const ignoreCertificateErrors = config_1.ConfigInternals.getIgnoreCertificateErrors();
55
- const headless = config_1.ConfigInternals.getChromiumHeadlessMode();
56
46
  const userAgent = config_1.ConfigInternals.getChromiumUserAgent();
57
47
  const everyNthFrame = config_1.ConfigInternals.getEveryNthFrame();
58
48
  const concurrency = config_1.ConfigInternals.getConcurrency();
@@ -64,7 +54,6 @@ const getCliOptions = (options) => {
64
54
  checkIfValidForCurrentMachine: false,
65
55
  });
66
56
  return {
67
- puppeteerTimeout: config_1.ConfigInternals.getCurrentPuppeteerTimeout(),
68
57
  concurrency,
69
58
  frameRange,
70
59
  shouldOutputImageSequence,
@@ -75,12 +64,9 @@ const getCliOptions = (options) => {
75
64
  everyNthFrame,
76
65
  stillFrame: config_1.ConfigInternals.getStillFrame(),
77
66
  browserExecutable,
78
- logLevel: config_1.ConfigInternals.Logging.getLogLevel(),
79
67
  userAgent,
80
- headless,
81
68
  disableWebSecurity,
82
69
  ignoreCertificateErrors,
83
- overwrite,
84
70
  publicDir: config_1.ConfigInternals.getPublicDir(),
85
71
  ffmpegOverride: config_1.ConfigInternals.getFfmpegOverrideFunction(),
86
72
  height,
@@ -70,7 +70,7 @@ const getCompositionId = async ({ args, compositionIdFromUi, serializedInputProp
70
70
  serializedInputPropsWithCustomSchema,
71
71
  offthreadVideoCacheSizeInBytes,
72
72
  });
73
- const { compositionId, reason } = await (0, show_compositions_picker_1.showSingleCompositionsPicker)(comps);
73
+ const { compositionId, reason } = await (0, show_compositions_picker_1.showSingleCompositionsPicker)(comps, logLevel);
74
74
  if (compositionId && typeof compositionId === 'string') {
75
75
  return {
76
76
  compositionId,
@@ -80,8 +80,8 @@ const getCompositionId = async ({ args, compositionIdFromUi, serializedInputProp
80
80
  };
81
81
  }
82
82
  }
83
- log_1.Log.error('Composition ID not passed.');
84
- log_1.Log.error('Pass an extra argument <composition-id>.');
83
+ log_1.Log.error({ indent: false, logLevel }, 'Composition ID not passed.');
84
+ log_1.Log.error({ indent: false, logLevel }, 'Pass an extra argument <composition-id>.');
85
85
  process.exit(1);
86
86
  };
87
87
  exports.getCompositionId = getCompositionId;
@@ -15,7 +15,7 @@ const loadConfig = (remotionRoot) => {
15
15
  if (parse_command_line_1.parsedCli.config) {
16
16
  const fullPath = node_path_1.default.resolve(process.cwd(), parse_command_line_1.parsedCli.config);
17
17
  if (!(0, node_fs_1.existsSync)(fullPath)) {
18
- log_1.Log.error(`You specified a config file location of "${parse_command_line_1.parsedCli.config}" but no file under ${fullPath} was found.`);
18
+ log_1.Log.error({ indent: false, logLevel: 'error' }, `You specified a config file location of "${parse_command_line_1.parsedCli.config}" but no file under ${fullPath} was found.`);
19
19
  process.exit(1);
20
20
  }
21
21
  return (0, load_config_1.loadConfigFile)(remotionRoot, parse_command_line_1.parsedCli.config, fullPath.endsWith('.js'));
package/dist/get-env.js CHANGED
@@ -61,15 +61,15 @@ const watchEnvFile = ({ processEnv, envFile, onUpdate, logLevel, }) => {
61
61
  }
62
62
  else if (type === 'changed') {
63
63
  await updateFile();
64
- log_1.Log.info(chalk_1.chalk.blueBright(`Updated env file ${envFile}`));
64
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.blueBright(`Updated env file ${envFile}`));
65
65
  }
66
66
  else if (type === 'created') {
67
67
  await updateFile();
68
- log_1.Log.info(chalk_1.chalk.blueBright(`Created env file ${envFile}`));
68
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.blueBright(`Created env file ${envFile}`));
69
69
  }
70
70
  }
71
71
  catch (err) {
72
- log_1.Log.error(`${envFile} update failed with error ${err.stack}`);
72
+ log_1.Log.error({ indent: false, logLevel }, `${envFile} update failed with error ${err.stack}`);
73
73
  }
74
74
  },
75
75
  });
@@ -93,8 +93,8 @@ const getEnvForEnvFile = ({ processEnv, envFile, onUpdate, logLevel, indent, })
93
93
  };
94
94
  }
95
95
  catch (err) {
96
- log_1.Log.error(`Your .env file at ${envFile} could not not be parsed.`);
97
- log_1.Log.error(err);
96
+ log_1.Log.error({ indent: false, logLevel }, `Your .env file at ${envFile} could not not be parsed.`);
97
+ log_1.Log.error({ indent: false, logLevel }, err);
98
98
  process.exit(1);
99
99
  }
100
100
  };
@@ -113,9 +113,9 @@ const getEnvironmentVariables = (onUpdate, logLevel, indent) => {
113
113
  if (parse_command_line_1.parsedCli['env-file']) {
114
114
  const envFile = node_path_1.default.resolve(process.cwd(), parse_command_line_1.parsedCli['env-file']);
115
115
  if (!node_fs_1.default.existsSync(envFile)) {
116
- log_1.Log.error('You passed a --env-file but it could not be found.');
117
- log_1.Log.error('We looked for the file at:', envFile);
118
- log_1.Log.error('Check that your path is correct and try again.');
116
+ log_1.Log.error({ indent: false, logLevel }, 'You passed a --env-file but it could not be found.');
117
+ log_1.Log.error({ indent: false, logLevel }, 'We looked for the file at:', envFile);
118
+ log_1.Log.error({ indent: false, logLevel }, 'Check that your path is correct and try again.');
119
119
  process.exit(1);
120
120
  }
121
121
  return getEnvForEnvFile({ processEnv, envFile, onUpdate, logLevel, indent });
@@ -125,9 +125,9 @@ const getEnvironmentVariables = (onUpdate, logLevel, indent) => {
125
125
  if (configFileSetting) {
126
126
  const envFile = node_path_1.default.resolve(remotionRoot, configFileSetting);
127
127
  if (!node_fs_1.default.existsSync(envFile)) {
128
- log_1.Log.error('You specified a custom .env file using `Config.setDotEnvLocation()` in the config file but it could not be found');
129
- log_1.Log.error('We looked for the file at:', envFile);
130
- log_1.Log.error('Check that your path is correct and try again.');
128
+ log_1.Log.error({ indent: false, logLevel }, 'You specified a custom .env file using `Config.setDotEnvLocation()` in the config file but it could not be found');
129
+ log_1.Log.error({ indent: false, logLevel }, 'We looked for the file at:', envFile);
130
+ log_1.Log.error({ indent: false, logLevel }, 'Check that your path is correct and try again.');
131
131
  process.exit(1);
132
132
  }
133
133
  return getEnvForEnvFile({ processEnv, envFile, onUpdate, logLevel, indent });
@@ -21,10 +21,10 @@ const getInputProps = (onUpdate, logLevel) => {
21
21
  node_fs_1.default.watchFile(jsonFile, { interval: 100 }, () => {
22
22
  try {
23
23
  onUpdate(JSON.parse(node_fs_1.default.readFileSync(jsonFile, 'utf-8')));
24
- log_1.Log.info(`Updated input props from ${jsonFile}.`);
24
+ log_1.Log.info({ indent: false, logLevel }, `Updated input props from ${jsonFile}.`);
25
25
  }
26
26
  catch (err) {
27
- log_1.Log.error(`${jsonFile} contains invalid JSON. Did not apply new input props.`);
27
+ log_1.Log.error({ indent: false, logLevel }, `${jsonFile} contains invalid JSON. Did not apply new input props.`);
28
28
  }
29
29
  });
30
30
  }
@@ -33,10 +33,10 @@ const getInputProps = (onUpdate, logLevel) => {
33
33
  return JSON.parse(parse_command_line_1.parsedCli.props);
34
34
  }
35
35
  catch (err) {
36
- log_1.Log.error('You passed --props but it was neither valid JSON nor a file path to a valid JSON file. Provided value: ' +
36
+ log_1.Log.error({ indent: false, logLevel }, 'You passed --props but it was neither valid JSON nor a file path to a valid JSON file. Provided value: ' +
37
37
  parse_command_line_1.parsedCli.props);
38
- log_1.Log.info('Got the following value:', parse_command_line_1.parsedCli.props);
39
- log_1.Log.error('Check that your input is parseable using `JSON.parse` and try again.');
38
+ log_1.Log.info({ indent: false, logLevel }, 'Got the following value:', parse_command_line_1.parsedCli.props);
39
+ log_1.Log.error({ indent: false, logLevel }, 'Check that your input is parseable using `JSON.parse` and try again.');
40
40
  if (node_os_1.default.platform() === 'win32') {
41
41
  const logOptions = {
42
42
  indent: false,
@@ -5,13 +5,13 @@ const renderer_1 = require("@remotion/renderer");
5
5
  const client_1 = require("@remotion/renderer/client");
6
6
  const config_1 = require("./config");
7
7
  const parse_command_line_1 = require("./parse-command-line");
8
- const { x264Option, audioBitrateOption, offthreadVideoCacheSizeInBytesOption, scaleOption, jpegQualityOption, videoBitrateOption, enforceAudioOption, mutedOption, colorSpaceOption, enableMultiprocessOnLinuxOption, glOption, numberOfGifLoopsOption, beepOnFinishOption, encodingMaxRateOption, encodingBufferSizeOption, reproOption, } = client_1.BrowserSafeApis.options;
8
+ const { x264Option, audioBitrateOption, offthreadVideoCacheSizeInBytesOption, scaleOption, jpegQualityOption, videoBitrateOption, enforceAudioOption, mutedOption, colorSpaceOption, enableMultiprocessOnLinuxOption, glOption, numberOfGifLoopsOption, beepOnFinishOption, encodingMaxRateOption, encodingBufferSizeOption, reproOption, logLevelOption, delayRenderTimeoutInMillisecondsOption, headlessOption, } = client_1.BrowserSafeApis.options;
9
9
  const getRenderDefaults = () => {
10
10
  var _a;
11
11
  const defaultJpegQuality = jpegQualityOption.getValue({
12
12
  commandLine: parse_command_line_1.parsedCli,
13
13
  }).value;
14
- const logLevel = config_1.ConfigInternals.Logging.getLogLevel();
14
+ const logLevel = logLevelOption.getValue({ commandLine: parse_command_line_1.parsedCli }).value;
15
15
  const defaultCodec = config_1.ConfigInternals.getOutputCodecOrUndefined();
16
16
  const concurrency = renderer_1.RenderInternals.getActualConcurrency(config_1.ConfigInternals.getConcurrency());
17
17
  const pixelFormat = config_1.ConfigInternals.getPixelFormat();
@@ -61,13 +61,17 @@ const getRenderDefaults = () => {
61
61
  const repro = reproOption.getValue({
62
62
  commandLine: parse_command_line_1.parsedCli,
63
63
  }).value;
64
+ const delayRenderTimeout = delayRenderTimeoutInMillisecondsOption.getValue({
65
+ commandLine: parse_command_line_1.parsedCli,
66
+ }).value;
67
+ const headless = headlessOption.getValue({
68
+ commandLine: parse_command_line_1.parsedCli,
69
+ }).value;
64
70
  const everyNthFrame = config_1.ConfigInternals.getEveryNthFrame();
65
- const delayRenderTimeout = config_1.ConfigInternals.getCurrentPuppeteerTimeout();
66
71
  const audioCodec = config_1.ConfigInternals.getAudioCodec();
67
72
  const stillImageFormat = config_1.ConfigInternals.getUserPreferredStillImageFormat();
68
73
  const videoImageFormat = config_1.ConfigInternals.getUserPreferredVideoImageFormat();
69
74
  const disableWebSecurity = config_1.ConfigInternals.getChromiumDisableWebSecurity();
70
- const headless = config_1.ConfigInternals.getChromiumHeadlessMode();
71
75
  const ignoreCertificateErrors = config_1.ConfigInternals.getIgnoreCertificateErrors();
72
76
  const userAgent = config_1.ConfigInternals.getChromiumUserAgent();
73
77
  const maxConcurrency = renderer_1.RenderInternals.getMaxConcurrency();
package/dist/gpu.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import type { LogLevel } from '@remotion/renderer';
2
2
  export declare const GPU_COMMAND = "gpu";
3
- export declare const gpuCommand: (remotionRoot: string, logLevel: LogLevel) => Promise<void>;
3
+ export declare const gpuCommand: (logLevel: LogLevel) => Promise<void>;
package/dist/gpu.js CHANGED
@@ -8,18 +8,22 @@ const get_cli_options_1 = require("./get-cli-options");
8
8
  const log_1 = require("./log");
9
9
  const parse_command_line_1 = require("./parse-command-line");
10
10
  exports.GPU_COMMAND = 'gpu';
11
- const { enableMultiprocessOnLinuxOption, glOption } = client_1.BrowserSafeApis.options;
12
- const gpuCommand = async (remotionRoot, logLevel) => {
13
- const { browserExecutable, puppeteerTimeout, disableWebSecurity, headless, ignoreCertificateErrors, userAgent, } = (0, get_cli_options_1.getCliOptions)({
14
- isLambda: false,
15
- remotionRoot,
16
- type: 'get-compositions',
11
+ const { enableMultiprocessOnLinuxOption, glOption, delayRenderTimeoutInMillisecondsOption, headlessOption, } = client_1.BrowserSafeApis.options;
12
+ const gpuCommand = async (logLevel) => {
13
+ const { browserExecutable, disableWebSecurity, ignoreCertificateErrors, userAgent, } = (0, get_cli_options_1.getCliOptions)({
14
+ isStill: false,
17
15
  logLevel,
18
16
  });
19
17
  const enableMultiProcessOnLinux = enableMultiprocessOnLinuxOption.getValue({
20
18
  commandLine: parse_command_line_1.parsedCli,
21
19
  }).value;
22
20
  const gl = glOption.getValue({ commandLine: parse_command_line_1.parsedCli }).value;
21
+ const puppeteerTimeout = delayRenderTimeoutInMillisecondsOption.getValue({
22
+ commandLine: parse_command_line_1.parsedCli,
23
+ }).value;
24
+ const headless = headlessOption.getValue({
25
+ commandLine: parse_command_line_1.parsedCli,
26
+ }).value;
23
27
  const chromiumOptions = {
24
28
  disableWebSecurity,
25
29
  enableMultiProcessOnLinux,
@@ -36,7 +40,7 @@ const gpuCommand = async (remotionRoot, logLevel) => {
36
40
  timeoutInMilliseconds: puppeteerTimeout,
37
41
  });
38
42
  for (const { feature, status } of statuses) {
39
- log_1.Log.info(`${feature}: ${colorStatus(status)}`);
43
+ log_1.Log.info({ indent: false, logLevel }, `${feature}: ${colorStatus(status)}`);
40
44
  }
41
45
  };
42
46
  exports.gpuCommand = gpuCommand;
package/dist/index.d.ts CHANGED
@@ -62,21 +62,16 @@ export declare const CliInternals: {
62
62
  verbose: (options: import("@remotion/renderer").LogOptions & {
63
63
  tag?: string | undefined;
64
64
  }, message?: any, ...optionalParams: any[]) => void;
65
- info: (message?: any, ...optionalParams: any[]) => void;
66
- infoAdvanced: (options: import("@remotion/renderer").LogOptions, message?: any, ...optionalParams: any[]) => void;
65
+ info: (options: import("@remotion/renderer").LogOptions, message?: any, ...optionalParams: any[]) => void;
67
66
  warn: (options: import("@remotion/renderer").LogOptions, message?: any, ...optionalParams: any[]) => void;
68
- error: (message?: any, ...optionalParams: any[]) => void;
69
- errorAdvanced: (options: import("@remotion/renderer").LogOptions & {
67
+ error: (options: import("@remotion/renderer").LogOptions & {
70
68
  tag?: string | undefined;
71
69
  }, message?: any, ...optionalParams: any[]) => void;
72
70
  };
73
71
  getCliOptions: (options: {
74
- isLambda: boolean;
75
- type: "still" | "series" | "get-compositions";
76
- remotionRoot: string;
77
- logLevel: "verbose" | "info" | "warn" | "error";
72
+ isStill: boolean;
73
+ logLevel: "info" | "verbose" | "warn" | "error";
78
74
  }) => {
79
- puppeteerTimeout: number;
80
75
  concurrency: string | number | null;
81
76
  frameRange: import("@remotion/renderer").FrameRange | null;
82
77
  shouldOutputImageSequence: boolean;
@@ -87,12 +82,9 @@ export declare const CliInternals: {
87
82
  everyNthFrame: number;
88
83
  stillFrame: number;
89
84
  browserExecutable: import("@remotion/renderer").BrowserExecutable;
90
- logLevel: "verbose" | "info" | "warn" | "error";
91
85
  userAgent: string | null;
92
- headless: boolean;
93
86
  disableWebSecurity: boolean;
94
87
  ignoreCertificateErrors: boolean;
95
- overwrite: boolean;
96
88
  publicDir: string | null;
97
89
  ffmpegOverride: import("@remotion/renderer").FfmpegOverrideFn;
98
90
  height: number | null;
@@ -106,13 +98,13 @@ export declare const CliInternals: {
106
98
  binary?: boolean | undefined;
107
99
  signed: boolean;
108
100
  }) | undefined) => string;
109
- initializeCli: (remotionRoot: string) => Promise<"verbose" | "info" | "warn" | "error">;
101
+ initializeCli: (remotionRoot: string) => Promise<"info" | "verbose" | "warn" | "error">;
110
102
  BooleanFlags: string[];
111
103
  quietFlagProvided: () => boolean;
112
104
  parsedCli: {
113
105
  "browser-executable": import("@remotion/renderer").BrowserExecutable;
114
106
  "pixel-format": "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
115
- "image-format": "png" | "jpeg" | "pdf" | "webp" | "none";
107
+ "image-format": "png" | "jpeg" | "none" | "pdf" | "webp";
116
108
  "prores-profile": "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy";
117
109
  "bundle-cache": string;
118
110
  "env-file": string;
@@ -176,13 +168,13 @@ export declare const CliInternals: {
176
168
  } & {
177
169
  _: string[];
178
170
  };
179
- printError: (err: Error, logLevel: "verbose" | "info" | "warn" | "error") => Promise<void>;
171
+ printError: (err: Error, logLevel: "info" | "verbose" | "warn" | "error") => Promise<void>;
180
172
  getFileSizeDownloadBar: (downloaded: number) => string;
181
173
  determineFinalStillImageFormat: ({ downloadName, outName, configImageFormat, cliFlag, isLambda, fromUi, }: {
182
174
  downloadName: string | null;
183
175
  outName: string | null;
184
176
  configImageFormat: "png" | "jpeg" | "pdf" | "webp" | null;
185
- cliFlag: "png" | "jpeg" | "pdf" | "webp" | "none" | null;
177
+ cliFlag: "png" | "jpeg" | "none" | "pdf" | "webp" | null;
186
178
  isLambda: boolean;
187
179
  fromUi: "png" | "jpeg" | "pdf" | "webp" | null;
188
180
  }) => {
@@ -190,7 +182,7 @@ export declare const CliInternals: {
190
182
  source: string;
191
183
  };
192
184
  minimist: typeof minimist;
193
- findEntryPoint: (args: string[], remotionRoot: string, logLevel: "verbose" | "info" | "warn" | "error") => {
185
+ findEntryPoint: (args: string[], remotionRoot: string, logLevel: "info" | "verbose" | "warn" | "error") => {
194
186
  file: string | null;
195
187
  remainingArgs: string[];
196
188
  reason: "argument passed - found in cwd" | "argument passed - found in root" | "argument passed" | "config file" | "common paths" | "none found";
@@ -199,10 +191,10 @@ export declare const CliInternals: {
199
191
  codec: import("@remotion/renderer").CodecOrUndefined;
200
192
  uiImageFormat: "png" | "jpeg" | "none" | null;
201
193
  }) => "png" | "jpeg" | "none";
202
- printCompositions: (compositions: import("remotion").VideoConfig[]) => void;
194
+ printCompositions: (compositions: import("remotion").VideoConfig[], logLevel: "info" | "verbose" | "warn" | "error") => void;
203
195
  listOfRemotionPackages: string[];
204
196
  shouldUseNonOverlayingLogger: ({ logLevel, }: {
205
- logLevel: "verbose" | "info" | "warn" | "error";
197
+ logLevel: "info" | "verbose" | "warn" | "error";
206
198
  }) => boolean;
207
199
  getCompositionWithDimensionOverride: ({ height, width, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent, serializedInputPropsWithCustomSchema, logLevel, server, offthreadVideoCacheSizeInBytes, }: {
208
200
  height: number | null;
@@ -217,7 +209,7 @@ export declare const CliInternals: {
217
209
  browserExecutable: import("@remotion/renderer").BrowserExecutable;
218
210
  serveUrlOrWebpackUrl: string;
219
211
  indent: boolean;
220
- logLevel: "verbose" | "info" | "warn" | "error";
212
+ logLevel: "info" | "verbose" | "warn" | "error";
221
213
  serializedInputPropsWithCustomSchema: string;
222
214
  server: import("@remotion/renderer").RemotionServer;
223
215
  offthreadVideoCacheSizeInBytes: number | null;
package/dist/index.js CHANGED
@@ -12,7 +12,6 @@ const chalk_1 = require("./chalk");
12
12
  const cleanup_before_quit_1 = require("./cleanup-before-quit");
13
13
  const cloudrun_command_1 = require("./cloudrun-command");
14
14
  const compositions_1 = require("./compositions");
15
- const config_1 = require("./config");
16
15
  const determine_image_format_1 = require("./determine-image-format");
17
16
  const download_progress_1 = require("./download-progress");
18
17
  const entry_point_1 = require("./entry-point");
@@ -41,13 +40,14 @@ const versions_1 = require("./versions");
41
40
  const cli = async () => {
42
41
  const [command, ...args] = parse_command_line_1.parsedCli._;
43
42
  if (parse_command_line_1.parsedCli.help) {
44
- (0, print_help_1.printHelp)();
43
+ (0, print_help_1.printHelp)('info');
45
44
  process.exit(0);
46
45
  }
47
46
  const remotionRoot = renderer_1.RenderInternals.findRemotionRoot();
48
47
  if (command !== versions_1.VERSIONS_COMMAND) {
49
48
  await (0, versions_1.validateVersionsBeforeCommand)(remotionRoot, 'info');
50
49
  }
50
+ const logLevel = await (0, initialize_cli_1.initializeCli)(remotionRoot);
51
51
  const isBun = typeof Bun !== 'undefined';
52
52
  if (isBun) {
53
53
  const version = Bun.version.split('.');
@@ -59,13 +59,12 @@ const cli = async () => {
59
59
  throw new Error('Please upgrade to at least Bun 1.0.3');
60
60
  }
61
61
  }
62
- log_1.Log.info('You are running Remotion with Bun, which is mostly supported. Visit https://remotion.dev/bun for more information.');
62
+ log_1.Log.info({ indent: false, logLevel }, 'You are running Remotion with Bun, which is mostly supported. Visit https://remotion.dev/bun for more information.');
63
63
  }
64
64
  const isStudio = command === 'studio' || command === 'preview';
65
65
  const errorSymbolicationLock = isStudio
66
66
  ? 0
67
67
  : renderer_1.RenderInternals.registerErrorSymbolicationLock();
68
- const logLevel = await (0, initialize_cli_1.initializeCli)(remotionRoot);
69
68
  (0, cleanup_before_quit_1.handleCtrlC)({ indent: false, logLevel });
70
69
  try {
71
70
  if (command === 'bundle') {
@@ -90,16 +89,16 @@ const cli = async () => {
90
89
  await (0, still_1.still)(remotionRoot, args, logLevel);
91
90
  }
92
91
  else if (command === 'ffmpeg') {
93
- (0, ffmpeg_1.ffmpegCommand)(remotionRoot, process.argv.slice(3));
92
+ (0, ffmpeg_1.ffmpegCommand)(remotionRoot, process.argv.slice(3), logLevel);
94
93
  }
95
94
  else if (command === 'gpu') {
96
- await (0, gpu_1.gpuCommand)(remotionRoot, logLevel);
95
+ await (0, gpu_1.gpuCommand)(logLevel);
97
96
  }
98
97
  else if (command === 'ffprobe') {
99
- (0, ffmpeg_1.ffprobeCommand)(remotionRoot, process.argv.slice(3));
98
+ (0, ffmpeg_1.ffprobeCommand)(remotionRoot, process.argv.slice(3), logLevel);
100
99
  }
101
100
  else if (command === 'upgrade') {
102
- await (0, upgrade_1.upgrade)(remotionRoot, parse_command_line_1.parsedCli['package-manager'], parse_command_line_1.parsedCli.version);
101
+ await (0, upgrade_1.upgrade)(remotionRoot, parse_command_line_1.parsedCli['package-manager'], parse_command_line_1.parsedCli.version, logLevel);
103
102
  }
104
103
  else if (command === versions_1.VERSIONS_COMMAND) {
105
104
  await (0, versions_1.versionsCommand)(remotionRoot, logLevel);
@@ -108,20 +107,20 @@ const cli = async () => {
108
107
  await (0, benchmark_1.benchmarkCommand)(remotionRoot, args, logLevel);
109
108
  }
110
109
  else if (command === 'help') {
111
- (0, print_help_1.printHelp)();
110
+ (0, print_help_1.printHelp)(logLevel);
112
111
  process.exit(0);
113
112
  }
114
113
  else {
115
114
  if (command) {
116
- log_1.Log.error(`Command ${command} not found.`);
115
+ log_1.Log.error({ indent: false, logLevel }, `Command ${command} not found.`);
117
116
  }
118
- (0, print_help_1.printHelp)();
117
+ (0, print_help_1.printHelp)(logLevel);
119
118
  process.exit(1);
120
119
  }
121
120
  }
122
121
  catch (err) {
123
- log_1.Log.info();
124
- await (0, print_error_1.printError)(err, config_1.ConfigInternals.Logging.getLogLevel());
122
+ log_1.Log.info({ indent: false, logLevel });
123
+ await (0, print_error_1.printError)(err, logLevel);
125
124
  (0, cleanup_before_quit_1.cleanupBeforeQuit)({ indent: false, logLevel });
126
125
  process.exit(1);
127
126
  }
@@ -1,14 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.initializeCli = void 0;
4
- const config_1 = require("./config");
4
+ const client_1 = require("@remotion/renderer/client");
5
5
  const get_config_file_name_1 = require("./get-config-file-name");
6
6
  const log_1 = require("./log");
7
7
  const parse_command_line_1 = require("./parse-command-line");
8
8
  const initializeCli = async (remotionRoot) => {
9
9
  const appliedName = await (0, get_config_file_name_1.loadConfig)(remotionRoot);
10
10
  (0, parse_command_line_1.parseCommandLine)();
11
- const logLevel = config_1.ConfigInternals.Logging.getLogLevel();
11
+ const logLevel = client_1.BrowserSafeApis.options.logLevelOption.getValue({
12
+ commandLine: parse_command_line_1.parsedCli,
13
+ }).value;
12
14
  // Only now Log.verbose is available
13
15
  log_1.Log.verbose({ indent: false, logLevel }, 'Remotion root directory:', remotionRoot);
14
16
  if (remotionRoot !== process.cwd()) {
@@ -15,11 +15,11 @@ const lambdaCommand = async (remotionRoot, args, logLevel) => {
15
15
  catch (err) {
16
16
  const manager = studio_server_1.StudioServerInternals.getPackageManager(remotionRoot, undefined);
17
17
  const installCommand = manager === 'unknown' ? 'npm i' : manager.installCommand;
18
- log_1.Log.error(err);
19
- log_1.Log.error('Remotion Lambda is not installed.');
20
- log_1.Log.info('');
21
- log_1.Log.info('You can install it using:');
22
- log_1.Log.info(`${installCommand} @remotion/lambda@${studio_server_1.StudioServerInternals.getRemotionVersion()}`);
18
+ log_1.Log.error({ indent: false, logLevel }, err);
19
+ log_1.Log.error({ indent: false, logLevel }, 'Remotion Lambda is not installed.');
20
+ log_1.Log.info({ indent: false, logLevel }, '');
21
+ log_1.Log.info({ indent: false, logLevel }, 'You can install it using:');
22
+ log_1.Log.info({ indent: false, logLevel }, `${installCommand} @remotion/lambda@${studio_server_1.StudioServerInternals.getRemotionVersion()}`);
23
23
  process.exit(1);
24
24
  }
25
25
  };
@@ -13,8 +13,8 @@ const loadConfigFile = async (remotionRoot, configFileName, isJavascript) => {
13
13
  const resolved = node_path_1.default.resolve(remotionRoot, configFileName);
14
14
  const tsconfigJson = node_path_1.default.join(remotionRoot, 'tsconfig.json');
15
15
  if (!isJavascript && !node_fs_1.default.existsSync(tsconfigJson)) {
16
- log_1.Log.error('Could not find a tsconfig.json file in your project. Did you delete it? Create a tsconfig.json in the root of your project. Copy the default file from https://github.com/remotion-dev/template-helloworld/blob/main/tsconfig.json.');
17
- log_1.Log.error('The root directory is:', remotionRoot);
16
+ log_1.Log.error({ indent: false, logLevel: 'error' }, 'Could not find a tsconfig.json file in your project. Did you delete it? Create a tsconfig.json in the root of your project. Copy the default file from https://github.com/remotion-dev/template-helloworld/blob/main/tsconfig.json.');
17
+ log_1.Log.error({ indent: false, logLevel: 'error' }, 'The root directory is:', remotionRoot);
18
18
  process.exit(1);
19
19
  }
20
20
  const virtualOutfile = 'bundle.js';
@@ -30,9 +30,9 @@ const loadConfigFile = async (remotionRoot, configFileName, isJavascript) => {
30
30
  packages: 'external',
31
31
  });
32
32
  if (result.errors.length > 0) {
33
- log_1.Log.error('Error in remotion.config.ts file');
33
+ log_1.Log.error({ indent: false, logLevel: 'error' }, 'Error in remotion.config.ts file');
34
34
  for (const err in result.errors) {
35
- log_1.Log.error(err);
35
+ log_1.Log.error({ indent: false, logLevel: 'error' }, err);
36
36
  }
37
37
  process.exit(1);
38
38
  }
package/dist/log.d.ts CHANGED
@@ -2,11 +2,9 @@ export declare const Log: {
2
2
  verbose: (options: import("@remotion/renderer").LogOptions & {
3
3
  tag?: string | undefined;
4
4
  }, message?: any, ...optionalParams: any[]) => void;
5
- info: (message?: any, ...optionalParams: any[]) => void;
6
- infoAdvanced: (options: import("@remotion/renderer").LogOptions, message?: any, ...optionalParams: any[]) => void;
5
+ info: (options: import("@remotion/renderer").LogOptions, message?: any, ...optionalParams: any[]) => void;
7
6
  warn: (options: import("@remotion/renderer").LogOptions, message?: any, ...optionalParams: any[]) => void;
8
- error: (message?: any, ...optionalParams: any[]) => void;
9
- errorAdvanced: (options: import("@remotion/renderer").LogOptions & {
7
+ error: (options: import("@remotion/renderer").LogOptions & {
10
8
  tag?: string | undefined;
11
9
  }, message?: any, ...optionalParams: any[]) => void;
12
10
  };
@@ -4,15 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.quietFlagProvided = exports.parseCommandLine = exports.parsedCli = exports.BooleanFlags = void 0;
7
- const renderer_1 = require("@remotion/renderer");
8
7
  const client_1 = require("@remotion/renderer/client");
9
8
  const minimist_1 = __importDefault(require("minimist"));
10
9
  const config_1 = require("./config");
11
10
  const log_1 = require("./log");
12
11
  const { beepOnFinishOption, colorSpaceOption, offthreadVideoCacheSizeInBytesOption, encodingBufferSizeOption, encodingMaxRateOption, deleteAfterOption, folderExpiryOption, enableMultiprocessOnLinuxOption, numberOfGifLoopsOption, x264Option, enforceAudioOption, jpegQualityOption, audioBitrateOption, videoBitrateOption, } = client_1.BrowserSafeApis.options;
13
12
  exports.BooleanFlags = [
14
- 'force',
15
13
  'overwrite',
14
+ 'force',
16
15
  'sequence',
17
16
  'help',
18
17
  'quiet',
@@ -38,6 +37,9 @@ exports.BooleanFlags = [
38
37
  ];
39
38
  exports.parsedCli = (0, minimist_1.default)(process.argv.slice(2), {
40
39
  boolean: exports.BooleanFlags,
40
+ default: {
41
+ overwrite: true,
42
+ },
41
43
  });
42
44
  const parseCommandLine = () => {
43
45
  if (exports.parsedCli.repro) {
@@ -58,28 +60,12 @@ const parseCommandLine = () => {
58
60
  if (exports.parsedCli['ignore-certificate-errors']) {
59
61
  config_1.Config.setChromiumIgnoreCertificateErrors(true);
60
62
  }
61
- if (exports.parsedCli['disable-headless']) {
62
- config_1.Config.setChromiumHeadlessMode(false);
63
- }
64
63
  if (exports.parsedCli['user-agent']) {
65
64
  config_1.Config.setChromiumUserAgent(exports.parsedCli['user-agent']);
66
65
  }
67
- if (exports.parsedCli.log) {
68
- if (!renderer_1.RenderInternals.isValidLogLevel(exports.parsedCli.log)) {
69
- log_1.Log.error('Invalid `--log` value passed.');
70
- log_1.Log.error(`Accepted values: ${renderer_1.RenderInternals.logLevels
71
- .map((l) => `'${l}'`)
72
- .join(', ')}.`);
73
- process.exit(1);
74
- }
75
- config_1.ConfigInternals.Logging.setLogLevel(exports.parsedCli.log);
76
- }
77
66
  if (exports.parsedCli.concurrency) {
78
67
  config_1.Config.setConcurrency(exports.parsedCli.concurrency);
79
68
  }
80
- if (exports.parsedCli.timeout) {
81
- config_1.Config.setTimeoutInMilliseconds(exports.parsedCli.timeout);
82
- }
83
69
  if (exports.parsedCli.height) {
84
70
  config_1.Config.overrideHeight(exports.parsedCli.height);
85
71
  }
@@ -107,9 +93,6 @@ const parseCommandLine = () => {
107
93
  if (exports.parsedCli['prores-profile']) {
108
94
  config_1.Config.setProResProfile(String(exports.parsedCli['prores-profile']));
109
95
  }
110
- if (exports.parsedCli.overwrite) {
111
- config_1.Config.setOverwriteOutput(exports.parsedCli.overwrite);
112
- }
113
96
  if (typeof exports.parsedCli.quality !== 'undefined') {
114
97
  log_1.Log.warn({ indent: false, logLevel: 'info' }, 'The --quality flag has been renamed to --jpeg-quality instead.');
115
98
  config_1.Config.setJpegQuality(exports.parsedCli.quality);
@@ -1,2 +1,3 @@
1
+ import type { LogLevel } from '@remotion/renderer';
1
2
  import type { VideoConfig } from 'remotion';
2
- export declare const printCompositions: (compositions: VideoConfig[]) => void;
3
+ export declare const printCompositions: (compositions: VideoConfig[], logLevel: LogLevel) => void;