Skip to content

πŸŽ₯ Make videos programmatically with React

`@remotion/cli`: Nicer output for audio

Jonny Burger4795f3916b7b
diff --git a/packages/cli/src/render-flows/render.ts b/packages/cli/src/render-flows/render.ts
index b657c9e260..51fc363e4a 100644
--- a/packages/cli/src/render-flows/render.ts
+++ b/packages/cli/src/render-flows/render.ts
@@ -28,7 +28,7 @@ import type {
RenderingProgressInput,
StitchingProgressInput,
} from '@remotion/studio-server';
-import type {ArtifactProgress} from '@remotion/studio-shared';
+import {formatBytes, type ArtifactProgress} from '@remotion/studio-shared';
import fs, {existsSync} from 'node:fs';
import os from 'node:os';
import path from 'node:path';
@@ -602,22 +602,27 @@ export const renderVideoFlow = async ({
updateRenderProgress({newline: true, printToConsole: true});
}
- Log.info(
- {indent, logLevel},
- chalk.blue(
- `${(exists ? 'β—‹' : '+').padEnd(LABEL_WIDTH)} ${makeHyperlink({url: `file://${absoluteOutputFile}`, text: relativeOutputLocation, fallback: relativeOutputLocation})}`,
- ),
- );
-
if (absoluteSeparateAudioTo) {
+ const relativeAudio = path.relative(process.cwd(), absoluteSeparateAudioTo);
+ const audioSize = fs.statSync(absoluteSeparateAudioTo).size;
Log.info(
{indent, logLevel},
chalk.blue(
- `${(audioExists ? 'β—‹' : '+').padEnd(LABEL_WIDTH, ' ')} ${absoluteSeparateAudioTo}`,
+ `${(audioExists ? 'β—‹' : '+').padEnd(LABEL_WIDTH, ' ')} ${makeHyperlink({url: `file://${absoluteSeparateAudioTo}`, text: relativeAudio, fallback: absoluteSeparateAudioTo})}`,
),
+ chalk.gray(`${formatBytes(audioSize)}`),
);
}
+ const {size} = fs.statSync(absoluteOutputFile);
+ Log.info(
+ {indent, logLevel},
+ chalk.blue(
+ `${(exists ? 'β—‹' : '+').padEnd(LABEL_WIDTH)} ${makeHyperlink({url: `file://${absoluteOutputFile}`, text: relativeOutputLocation, fallback: relativeOutputLocation})}`,
+ ),
+ chalk.gray(`${formatBytes(size)}`),
+ );
+
Log.verbose({indent, logLevel}, `Slowest frames:`);
slowestFrames.forEach(({frame, time}) => {
Log.verbose({indent, logLevel}, ` Frame ${frame} (${time.toFixed(3)}ms)`);