@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
@@ -16,20 +16,20 @@ const max = (arr) => {
16
16
  }
17
17
  return biggest;
18
18
  };
19
- const printCompositions = (compositions) => {
19
+ const printCompositions = (compositions, logLevel) => {
20
20
  if (!(0, parse_command_line_1.quietFlagProvided)()) {
21
- log_1.Log.info();
22
- log_1.Log.info('The following compositions are available:');
23
- log_1.Log.info();
21
+ log_1.Log.info({ indent: false, logLevel });
22
+ log_1.Log.info({ indent: false, logLevel }, 'The following compositions are available:');
23
+ log_1.Log.info({ indent: false, logLevel });
24
24
  }
25
25
  if ((0, parse_command_line_1.quietFlagProvided)()) {
26
- log_1.Log.info(compositions.map((c) => c.id).join(' '));
26
+ log_1.Log.info({ indent: false, logLevel }, compositions.map((c) => c.id).join(' '));
27
27
  return;
28
28
  }
29
29
  const firstColumnLength = max(compositions.map(({ id }) => id.length)) + 4;
30
30
  const secondColumnLength = 8;
31
31
  const thirdColumnLength = 15;
32
- log_1.Log.info(compositions
32
+ log_1.Log.info({ indent: false, logLevel }, compositions
33
33
  .map((comp) => {
34
34
  const isStill = comp.durationInFrames === 1;
35
35
  const dimensions = `${comp.width}x${comp.height}`;
@@ -27,15 +27,15 @@ const printError = async (err, logLevel) => {
27
27
  else {
28
28
  output.update(chalk_1.chalk.red(`An error occurred while rendering frame ${err.frame}:`), true);
29
29
  }
30
- (0, code_frame_1.printCodeFrameAndStack)(symbolicated);
30
+ (0, code_frame_1.printCodeFrameAndStack)(symbolicated, logLevel);
31
31
  }
32
32
  catch (e) {
33
33
  output.update(chalk_1.chalk.red(''), true);
34
- log_1.Log.error();
35
- log_1.Log.error(err.stack || err);
34
+ log_1.Log.error({ indent: false, logLevel });
35
+ log_1.Log.error({ indent: false, logLevel }, err.stack || err);
36
36
  }
37
37
  return;
38
38
  }
39
- log_1.Log.error(err.stack || err);
39
+ log_1.Log.error({ indent: false, logLevel }, err.stack || err);
40
40
  };
41
41
  exports.printError = printError;
@@ -1 +1,2 @@
1
- export declare const printHelp: () => void;
1
+ import type { LogLevel } from '@remotion/renderer';
2
+ export declare const printHelp: (logLevel: LogLevel) => void;
@@ -6,51 +6,51 @@ const gpu_1 = require("./gpu");
6
6
  const log_1 = require("./log");
7
7
  const versions_1 = require("./versions");
8
8
  const packagejson = require('../package.json');
9
- const printHelp = () => {
10
- log_1.Log.info(`@remotion/cli ${packagejson.version}`);
11
- log_1.Log.info(`© ${new Date().getFullYear()} Remotion AG`);
12
- log_1.Log.info();
13
- log_1.Log.info('Available commands:');
14
- log_1.Log.info();
15
- log_1.Log.info(chalk_1.chalk.blue('remotion studio') + chalk_1.chalk.gray(' <entry-point.ts>'));
16
- log_1.Log.info('Start the Remotion studio.');
17
- log_1.Log.info(chalk_1.chalk.gray('https://www.remotion.dev/docs/cli/studio'));
18
- log_1.Log.info();
19
- log_1.Log.info(chalk_1.chalk.blue('remotion render') +
9
+ const printHelp = (logLevel) => {
10
+ log_1.Log.info({ indent: false, logLevel }, `@remotion/cli ${packagejson.version}`);
11
+ log_1.Log.info({ indent: false, logLevel }, `© ${new Date().getFullYear()} Remotion AG`);
12
+ log_1.Log.info({ indent: false, logLevel });
13
+ log_1.Log.info({ indent: false, logLevel }, 'Available commands:');
14
+ log_1.Log.info({ indent: false, logLevel });
15
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.blue('remotion studio') + chalk_1.chalk.gray(' <entry-point.ts>'));
16
+ log_1.Log.info({ indent: false, logLevel }, 'Start the Remotion studio.');
17
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.gray('https://www.remotion.dev/docs/cli/studio'));
18
+ log_1.Log.info({ indent: false, logLevel });
19
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.blue('remotion render') +
20
20
  chalk_1.chalk.gray(' <entry-point.ts> <comp-id> <output-file.mp4>'));
21
- log_1.Log.info('Render video, audio or an image sequence.');
22
- log_1.Log.info(chalk_1.chalk.gray('https://www.remotion.dev/docs/cli/render'));
23
- log_1.Log.info();
24
- log_1.Log.info(chalk_1.chalk.blue('remotion still') +
21
+ log_1.Log.info({ indent: false, logLevel }, 'Render video, audio or an image sequence.');
22
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.gray('https://www.remotion.dev/docs/cli/render'));
23
+ log_1.Log.info({ indent: false, logLevel });
24
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.blue('remotion still') +
25
25
  chalk_1.chalk.gray(' <entry-point.ts> <comp-id> <still.png>'));
26
- log_1.Log.info('Render a still frame and save it as an image.');
27
- log_1.Log.info(chalk_1.chalk.gray('https://www.remotion.dev/docs/cli/still'));
28
- log_1.Log.info();
29
- log_1.Log.info(chalk_1.chalk.blue('remotion bundle') + chalk_1.chalk.gray(' <entry-point.ts>'));
30
- log_1.Log.info('Create a Remotion bundle to be deployed to the web.');
31
- log_1.Log.info(chalk_1.chalk.gray('https://www.remotion.dev/docs/cli/bundle'));
32
- log_1.Log.info();
33
- log_1.Log.info(chalk_1.chalk.blue('remotion compositions') + chalk_1.chalk.gray(' <index-file.ts>'));
34
- log_1.Log.info('Prints the available compositions.');
35
- log_1.Log.info(chalk_1.chalk.gray('https://www.remotion.dev/docs/cli/compositions'));
36
- log_1.Log.info();
37
- log_1.Log.info(chalk_1.chalk.blue('remotion benchmark') +
26
+ log_1.Log.info({ indent: false, logLevel }, 'Render a still frame and save it as an image.');
27
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.gray('https://www.remotion.dev/docs/cli/still'));
28
+ log_1.Log.info({ indent: false, logLevel });
29
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.blue('remotion bundle') + chalk_1.chalk.gray(' <entry-point.ts>'));
30
+ log_1.Log.info({ indent: false, logLevel }, 'Create a Remotion bundle to be deployed to the web.');
31
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.gray('https://www.remotion.dev/docs/cli/bundle'));
32
+ log_1.Log.info({ indent: false, logLevel });
33
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.blue('remotion compositions') + chalk_1.chalk.gray(' <index-file.ts>'));
34
+ log_1.Log.info({ indent: false, logLevel }, 'Prints the available compositions.');
35
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.gray('https://www.remotion.dev/docs/cli/compositions'));
36
+ log_1.Log.info({ indent: false, logLevel });
37
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.blue('remotion benchmark') +
38
38
  chalk_1.chalk.gray(' <index-file.ts> <list-of-compositions>'));
