@remotion/cli 4.0.355 → 4.0.356

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.
package/dist/benchmark.js CHANGED
@@ -207,6 +207,7 @@ const benchmarkCommand = async (remotionRoot, args, logLevel) => {
207
207
  mediaCacheSizeInBytes: mediaCacheSizeInBytesOption.getValue({
208
208
  commandLine: parsed_cli_1.parsedCli,
209
209
  }).value,
210
+ onLog: renderer_1.RenderInternals.defaultOnLog,
210
211
  });
211
212
  const ids = (remainingArgs[0]
212
213
  ? String(remainingArgs[0])
@@ -363,6 +364,7 @@ const benchmarkCommand = async (remotionRoot, args, logLevel) => {
363
364
  mediaCacheSizeInBytes: mediaCacheSizeInBytesOption.getValue({
364
365
  commandLine: parsed_cli_1.parsedCli,
365
366
  }).value,
367
+ onLog: renderer_1.RenderInternals.defaultOnLog,
366
368
  }, (run, progress) => {
367
369
  benchmarkProgress.update(makeBenchmarkProgressBar({
368
370
  totalRuns: runs,
@@ -114,6 +114,7 @@ const listCompositionsCommand = async (remotionRoot, args, logLevel) => {
114
114
  }),
115
115
  chromeMode,
116
116
  mediaCacheSizeInBytes,
117
+ onLog: renderer_1.RenderInternals.defaultOnLog,
117
118
  });
118
119
  (0, print_compositions_1.printCompositions)(compositions, logLevel);
119
120
  };
@@ -86,6 +86,7 @@ const getCompositionId = async ({ args, compositionIdFromUi, serializedInputProp
86
86
  onBrowserDownload,
87
87
  chromeMode,
88
88
  mediaCacheSizeInBytes,
89
+ onLog: renderer_1.RenderInternals.defaultOnLog,
89
90
  });
90
91
  if (comps.length === 1) {
91
92
  return {
package/dist/gpu.js CHANGED
@@ -61,6 +61,7 @@ const gpuCommand = async (logLevel) => {
61
61
  quiet: (0, parsed_cli_1.quietFlagProvided)(),
62
62
  }),
63
63
  chromeMode,
64
+ onLog: renderer_1.RenderInternals.defaultOnLog,
64
65
  });
