Skip to content

🎥 Make videos programmatically with React

scope more

Jonny Burger693eaee8d028
diff --git a/packages/cli/src/compositions.ts b/packages/cli/src/compositions.ts
index b5ce441652..1a8240b6fa 100644
--- a/packages/cli/src/compositions.ts
+++ b/packages/cli/src/compositions.ts
@@ -1,4 +1,4 @@
-import {getCompositions} from '@remotion/renderer';
+import {getCompositions, RenderInternals} from '@remotion/renderer';
import path from 'path';
import {getCliOptions} from './get-cli-options';
import {loadConfig} from './get-config-file-name';
@@ -36,6 +36,8 @@ export const listCompositionsCommand = async (remotionRoot: string) => {
process.exit(1);
}
+ const downloadMap = RenderInternals.makeDownloadMap();
+
const fullPath = path.join(process.cwd(), file);
await loadConfig(remotionRoot);
@@ -69,6 +71,7 @@ export const listCompositionsCommand = async (remotionRoot: string) => {
inputProps,
timeoutInMilliseconds: puppeteerTimeout,
port,
+ downloadMap,
});
if (!quietFlagProvided()) {
Log.info();
diff --git a/packages/cli/src/render.tsx b/packages/cli/src/render.tsx
index d8270bbaeb..f3abf7633c 100644
--- a/packages/cli/src/render.tsx
+++ b/packages/cli/src/render.tsx
@@ -47,6 +47,8 @@ export const render = async (remotionRoot: string) => {
? file
: path.join(process.cwd(), file);
+ const downloadMap = RenderInternals.makeDownloadMap();
+
await initializeRenderCli(remotionRoot, 'sequence');
const {
@@ -151,6 +153,7 @@ export const render = async (remotionRoot: string) => {
timeoutInMilliseconds: ConfigInternals.getCurrentPuppeteerTimeout(),
chromiumOptions,
browserExecutable,
+ downloadMap,
});
const config = comps.find((c) => c.id === compositionId);
@@ -267,6 +270,7 @@ export const render = async (remotionRoot: string) => {
ffprobeExecutable,
browserExecutable,
port,
+ downloadMap,
});
renderedDoneIn = Date.now() - startTime;
@@ -318,6 +322,7 @@ export const render = async (remotionRoot: string) => {
ConfigInternals.Logging.getLogLevel(),
'verbose'
),
+ downloadMap,
});
Log.info();
diff --git a/packages/cli/src/still.ts b/packages/cli/src/still.ts
index 5dbb907c9a..e040332539 100644
--- a/packages/cli/src/still.ts
+++ b/packages/cli/src/still.ts
@@ -144,6 +144,9 @@ export const still = async (remotionRoot: string) => {
: await bundleOnCli({fullPath, remotionRoot, steps});
const puppeteerInstance = await browserInstance;
+
+ const downloadMap = RenderInternals.makeDownloadMap();
+
const comps = await getCompositions(await urlOrBundle, {
inputProps,
puppeteerInstance,
@@ -154,6 +157,7 @@ export const still = async (remotionRoot: string) => {
browserExecutable,
ffmpegExecutable,
ffprobeExecutable,
+ downloadMap,
});
const composition = comps.find((c) => c.id === compositionId);
@@ -225,6 +229,7 @@ export const still = async (remotionRoot: string) => {
overwrite,
onDownload,
port,
+ downloadMap,
});
frames = 1;
diff --git a/packages/core/src/CompositionManager.tsx b/packages/core/src/CompositionManager.tsx
index 6f09cb748d..32bce88368 100644
--- a/packages/core/src/CompositionManager.tsx
+++ b/packages/core/src/CompositionManager.tsx
@@ -78,34 +78,6 @@ export type TAsset = {
playbackRate: number;
};
-export type DownloadMap = {
- isDownloadingMap: {
- [src: string]:
- | {
- [downloadDir: string]: boolean;
- }
- | undefined;
- };
- hasBeenDownloadedMap: {
- [src: string]:
- | {
- [downloadDir: string]: string | null;
- }
- | undefined;
- };
- listeners: {[key: string]: {[downloadDir: string]: (() => void)[]}};
- lastFrameMap: Record<string, {lastAccessed: number; data: Buffer}>;
- isBeyondLastFrameMap: Record<string, number>;
-};
-
-export type RenderAssetInfo = {
- assets: TAsset[][];
- imageSequenceName: string;
- downloadDir: string;
- firstFrameIndex: number;
- downloadMap: DownloadMap;
-};
-
export type CompositionManagerContext = {
compositions: TComposition[];
registerComposition: <T>(comp: TComposition<T>) => void;
diff --git a/packages/core/src/internals.ts b/packages/core/src/internals.ts
index 51a2ca61db..e3a2fc82dc 100644
--- a/packages/core/src/internals.ts
+++ b/packages/core/src/internals.ts
@@ -12,7 +12,6 @@ import {
import type {CompProps} from './Composition';
import type {
CompositionManagerContext,
- RenderAssetInfo,
TAsset,
TCompMetadata,
TComposition,
@@ -118,7 +117,6 @@ export type {
WebpackOverrideFn,
WebpackConfiguration,
TAsset,
- RenderAssetInfo,
TimelineContextValue,
SetTimelineContextValue,
CompProps,
diff --git a/packages/lambda/src/functions/helpers/validate-composition.ts b/packages/lambda/src/functions/helpers/validate-composition.ts
index 93fff628c9..fc323a0ddf 100644
--- a/packages/lambda/src/functions/helpers/validate-composition.ts
+++ b/packages/lambda/src/functions/helpers/validate-composition.ts
@@ -4,7 +4,7 @@ import type {
openBrowser,
} from '@remotion/renderer';
import {getCompositions} from '@remotion/renderer';
-import type {TCompMetadata} from 'remotion';
+import type {DownloadMap, TCompMetadata} from 'remotion';
import type {Await} from '../../shared/await';
type ValidateCompositionOptions = {
@@ -18,6 +18,7 @@ type ValidateCompositionOptions = {
timeoutInMilliseconds: number;
chromiumOptions: ChromiumOptions;
port: number | null;
+ downloadMap: DownloadMap;
};
export const validateComposition = async ({
@@ -31,6 +32,7 @@ export const validateComposition = async ({
ffprobeExecutable,
chromiumOptions,
port,
+ downloadMap,
}: ValidateCompositionOptions): Promise<TCompMetadata> => {
const compositions = await getCompositions(serveUrl, {
puppeteerInstance: browserInstance,
@@ -41,6 +43,7 @@ export const validateComposition = async ({
timeoutInMilliseconds,
chromiumOptions,
port,
+ downloadMap,
});
const found = compositions.find((c) => c.id === composition);
diff --git a/packages/lambda/src/functions/launch.ts b/packages/lambda/src/functions/launch.ts
index 1c8368f98f..0a4c6a11e9 100644
--- a/packages/lambda/src/functions/launch.ts
+++ b/packages/lambda/src/functions/launch.ts
@@ -77,6 +77,8 @@ const innerLaunchHandler = async (params: LambdaPayload, options: Options) => {
}),
]);
+ const downloadMap = RenderInternals.makeDownloadMap();
+
const comp = await validateComposition({
serveUrl: params.serveUrl,
composition: params.composition,
@@ -88,6 +90,7 @@ const innerLaunchHandler = async (params: LambdaPayload, options: Options) => {
timeoutInMilliseconds: params.timeoutInMilliseconds,
chromiumOptions: params.chromiumOptions,
port: null,
+ downloadMap,
});
Internals.validateDurationInFrames(
comp.durationInFrames,
diff --git a/packages/lambda/src/functions/renderer.ts b/packages/lambda/src/functions/renderer.ts
index 1f6a09490a..2820a9ccd5 100644
--- a/packages/lambda/src/functions/renderer.ts
+++ b/packages/lambda/src/functions/renderer.ts
@@ -76,6 +76,8 @@ const renderHandler = async (
const chunkCodec: Codec = params.codec === 'gif' ? 'h264-mkv' : params.codec;
+ const downloadMap = RenderInternals.makeDownloadMap();
+
await renderMedia({
composition: {
id: params.composition,
@@ -162,6 +164,7 @@ const renderHandler = async (
port: null,
everyNthFrame: params.everyNthFrame,
numberOfGifLoops: null,
+ downloadMap,
});
const endRendered = Date.now();
diff --git a/packages/lambda/src/functions/still.ts b/packages/lambda/src/functions/still.ts
index f4749189e4..54b88bfaaa 100644
--- a/packages/lambda/src/functions/still.ts
+++ b/packages/lambda/src/functions/still.ts
@@ -67,6 +67,8 @@ const innerStillHandler = async (
const outputPath = path.join(outputDir, 'output');
+ const downloadMap = RenderInternals.makeDownloadMap();
+
const composition = await validateComposition({
serveUrl: lambdaParams.serveUrl,
browserInstance,
@@ -78,6 +80,7 @@ const innerStillHandler = async (
chromiumOptions: lambdaParams.chromiumOptions,
timeoutInMilliseconds: lambdaParams.timeoutInMilliseconds,
port: null,
+ downloadMap,
});
const renderMetadata: RenderMetadata = {
@@ -126,6 +129,7 @@ const innerStillHandler = async (
chromiumOptions: lambdaParams.chromiumOptions,
scale: lambdaParams.scale,
timeoutInMilliseconds: lambdaParams.timeoutInMilliseconds,
+ downloadMap,
});
const {key, renderBucketName} = getExpectedOutName(
diff --git a/packages/renderer/src/assets/download-and-map-assets-to-file.ts b/packages/renderer/src/assets/download-and-map-assets-to-file.ts
index 781d38f043..f33dc3cfbf 100644
--- a/packages/renderer/src/assets/download-and-map-assets-to-file.ts
+++ b/packages/renderer/src/assets/download-and-map-assets-to-file.ts
@@ -1,10 +1,11 @@
import fs from 'fs';
import path from 'path';
-import type {DownloadMap, TAsset} from 'remotion';
+import type {TAsset} from 'remotion';
import {random} from 'remotion';
import {isAssetCompressed} from '../compress-assets';
import {ensureOutputDirectory} from '../ensure-output-directory';
import {downloadFile} from './download-file';
+import type {DownloadMap} from './download-map';
import {sanitizeFilePath} from './sanitize-filepath';
export type RenderMediaOnDownload = (
@@ -18,16 +19,6 @@ export type RenderMediaOnDownload = (
| undefined
| void;
-export const makeDownloadMap = (): DownloadMap => {
- return {
- isDownloadingMap: {},
- hasBeenDownloadedMap: {},
- listeners: {},
- lastFrameMap: {},
- isBeyondLastFrameMap: {},
- };
-};
-
const waitForAssetToBeDownloaded = ({
src,
downloadDir,
diff --git a/packages/renderer/src/assets/download-map.ts b/packages/renderer/src/assets/download-map.ts
new file mode 100644
index 0000000000..ad76412dd2
--- /dev/null
+++ b/packages/renderer/src/assets/download-map.ts
@@ -0,0 +1,52 @@
+import type {TAsset} from 'remotion';
+
+type EncodingStatus =
+ | {
+ type: 'encoding';
+ }
+ | {
+ type: 'done';
+ src: string;
+ }
+ | undefined;
+
+export type DownloadMap = {
+ isDownloadingMap: {
+ [src: string]:
+ | {
+ [downloadDir: string]: boolean;
+ }
+ | undefined;
+ };
+ hasBeenDownloadedMap: {
+ [src: string]:
+ | {
+ [downloadDir: string]: string | null;
+ }
+ | undefined;
+ };
+ listeners: {[key: string]: {[downloadDir: string]: (() => void)[]}};
+ lastFrameMap: Record<string, {lastAccessed: number; data: Buffer}>;
+ isBeyondLastFrameMap: Record<string, number>;
+
+ ensureFileHasPresentationTimestamp: Record<string, EncodingStatus>;
+};
+
+export type RenderAssetInfo = {
+ assets: TAsset[][];
+ imageSequenceName: string;
+ downloadDir: string;
+ firstFrameIndex: number;
+ downloadMap: DownloadMap;
+};
+
+export const makeDownloadMap = (): DownloadMap => {
+ return {
+ isDownloadingMap: {},
+ hasBeenDownloadedMap: {},
+ listeners: {},
+ lastFrameMap: {},
+ isBeyondLastFrameMap: {},
+ ensureFileHasPresentationTimestamp: {},
+ };
+};
diff --git a/packages/renderer/src/ensure-presentation-timestamp.ts b/packages/renderer/src/ensure-presentation-timestamp.ts
index cc66c9246e..ffd969fa9c 100644
--- a/packages/renderer/src/ensure-presentation-timestamp.ts
+++ b/packages/renderer/src/ensure-presentation-timestamp.ts
@@ -1,20 +1,9 @@
import execa from 'execa';
import path from 'path';
+import type {DownloadMap} from './assets/download-map';
import {guessExtensionForVideo} from './guess-extension-for-media';
import {truthy} from './truthy';
-type EncodingStatus =
- | {
- type: 'encoding';
- }
- | {
- type: 'done';
- src: string;
- }
- | undefined;
-
-const ensureFileHasPresentationTimestamp: Record<string, EncodingStatus> = {};
-
type Callback = {
src: string;
fn: (newsrc: string) => void;
@@ -44,9 +33,10 @@ const getTemporaryOutputName = async (src: string) => {
};
export const ensurePresentationTimestamps = async (
+ downloadMap: DownloadMap,
src: string
): Promise<string> => {
- const elem = ensureFileHasPresentationTimestamp[src];
+ const elem = downloadMap.ensureFileHasPresentationTimestamp[src];
if (elem?.type === 'encoding') {
return new Promise<string>((resolve) => {
callbacks.push({
@@ -60,7 +50,7 @@ export const ensurePresentationTimestamps = async (
return elem.src;
}
- ensureFileHasPresentationTimestamp[src] = {type: 'encoding'};
+ downloadMap.ensureFileHasPresentationTimestamp[src] = {type: 'encoding'};
// If there is no file extension for the video, then we need to tempoa
const output = await getTemporaryOutputName(src);
@@ -86,6 +76,9 @@ export const ensurePresentationTimestamps = async (
return true;
});
- ensureFileHasPresentationTimestamp[src] = {type: 'done', src: output};
+ downloadMap.ensureFileHasPresentationTimestamp[src] = {
+ type: 'done',
+ src: output,
+ };
return output;
};
diff --git a/packages/renderer/src/extract-frame-from-video.ts b/packages/renderer/src/extract-frame-from-video.ts
index ff72565737..9f3dcfce9d 100644
--- a/packages/renderer/src/extract-frame-from-video.ts
+++ b/packages/renderer/src/extract-frame-from-video.ts
@@ -250,7 +250,7 @@ const extractFrameFromVideoFn = async ({
}: Options): Promise<Buffer> => {
// We make a new copy of the video only for video because the conversion may affect
// audio rendering, so we work with 2 different files
- const src = await ensurePresentationTimestamps(options.src);
+ const src = await ensurePresentationTimestamps(downloadMap, options.src);
const {specialVcodec, needsResize} = await getVideoInfo(
src,
ffprobeExecutable
diff --git a/packages/renderer/src/get-compositions.ts b/packages/renderer/src/get-compositions.ts
index 88576d935d..7ffbb5dcd3 100644
--- a/packages/renderer/src/get-compositions.ts
+++ b/packages/renderer/src/get-compositions.ts
@@ -1,5 +1,5 @@
-import type {TCompMetadata} from 'remotion';
-import {makeDownloadMap} from './assets/download-and-map-assets-to-file';
+import type {DownloadMap, TCompMetadata} from 'remotion';
+import {makeDownloadMap} from './assets/download-map';
import type {BrowserExecutable} from './browser-executable';
import type {BrowserLog} from './browser-log';
import type {Browser} from './browser/Browser';
@@ -25,6 +25,10 @@ type GetCompositionsConfig = {
ffmpegExecutable?: FfmpegExecutable;
ffprobeExecutable?: FfmpegExecutable;
port?: number | null;
+ /**
+ * @deprecated Only for Remotion internal usage
+ */
+ downloadMap?: DownloadMap;
};
const innerGetCompositions = async (
@@ -85,7 +89,7 @@ export const getCompositions = async (
config?: GetCompositionsConfig
) => {
const downloadDir = makeAssetsDownloadTmpDir();
- const downloadMap = makeDownloadMap();
+ const downloadMap = config?.downloadMap ?? makeDownloadMap();
const {page, cleanup} = await getPageAndCleanupFn({
passedInInstance: config?.puppeteerInstance,
@@ -118,6 +122,7 @@ export const getCompositions = async (
return innerGetCompositions(
serveUrl,
page,
+ // @ts-expect-error
config ?? {},
offthreadPort
);
diff --git a/packages/renderer/src/index.ts b/packages/renderer/src/index.ts
index 378f19a4f9..fa57074620 100644
--- a/packages/renderer/src/index.ts
+++ b/packages/renderer/src/index.ts
@@ -1,5 +1,6 @@
import execa from 'execa';
import {downloadFile} from './assets/download-file';
+import {makeDownloadMap} from './assets/download-map';
import {DEFAULT_BROWSER} from './browser';
import {DEFAULT_TIMEOUT} from './browser/TimeoutSettings';
import {canUseParallelEncoding} from './can-use-parallel-encoding';
@@ -163,4 +164,5 @@ export const RenderInternals = {
isValidLogLevel,
validateEveryNthFrame,
perf,
+ makeDownloadMap,
};
diff --git a/packages/renderer/src/last-frame-from-video-cache.ts b/packages/renderer/src/last-frame-from-video-cache.ts
index 453623fc58..ff6c320a3b 100644
--- a/packages/renderer/src/last-frame-from-video-cache.ts
+++ b/packages/renderer/src/last-frame-from-video-cache.ts
@@ -1,6 +1,7 @@
// OffthreadVideo requires sometimes that the last frame of a video gets extracted, however, this can be slow. We allocate a cache for it but that can be garbage collected
-import type {DownloadMap, OffthreadVideoImageFormat} from 'remotion';
+import type {OffthreadVideoImageFormat} from 'remotion';
+import type {DownloadMap} from './assets/download-map';
import type {FfmpegExecutable} from './ffmpeg-executable';
import type {SpecialVCodecForTransparency} from './get-video-info';
diff --git a/packages/renderer/src/render-frames.ts b/packages/renderer/src/render-frames.ts
index 2d363be2d2..8b8e280758 100644
--- a/packages/renderer/src/render-frames.ts
+++ b/packages/renderer/src/render-frames.ts
@@ -1,12 +1,10 @@
import fs from 'fs';
import path from 'path';
-import type {SmallTCompMetadata, TAsset} from 'remotion';
+import type {DownloadMap, SmallTCompMetadata, TAsset} from 'remotion';
import {Internals} from 'remotion';
import type {RenderMediaOnDownload} from './assets/download-and-map-assets-to-file';
-import {
- downloadAndMapAssetsToFileUrl,
- makeDownloadMap,
-} from './assets/download-and-map-assets-to-file';
+import {downloadAndMapAssetsToFileUrl} from './assets/download-and-map-assets-to-file';
+import {makeDownloadMap} from './assets/download-map';
import {DEFAULT_BROWSER} from './browser';
import type {BrowserExecutable} from './browser-executable';
import type {BrowserLog} from './browser-log';
@@ -81,6 +79,10 @@ type RenderFramesOptions = {
ffprobeExecutable?: FfmpegExecutable;
port?: number | null;
cancelSignal?: CancelSignal;
+ /**
+ * @deprecated Only for Remotion internal usage
+ */
+ downloadMap?: DownloadMap;
} & ConfigOrComposition &
ServeUrlOrWebpackBundle;
@@ -126,6 +128,7 @@ const innerRenderFrames = ({
everyNthFrame = 1,
proxyPort,
cancelSignal,
+ downloadMap,
}: Omit<RenderFramesOptions, 'url' | 'onDownload'> & {
onError: (err: Error) => void;
pagesArray: Page[];
@@ -135,8 +138,8 @@ const innerRenderFrames = ({
downloadDir: string;
onDownload: RenderMediaOnDownload;
proxyPort: number;
+ downloadMap: DownloadMap;
}): Promise<RenderFramesOutput> => {
- const downloadMap = makeDownloadMap();
if (!puppeteerInstance) {
throw new Error(
'no puppeteer instance passed to innerRenderFrames - internal error'
@@ -406,7 +409,7 @@ export const renderFrames = (
});
const downloadDir = makeAssetsDownloadTmpDir();
- const downloadMap = makeDownloadMap();
+ const downloadMap = options.downloadMap ?? makeDownloadMap();
const onDownload = options.onDownload ?? (() => () => undefined);
@@ -458,6 +461,7 @@ export const renderFrames = (
onDownload,
downloadDir,
proxyPort: offthreadPort,
+ downloadMap,
});
}),
])
diff --git a/packages/renderer/src/render-media.ts b/packages/renderer/src/render-media.ts
index 2bfdb7ed28..6881be6d5d 100644
--- a/packages/renderer/src/render-media.ts
+++ b/packages/renderer/src/render-media.ts
@@ -2,9 +2,10 @@ import type {ExecaChildProcess} from 'execa';
import fs from 'fs';
import os from 'os';
import path from 'path';
-import type {SmallTCompMetadata} from 'remotion';
+import type {DownloadMap, SmallTCompMetadata} from 'remotion';
import {Internals} from 'remotion';
import type {RenderMediaOnDownload} from './assets/download-and-map-assets-to-file';
+import {makeDownloadMap} from './assets/download-map';
import type {BrowserExecutable} from './browser-executable';
import type {BrowserLog} from './browser-log';
import type {Browser as PuppeteerBrowser} from './browser/Browser';
@@ -79,6 +80,10 @@ export type RenderMediaOptions = {
cancelSignal?: CancelSignal;
browserExecutable?: BrowserExecutable;
verbose?: boolean;
+ /**
+ * @deprecated Only for Remotion internal usage
+ */
+ downloadMap?: DownloadMap;
} & ServeUrlOrWebpackBundle;
type Await<T> = T extends PromiseLike<infer U> ? U : T;
@@ -116,6 +121,7 @@ export const renderMedia = ({
browserExecutable,
port,
cancelSignal,
+ downloadMap,
...options
}: RenderMediaOptions): Promise<Buffer | null> => {
validateQuality(quality);
@@ -280,6 +286,7 @@ export const renderMedia = ({
browserExecutable,
port,
cancelSignal: cancelRenderFrames.cancelSignal,
+ downloadMap: downloadMap ?? makeDownloadMap(),
});
return renderFramesProc;
diff --git a/packages/renderer/src/render-still.ts b/packages/renderer/src/render-still.ts
index e34df0e634..e630f92d0a 100644
--- a/packages/renderer/src/render-still.ts
+++ b/packages/renderer/src/render-still.ts
@@ -1,9 +1,9 @@
import fs, {statSync} from 'fs';
import path from 'path';
-import type {SmallTCompMetadata} from 'remotion';
+import type {DownloadMap, SmallTCompMetadata} from 'remotion';
import {Internals} from 'remotion';
import type {RenderMediaOnDownload} from './assets/download-and-map-assets-to-file';
-import {makeDownloadMap} from './assets/download-and-map-assets-to-file';
+import {makeDownloadMap} from './assets/download-map';
import {DEFAULT_BROWSER} from './browser';
import type {BrowserExecutable} from './browser-executable';
import type {Browser as PuppeteerBrowser} from './browser/Browser';
@@ -47,6 +47,10 @@ type InnerStillOptions = {
cancelSignal?: CancelSignal;
ffmpegExecutable?: FfmpegExecutable;
ffprobeExecutable?: FfmpegExecutable;
+ /**
+ * @deprecated Only for Remotion internal usage
+ */
+ downloadMap?: DownloadMap;
};
type RenderStillOptions = InnerStillOptions &
@@ -222,7 +226,7 @@ export const renderStill = (options: RenderStillOptions): Promise<void> => {
const selectedServeUrl = getServeUrlWithFallback(options);
const downloadDir = makeAssetsDownloadTmpDir();
- const downloadMap = makeDownloadMap();
+ const downloadMap = options.downloadMap ?? makeDownloadMap();
const onDownload = options.onDownload ?? (() => () => undefined);
diff --git a/packages/renderer/src/stitch-frames-to-video.ts b/packages/renderer/src/stitch-frames-to-video.ts
index 4907ba0e4c..cab5715e0f 100644
--- a/packages/renderer/src/stitch-frames-to-video.ts
+++ b/packages/renderer/src/stitch-frames-to-video.ts
@@ -2,12 +2,13 @@ import execa from 'execa';
import fs, {unlinkSync} from 'fs';
import {readFile} from 'fs/promises';
import path from 'path';
-import type {DownloadMap, RenderAssetInfo, TAsset} from 'remotion';
+import type {DownloadMap, TAsset} from 'remotion';
import {Internals} from 'remotion';
import {calculateAssetPositions} from './assets/calculate-asset-positions';
import {convertAssetsToFileUrls} from './assets/convert-assets-to-file-urls';
import type {RenderMediaOnDownload} from './assets/download-and-map-assets-to-file';
import {markAllAssetsAsDownloaded} from './assets/download-and-map-assets-to-file';
+import type {RenderAssetInfo} from './assets/download-map';
import type {Assets} from './assets/types';
import type {Codec} from './codec';
import {DEFAULT_CODEC} from './codec';
diff --git a/packages/renderer/src/test/extract-frame-from-video.test.ts b/packages/renderer/src/test/extract-frame-from-video.test.ts
index 8da0a80ece..fc0b4c940c 100644
--- a/packages/renderer/src/test/extract-frame-from-video.test.ts
+++ b/packages/renderer/src/test/extract-frame-from-video.test.ts
@@ -1,6 +1,6 @@
import path from 'path';
import {expect, test} from 'vitest';
-import {makeDownloadMap} from '../assets/download-and-map-assets-to-file';
+import {makeDownloadMap} from '../assets/download-map';
import {extractFrameFromVideo} from '../extract-frame-from-video';
const src = path.join(
diff --git a/packages/renderer/src/test/get-last-frame-of-corrupted-video.test.ts b/packages/renderer/src/test/get-last-frame-of-corrupted-video.test.ts
index d72be4f151..2d4bfdf65b 100644
--- a/packages/renderer/src/test/get-last-frame-of-corrupted-video.test.ts
+++ b/packages/renderer/src/test/get-last-frame-of-corrupted-video.test.ts
@@ -1,6 +1,6 @@
import path from 'path';
import {test} from 'vitest';
-import {makeDownloadMap} from '../assets/download-and-map-assets-to-file';
+import {makeDownloadMap} from '../assets/download-map';
import {getLastFrameOfVideo} from '../extract-frame-from-video';
test('Get last frame of corrupted video', async () => {
diff --git a/packages/renderer/src/test/last-frame-video-cache.test.ts b/packages/renderer/src/test/last-frame-video-cache.test.ts
index d91dd62a16..30af426c40 100644
--- a/packages/renderer/src/test/last-frame-video-cache.test.ts
+++ b/packages/renderer/src/test/last-frame-video-cache.test.ts
@@ -1,7 +1,7 @@
import crypto from 'crypto';
import type {DownloadMap} from 'remotion';
import {expect, test} from 'vitest';
-import {makeDownloadMap} from '../assets/download-and-map-assets-to-file';
+import {makeDownloadMap} from '../assets/download-map';
import type {LastFrameOptions} from '../last-frame-from-video-cache';
import {
clearLastFileCache,
diff --git a/packages/renderer/src/test/render-still.test.ts b/packages/renderer/src/test/render-still.test.ts
index 75ad0a796f..541e54cedf 100644
--- a/packages/renderer/src/test/render-still.test.ts
+++ b/packages/renderer/src/test/render-still.test.ts
@@ -1,4 +1,5 @@
import {expect, test} from 'vitest';
+import {makeDownloadMap} from '../assets/download-map';
import {renderStill} from '../render-still';
test('Need to pass valid metadata', () => {
@@ -15,6 +16,7 @@ test('Need to pass valid metadata', () => {
frame: 0,
output: '/file/output.png',
serveUrl: 'https://silly-crostata-c4c336.netlify.app/',
+ downloadMap: makeDownloadMap(),
})
).rejects.toThrow(/not be NaN, but is NaN/);
});
@@ -33,6 +35,7 @@ test('Need to pass valid metadata', () => {
frame: 200,
output: '/file/output.png',
serveUrl: 'https://silly-crostata-c4c336.netlify.app/',
+ downloadMap: makeDownloadMap(),
})
).rejects.toThrow(
/Cannot use frame 200: Duration of composition is 30, therefore the highest frame that can be rendered is 29/
diff --git a/packages/renderer/src/types.ts b/packages/renderer/src/types.ts
index dbac31a434..defe4ea177 100644
--- a/packages/renderer/src/types.ts
+++ b/packages/renderer/src/types.ts
@@ -1,4 +1,4 @@
-import type {RenderAssetInfo} from 'remotion';
+import type {RenderAssetInfo} from './assets/download-map';
export type RenderFramesOutput = {
frameCount: number;