🎥 Make videos programmatically with React
do something with the artifact
Jonny Burgerd654062a8d6d
diff --git a/packages/cli/src/render-flows/render.ts b/packages/cli/src/render-flows/render.tsindex 2e61f875f1..6fbb8faa79 100644--- a/packages/cli/src/render-flows/render.ts+++ b/packages/cli/src/render-flows/render.ts@@ -29,7 +29,7 @@ import type {RenderingProgressInput,StitchingProgressInput,} from '@remotion/studio-server';-import fs, {existsSync} from 'node:fs';+import fs, {existsSync, writeFileSync} from 'node:fs';import os from 'node:os';import path from 'node:path';import {NoReactInternals} from 'remotion/no-react';@@ -404,7 +404,7 @@ export const renderVideoFlow = async ({);const onArtifact: OnArtifact = (artifact) => {- console.log('artifact', artifact);+ writeFileSync(artifact.filename, artifact.content);};const absoluteSeparateAudioTo =diff --git a/packages/renderer/src/render-frames.ts b/packages/renderer/src/render-frames.tsindex 8ac752ef34..15ef6b4ea3 100644--- a/packages/renderer/src/render-frames.ts+++ b/packages/renderer/src/render-frames.ts@@ -239,6 +239,7 @@ const innerRenderFrames = async ({parallelEncodingEnabled,compositionStart,forSeamlessAacConcatenation,+ onArtifact,}: Omit<InnerRenderFramesOptions,'offthreadVideoCacheSizeInBytes'@@ -529,6 +530,8 @@ const innerRenderFrames = async ({return;}}++ onArtifact?.(artifact);}const compressedAssets = audioAndVideoAssets.map((asset) => {