65
66
  for (const { feature, status } of statuses) {
66
67
  log_1.Log.info({ indent: false, logLevel }, `${feature}: ${colorStatus(status)}`);
package/dist/index.d.ts CHANGED
@@ -60,6 +60,9 @@ export declare const CliInternals: {
60
60
  };
61
61
  makeProgressBar: (percentage: number, noColor: boolean) => string;
62
62
  Log: {
63
+ formatLogs: (logLevel: import("@remotion/renderer").LogLevel, options: import("@remotion/renderer").LogOptions & {
64
+ tag?: string;
65
+ }, args: Parameters<typeof console.log>) => string[];
63
66
  trace: (options: import("@remotion/renderer").LogOptions & {
64
67
  tag?: string;
65
68
  }, message?: any, ...optionalParams: any[]) => boolean | void;
package/dist/log.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  export declare const Log: {
2
+ formatLogs: (logLevel: import("@remotion/renderer").LogLevel, options: import("@remotion/renderer").LogOptions & {
3
+ tag?: string;
4
+ }, args: Parameters<typeof console.log>) => string[];
2
5
  trace: (options: import("@remotion/renderer").LogOptions & {
3
6
  tag?: string;
4
7
  }, message?: any, ...optionalParams: any[]) => boolean | void;
@@ -167,6 +167,23 @@ const getRightLabelWidth = (totalFrames) => {
167
167
  return `${totalFrames}/${totalFrames}`.length;
168
168
  };
169
169
  exports.getRightLabelWidth = getRightLabelWidth;
170
+ const makeLogsProgress = (logs) => {
171
+ if (logs.length === 0) {
172
+ return null;
173
+ }
174
+ return logs
175
+ .map((log) => {
176
+ var _a;
177
+ return renderer_1.RenderInternals.Log.formatLogs(log.logLevel, {
178
+ indent: false,
179
+ // It the log makes it this far, it should be logged
180
+ // Bypass log level filter
181
+ logLevel: 'trace',
182
+ tag: (_a = log.tag) !== null && _a !== void 0 ? _a : undefined,
183
+ }, [log.previewString]).join(' ');
184
+ })
185
+ .join('\n');
186
+ };
170
187
  const makeStitchingProgress = ({ stitchingProgress, isUsingParallelEncoding, }) => {
171
188
  const { frames, totalFrames, doneIn, stage, codec } = stitchingProgress;
172
189
  const progress = frames / totalFrames;
@@ -189,9 +206,10 @@ const makeStitchingProgress = ({ stitchingProgress, isUsingParallelEncoding, })
189
206
  };
190
207
  const makeRenderingAndStitchingProgress = ({ prog, isUsingParallelEncoding, }) => {
191
208
  var _a;
192
- const { rendering, stitching, downloads, bundling, artifactState } = prog;
209
+ const { rendering, stitching, downloads, bundling, artifactState, logs } = prog;
193
210
  const output = [
194
211
  rendering ? makeRenderingProgress(rendering) : null,
212
+ makeLogsProgress(logs),
195
213
  (0, download_progress_1.makeMultiDownloadProgress)(downloads, (_a = rendering === null || rendering === void 0 ? void 0 : rendering.totalFrames) !== null && _a !== void 0 ? _a : 0),
196
214
  stitching === null
197
215
  ? null
@@ -16,5 +16,6 @@ const initialAggregateRenderProgress = () => ({
16
16
  artifactState: {
17
17
  received: [],
18
18
  },
19
+ logs: [],
19
20
  });
20
21
  exports.initialAggregateRenderProgress = initialAggregateRenderProgress;
@@ -0,0 +1,8 @@
1
+ import type { AggregateRenderProgress } from '@remotion/studio-shared';
2
+ import type { LogLevel } from 'remotion';
3
+ export declare const addLogToAggregateProgress: ({ logs, logLevel, previewString, tag, }: {
4
+ logs: AggregateRenderProgress["logs"];
5
+ logLevel: LogLevel;
6
+ previewString: string;
7
+ tag: string | null;
8
+ }) => void;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addLogToAggregateProgress = void 0;
4
+ const addLogToAggregateProgress = ({ logs, logLevel, previewString, tag, }) => {
5
+ logs.push({ logLevel, previewString, tag });
6
+ };
7
+ exports.addLogToAggregateProgress = addLogToAggregateProgress;
@@ -0,0 +1,9 @@
1
+ import type { AggregateRenderProgress } from '@remotion/studio-shared';
2
+ import type { LogLevel } from 'remotion';
3
+ export declare const addLogToAggregateProgress: ({ logs, logLogLevel, logLevel, previewString, tag, }: {
4
+ logs: AggregateRenderProgress["logs"];
5
+ logLogLevel: LogLevel;
6
+ logLevel: LogLevel;
7
+ previewString: string;
8
+ tag: string | null;
9
+ }) => void;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addLogToAggregateProgress = void 0;
4
+ const renderer_1 = require("@remotion/renderer");
5
+ const addLogToAggregateProgress = ({ logs, logLogLevel, logLevel, previewString, tag, }) => {
6
+ if (renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, logLogLevel)) {
7
+ logs.push({ logLevel: logLogLevel, previewString, tag });
8
+ if (logs.length > 3) {
9
+ logs.shift();
10
+ }
11
+ }
12
+ };
13
+ exports.addLogToAggregateProgress = addLogToAggregateProgress;
@@ -61,6 +61,7 @@ const setup_cache_1 = require("../setup-cache");
61
61
  const should_use_non_overlaying_logger_1 = require("../should-use-non-overlaying-logger");
62
62
  const truthy_1 = require("../truthy");
63
63
  const user_passed_output_location_1 = require("../user-passed-output-location");
64
+ const add_log_to_aggregate_progress_1 = require("./add-log-to-aggregate-progress");
64
65
  const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel, browserExecutable, browser, chromiumOptions, scale, shouldOutputImageSequence, publicDir, envVariables, puppeteerTimeout, port, height, width, remainingArgs, compositionIdFromUi, entryPointReason, overwrite, quiet, concurrency, frameRange, everyNthFrame, outputLocationFromUI, jpegQuality, onProgress, addCleanupCallback, cancelSignal, crf, uiCodec, uiImageFormat, ffmpegOverride, audioBitrate, muted, enforceAudioTrack, proResProfile, x264Preset, pixelFormat, videoBitrate, encodingMaxRate, encodingBufferSize, numberOfGifLoops, audioCodec, serializedInputPropsWithCustomSchema, disallowParallelEncoding, offthreadVideoCacheSizeInBytes, offthreadVideoThreads, colorSpace, repro, binariesDirectory, forSeamlessAacConcatenation, separateAudioTo, publicPath, metadata, hardwareAcceleration, chromeMode, audioLatencyHint, imageSequencePattern, mediaCacheSizeInBytes, }) => {
65
66
  var _a;
66
67
  const isVerbose = renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose');
@@ -115,6 +116,7 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
115
116
  bytes: 0,
116
117
  doneIn: null,
117
118
  };
119
+ const logsProgress = [];
118
120
  let artifactState = { received: [] };
119
121
  const updateRenderProgress = ({ newline, printToConsole, }) => {
120
122
  const aggregateRenderProgress = {
@@ -124,6 +126,7 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
124
126
  bundling: bundlingProgress,
125
127
  copyingState,
126
128
  artifactState,
129
+ logs: logsProgress,
127
130
  };
128
131
  const { output, message, progress } = (0, progress_bar_1.makeRenderingAndStitchingProgress)({
129
132
  prog: aggregateRenderProgress,
@@ -209,7 +212,10 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
209
212
  artifactState,
210
213
  onProgress: (progress) => {
211
214
  artifactState = progress;
212
- updateRenderProgress({ newline: false, printToConsole: true });
215
+ updateRenderProgress({
216
+ newline: false,
217
+ printToConsole: !updatesDontOverwrite,
218
+ });
213
219
  },
214
220
  compositionId,
215
221
  });
@@ -294,6 +300,28 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
294
300
  codec: shouldOutputImageSequence ? undefined : codec,
295
301
  uiImageFormat,
296
302
  });
303
+ const onLog = ({ logLevel: logLogLevel, previewString, tag }) => {
304
+ (0, add_log_to_aggregate_progress_1.addLogToAggregateProgress)({
305
+ logs: logsProgress,
306
+ logLogLevel,
307
+ previewString,
308
+ tag,
309
+ logLevel,
310
+ });
311
+ if (!updatesDontOverwrite) {
312
+ updateRenderProgress({
313
+ newline: false,
314
+ printToConsole: !updatesDontOverwrite,
315
+ });
316
+ }
317
+ else {
318
+ log_1.Log[logLogLevel]({
319
+ indent,
320
+ logLevel,
321
+ tag,
322
+ }, previewString);
323
+ }
324
+ };
297
325
  if (shouldOutputImageSequence) {
298
326
  node_fs_1.default.mkdirSync(absoluteOutputFile, {
299
327
  recursive: true,
@@ -353,6 +381,7 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
353
381
  chromeMode,
354
382
  imageSequencePattern,
355
383
  mediaCacheSizeInBytes,
384
+ onLog,
356
385
  });
357
386
  log_1.Log.info({ indent, logLevel }, chalk_1.chalk.blue(`\n▶ ${absoluteOutputFile}`));
358
387
  return;
@@ -442,6 +471,7 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
442
471
  hardwareAcceleration,
443
472
  chromeMode,
444
473
  mediaCacheSizeInBytes,
474
+ onLog,
445
475
  });
