@remotion/cli 3.3.19 → 3.3.25

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,3 +1,3 @@
1
1
  import type { LogLevel } from '@remotion/renderer';
2
- export declare const getLogLevel: () => "error" | "verbose" | "info" | "warn";
2
+ export declare const getLogLevel: () => "verbose" | "error" | "info" | "warn";
3
3
  export declare const setLogLevel: (newLogLevel: LogLevel) => void;
@@ -1,5 +1,5 @@
1
1
  import type { PropsWithChildren } from 'react';
2
2
  import React from 'react';
3
3
  export declare const InlineAction: React.FC<PropsWithChildren<{
4
- onClick: React.MouseEventHandler<HTMLButtonElement> | undefined;
4
+ onClick: React.MouseEventHandler<HTMLAnchorElement> | undefined;
5
5
  }>>;
@@ -27,6 +27,8 @@ const InlineAction = ({ children, onClick }) => {
27
27
  opacity: hovered ? 1 : 0.6,
28
28
  };
29
29
  }, [hovered]);
30
- return ((0, jsx_runtime_1.jsx)("button", { onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, type: "button", onClick: onClick, style: style, tabIndex: tabIndex, children: children }));
30
+ return (
31
+ // <div> because cannot use button inside a button
32
+ (0, jsx_runtime_1.jsx)("a", { onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, style: style, tabIndex: tabIndex, children: children }));
31
33
  };
32
34
  exports.InlineAction = InlineAction;
@@ -257,6 +257,6 @@ const RenderModal = ({ compositionId, initialFrame, initialImageFormat, initialQ
257
257
  max: Infinity }), ' '] })] }), (0, jsx_runtime_1.jsxs)(CollapsableOptions_1.CollapsableOptions, { showLabel: "Show advanced settings", hideLabel: "Hide advanced settings", children: [(0, jsx_runtime_1.jsxs)("div", { style: optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: label, children: "Scale" }), (0, jsx_runtime_1.jsx)("div", { style: rightRow, children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: scale, onChange: onScaleChanged, placeholder: "0.1-10",
258
258
  // TODO: Does not allow non-integer steps
259
259
  // TODO: Cannot click and type in 0.2
260
- onValueChange: onScaleSetDirectly, name: "scale", step: 0.05, min: MIN_SCALE, max: MAX_SCALE }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: label, children: "Verbose logging" }), (0, jsx_runtime_1.jsx)("div", { style: rightRow, children: (0, jsx_runtime_1.jsx)("input", { type: 'checkbox', checked: verbose, onChange: onVerboseLoggingChanged }) })] }), imageFormat === 'jpeg' && ((0, jsx_runtime_1.jsxs)("div", { style: optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: label, children: "JPEG Quality" }), (0, jsx_runtime_1.jsx)("div", { style: rightRow, children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: quality, onChange: onQualityChanged, placeholder: "0-100", onValueChange: onQualityChangedDirectly, name: "quality", step: 1, min: MIN_QUALITY, max: MAX_QUALITY }) })] }))] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { block: true, y: 0.5 }), (0, jsx_runtime_1.jsxs)("div", { style: buttonRow, children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { autoFocus: true, onClick: onClickVideo, disabled: state.type === 'load', children: state.type === 'idle' ? 'Render video' : 'Rendering...' }), (0, jsx_runtime_1.jsx)(Button_1.Button, { autoFocus: true, onClick: onClickStill, disabled: state.type === 'load', children: state.type === 'idle' ? 'Render' : 'Rendering...' })] })] })] }));
260
+ onValueChange: onScaleSetDirectly, name: "scale", step: 0.05, min: MIN_SCALE, max: MAX_SCALE }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: label, children: "Verbose logging" }), (0, jsx_runtime_1.jsx)("div", { style: rightRow, children: (0, jsx_runtime_1.jsx)("input", { type: 'checkbox', checked: verbose, onChange: onVerboseLoggingChanged }) })] }), imageFormat === 'jpeg' && ((0, jsx_runtime_1.jsxs)("div", { style: optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: label, children: "JPEG Quality" }), (0, jsx_runtime_1.jsx)("div", { style: rightRow, children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: quality, onChange: onQualityChanged, placeholder: "0-100", onValueChange: onQualityChangedDirectly, name: "quality", step: 1, min: MIN_QUALITY, max: MAX_QUALITY }) })] }))] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { block: true, y: 0.5 }), (0, jsx_runtime_1.jsxs)("div", { style: buttonRow, children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { autoFocus: true, onClick: onClickVideo, disabled: state.type === 'load', children: state.type === 'idle' ? 'Render video' : 'Rendering...' }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { block: true, x: 0.5 }), (0, jsx_runtime_1.jsx)(Button_1.Button, { autoFocus: true, onClick: onClickStill, disabled: state.type === 'load', children: state.type === 'idle' ? 'Render still' : 'Rendering...' })] })] })] }));
261
261
  };