39
- log_1.Log.info('Benchmarks rendering a composition. Same options as for render.');
40
- log_1.Log.info(chalk_1.chalk.gray('https://www.remotion.dev/docs/cli/benchmark'));
41
- log_1.Log.info();
42
- log_1.Log.info(chalk_1.chalk.blue('remotion ' + versions_1.VERSIONS_COMMAND));
43
- log_1.Log.info('Prints and validates versions of all Remotion packages.');
44
- log_1.Log.info(chalk_1.chalk.gray('https://www.remotion.dev/docs/cli/versions'));
45
- log_1.Log.info();
46
- log_1.Log.info(chalk_1.chalk.blue('remotion ' + gpu_1.GPU_COMMAND));
47
- log_1.Log.info('Prints information about how Chrome uses the CPU.');
48
- log_1.Log.info(chalk_1.chalk.gray('https://www.remotion.dev/docs/cli/gpu'));
49
- log_1.Log.info();
50
- log_1.Log.info(chalk_1.chalk.blue('remotion upgrade'));
51
- log_1.Log.info('Ensure Remotion is on the newest version.');
52
- log_1.Log.info(chalk_1.chalk.gray('https://www.remotion.dev/docs/cli/upgrade'));
53
- log_1.Log.info();
54
- log_1.Log.info('Visit https://www.remotion.dev/docs/cli for browsable CLI documentation.');
39
+ log_1.Log.info({ indent: false, logLevel }, 'Benchmarks rendering a composition. Same options as for render.');
40
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.gray('https://www.remotion.dev/docs/cli/benchmark'));
41
+ log_1.Log.info({ indent: false, logLevel });
42
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.blue('remotion ' + versions_1.VERSIONS_COMMAND));
43
+ log_1.Log.info({ indent: false, logLevel }, 'Prints and validates versions of all Remotion packages.');
44
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.gray('https://www.remotion.dev/docs/cli/versions'));
45
+ log_1.Log.info({ indent: false, logLevel });
46
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.blue('remotion ' + gpu_1.GPU_COMMAND));
47
+ log_1.Log.info({ indent: false, logLevel }, 'Prints information about how Chrome uses the CPU.');
48
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.gray('https://www.remotion.dev/docs/cli/gpu'));
49
+ log_1.Log.info({ indent: false, logLevel });
50
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.blue('remotion upgrade'));
51
+ log_1.Log.info({ indent: false, logLevel }, 'Ensure Remotion is on the newest version.');
52
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.gray('https://www.remotion.dev/docs/cli/upgrade'));
53
+ log_1.Log.info({ indent: false, logLevel });
54
+ log_1.Log.info({ indent: false, logLevel }, 'Visit https://www.remotion.dev/docs/cli for browsable CLI documentation.');
55
55
  };