446
476
  if (!updatesDontOverwrite) {
447
477
  updateRenderProgress({ newline: true, printToConsole: true });
@@ -27,6 +27,7 @@ const setup_cache_1 = require("../setup-cache");
27
27
  const should_use_non_overlaying_logger_1 = require("../should-use-non-overlaying-logger");
28
28
  const truthy_1 = require("../truthy");
29
29
  const user_passed_output_location_1 = require("../user-passed-output-location");
30
+ const add_log_to_aggregate_progress_1 = require("./add-log-to-aggregate-progress");
30
31
  const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason, remainingArgs, browser, browserExecutable, chromiumOptions, envVariables, height, serializedInputPropsWithCustomSchema, overwrite, port, publicDir, puppeteerTimeout, jpegQuality, scale, stillFrame, width, compositionIdFromUi, imageFormatFromUi, logLevel, onProgress, indent, addCleanupCallback, cancelSignal, outputLocationFromUi, offthreadVideoCacheSizeInBytes, binariesDirectory, publicPath, chromeMode, offthreadVideoThreads, audioLatencyHint, mediaCacheSizeInBytes, }) => {
31
32
  var _a, _b;
32
33
  const isVerbose = renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose');
@@ -250,6 +251,19 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
250
251
  chromeMode,
251
252
  offthreadVideoThreads,
252
253
  mediaCacheSizeInBytes,
254
+ onLog: ({ logLevel: logLogLevel, previewString, tag }) => {
255
+ (0, add_log_to_aggregate_progress_1.addLogToAggregateProgress)({
256
+ logs: aggregate.logs,
257
+ logLogLevel,
258
+ previewString,
259
+ tag,
260
+ logLevel,
261
+ });
262
+ updateRenderProgress({
263
+ newline: false,
264
+ printToConsole: true,
265
+ });
266
+ },
253
267
  });