262
262
  exports.RenderModal = RenderModal;
@@ -30,7 +30,7 @@ export declare const getCliOptions: (options: {
30
30
  browserExecutable: BrowserExecutable;
31
31
  ffmpegExecutable: import("@remotion/renderer").FfmpegExecutable;
32
32
  ffprobeExecutable: import("@remotion/renderer").FfmpegExecutable;
33
- logLevel: "error" | "verbose" | "info" | "warn";
33
+ logLevel: "verbose" | "error" | "info" | "warn";
34
34
  scale: number;
35
35
  chromiumOptions: ChromiumOptions;
36
36
  overwrite: boolean;
package/dist/index.d.ts CHANGED
@@ -88,7 +88,7 @@ export declare const CliInternals: {
88
88
  browserExecutable: import("@remotion/renderer").BrowserExecutable;
89
89
  ffmpegExecutable: import("@remotion/renderer").FfmpegExecutable;
90
90
  ffprobeExecutable: import("@remotion/renderer").FfmpegExecutable;
91
- logLevel: "error" | "verbose" | "info" | "warn";
91
+ logLevel: "verbose" | "error" | "info" | "warn";
92
92
  scale: number;
93
93
  chromiumOptions: import("@remotion/renderer").ChromiumOptions;
94
94
  overwrite: boolean;
@@ -135,7 +135,7 @@ export declare const CliInternals: {
135
135
  source: string;
136
136
  };
137
137
  minimist: typeof minimist;
138
- selectComposition: (validCompositions: import("remotion").TCompMetadata[]) => Promise<{
138
+ selectComposition: (validCompositions: import("remotion/.").TCompMetadata[]) => Promise<{
139
139
  compositionId: string;
140
140
  reason: string;
141
141
  }>;
@@ -145,5 +145,5 @@ export declare const CliInternals: {
145
145
  reason: string;
146
146
  };
147
147
  getImageFormat: (codec: import("@remotion/renderer").CodecOrUndefined) => "png" | "jpeg" | "none";
148
- printCompositions: (compositions: import("remotion").TCompMetadata[]) => void;
148
+ printCompositions: (compositions: import("remotion/.").TCompMetadata[]) => void;
149
149
  };
@@ -1,7 +1,8 @@
1
1
  import type { JobProgressCallback, RenderJob } from './job';
2
- export declare const processStill: ({ job, remotionRoot, entryPoint, onProgress, }: {
2
+ export declare const processStill: ({ job, remotionRoot, entryPoint, onProgress, addCleanupCallback, }: {
3
3
  job: RenderJob;
4
4
  remotionRoot: string;
5
5
  entryPoint: string;
6
6
  onProgress: JobProgressCallback;
7
+ addCleanupCallback: (cb: () => Promise<void>) => void;
7
8
  }) => Promise<void>;
@@ -4,7 +4,7 @@ exports.processStill = void 0;
4
4
  const convert_entry_point_to_serve_url_1 = require("../../convert-entry-point-to-serve-url");
5
5
  const get_cli_options_1 = require("../../get-cli-options");
6
6
  const still_1 = require("../../render-flows/still");
7
- const processStill = async ({ job, remotionRoot, entryPoint, onProgress, }) => {
7
+ const processStill = async ({ job, remotionRoot, entryPoint, onProgress, addCleanupCallback, }) => {
8
8
  var _a;
9
9
  if (job.type !== 'still') {
10
10
  throw new Error('Expected still job');
@@ -42,6 +42,7 @@ const processStill = async ({ job, remotionRoot, entryPoint, onProgress, }) => {
42
42
  logLevel: job.verbose ? 'verbose' : 'info',
43
43
  onProgress,
44
44
  indentOutput: true,
45
+ addCleanupCallback,
45
46
  });
46
47
  // TODO: Allow cancel signal
47
48
  // TODO: Accept CLI options
@@ -1,7 +1,8 @@
1
1
  import type { JobProgressCallback, RenderJob } from './job';
2
- export declare const processVideoJob: ({ job, remotionRoot, entryPoint, onProgress, }: {
2
+ export declare const processVideoJob: ({ job, remotionRoot, entryPoint, onProgress, addCleanupCallback, }: {
3
3
  job: RenderJob;
4
4
  remotionRoot: string;
5
5
  entryPoint: string;
6
6
  onProgress: JobProgressCallback;
7
+ addCleanupCallback: (cb: () => Promise<void>) => void;
7
8
  }) => Promise<void>;
@@ -4,10 +4,10 @@ exports.processVideoJob = void 0;
4
4
  const convert_entry_point_to_serve_url_1 = require("../../convert-entry-point-to-serve-url");
5
5
  const get_cli_options_1 = require("../../get-cli-options");
6
6
  const render_1 = require("../../render-flows/render");
7
- const processVideoJob = async ({ job, remotionRoot, entryPoint, onProgress, }) => {
7
+ const processVideoJob = async ({ job, remotionRoot, entryPoint, onProgress, addCleanupCallback, }) => {
8
8
  var _a;
9
9
  if (job.type !== 'video') {
10
- throw new Error('Expected still job');
10
+ throw new Error('Expected video job');
11
11
  }
12
12
  const { publicDir, browserExecutable, ffmpegExecutable, ffprobeExecutable, chromiumOptions, envVariables, inputProps, port, browser, puppeteerTimeout, } = await (0, get_cli_options_1.getCliOptions)({
13
13
  isLambda: false,
@@ -39,7 +39,7 @@ const processVideoJob = async ({ job, remotionRoot, entryPoint, onProgress, }) =
39
39
  configFileImageFormat: undefined,
40
40
  logLevel: job.verbose ? 'verbose' : 'info',
41
41
  onProgress,
42
- indentOutput: true,
42
+ indent: true,
43
43
  // TODO: Make configurable
44
44
  concurrency: null,
45
45
  // TODO: Make configurable
@@ -48,6 +48,8 @@ const processVideoJob = async ({ job, remotionRoot, entryPoint, onProgress, }) =
48
48
  frameRange: null,
49
49
  quiet: false,
50
50
  shouldOutputImageSequence: false,
51
+ addCleanupCallback,
52
+ outputLocationFromUI: job.outName,
51
53
  });
52
54
  // TODO: Allow cancel signal
53
55
  // TODO: Accept CLI options
@@ -1,11 +1,12 @@
1
1
  import type { JobProgressCallback, RenderJob, RenderJobWithCleanup } from './job';
2
2
  export declare const getRenderQueue: () => RenderJob[];
3
3
  export declare const notifyClientsOfJobUpdate: () => void;
4
- export declare const processJob: ({ job, remotionRoot, entryPoint, onProgress, }: {
4
+ export declare const processJob: ({ job, remotionRoot, entryPoint, onProgress, addCleanupCallback, }: {
5
5
  job: RenderJob;
6
6
  remotionRoot: string;
7
7
  entryPoint: string;
8
8
  onProgress: JobProgressCallback;
9
+ addCleanupCallback: (cb: () => Promise<void>) => void;
9
10
  }) => Promise<void>;
10
11
  export declare const addJob: ({ job, entryPoint, remotionRoot, }: {
11
12
  job: RenderJobWithCleanup;
@@ -37,13 +37,25 @@ const notifyClientsOfJobUpdate = () => {
37
37
  });
38
38
  };
39
39
  exports.notifyClientsOfJobUpdate = notifyClientsOfJobUpdate;
40
- const processJob = async ({ job, remotionRoot, entryPoint, onProgress, }) => {
40
+ const processJob = async ({ job, remotionRoot, entryPoint, onProgress, addCleanupCallback, }) => {
41
41
  if (job.type === 'still') {
42
- await (0, process_still_1.processStill)({ job, remotionRoot, entryPoint, onProgress });
42
+ await (0, process_still_1.processStill)({
43
+ job,
44
+ remotionRoot,
45
+ entryPoint,
46
+ onProgress,
47
+ addCleanupCallback,
48
+ });
43
49
  return;
44
50
  }
45
51
  if (job.type === 'video') {
46
- await (0, process_video_1.processVideoJob)({ job, remotionRoot, entryPoint, onProgress });
52
+ await (0, process_video_1.processVideoJob)({
53
+ job,
54
+ remotionRoot,
55
+ entryPoint,
56
+ onProgress,
57
+ addCleanupCallback,
58
+ });
47
59
  return;
48
60
  }
49
61
  throw new Error(`Unknown job ${JSON.stringify(job)}`);
@@ -75,6 +87,7 @@ const processJobIfPossible = async ({ remotionRoot, entryPoint, }) => {
75
87
  if (!nextJob) {
76
88
  return;
77
89
  }
90
+ const jobCleanups = [];
78
91
  try {
79
92
  updateJob(nextJob.id, (job) => {
80
93
  return {
@@ -100,6 +113,9 @@ const processJobIfPossible = async ({ remotionRoot, entryPoint, }) => {
100
113
  };
101
114
  });
102
115
  },
116
+ addCleanupCallback: (cleanup) => {
117
+ jobCleanups.push(cleanup);
118
+ },
103
119
  });
104
120
  log_1.Log.info(chalk_1.chalk.gray('╰─ Done in ' + (Date.now() - startTime) + 'ms.'));
105
121
  const { unwatch } = (0, file_watcher_1.installFileWatcher)({
@@ -146,5 +162,8 @@ const processJobIfPossible = async ({ remotionRoot, entryPoint, }) => {
146
162
  });
147
163
  });
148
164
  }
165
+ finally {
166
+ await Promise.all(jobCleanups.map((c) => c()));
167
+ }
149
168
  };
150
169
  exports.processJobIfPossible = processJobIfPossible;
@@ -1,6 +1,6 @@
1
1
  import type { Browser, BrowserExecutable, ChromiumOptions, FfmpegExecutable, FrameRange, ImageFormat, LogLevel } from '@remotion/renderer';
2
2
  import type { JobProgressCallback } from '../preview-server/render-queue/job';
3
- export declare const renderCompFlow: ({ remotionRoot, fullEntryPoint, ffmpegExecutable, ffprobeExecutable, indentOutput, logLevel, browserExecutable, browser, chromiumOptions, scale, shouldOutputImageSequence, publicDir, inputProps, envVariables, puppeteerTimeout, port, height, width, remainingArgs, compositionIdFromUi, entryPointReason, overwrite, quiet, concurrency, frameRange, everyNthFrame, configFileImageFormat, quality, onProgress, }: {
3
+ export declare const renderCompFlow: ({ remotionRoot, fullEntryPoint, ffmpegExecutable, ffprobeExecutable, indent, logLevel, browserExecutable, browser, chromiumOptions, scale, shouldOutputImageSequence, publicDir, inputProps, envVariables, puppeteerTimeout, port, height, width, remainingArgs, compositionIdFromUi, entryPointReason, overwrite, quiet, concurrency, frameRange, everyNthFrame, configFileImageFormat, outputLocationFromUI, quality, onProgress, addCleanupCallback, }: {
4
4
  remotionRoot: string;
5
5
  fullEntryPoint: string;
6
6
  entryPointReason: string;
@@ -11,7 +11,7 @@ export declare const renderCompFlow: ({ remotionRoot, fullEntryPoint, ffmpegExec
11
11
  logLevel: LogLevel;
12
12
  browser: Browser;
13
13
  scale: number;
14
- indentOutput: boolean;
14
+ indent: boolean;
15
15
  shouldOutputImageSequence: boolean;
16
16
  publicDir: string | null;
17
17
  inputProps: object;
@@ -22,6 +22,7 @@ export declare const renderCompFlow: ({ remotionRoot, fullEntryPoint, ffmpegExec
22
22
  width: number | null;
23
23
  remainingArgs: string[];
24
24
  compositionIdFromUi: string | null;
25
+ outputLocationFromUI: string | null;
25
26
  overwrite: boolean;
26
27
  quiet: boolean;
27
28
  concurrency: number | null;
@@ -30,4 +31,5 @@ export declare const renderCompFlow: ({ remotionRoot, fullEntryPoint, ffmpegExec
30
31
  configFileImageFormat: ImageFormat | undefined;
31
32
  quality: number | undefined;
32
33
  onProgress: JobProgressCallback;
34
+ addCleanupCallback: (cb: () => Promise<void>) => void;
33
35
  }) => Promise<void>;
@@ -19,22 +19,23 @@ const progress_bar_1 = require("../progress-bar");
19
19
  const setup_cache_1 = require("../setup-cache");
20
20
  const truthy_1 = require("../truthy");
21
21
  const user_passed_output_location_1 = require("../user-passed-output-location");
22
- const renderCompFlow = async ({ remotionRoot, fullEntryPoint, ffmpegExecutable, ffprobeExecutable, indentOutput, logLevel, browserExecutable, browser, chromiumOptions, scale, shouldOutputImageSequence, publicDir, inputProps, envVariables, puppeteerTimeout, port, height, width, remainingArgs, compositionIdFromUi, entryPointReason, overwrite, quiet, concurrency, frameRange, everyNthFrame, configFileImageFormat, quality, onProgress, }) => {
22
+ const renderCompFlow = async ({ remotionRoot, fullEntryPoint, ffmpegExecutable, ffprobeExecutable, indent, logLevel, browserExecutable, browser, chromiumOptions, scale, shouldOutputImageSequence, publicDir, inputProps, envVariables, puppeteerTimeout, port, height, width, remainingArgs, compositionIdFromUi, entryPointReason, overwrite, quiet, concurrency, frameRange, everyNthFrame, configFileImageFormat, outputLocationFromUI, quality, onProgress, addCleanupCallback, }) => {
23
23
  const downloads = [];
24
24
  const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
25
+ addCleanupCallback(() => renderer_1.RenderInternals.cleanDownloadMap(downloadMap));
25
26
  const ffmpegVersion = await renderer_1.RenderInternals.getFfmpegVersion({
26
27
  ffmpegExecutable,
27
28
  remotionRoot,
28
29
  });
29
- log_1.Log.verboseAdvanced({ indent: indentOutput, logLevel }, 'FFMPEG Version:', ffmpegVersion ? ffmpegVersion.join('.') : 'Built from source');
30
- log_1.Log.verboseAdvanced({ indent: indentOutput, logLevel }, 'Browser executable: ', browserExecutable);
31
- log_1.Log.verboseAdvanced({ indent: indentOutput, logLevel }, 'Asset dirs', downloadMap.assetDir);
30
+ log_1.Log.verboseAdvanced({ indent, logLevel }, 'FFMPEG Version:', ffmpegVersion ? ffmpegVersion.join('.') : 'Built from source');
31
+ log_1.Log.verboseAdvanced({ indent, logLevel }, 'Browser executable: ', browserExecutable);
32
+ log_1.Log.verboseAdvanced({ indent, logLevel }, 'Asset dirs', downloadMap.assetDir);
32
33
  const browserInstance = (0, renderer_1.openBrowser)(browser, {
33
34
  browserExecutable,
34
35
  shouldDumpIo: renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose'),
35
36
  chromiumOptions,
36
37
  forceDeviceScaleFactor: scale,
37
- indentationString: indentOutput ? log_1.INDENT_TOKEN + ' ' : '',
38
+ indentationString: indent ? log_1.INDENT_TOKEN + ' ' : '',
38
39
  });
39
40
  const steps = [
40
41
  renderer_1.RenderInternals.isServeUrl(fullEntryPoint) ? null : 'bundling',
@@ -48,9 +49,10 @@ const renderCompFlow = async ({ remotionRoot, fullEntryPoint, ffmpegExecutable,
48
49
  publicDir,
49
50
  // TODO: Implement onProgress
50
51
  onProgress: () => undefined,
51
- indentOutput,
52
+ indentOutput: indent,
52
53
  logLevel,
53
54
  });
55
+ addCleanupCallback(cleanupBundle);
54
56
  const onDownload = (src) => {
55
57
  const id = Math.random();
56
58
  const download = {
@@ -70,6 +72,7 @@ const renderCompFlow = async ({ remotionRoot, fullEntryPoint, ffmpegExecutable,
70
72
  };
71
73
  };
72
74
  const puppeteerInstance = await browserInstance;
75
+ addCleanupCallback(() => puppeteerInstance.close(false));
73
76
  const comps = await (0, renderer_1.getCompositions)(urlOrBundle, {
74
77
  inputProps,
75
78
  puppeteerInstance,
@@ -99,20 +102,22 @@ const renderCompFlow = async ({ remotionRoot, fullEntryPoint, ffmpegExecutable,
99
102
  codec,
100
103
  scale,
101
104
  });
102
- // TODO: Should use output location from UI if explicitly specified
103
105
  const relativeOutputLocation = (0, get_filename_1.getOutputFilename)({
104
106
  codec,
105
107
  imageSequence: shouldOutputImageSequence,
106
108
  compositionName: compositionId,
107
109
  defaultExtension: renderer_1.RenderInternals.getFileExtensionFromCodec(codec, 'final'),
108
110
  args: argsAfterComposition,
111
+ indent,
112
+ fromUi: outputLocationFromUI,
113
+ logLevel,
109
114
  });
110
- log_1.Log.infoAdvanced({ indent: indentOutput, logLevel }, chalk_1.chalk.gray(`Entry point = ${fullEntryPoint} (${entryPointReason}), Composition = ${compositionId} (${reason}), Codec = ${codec} (${codecReason}), Output = ${relativeOutputLocation}`));
115
+ log_1.Log.infoAdvanced({ indent, logLevel }, chalk_1.chalk.gray(`Entry point = ${fullEntryPoint} (${entryPointReason}), Composition = ${compositionId} (${reason}), Codec = ${codec} (${codecReason}), Output = ${relativeOutputLocation}`));
111
116
  const absoluteOutputFile = (0, get_cli_options_1.getAndValidateAbsoluteOutputFile)(relativeOutputLocation, overwrite);
112
117
  const outputDir = shouldOutputImageSequence
113
118
  ? absoluteOutputFile
114
119
  : await fs_1.default.promises.mkdtemp(path_1.default.join(os_1.default.tmpdir(), 'react-motion-render'));
115
- log_1.Log.verboseAdvanced({ indent: indentOutput, logLevel }, 'Output dir', outputDir);
120
+ log_1.Log.verboseAdvanced({ indent, logLevel }, 'Output dir', outputDir);
116
121
  const renderProgress = (0, progress_bar_1.createOverwriteableCliOutput)({
117
122
  quiet,
118
123
  });
@@ -150,7 +155,7 @@ const renderCompFlow = async ({ remotionRoot, fullEntryPoint, ffmpegExecutable,
150
155
  message: 'Bundled',
151
156
  progress: 1,
152
157
  },
153
- }, indentOutput);
158
+ }, indent);
154
159
  onProgress({ progress, message });
155
160
  return renderProgress.update(output);
156
161
  };
@@ -174,10 +179,10 @@ const renderCompFlow = async ({ remotionRoot, fullEntryPoint, ffmpegExecutable,
174
179
  onStart: () => undefined,
175
180
  onDownload: (src) => {
176
181
  if (src.startsWith('data:')) {
177
- log_1.Log.infoAdvanced({ indent: indentOutput, logLevel }, '\nWriting Data URL to file: ', src.substring(0, 30) + '...');
182
+ log_1.Log.infoAdvanced({ indent, logLevel }, '\nWriting Data URL to file: ', src.substring(0, 30) + '...');
178
183
  }
179
184
  else {
180
- log_1.Log.infoAdvanced({ indent: indentOutput, logLevel }, '\nDownloading asset... ', src);
185
+ log_1.Log.infoAdvanced({ indent, logLevel }, '\nDownloading asset... ', src);
181
186
  }
182
187
  },
183
188
  outputDir,
@@ -199,8 +204,8 @@ const renderCompFlow = async ({ remotionRoot, fullEntryPoint, ffmpegExecutable,
199
204
  downloadMap,
200
205
  });
201
206
  updateRenderProgress();
202
- log_1.Log.infoAdvanced({ indent: indentOutput, logLevel });
203
- log_1.Log.infoAdvanced({ indent: indentOutput, logLevel }, chalk_1.chalk.cyan(`▶ ${absoluteOutputFile}`));
207
+ log_1.Log.infoAdvanced({ indent, logLevel });
208
+ log_1.Log.infoAdvanced({ indent, logLevel }, chalk_1.chalk.cyan(`▶ ${absoluteOutputFile}`));
204
209
  }
205
210
  const options = await (0, get_render_media_options_1.getRenderMediaOptions)({
206
211
  config,
@@ -223,29 +228,18 @@ const renderCompFlow = async ({ remotionRoot, fullEntryPoint, ffmpegExecutable,
223
228
  onDownload,
224
229
  downloadMap,
225
230
  onSlowestFrames: (slowestFrames) => {
226
- log_1.Log.verboseAdvanced({ indent: indentOutput, logLevel });
227
- log_1.Log.verboseAdvanced({ indent: indentOutput, logLevel }, `Slowest frames:`);
231
+ log_1.Log.verboseAdvanced({ indent, logLevel });
232
+ log_1.Log.verboseAdvanced({ indent, logLevel }, `Slowest frames:`);
228
233
  slowestFrames.forEach(({ frame, time }) => {
229
- log_1.Log.verboseAdvanced({ indent: indentOutput, logLevel }, `Frame ${frame} (${time.toFixed(3)}ms)`);
234
+ log_1.Log.verboseAdvanced({ indent, logLevel }, `Frame ${frame} (${time.toFixed(3)}ms)`);
230
235
  });
231
236
  },
232
- printLog: (...str) => log_1.Log.verboseAdvanced({ indent: indentOutput, logLevel }, ...str),
237
+ printLog: (...str) => log_1.Log.verboseAdvanced({ indent, logLevel }, ...str),
233
238
  });
234
- log_1.Log.infoAdvanced({ indent: indentOutput, logLevel });
235
- log_1.Log.infoAdvanced({ indent: indentOutput, logLevel }, chalk_1.chalk.cyan(`▶ ${absoluteOutputFile}`));
236
- try {
237
- await cleanupBundle();
238
- await renderer_1.RenderInternals.cleanDownloadMap(downloadMap);
239
- log_1.Log.verboseAdvanced({ indent: indentOutput, logLevel }, 'Cleaned up', downloadMap.assetDir);
240
- }
241
- catch (err) {
242
- log_1.Log.warnAdvanced({ indent: indentOutput, logLevel }, 'Could not clean up directory.');
243
- log_1.Log.warnAdvanced({ indent: indentOutput, logLevel }, err);
244
- log_1.Log.warnAdvanced({ indent: indentOutput, logLevel }, 'Do you have minimum required Node.js version?');
245
- }
246
- // TODO: This will not indent
247
- if (renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose')) {
248
- renderer_1.RenderInternals.perf.logPerf();
239
+ log_1.Log.infoAdvanced({ indent, logLevel });
240
+ log_1.Log.infoAdvanced({ indent, logLevel }, chalk_1.chalk.cyan(`▶ ${absoluteOutputFile}`));
241
+ for (const line of renderer_1.RenderInternals.perf.getPerf()) {
242
+ log_1.Log.verboseAdvanced({ indent, logLevel }, line);
249
243
  }
250
244
  };
251
245
  exports.renderCompFlow = renderCompFlow;
@@ -1,6 +1,6 @@
1
1
  import type { Browser, BrowserExecutable, ChromiumOptions, FfmpegExecutable, ImageFormat, LogLevel, StillImageFormat } from '@remotion/renderer';
2
2
  import type { JobProgressCallback } from '../preview-server/render-queue/job';
3
- export declare const renderStillFlow: ({ remotionRoot, fullEntryPoint, entryPointReason, remainingArgs, browser, browserExecutable, chromiumOptions, envVariables, ffmpegExecutable, ffprobeExecutable, height, inputProps, overwrite, port, publicDir, puppeteerTimeout, quality, scale, stillFrame, width, compositionIdFromUi, imageFormatFromUi, logLevel, configFileImageFormat, onProgress, indentOutput, }: {
3
+ export declare const renderStillFlow: ({ remotionRoot, fullEntryPoint, entryPointReason, remainingArgs, browser, browserExecutable, chromiumOptions, envVariables, ffmpegExecutable, ffprobeExecutable, height, inputProps, overwrite, port, publicDir, puppeteerTimeout, quality, scale, stillFrame, width, compositionIdFromUi, imageFormatFromUi, logLevel, configFileImageFormat, onProgress, indentOutput, addCleanupCallback, }: {
4
4
  remotionRoot: string;
5
5
  fullEntryPoint: string;
6
6
  entryPointReason: string;
@@ -27,4 +27,5 @@ export declare const renderStillFlow: ({ remotionRoot, fullEntryPoint, entryPoin
27
27
  configFileImageFormat: ImageFormat | undefined;
28
28
  onProgress: JobProgressCallback;
29
29
  indentOutput: boolean;
30
+ addCleanupCallback: (cb: () => Promise<void>) => void;
30
31
  }) => Promise<void>;
@@ -18,7 +18,7 @@ const progress_bar_1 = require("../progress-bar");
18
18
  const setup_cache_1 = require("../setup-cache");
19
19
  const truthy_1 = require("../truthy");
20
20
  const user_passed_output_location_1 = require("../user-passed-output-location");
21
- const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason, remainingArgs, browser, browserExecutable, chromiumOptions, envVariables, ffmpegExecutable, ffprobeExecutable, height, inputProps, overwrite, port, publicDir, puppeteerTimeout, quality, scale, stillFrame, width, compositionIdFromUi, imageFormatFromUi, logLevel, configFileImageFormat, onProgress, indentOutput, }) => {
21
+ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason, remainingArgs, browser, browserExecutable, chromiumOptions, envVariables, ffmpegExecutable, ffprobeExecutable, height, inputProps, overwrite, port, publicDir, puppeteerTimeout, quality, scale, stillFrame, width, compositionIdFromUi, imageFormatFromUi, logLevel, configFileImageFormat, onProgress, indentOutput, addCleanupCallback, }) => {
22
22
  var _a;
23
23
  const downloads = [];
24
24
  const aggregate = {
@@ -63,8 +63,11 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
63
63
  indentOutput,
64
64
  logLevel,
65
65
  });
66
+ addCleanupCallback(cleanupBundle);
66
67
  const puppeteerInstance = await browserInstance;
68
+ addCleanupCallback(() => puppeteerInstance.close(false));
67
69
  const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
70
+ addCleanupCallback(() => renderer_1.RenderInternals.cleanDownloadMap(downloadMap));
68
71
  const comps = await (0, renderer_1.getCompositions)(urlOrBundle, {
69
72
  inputProps,
70
73
  puppeteerInstance,
@@ -160,11 +163,6 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
160
163
  };
161
164
  updateProgress();
162
165
  log_1.Log.infoAdvanced({ indent: indentOutput, logLevel });
163
- const closeBrowserPromise = puppeteerInstance.close(false);
164
166
  log_1.Log.infoAdvanced({ indent: indentOutput, logLevel }, chalk_1.chalk.cyan(`▶️ ${absoluteOutputLocation}`));
165
- await closeBrowserPromise;
166
- await renderer_1.RenderInternals.cleanDownloadMap(downloadMap);
167
- await cleanupBundle();
168
- log_1.Log.verboseAdvanced({ indent: indentOutput, logLevel }, 'Cleaned up', downloadMap.assetDir);
169
167
  };
170
168
  exports.renderStillFlow = renderStillFlow;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cli",
3
- "version": "3.3.19",
3
+ "version": "3.3.25",
4
4
  "description": "CLI for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -22,16 +22,16 @@
22
22
  "author": "Jonny Burger <jonny@remotion.dev>",
23
23
  "license": "SEE LICENSE IN LICENSE.md",
24
24
  "dependencies": {
25
- "@remotion/bundler": "3.3.19",
26
- "@remotion/media-utils": "3.3.19",
27
- "@remotion/player": "3.3.19",
28
- "@remotion/renderer": "3.3.19",
25
+ "@remotion/bundler": "3.3.25",
26
+ "@remotion/media-utils": "3.3.25",
27
+ "@remotion/player": "3.3.25",
28
+ "@remotion/renderer": "3.3.25",
29
29
  "better-opn": "2.1.1",
30
30
  "dotenv": "9.0.2",
31
31
  "memfs": "3.4.3",
32
32
  "minimist": "1.2.6",
33
33
  "prompts": "2.4.1",
34
- "remotion": "3.3.19",
34
+ "remotion": "3.3.25",
35
35
  "semver": "7.3.5",
36
36
  "source-map": "0.6.1"
37
37
  },
@@ -66,11 +66,10 @@
66
66
  "ffmpeg",
67
67
  "video",
68
68
  "react",
69
- "puppeteer",
70
69
  "player"
71
70
  ],
72
71
  "publishConfig": {
73
72
  "access": "public"
74
73
  },
75
- "gitHead": "097ff40cd34ecba3c7ebbbc08b442827b0f4ad7d"
74
+ "gitHead": "48e46dd2ede8fe903bf0139cebd6f546d7f2b5e0"
76
75
  }