56
56
  exports.printHelp = printHelp;
@@ -191,8 +191,8 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
191
191
  logLevel,
192
192
  });
193
193
  log_1.Log.verbose({ indent, logLevel }, chalk_1.chalk.gray(`Entry point = ${fullEntryPoint} (${entryPointReason})`));
194
- log_1.Log.infoAdvanced({ indent, logLevel }, chalk_1.chalk.gray(`Composition = ${compositionId} (${reason}), Codec = ${codec} (${codecReason}), Output = ${relativeOutputLocation}`));
195
- const absoluteOutputFile = (0, get_cli_options_1.getAndValidateAbsoluteOutputFile)(relativeOutputLocation, overwrite);
194
+ log_1.Log.info({ indent, logLevel }, chalk_1.chalk.gray(`Composition = ${compositionId} (${reason}), Codec = ${codec} (${codecReason}), Output = ${relativeOutputLocation}`));
195
+ const absoluteOutputFile = (0, get_cli_options_1.getAndValidateAbsoluteOutputFile)(relativeOutputLocation, overwrite, logLevel);
196
196
  const exists = (0, node_fs_1.existsSync)(absoluteOutputFile);
197
197
  const realFrameRange = renderer_1.RenderInternals.getRealFrameRange(config.durationInFrames, frameRange);
198
198
  const totalFrames = renderer_1.RenderInternals.getFramesToRender(realFrameRange, everyNthFrame);
@@ -259,7 +259,7 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
259
259
  parallelEncodingEnabled: isUsingParallelEncoding,
260
260
  });
261
261
  updateRenderProgress({ newline: true, printToConsole: true });
262
- log_1.Log.infoAdvanced({ indent, logLevel }, chalk_1.chalk.blue(`▶ ${absoluteOutputFile}`));
262
+ log_1.Log.info({ indent, logLevel }, chalk_1.chalk.blue(`▶ ${absoluteOutputFile}`));
263
263
  return;
264
264
  }
265
265
  stitchingProgress = {
@@ -339,7 +339,7 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
339
339
  updateRenderProgress({ newline: true, printToConsole: true });
340
340
  },
341
341
  });
342
- log_1.Log.infoAdvanced({ indent, logLevel }, chalk_1.chalk.blue(`${exists ? '○' : '+'} ${absoluteOutputFile}`));
342
+ log_1.Log.info({ indent, logLevel }, chalk_1.chalk.blue(`${exists ? '○' : '+'} ${absoluteOutputFile}`));
343
343
  log_1.Log.verbose({ indent, logLevel }, `Slowest frames:`);
344
344
  slowestFrames.forEach(({ frame, time }) => {
345
345
  log_1.Log.verbose({ indent, logLevel }, ` Frame ${frame} (${time.toFixed(3)}ms)`);
@@ -135,13 +135,13 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
135
135
  type: 'asset',
136
136
  outputLocationFromUi,
137
137
  });
138
- const absoluteOutputLocation = (0, get_cli_options_1.getAndValidateAbsoluteOutputFile)(relativeOutputLocation, overwrite);
138
+ const absoluteOutputLocation = (0, get_cli_options_1.getAndValidateAbsoluteOutputFile)(relativeOutputLocation, overwrite, logLevel);
139
139
  const exists = (0, node_fs_1.existsSync)(absoluteOutputLocation);
140
140
  (0, node_fs_1.mkdirSync)(node_path_1.default.join(absoluteOutputLocation, '..'), {
141
141
  recursive: true,
142
142
  });
143
143
  log_1.Log.verbose({ indent, logLevel }, chalk_1.chalk.gray(`Entry point = ${fullEntryPoint} (${entryPointReason})`));
144
- log_1.Log.infoAdvanced({ indent, logLevel }, chalk_1.chalk.gray(`Composition = ${compositionId} (${reason}), Format = ${imageFormat} (${source}), Output = ${relativeOutputLocation}`));
144
+ log_1.Log.info({ indent, logLevel }, chalk_1.chalk.gray(`Composition = ${compositionId} (${reason}), Format = ${imageFormat} (${source}), Output = ${relativeOutputLocation}`));
145
145
  const renderStart = Date.now();
146
146
  aggregate.rendering = {
147
147
  frames: 0,
@@ -204,6 +204,6 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
204
204
  printToConsole: true,
205
205
  isUsingParallelEncoding: false,
206
206
  });
207
- log_1.Log.infoAdvanced({ indent, logLevel }, chalk_1.chalk.blue(`${exists ? '○' : '+'} ${absoluteOutputLocation}`));
207
+ log_1.Log.info({ indent, logLevel }, chalk_1.chalk.blue(`${exists ? '○' : '+'} ${absoluteOutputLocation}`));
208
208
  };