254
268
  aggregate.rendering = {
255
269
  frames: 1,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/cli"
4
4
  },
5
5
  "name": "@remotion/cli",
6
- "version": "4.0.355",
6
+ "version": "4.0.356",
7
7
  "description": "Control Remotion features using the `npx remotion` command",
8
8
  "main": "dist/index.js",
9
9
  "sideEffects": false,
@@ -33,14 +33,14 @@
33
33
  "dotenv": "9.0.2",
34
34
  "minimist": "1.2.6",
35
35
  "prompts": "2.4.2",
36
- "@remotion/bundler": "4.0.355",
37
- "@remotion/studio-shared": "4.0.355",
38
- "@remotion/media-utils": "4.0.355",
39
- "@remotion/renderer": "4.0.355",
40
- "@remotion/studio": "4.0.355",
41
- "@remotion/player": "4.0.355",
42
- "remotion": "4.0.355",
43
- "@remotion/studio-server": "4.0.355"
36
+ "@remotion/bundler": "4.0.356",
37
+ "@remotion/media-utils": "4.0.356",
38
+ "remotion": "4.0.356",
39
+ "@remotion/player": "4.0.356",
40
+ "@remotion/studio-shared": "4.0.356",
41
+ "@remotion/studio-server": "4.0.356",
42
+ "@remotion/studio": "4.0.356",
43
+ "@remotion/renderer": "4.0.356"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "react": ">=16.8.0",
@@ -54,11 +54,11 @@
54
54
  "react-dom": "19.0.0",
55
55
  "zod": "3.22.3",
56
56
  "eslint": "9.19.0",
57
- "@remotion/zod-types": "4.0.355",
58
- "@remotion/tailwind-v4": "4.0.355",
59
- "@remotion/skia": "4.0.355",
60
- "@remotion/enable-scss": "4.0.355",
61
- "@remotion/eslint-config-internal": "4.0.355"
57
+ "@remotion/zod-types": "4.0.356",
58
+ "@remotion/eslint-config-internal": "4.0.356",
59
+ "@remotion/enable-scss": "4.0.356",
60
+ "@remotion/tailwind-v4": "4.0.356",
61
+ "@remotion/skia": "4.0.356"
62
62
  },
63
63
  "keywords": [
64
64
  "remotion",