209
209
  exports.renderStillFlow = renderStillFlow;
@@ -9,10 +9,8 @@ const processStill = async ({ job, remotionRoot, entryPoint, onProgress, addClea
9
9
  if (job.type !== 'still') {
10
10
  throw new Error('Expected still job');
11
11
  }
12
- const { publicDir, browserExecutable, puppeteerTimeout } = (0, get_cli_options_1.getCliOptions)({
13
- isLambda: false,
14
- type: 'still',
15
- remotionRoot,
12
+ const { publicDir, browserExecutable } = (0, get_cli_options_1.getCliOptions)({
13
+ isStill: true,
16
14
  logLevel: job.logLevel,
17
15
  });
18
16
  const fullEntryPoint = (0, convert_entry_point_to_serve_url_1.convertEntryPointToServeUrl)(entryPoint);
@@ -29,7 +27,7 @@ const processStill = async ({ job, remotionRoot, entryPoint, onProgress, addClea
29
27
  overwrite: true,
30
28
  port: (0, preview_server_1.getRendererPortFromConfigFile)(),
31
29
  publicDir,
32
- puppeteerTimeout,
30
+ puppeteerTimeout: job.delayRenderTimeout,
33
31
  jpegQuality: job.jpegQuality,
34
32
  remainingArgs: [],
35
33
  scale: job.scale,
@@ -10,10 +10,8 @@ const processVideoJob = async ({ job, remotionRoot, entryPoint, onProgress, addC
10
10
  if (job.type !== 'video' && job.type !== 'sequence') {
11
11
  throw new Error('Expected video job');
12
12
  }
13
- const { publicDir, browserExecutable, ffmpegOverride } = await (0, get_cli_options_1.getCliOptions)({
14
- isLambda: false,
15
- type: 'still',
16
- remotionRoot,
13
+ const { publicDir, browserExecutable, ffmpegOverride } = (0, get_cli_options_1.getCliOptions)({
14
+ isStill: true,
17
15
  logLevel,
18
16
  });
19
17
  const fullEntryPoint = (0, convert_entry_point_to_serve_url_1.convertEntryPointToServeUrl)(entryPoint);
@@ -7,7 +7,6 @@ exports.cancelJob = exports.removeJob = exports.addJob = exports.getRenderQueue
7
7
  const studio_server_1 = require("@remotion/studio-server");
8
8
  const node_path_1 = __importDefault(require("node:path"));
9
9
  const chalk_1 = require("../chalk");
10
- const config_1 = require("../config");
11
10
  const log_1 = require("../log");
12
11
  const print_error_1 = require("../print-error");
13
12
  const progress_types_1 = require("../progress-types");
@@ -120,7 +119,7 @@ const processJobIfPossible = async ({ remotionRoot, entryPoint, logLevel, }) =>
120
119
  };
121
120
  });
122
121
  const startTime = Date.now();
123
- log_1.Log.info(chalk_1.chalk.gray('╭─ Starting render '));
122
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.gray('╭─ Starting render '));
124
123
  let lastProgress = null;
125
124
  await processJob({
126
125
  job: nextJob,
@@ -162,7 +161,7 @@ const processJobIfPossible = async ({ remotionRoot, entryPoint, logLevel, }) =>
162
161
  },
163
162
  logLevel,
164
163
  });
165
- log_1.Log.info(chalk_1.chalk.gray('╰─ Done in ' + (Date.now() - startTime) + 'ms.'));
164
+ log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.gray('╰─ Done in ' + (Date.now() - startTime) + 'ms.'));
166
165
  const { unwatch } = studio_server_1.StudioServerInternals.installFileWatcher({
167
166
  file: node_path_1.default.resolve(remotionRoot, nextJob.outName),
168
167
  onChange: (type) => {
@@ -193,7 +192,7 @@ const processJobIfPossible = async ({ remotionRoot, entryPoint, logLevel, }) =>
193
192
  });
194
193
  }
195
194
  catch (err) {
196
- log_1.Log.error(chalk_1.chalk.gray('╰─ '), chalk_1.chalk.red('Failed to render'));
195
+ log_1.Log.error({ indent: false, logLevel }, chalk_1.chalk.gray('╰─ '), chalk_1.chalk.red('Failed to render'));
197
196
  updateJob(nextJob.id, (job) => {
198
197
  return {
199
198
  ...job,
@@ -204,7 +203,7 @@ const processJobIfPossible = async ({ remotionRoot, entryPoint, logLevel, }) =>
204
203
  },
205
204
  };
206
205
  });
207
- await (0, print_error_1.printError)(err, config_1.ConfigInternals.Logging.getLogLevel());
206
+ await (0, print_error_1.printError)(err, logLevel);
208
207
  studio_server_1.StudioServerInternals.waitForLiveEventsListener().then((listener) => {
209
208
  listener.sendEventToClient({
210
209
  type: 'render-job-failed',
package/dist/render.js CHANGED
@@ -8,29 +8,27 @@ const config_1 = require("./config");
8
8
  const preview_server_1 = require("./config/preview-server");
9
9
  const convert_entry_point_to_serve_url_1 = require("./convert-entry-point-to-serve-url");
10
10
  const entry_point_1 = require("./entry-point");
11
- const get_audio_codec_1 = require("./get-audio-codec");
12
11
  const get_cli_options_1 = require("./get-cli-options");
13
12
  const log_1 = require("./log");
14
13
  const parse_command_line_1 = require("./parse-command-line");
15
14
  const render_1 = require("./render-flows/render");
16
- const { x264Option, audioBitrateOption, offthreadVideoCacheSizeInBytesOption, scaleOption, crfOption, jpegQualityOption, videoBitrateOption, enforceAudioOption, mutedOption, colorSpaceOption, enableMultiprocessOnLinuxOption, glOption, numberOfGifLoopsOption, encodingMaxRateOption, encodingBufferSizeOption, reproOption, } = client_1.BrowserSafeApis.options;
15
+ const { x264Option, audioBitrateOption, offthreadVideoCacheSizeInBytesOption, scaleOption, crfOption, jpegQualityOption, videoBitrateOption, enforceAudioOption, mutedOption, colorSpaceOption, enableMultiprocessOnLinuxOption, glOption, numberOfGifLoopsOption, encodingMaxRateOption, encodingBufferSizeOption, reproOption, delayRenderTimeoutInMillisecondsOption, headlessOption, overwriteOption, } = client_1.BrowserSafeApis.options;
17
16
  const render = async (remotionRoot, args, logLevel) => {
17
+ var _a;
18
18
  const { file, remainingArgs, reason: entryPointReason, } = (0, entry_point_1.findEntryPoint)(args, remotionRoot, logLevel);
19
19
  if (!file) {
20
- log_1.Log.error('No entry point specified. Pass more arguments:');
21
- log_1.Log.error(' npx remotion render [entry-point] [composition-name] [out-name]');
22
- log_1.Log.error('Documentation: https://www.remotion.dev/docs/render');
20
+ log_1.Log.error({ indent: false, logLevel }, 'No entry point specified. Pass more arguments:');
21
+ log_1.Log.error({ indent: false, logLevel }, ' npx remotion render [entry-point] [composition-name] [out-name]');
22
+ log_1.Log.error({ indent: false, logLevel }, 'Documentation: https://www.remotion.dev/docs/render');
23
23
  process.exit(1);
24
24
  }
25
25
  const fullEntryPoint = (0, convert_entry_point_to_serve_url_1.convertEntryPointToServeUrl)(file);
26
26
  if (parse_command_line_1.parsedCli.frame) {
27
- log_1.Log.error('--frame flag was passed to the `render` command. This flag only works with the `still` command. Did you mean `--frames`? See reference: https://www.remotion.dev/docs/cli/');
27
+ log_1.Log.error({ indent: false, logLevel }, '--frame flag was passed to the `render` command. This flag only works with the `still` command. Did you mean `--frames`? See reference: https://www.remotion.dev/docs/cli/');
28
28
  process.exit(1);
29
29
  }
30
- const { concurrency, frameRange, shouldOutputImageSequence, overwrite, inputProps, envVariables, browserExecutable, everyNthFrame, headless, userAgent, disableWebSecurity, ignoreCertificateErrors, puppeteerTimeout, publicDir, height, width, ffmpegOverride, proResProfile, pixelFormat, } = (0, get_cli_options_1.getCliOptions)({
31
- isLambda: false,
32
- type: 'series',
33
- remotionRoot,
30
+ const { concurrency, frameRange, shouldOutputImageSequence, inputProps, envVariables, browserExecutable, everyNthFrame, userAgent, disableWebSecurity, ignoreCertificateErrors, publicDir, height, width, ffmpegOverride, proResProfile, pixelFormat, } = (0, get_cli_options_1.getCliOptions)({
31
+ isStill: false,
34
32
  logLevel,
35
33
  });
36
34
  const x264Preset = x264Option.getValue({ commandLine: parse_command_line_1.parsedCli }).value;
@@ -71,6 +69,15 @@ const render = async (remotionRoot, args, logLevel) => {
71
69
  commandLine: parse_command_line_1.parsedCli,
72
70
  }).value;
73
71
  const repro = reproOption.getValue({ commandLine: parse_command_line_1.parsedCli }).value;
72
+ const puppeteerTimeout = delayRenderTimeoutInMillisecondsOption.getValue({
73
+ commandLine: parse_command_line_1.parsedCli,
74
+ }).value;
75
+ const headless = headlessOption.getValue({
76
+ commandLine: parse_command_line_1.parsedCli,
77
+ }).value;
78
+ const overwrite = overwriteOption.getValue({
79
+ commandLine: parse_command_line_1.parsedCli,
80
+ }, true).value;
74
81
  const chromiumOptions = {
75
82
  disableWebSecurity,
76
83
  enableMultiProcessOnLinux,
@@ -79,13 +86,13 @@ const render = async (remotionRoot, args, logLevel) => {
79
86
  ignoreCertificateErrors,
80
87
  userAgent,
81
88
  };
82
- const audioCodec = (0, get_audio_codec_1.getResolvedAudioCodec)();
89
+ const audioCodec = (_a = parse_command_line_1.parsedCli['audio-codec']) !== null && _a !== void 0 ? _a : config_1.ConfigInternals.getAudioCodec();
83
90
  await (0, render_1.renderVideoFlow)({
84
91
  fullEntryPoint,
85
92
  remotionRoot,
86
93
  browserExecutable,
87
94
  indent: false,
88
- logLevel: config_1.ConfigInternals.Logging.getLogLevel(),
95
+ logLevel,
89
96
  browser: 'chrome',
90
97
  chromiumOptions,
91
98
  scale,
@@ -109,11 +109,11 @@ const bundleOnCli = async ({ fullPath, remotionRoot, publicDir, onProgressCallba
109
109
  });
110
110
  const cacheExistedBefore = bundler_1.BundlerInternals.cacheExists(remotionRoot, 'production', hash);
111
111
  if (cacheExistedBefore !== 'does-not-exist' && !shouldCache) {
112
- log_1.Log.infoAdvanced({ indent, logLevel }, '🧹 Cache disabled but found. Deleting... ');
112
+ log_1.Log.info({ indent, logLevel }, '🧹 Cache disabled but found. Deleting... ');
113
113
  await bundler_1.BundlerInternals.clearCache(remotionRoot, 'production');
114
114
  }
115
115
  if (cacheExistedBefore === 'other-exists' && shouldCache) {
116
- log_1.Log.infoAdvanced({ indent, logLevel }, '🧹 Webpack config change detected. Clearing cache... ');
116
+ log_1.Log.info({ indent, logLevel }, '🧹 Webpack config change detected. Clearing cache... ');
117
117
  await bundler_1.BundlerInternals.clearCache(remotionRoot, 'production');
118
118
  }
119
119
  const bundleStartTime = Date.now();
@@ -157,7 +157,7 @@ const bundleOnCli = async ({ fullPath, remotionRoot, publicDir, onProgressCallba
157
157
  if (cacheExistedAfter) {
158
158
  if (cacheExistedBefore === 'does-not-exist' ||
159
159
  cacheExistedBefore === 'other-exists') {
160
- log_1.Log.infoAdvanced({ indent, logLevel }, '⚡️ Cached bundle. Subsequent renders will be faster.');
160
+ log_1.Log.info({ indent, logLevel }, '⚡️ Cached bundle. Subsequent renders will be faster.');
161
161
  }
162
162
  }
163
163
  return bundled;
@@ -1,8 +1,8 @@
1
- import type { getCompositions } from '@remotion/renderer';
1
+ import type { getCompositions, LogLevel } from '@remotion/renderer';
2
2
  type Await<T> = T extends PromiseLike<infer U> ? U : T;
3
- export declare const showSingleCompositionsPicker: (validCompositions: Await<ReturnType<typeof getCompositions>>) => Promise<{
3
+ export declare const showSingleCompositionsPicker: (validCompositions: Await<ReturnType<typeof getCompositions>>, logLevel: LogLevel) => Promise<{
4
4
  compositionId: string;
5
5
  reason: string;
6
6
  }>;
7
- export declare const showMultiCompositionsPicker: (validCompositions: Await<ReturnType<typeof getCompositions>>) => Promise<string[]>;
7
+ export declare const showMultiCompositionsPicker: (validCompositions: Await<ReturnType<typeof getCompositions>>, logLevel: LogLevel) => Promise<string[]>;
8
8
  export {};
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.showMultiCompositionsPicker = exports.showSingleCompositionsPicker = void 0;
4
4
  const composition_prompts_1 = require("./composition-prompts");
5
5
  const chalk_1 = require("./chalk");
6
- const showSingleCompositionsPicker = async (validCompositions) => {
6
+ const showSingleCompositionsPicker = async (validCompositions, logLevel) => {
7
7
  if (validCompositions.length === 1) {
8
8
  const onlyComposition = validCompositions[0];
9
9
  if (onlyComposition) {
@@ -23,11 +23,11 @@ const showSingleCompositionsPicker = async (validCompositions) => {
23
23
  title: chalk_1.chalk.bold(comp.id),
24
24
  };
25
25
  }),
26
- }));
26
+ }, logLevel));
27
27
  return { compositionId: selectedComposition, reason: 'Selected' };
28
28
  };
29
29
  exports.showSingleCompositionsPicker = showSingleCompositionsPicker;
30
- const showMultiCompositionsPicker = async (validCompositions) => {
30
+ const showMultiCompositionsPicker = async (validCompositions, logLevel) => {
31
31
  if (validCompositions.length === 1) {
32
32
  const onlyComposition = validCompositions[0];
33
33
  if (onlyComposition) {
@@ -45,7 +45,7 @@ const showMultiCompositionsPicker = async (validCompositions) => {
45
45
  title: chalk_1.chalk.bold(comp.id),
46
46
  };
47
47
  }),
48
- });
48
+ }, logLevel);
49
49
  return selectedComposition;
50
50
  };
51
51
  exports.showMultiCompositionsPicker = showMultiCompositionsPicker;
package/dist/still.js CHANGED
@@ -11,24 +11,22 @@ const get_cli_options_1 = require("./get-cli-options");
11
11
  const log_1 = require("./log");
12
12
  const parse_command_line_1 = require("./parse-command-line");
13
13
  const still_1 = require("./render-flows/still");
14
- const { offthreadVideoCacheSizeInBytesOption, scaleOption, jpegQualityOption, enableMultiprocessOnLinuxOption, glOption, } = client_1.BrowserSafeApis.options;
14
+ const { offthreadVideoCacheSizeInBytesOption, scaleOption, jpegQualityOption, enableMultiprocessOnLinuxOption, glOption, delayRenderTimeoutInMillisecondsOption, headlessOption, overwriteOption, } = client_1.BrowserSafeApis.options;
15
15
  const still = async (remotionRoot, args, logLevel) => {
16
16
  const { file, remainingArgs, reason: entryPointReason, } = (0, entry_point_1.findEntryPoint)(args, remotionRoot, logLevel);
17
17
  if (!file) {
18
- log_1.Log.error('No entry point specified. Pass more arguments:');
19
- log_1.Log.error(' npx remotion render [entry-point] [composition-name] [out-name]');
20
- log_1.Log.error('Documentation: https://www.remotion.dev/docs/render');
18
+ log_1.Log.error({ indent: false, logLevel }, 'No entry point specified. Pass more arguments:');
19
+ log_1.Log.error({ indent: false, logLevel }, ' npx remotion render [entry-point] [composition-name] [out-name]');
20
+ log_1.Log.error({ indent: false, logLevel }, 'Documentation: https://www.remotion.dev/docs/render');
21
21
  process.exit(1);
22
22
  }
23
23
  const fullEntryPoint = (0, convert_entry_point_to_serve_url_1.convertEntryPointToServeUrl)(file);
24
24
  if (parse_command_line_1.parsedCli.frames) {
25
- log_1.Log.error('--frames flag was passed to the `still` command. This flag only works with the `render` command. Did you mean `--frame`? See reference: https://www.remotion.dev/docs/cli/');
25
+ log_1.Log.error({ indent: false, logLevel }, '--frames flag was passed to the `still` command. This flag only works with the `render` command. Did you mean `--frame`? See reference: https://www.remotion.dev/docs/cli/');
26
26
  process.exit(1);
27
27
  }
28
- const { browserExecutable, envVariables, height, inputProps, overwrite, publicDir, puppeteerTimeout, stillFrame, width, disableWebSecurity, headless, ignoreCertificateErrors, userAgent, } = (0, get_cli_options_1.getCliOptions)({
29
- isLambda: false,
30
- type: 'still',
31
- remotionRoot,
28
+ const { browserExecutable, envVariables, height, inputProps, publicDir, stillFrame, width, disableWebSecurity, ignoreCertificateErrors, userAgent, } = (0, get_cli_options_1.getCliOptions)({
29
+ isStill: true,
32
30
  logLevel,
33
31
  });
34
32
  const jpegQuality = jpegQualityOption.getValue({
@@ -39,6 +37,18 @@ const still = async (remotionRoot, args, logLevel) => {
39
37
  commandLine: parse_command_line_1.parsedCli,
40
38
  }).value;
41
39
  const gl = glOption.getValue({ commandLine: parse_command_line_1.parsedCli }).value;
40
+ const offthreadVideoCacheSizeInBytes = offthreadVideoCacheSizeInBytesOption.getValue({
41
+ commandLine: parse_command_line_1.parsedCli,
42
+ }).value;
43
+ const puppeteerTimeout = delayRenderTimeoutInMillisecondsOption.getValue({
44
+ commandLine: parse_command_line_1.parsedCli,
45
+ }).value;
46
+ const headless = headlessOption.getValue({
47
+ commandLine: parse_command_line_1.parsedCli,
48
+ }).value;
49
+ const overwrite = overwriteOption.getValue({
50
+ commandLine: parse_command_line_1.parsedCli,
51
+ }, true).value;
42
52
  const chromiumOptions = {
43
53
  disableWebSecurity,
44
54
  enableMultiProcessOnLinux,
@@ -80,9 +90,7 @@ const still = async (remotionRoot, args, logLevel) => {
80
90
  },
81
91
  cancelSignal: null,
82
92
  outputLocationFromUi: null,
83
- offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption.getValue({
84
- commandLine: parse_command_line_1.parsedCli,
85
- }).value,
93
+ offthreadVideoCacheSizeInBytes,
86
94
  });
87
95
  };
88
96
  exports.still = still;
package/dist/studio.js CHANGED
@@ -28,9 +28,9 @@ const studioCommand = async (remotionRoot, args, logLevel) => {
28
28
  const { file, reason } = (0, entry_point_1.findEntryPoint)(args, remotionRoot, logLevel);
29
29
  log_1.Log.verbose({ indent: false, logLevel }, 'Entry point:', file, 'reason:', reason);
30
30
  if (!file) {
31
- log_1.Log.error('No Remotion entrypoint was found. Specify an additional argument manually:');
32
- log_1.Log.error(' npx remotion studio src/index.ts');
33
- log_1.Log.error('See https://www.remotion.dev/docs/register-root for more information.');
31
+ log_1.Log.error({ indent: false, logLevel }, 'No Remotion entrypoint was found. Specify an additional argument manually:');
32
+ log_1.Log.error({ indent: false, logLevel }, ' npx remotion studio src/index.ts');
33
+ log_1.Log.error({ indent: false, logLevel }, 'See https://www.remotion.dev/docs/register-root for more information.');
34
34
  process.exit(1);
35
35
  }
36
36
  const desiredPort = getPort();
package/dist/upgrade.d.ts CHANGED
@@ -1 +1,2 @@
1
- export declare const upgrade: (remotionRoot: string, packageManager: string | undefined, version: string | undefined) => Promise<void>;
1
+ import type { LogLevel } from '@remotion/renderer';
2
+ export declare const upgrade: (remotionRoot: string, packageManager: string | undefined, version: string | undefined, logLevel: LogLevel) => Promise<void>;
package/dist/upgrade.js CHANGED
@@ -7,7 +7,6 @@ exports.upgrade = void 0;
7
7
  const renderer_1 = require("@remotion/renderer");
8
8
  const studio_server_1 = require("@remotion/studio-server");
9
9
  const node_path_1 = __importDefault(require("node:path"));
10
- const config_1 = require("./config");
11
10
  const list_of_remotion_packages_1 = require("./list-of-remotion-packages");
12
11
  const log_1 = require("./log");
13
12
  const getUpgradeCommand = ({ manager, packages, version, }) => {
@@ -20,7 +19,7 @@ const getUpgradeCommand = ({ manager, packages, version, }) => {
20
19
  };
21
20
  return commands[manager];
22
21
  };
23
- const upgrade = async (remotionRoot, packageManager, version) => {
22
+ const upgrade = async (remotionRoot, packageManager, version, logLevel) => {
24
23
  var _a, _b, _c, _d;
25
24
  const packageJsonFilePath = node_path_1.default.join(remotionRoot, 'package.json');
26
25
  const packageJson = require(packageJsonFilePath);
@@ -31,11 +30,11 @@ const upgrade = async (remotionRoot, packageManager, version) => {
31
30
  let targetVersion;
32
31
  if (version) {
33
32
  targetVersion = version;
34
- log_1.Log.info('Upgrading to specified version: ' + version);
33
+ log_1.Log.info({ indent: false, logLevel }, 'Upgrading to specified version: ' + version);
35
34
  }
36
35
  else {
37
36
  targetVersion = await studio_server_1.StudioServerInternals.getLatestRemotionVersion();
38
- log_1.Log.info('Newest Remotion version is', targetVersion);
37
+ log_1.Log.info({ indent: false, logLevel }, 'Newest Remotion version is', targetVersion);
39
38
  }
40
39
  const manager = studio_server_1.StudioServerInternals.getPackageManager(remotionRoot, packageManager);
41
40
  if (manager === 'unknown') {
@@ -55,11 +54,11 @@ const upgrade = async (remotionRoot, packageManager, version) => {
55
54
  env: { ...process.env, ADBLOCK: '1', DISABLE_OPENCOLLECTIVE: '1' },
56
55
  stdio: 'inherit',
57
56
  });
58
- if (renderer_1.RenderInternals.isEqualOrBelowLogLevel(config_1.ConfigInternals.Logging.getLogLevel(), 'info')) {
57
+ if (renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, 'info')) {
59
58
  (_d = prom.stdout) === null || _d === void 0 ? void 0 : _d.pipe(process.stdout);
60
59
  }
61
60
  await prom;
62
- log_1.Log.info('⏫ Remotion has been upgraded!');
63
- log_1.Log.info('https://remotion.dev/changelog');
61
+ log_1.Log.info({ indent: false, logLevel }, '⏫ Remotion has been upgraded!');
62
+ log_1.Log.info({ indent: false, logLevel }, 'https://remotion.dev/changelog');
64
63
  };
65
64
  exports.upgrade = upgrade;