Skip to content

🎥 Make videos programmatically with React

rename to offthreadVideoCacheSizeInBytes

Jonny Burgerd1789547e0ed
diff --git a/packages/cli/src/benchmark.ts b/packages/cli/src/benchmark.ts
index d87c9c1797..70e874f26b 100644
--- a/packages/cli/src/benchmark.ts
+++ b/packages/cli/src/benchmark.ts
@@ -35,7 +35,7 @@ const getValidConcurrency = (cliConcurrency: number | string | null) => {
const runBenchmark = async (
runs: number,
options: Omit<InternalRenderMediaOptions, 'onProgress'>,
- onProgress?: (run: number, progress: number) => void
+ onProgress?: (run: number, progress: number) => void,
) => {
const timeTaken: number[] = [];
for (let run = 0; run < runs; ++run) {
@@ -82,7 +82,7 @@ const avg = (time: number[]) =>
const stdDev = (time: number[]) => {
const mean = avg(time);
return Math.sqrt(
- time.map((x) => (x - mean) ** 2).reduce((a, b) => a + b) / time.length
+ time.map((x) => (x - mean) ** 2).reduce((a, b) => a + b) / time.length,
);
};
@@ -93,13 +93,13 @@ const getResults = (results: number[], runs: number) => {
const min = Math.min(...results);
return ` Time (${chalk.green('mean')} ± ${chalk.green(
- 'σ'
+ 'σ',
)}): ${chalk.green(formatTime(mean))} ± ${chalk.green(
- formatTime(dev)
+ formatTime(dev),
)}\n Range (${chalk.blue('min')} ... ${chalk.red(
- 'max'
+ 'max',
)}): ${chalk.blue(formatTime(min))} ... ${chalk.red(
- formatTime(max)
+ formatTime(max),
)} \t ${chalk.gray(`${runs} runs`)}
`;
};
@@ -130,7 +130,7 @@ const makeBenchmarkProgressBar = ({
export const benchmarkCommand = async (
remotionRoot: string,
- args: string[]
+ args: string[],
) => {
const runs: number = parsedCli.runs ?? DEFAULT_RUNS;
@@ -175,7 +175,7 @@ export const benchmarkCommand = async (
width,
concurrency: unparsedConcurrency,
logLevel,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
} = await getCliOptions({
isLambda: false,
type: 'series',
@@ -234,7 +234,7 @@ export const benchmarkCommand = async (
// Intentionally disabling server to not cache results
server: undefined,
logLevel,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
const ids = (
@@ -258,7 +258,7 @@ export const benchmarkCommand = async (
if (compositions.length === 0) {
Log.error(
- 'No composition IDs passed. Add another argument to the command specifying at least 1 composition ID.'
+ 'No composition IDs passed. Add another argument to the command specifying at least 1 composition ID.',
);
}
@@ -288,8 +288,8 @@ export const benchmarkCommand = async (
Log.info();
Log.info(
`${chalk.bold(`Benchmark #${count++}:`)} ${chalk.gray(
- `composition=${composition.id} concurrency=${con} codec=${codec} (${codecReason})`
- )}`
+ `composition=${composition.id} concurrency=${con} codec=${codec} (${codecReason})`,
+ )}`,
);
const timeTaken = await runBenchmark(
@@ -347,7 +347,7 @@ export const benchmarkCommand = async (
indent: undefined,
staticBase: null,
}).serializedString,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
},
(run, progress) => {
benchmarkProgress.update(
@@ -357,9 +357,9 @@ export const benchmarkCommand = async (
doneIn: null,
progress,
}),
- false
+ false,
);
- }
+ },
);
benchmarkProgress.update('', false);
diff --git a/packages/cli/src/compositions.ts b/packages/cli/src/compositions.ts
index 6b4c57202b..fffa31ced8 100644
--- a/packages/cli/src/compositions.ts
+++ b/packages/cli/src/compositions.ts
@@ -10,17 +10,17 @@ import {bundleOnCliOrTakeServeUrl} from './setup-cache';
export const listCompositionsCommand = async (
remotionRoot: string,
- args: string[]
+ args: string[],
) => {
const {file, reason} = findEntryPoint(args, remotionRoot);
if (!file) {
Log.error(
- 'The `compositions` command requires you to specify a entry point. For example'
+ 'The `compositions` command requires you to specify a entry point. For example',
);
Log.error(' npx remotion compositions src/index.ts');
Log.error(
- 'See https://www.remotion.dev/docs/register-root for more information.'
+ 'See https://www.remotion.dev/docs/register-root for more information.',
);
process.exit(1);
}
@@ -37,7 +37,7 @@ export const listCompositionsCommand = async (
puppeteerTimeout,
port,
publicDir,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
} = await getCliOptions({
isLambda: false,
type: 'get-compositions',
@@ -79,7 +79,7 @@ export const listCompositionsCommand = async (
puppeteerInstance: undefined,
logLevel,
server: undefined,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
printCompositions(compositions);
diff --git a/packages/cli/src/config/index.ts b/packages/cli/src/config/index.ts
index 724690375f..96cb053b90 100644
--- a/packages/cli/src/config/index.ts
+++ b/packages/cli/src/config/index.ts
@@ -87,7 +87,7 @@ import {getMuted, setMuted} from './muted';
import type {Loop} from './number-of-gif-loops';
import {getNumberOfGifLoops, setNumberOfGifLoops} from './number-of-gif-loops';
import {setNumberOfSharedAudioTags} from './number-of-shared-audio-tags';
-import {getOffthreadVideoCacheSize} from './offthread-video-cache-size';
+import {getOffthreadVideoCacheSizeInBytes} from './offthread-video-cache-size';
import {getShouldOpenBrowser, setShouldOpenBrowser} from './open-browser';
import {setOutputLocation} from './output-location';
import type {WebpackOverrideFn} from './override-webpack';
@@ -176,21 +176,21 @@ declare global {
* Set this to 'verbose' to get browser logs and other IO.
*/
readonly setLevel: (
- newLogLevel: 'verbose' | 'info' | 'warn' | 'error'
+ newLogLevel: 'verbose' | 'info' | 'warn' | 'error',
) => void;
/**
* Specify executable path for the browser to use.
* Default: null, which will make Remotion find or download a version of said browser.
*/
readonly setBrowserExecutable: (
- newBrowserExecutablePath: BrowserExecutable
+ newBrowserExecutablePath: BrowserExecutable,
) => void;
/**
* Set how many milliseconds a frame may take to render before it times out.
* Default: `30000`
*/
readonly setDelayRenderTimeoutInMilliseconds: (
- newPuppeteerTimeout: number
+ newPuppeteerTimeout: number,
) => void;
/**
* @deprecated Renamed to `setDelayRenderTimeoutInMilliseconds`.
@@ -218,7 +218,7 @@ declare global {
* Default: 'swangle' in Lambda, null elsewhere.
*/
readonly setChromiumOpenGlRenderer: (
- renderer: 'swangle' | 'angle' | 'egl' | 'swiftshader'
+ renderer: 'swangle' | 'angle' | 'egl' | 'swiftshader',
) => void;
/**
* Set the user agent for Chrome. Only works during rendering.
@@ -313,7 +313,7 @@ declare global {
| 'yuv420p10le'
| 'yuv422p10le'
| 'yuv444p10le'
- | 'yuva444p10le'
+ | 'yuva444p10le',
) => void;
/**
* Specify the codec for stitching the frames into a video.
@@ -352,7 +352,7 @@ declare global {
| 'standard'
| 'light'
| 'proxy'
- | undefined
+ | undefined,
) => void;
readonly setX264Preset: (
@@ -367,7 +367,7 @@ declare global {
| 'slower'
| 'veryslow'
| 'placebo'
- | undefined
+ | undefined,
) => void;
/**
* Override the arguments that Remotion passes to FFMPEG.
@@ -377,7 +377,7 @@ declare global {
command: (info: {
type: 'pre-stitcher' | 'stitcher';
args: string[];
- }) => string[]
+ }) => string[],
) => void;
/**
@@ -429,32 +429,32 @@ type FlatConfig = RemotionConfigObject &
export const Config: FlatConfig = {
get Bundling() {
throw new Error(
- 'The config format has changed. Change `Config.Bundling.*()` calls to `Config.*()` in your config file.'
+ 'The config format has changed. Change `Config.Bundling.*()` calls to `Config.*()` in your config file.',
);
},
get Rendering() {
throw new Error(
- 'The config format has changed. Change `Config.Rendering.*()` calls to `Config.*()` in your config file.'
+ 'The config format has changed. Change `Config.Rendering.*()` calls to `Config.*()` in your config file.',
);
},
get Output() {
throw new Error(
- 'The config format has changed. Change `Config.Output.*()` calls to `Config.*()` in your config file.'
+ 'The config format has changed. Change `Config.Output.*()` calls to `Config.*()` in your config file.',
);
},
get Log() {
throw new Error(
- 'The config format has changed. Change `Config.Log.*()` calls to `Config.*()` in your config file.'
+ 'The config format has changed. Change `Config.Log.*()` calls to `Config.*()` in your config file.',
);
},
get Preview() {
throw new Error(
- 'The config format has changed. Change `Config.Preview.*()` calls to `Config.*()` in your config file.'
+ 'The config format has changed. Change `Config.Preview.*()` calls to `Config.*()` in your config file.',
);
},
get Puppeteer() {
throw new Error(
- 'The config format has changed. Change `Config.Puppeteer.*()` calls to `Config.*()` in your config file.'
+ 'The config format has changed. Change `Config.Puppeteer.*()` calls to `Config.*()` in your config file.',
);
},
setMaxTimelineTracks,
@@ -480,12 +480,12 @@ export const Config: FlatConfig = {
setConcurrency,
setQuality: () => {
throw new Error(
- 'setQuality() has been renamed - use setJpegQuality() instead.'
+ 'setQuality() has been renamed - use setJpegQuality() instead.',
);
},
setImageFormat: () => {
throw new Error(
- 'Config.setImageFormat() has been renamed - use Config.setVideoImageFormat() instead (default "jpeg"). For rendering stills, use Config.setStillImageFormat() (default "png")'
+ 'Config.setImageFormat() has been renamed - use Config.setVideoImageFormat() instead (default "jpeg"). For rendering stills, use Config.setStillImageFormat() (default "png")',
);
},
setJpegQuality,
@@ -565,5 +565,5 @@ export const ConfigInternals = {
getWebpackPolling,
getShouldOpenBrowser,
getChromiumUserAgent,
- getOffthreadVideoCacheSize,
+ getOffthreadVideoCacheSizeInBytes,
};
diff --git a/packages/cli/src/config/offthread-video-cache-size.ts b/packages/cli/src/config/offthread-video-cache-size.ts
index 6372e02518..0b13f4ce2f 100644
--- a/packages/cli/src/config/offthread-video-cache-size.ts
+++ b/packages/cli/src/config/offthread-video-cache-size.ts
@@ -1,9 +1,9 @@
-let offthreadVideoCacheSize: number | null = null;
+let offthreadVideoCacheSizeInBytes: number | null = null;
-export const getOffthreadVideoCacheSize = () => {
- return offthreadVideoCacheSize;
+export const getOffthreadVideoCacheSizeInBytes = () => {
+ return offthreadVideoCacheSizeInBytes;
};
-export const setOffthreadVideoCacheSize = (size: number | null) => {
- offthreadVideoCacheSize = size;
+export const setOffthreadVideoCacheSizeInBytes = (size: number | null) => {
+ offthreadVideoCacheSizeInBytes = size;
};
diff --git a/packages/cli/src/editor/components/RenderModal/RenderModal.tsx b/packages/cli/src/editor/components/RenderModal/RenderModal.tsx
index 8eed0294a9..7cc3a82002 100644
--- a/packages/cli/src/editor/components/RenderModal/RenderModal.tsx
+++ b/packages/cli/src/editor/components/RenderModal/RenderModal.tsx
@@ -273,49 +273,49 @@ const RenderModal: React.FC<
const [unclampedFrame, setFrame] = useState(() => initialFrame);
const [saving, setSaving] = useState<boolean>(false);
const [stillImageFormat, setStillImageFormat] = useState<StillImageFormat>(
- () => initialStillImageFormat
+ () => initialStillImageFormat,
);
const [videoImageFormat, setVideoImageFormat] = useState<VideoImageFormat>(
- () => initialVideoImageFormat
+ () => initialVideoImageFormat,
);
const [concurrency, setConcurrency] = useState(() => initialConcurrency);
const [videoCodecForVideoTab, setVideoCodecForVideoTab] = useState<Codec>(
- () => initialVideoCodecForVideoTab
+ () => initialVideoCodecForVideoTab,
);
const [userSelectedAudioCodec, setUserSelectedAudioCodec] =
useState<AudioCodec | null>(() => initialAudioCodec);
const [envVariables, setEnvVariables] = useState<[string, string][]>(() =>
envVariablesObjectToArray(initialEnvVariables).filter(
- ([key]) => key !== 'NODE_ENV'
- )
+ ([key]) => key !== 'NODE_ENV',
+ ),
);
const [videoCodecForAudioTab, setVideoCodecForAudioTab] = useState<Codec>(
- () => initialVideoCodecForAudioTab
+ () => initialVideoCodecForAudioTab,
);
const [mutedState, setMuted] = useState(() => initialMuted);
const [enforceAudioTrackState, setEnforceAudioTrackState] = useState(
- () => initialEnforceAudioTrack
+ () => initialEnforceAudioTrack,
);
const [renderMode, setRenderModeState] =
useState<RenderType>(initialRenderType);
const [jpegQuality, setJpegQuality] = useState<number>(
- () => initialJpegQuality
+ () => initialJpegQuality,
);
const [scale, setScale] = useState(() => initialScale);
const [verbose, setVerboseLogging] = useState(() => initialVerbose);
const [disallowParallelEncoding, setDisallowParallelEncoding] =
useState(false);
const [disableWebSecurity, setDisableWebSecurity] = useState<boolean>(
- () => initialDisableWebSecurity
+ () => initialDisableWebSecurity,
);
const [headless, setHeadless] = useState<boolean>(() => initialHeadless);
const [ignoreCertificateErrors, setIgnoreCertificateErrors] =
useState<boolean>(() => initialIgnoreCertificateErrors);
const [openGlOption, setOpenGlOption] = useState<UiOpenGlOptions>(
- () => initialGl ?? 'default'
+ () => initialGl ?? 'default',
);
const chromiumOptions: RequiredChromiumOptions = useMemo(() => {
@@ -331,24 +331,24 @@ const RenderModal: React.FC<
const [outName, setOutName] = useState(() => initialOutName);
const [endFrameOrNull, setEndFrame] = useState<number | null>(
- () => outFrameMark ?? null
+ () => outFrameMark ?? null,
);
const [startFrameOrNull, setStartFrame] = useState<number | null>(
- () => inFrameMark ?? null
+ () => inFrameMark ?? null,
);
const [proResProfileSetting, setProResProfile] = useState<ProResProfile>(
- () => initialProResProfile
+ () => initialProResProfile,
);
const [x264PresetSetting, setx264Preset] = useState<X264Preset>(
- () => initialx264Preset
+ () => initialx264Preset,
);
const [pixelFormat, setPixelFormat] = useState<PixelFormat>(
- () => initialPixelFormat
+ () => initialPixelFormat,
);
const [preferredQualityControlType, setQualityControl] =
useState<QualityControl>(() =>
- initialVideoBitrate === null ? 'crf' : 'bitrate'
+ initialVideoBitrate === null ? 'crf' : 'bitrate',
);
const [
shouldHaveCustomTargetAudioBitrate,
@@ -356,24 +356,24 @@ const RenderModal: React.FC<
] = useState(() => initialAudioBitrate !== null);
const [customTargetAudioBitrate, setCustomTargetAudioBitrateValue] = useState(
- () => initialAudioBitrate ?? '320K'
+ () => initialAudioBitrate ?? '320K',
);
const [customTargetVideoBitrate, setCustomTargetVideoBitrateValue] = useState(
- () => initialVideoBitrate ?? '1M'
+ () => initialVideoBitrate ?? '1M',
);
const [limitNumberOfGifLoops, setLimitNumberOfGifLoops] = useState(
- () => initialNumberOfGifLoops !== null
+ () => initialNumberOfGifLoops !== null,
);
const [numberOfGifLoopsSetting, setNumberOfGifLoopsSetting] = useState(
- () => initialNumberOfGifLoops ?? 1
+ () => initialNumberOfGifLoops ?? 1,
);
const [delayRenderTimeout, setDelayRenderTimeout] = useState(
- () => initialDelayRenderTimeout
+ () => initialDelayRenderTimeout,
);
// TODO: Hardcoded
- const [offthreadVideoCacheSize] = useState(200);
+ const [offthreadVideoCacheSizeInBytes] = useState(200);
const codec = useMemo(() => {
if (renderMode === 'audio') {
@@ -486,7 +486,7 @@ const RenderModal: React.FC<
return Math.max(
0,
- Math.min(resolvedComposition.durationInFrames - 1, endFrameOrNull)
+ Math.min(resolvedComposition.durationInFrames - 1, endFrameOrNull),
);
}, [resolvedComposition.durationInFrames, endFrameOrNull]);
@@ -503,7 +503,7 @@ const RenderModal: React.FC<
return Math.max(
0,
- Math.min(resolvedComposition.durationInFrames - 1, parsed)
+ Math.min(resolvedComposition.durationInFrames - 1, parsed),
);
}, [resolvedComposition.durationInFrames, unclampedFrame]);
@@ -529,7 +529,7 @@ const RenderModal: React.FC<
return BrowserSafeApis.defaultAudioCodecs[passedVideoCodec]
.compressed as AudioCodec;
},
- []
+ [],
);
const setDefaultOutName = useCallback(
@@ -540,7 +540,7 @@ const RenderModal: React.FC<
type: 'render';
codec: Codec;
audioCodec: AudioCodec;
- }
+ },
) => {
if (options.type === 'still') {
setOutName((prev) => {
@@ -552,7 +552,7 @@ const RenderModal: React.FC<
setOutName((prev) => {
const codecSuffix = BrowserSafeApis.getFileExtensionFromCodec(
options.codec,
- deriveFinalAudioCodec(options.codec, options.audioCodec)
+ deriveFinalAudioCodec(options.codec, options.audioCodec),
);
const newFileName = getStringBeforeSuffix(prev) + '.' + codecSuffix;
@@ -560,7 +560,7 @@ const RenderModal: React.FC<
});
}
},
- [deriveFinalAudioCodec, getStringBeforeSuffix]
+ [deriveFinalAudioCodec, getStringBeforeSuffix],
);
const setAudioCodec = useCallback(
@@ -572,7 +572,7 @@ const RenderModal: React.FC<
audioCodec: newAudioCodec,
});
},
- [setDefaultOutName, videoCodecForVideoTab]
+ [setDefaultOutName, videoCodecForVideoTab],
);
const setCodec = useCallback(
@@ -594,7 +594,7 @@ const RenderModal: React.FC<
deriveFinalAudioCodec,
renderMode,
setDefaultOutName,
- ]
+ ],
);
const setStillFormat = useCallback(
@@ -602,7 +602,7 @@ const RenderModal: React.FC<
setStillImageFormat(format);
setDefaultOutName({type: 'still', imageFormat: format});
},
- [setDefaultOutName]
+ [setDefaultOutName],
);
const {setSidebarCollapsedState} = useContext(SidebarContext);
@@ -624,7 +624,7 @@ const RenderModal: React.FC<
delayRenderTimeout,
envVariables: envVariablesArrayToObject(envVariables),
inputProps,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
})
.then(() => {
dispatchIfMounted({type: 'succeed'});
@@ -647,11 +647,12 @@ const RenderModal: React.FC<
delayRenderTimeout,
envVariables,
inputProps,
+ offthreadVideoCacheSizeInBytes,
onClose,
]);
const [everyNthFrameSetting, setEveryNthFrameSetting] = useState(
- () => initialEveryNthFrame
+ () => initialEveryNthFrame,
);
const everyNthFrame = useMemo(() => {
@@ -696,7 +697,7 @@ const RenderModal: React.FC<
chromiumOptions,
envVariables: envVariablesArrayToObject(envVariables),
inputProps,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
})
.then(() => {
dispatchIfMounted({type: 'succeed'});
@@ -800,7 +801,7 @@ const RenderModal: React.FC<
codec: videoCodecForAudioTab,
audioCodec: deriveFinalAudioCodec(
videoCodecForAudioTab,
- userSelectedAudioCodec
+ userSelectedAudioCodec,
),
});
}
@@ -811,7 +812,7 @@ const RenderModal: React.FC<
codec: videoCodecForVideoTab,
audioCodec: deriveFinalAudioCodec(
videoCodecForVideoTab,
- userSelectedAudioCodec
+ userSelectedAudioCodec,
),
});
}
@@ -827,7 +828,7 @@ const RenderModal: React.FC<
setDefaultOutName,
stillImageFormat,
videoCodecForVideoTab,
- ]
+ ],
);
const renderTabOptions = useMemo((): SegmentedControlItem[] => {
@@ -1150,7 +1151,7 @@ export const RenderModalWithLoader: React.FC<RenderModalProps> = (props) => {
const resolved = Internals.useResolvedVideoConfig(props.compositionId);
const unresolvedContext = useContext(Internals.CompositionManager);
const unresolved = unresolvedContext.compositions.find(
- (c) => props.compositionId === c.id
+ (c) => props.compositionId === c.id,
);
if (!unresolved) {
diff --git a/packages/cli/src/editor/components/RenderQueue/actions.ts b/packages/cli/src/editor/components/RenderQueue/actions.ts
index 83b5f2cbf9..ef98c2c25f 100644
--- a/packages/cli/src/editor/components/RenderQueue/actions.ts
+++ b/packages/cli/src/editor/components/RenderQueue/actions.ts
@@ -20,7 +20,7 @@ import type {EnumPath} from '../RenderModal/SchemaEditor/extract-enum-json-paths
const callApi = <Endpoint extends keyof ApiRoutes>(
endpoint: Endpoint,
body: ApiRoutes[Endpoint]['Request'],
- signal?: AbortSignal
+ signal?: AbortSignal,
): Promise<ApiRoutes[Endpoint]['Response']> => {
return new Promise<ApiRoutes[Endpoint]['Response']>((resolve, reject) => {
fetch(endpoint, {
@@ -36,14 +36,14 @@ const callApi = <Endpoint extends keyof ApiRoutes>(
(
data:
| {success: true; data: ApiRoutes[Endpoint]['Response']}
- | {success: false; error: string}
+ | {success: false; error: string},
) => {
if (data.success) {
resolve(data.data);
} else {
reject(new Error(data.error));
}
- }
+ },
)
.catch((err) => {
reject(err);
@@ -63,7 +63,7 @@ export const addStillRenderJob = ({
delayRenderTimeout,
envVariables,
inputProps,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
}: {
compositionId: string;
outName: string;
@@ -76,7 +76,7 @@ export const addStillRenderJob = ({
delayRenderTimeout: number;
envVariables: Record<string, string>;
inputProps: Record<string, unknown>;
- offthreadVideoCacheSize: number | null;
+ offthreadVideoCacheSizeInBytes: number | null;
}) => {
return callApi('/api/render', {
compositionId,
@@ -95,7 +95,7 @@ export const addStillRenderJob = ({
staticBase: window.remotion_staticBase,
indent: undefined,
}).serializedString,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
};
@@ -126,7 +126,7 @@ export const addVideoRenderJob = ({
chromiumOptions,
envVariables,
inputProps,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
}: {
compositionId: string;
outName: string;
@@ -154,7 +154,7 @@ export const addVideoRenderJob = ({
chromiumOptions: RequiredChromiumOptions;
envVariables: Record<string, string>;
inputProps: Record<string, unknown>;
- offthreadVideoCacheSize: number | null;
+ offthreadVideoCacheSizeInBytes: number | null;
}) => {
return callApi('/api/render', {
compositionId,
@@ -188,7 +188,7 @@ export const addVideoRenderJob = ({
staticBase: window.remotion_staticBase,
indent: undefined,
}).serializedString,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
};
@@ -249,7 +249,7 @@ export const updateAvailable = (signal: AbortSignal) => {
export const updateDefaultProps = (
compositionId: string,
defaultProps: Record<string, unknown>,
- enumPaths: EnumPath[]
+ enumPaths: EnumPath[],
) => {
return callApi('/api/update-default-props', {
compositionId,
diff --git a/packages/cli/src/get-cli-options.ts b/packages/cli/src/get-cli-options.ts
index 9252c16b4d..b9365391b1 100644
--- a/packages/cli/src/get-cli-options.ts
+++ b/packages/cli/src/get-cli-options.ts
@@ -16,7 +16,7 @@ const getAndValidateFrameRange = () => {
if (typeof frameRange === 'number') {
Log.warn('Selected a single frame. Assuming you want to output an image.');
Log.warn(
- `If you want to render a video, pass a range: '--frames=${frameRange}-${frameRange}'.`
+ `If you want to render a video, pass a range: '--frames=${frameRange}-${frameRange}'.`,
);
Log.warn("To dismiss this message, add the '--sequence' flag explicitly.");
}
@@ -29,15 +29,15 @@ const getBrowser = () =>
export const getAndValidateAbsoluteOutputFile = (
relativeOutputLocation: string,
- overwrite: boolean
+ overwrite: boolean,
) => {
const absoluteOutputFile = path.resolve(
process.cwd(),
- relativeOutputLocation
+ relativeOutputLocation,
);
if (fs.existsSync(absoluteOutputFile) && !overwrite) {
Log.error(
- `File at ${absoluteOutputFile} already exists. Use --overwrite to overwrite.`
+ `File at ${absoluteOutputFile} already exists. Use --overwrite to overwrite.`,
);
process.exit(1);
}
@@ -166,6 +166,7 @@ export const getCliOptions = async (options: {
height,
width,
configFileImageFormat: ConfigInternals.getUserPreferredVideoImageFormat(),
- offthreadVideoCacheSize: ConfigInternals.getOffthreadVideoCacheSize(),
+ offthreadVideoCacheSizeInBytes:
+ ConfigInternals.getOffthreadVideoCacheSizeInBytes(),
};
};
diff --git a/packages/cli/src/get-composition-id.ts b/packages/cli/src/get-composition-id.ts
index a2a5a90b84..4fd5c7e817 100644
--- a/packages/cli/src/get-composition-id.ts
+++ b/packages/cli/src/get-composition-id.ts
@@ -49,7 +49,7 @@ export const getCompositionId = async ({
logLevel,
indent,
server,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
}: {
args: string[];
compositionIdFromUi: string | null;
@@ -64,7 +64,7 @@ export const getCompositionId = async ({
logLevel: LogLevel;
indent: boolean;
server: RemotionServer;
- offthreadVideoCacheSize: number | null;
+ offthreadVideoCacheSizeInBytes: number | null;
}): Promise<{
compositionId: string;
reason: string;
@@ -95,7 +95,7 @@ export const getCompositionId = async ({
server,
indent,
onBrowserLog: null,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
if (propsSize > 10_000_000) {
@@ -105,8 +105,8 @@ export const getCompositionId = async ({
logLevel,
},
`The props of your composition are large (${formatBytes(
- propsSize
- )}). This may cause slowdown.`
+ propsSize,
+ )}). This may cause slowdown.`,
);
}
@@ -136,7 +136,7 @@ export const getCompositionId = async ({
serveUrlOrWebpackUrl,
onBrowserLog: null,
serializedInputPropsWithCustomSchema,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
const {compositionId, reason} = await showSingleCompositionsPicker(comps);
if (compositionId && typeof compositionId === 'string') {
diff --git a/packages/cli/src/get-composition-with-dimension-override.ts b/packages/cli/src/get-composition-with-dimension-override.ts
index 5538b8aecb..ac74ec274b 100644
--- a/packages/cli/src/get-composition-with-dimension-override.ts
+++ b/packages/cli/src/get-composition-with-dimension-override.ts
@@ -24,7 +24,7 @@ export const getCompositionWithDimensionOverride = async ({
serializedInputPropsWithCustomSchema,
logLevel,
server,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
}: {
height: number | null;
width: number | null;
@@ -41,7 +41,7 @@ export const getCompositionWithDimensionOverride = async ({
logLevel: LogLevel;
serializedInputPropsWithCustomSchema: string;
server: RemotionServer;
- offthreadVideoCacheSize: number | null;
+ offthreadVideoCacheSizeInBytes: number | null;
}): Promise<{
compositionId: string;
reason: string;
@@ -62,7 +62,7 @@ export const getCompositionWithDimensionOverride = async ({
puppeteerInstance,
timeoutInMilliseconds,
server,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
return {
diff --git a/packages/cli/src/preview-server/render-queue/job.ts b/packages/cli/src/preview-server/render-queue/job.ts
index 44d251c2b5..9a5e612828 100644
--- a/packages/cli/src/preview-server/render-queue/job.ts
+++ b/packages/cli/src/preview-server/render-queue/job.ts
@@ -39,7 +39,7 @@ type RenderJobDynamicStatus =
};
export type JobProgressCallback = (
- options: BaseRenderProgress & AggregateRenderProgress
+ options: BaseRenderProgress & AggregateRenderProgress,
) => void;
type RenderJobDynamicFields =
@@ -49,7 +49,7 @@ type RenderJobDynamicFields =
jpegQuality: number;
frame: number;
scale: number;
- offthreadVideoCacheSize: number | null;
+ offthreadVideoCacheSizeInBytes: number | null;
} & RenderJobDynamicStatus)
| ({
type: 'video';
@@ -72,7 +72,7 @@ type RenderJobDynamicFields =
everyNthFrame: number;
numberOfGifLoops: number | null;
disallowParallelEncoding: boolean;
- offthreadVideoCacheSize: number | null;
+ offthreadVideoCacheSizeInBytes: number | null;
} & RenderJobDynamicStatus);
export type RenderJob = {
@@ -138,7 +138,7 @@ export type AddRenderRequest = {
delayRenderTimeout: number;
envVariables: Record<string, string>;
serializedInputPropsWithCustomSchema: string;
- offthreadVideoCacheSize: number | null;
+ offthreadVideoCacheSizeInBytes: number | null;
} & AddRenderRequestDynamicFields;
export type RemoveRenderRequest = {
diff --git a/packages/cli/src/preview-server/render-queue/process-still.ts b/packages/cli/src/preview-server/render-queue/process-still.ts
index 35f033ec61..38f46491f9 100644
--- a/packages/cli/src/preview-server/render-queue/process-still.ts
+++ b/packages/cli/src/preview-server/render-queue/process-still.ts
@@ -57,6 +57,6 @@ export const processStill = async ({
addCleanupCallback,
cancelSignal: job.cancelToken.cancelSignal,
outputLocationFromUi: job.outName,
- offthreadVideoCacheSize: job.offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes: job.offthreadVideoCacheSizeInBytes,
});
};
diff --git a/packages/cli/src/preview-server/render-queue/process-video.ts b/packages/cli/src/preview-server/render-queue/process-video.ts
index d21d783dbd..d9a66a6781 100644
--- a/packages/cli/src/preview-server/render-queue/process-video.ts
+++ b/packages/cli/src/preview-server/render-queue/process-video.ts
@@ -73,6 +73,6 @@ export const processVideoJob = async ({
numberOfGifLoops: job.numberOfGifLoops,
audioCodec: job.audioCodec,
disallowParallelEncoding: job.disallowParallelEncoding,
- offthreadVideoCacheSize: job.offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes: job.offthreadVideoCacheSizeInBytes,
});
};
diff --git a/packages/cli/src/preview-server/routes/add-render.ts b/packages/cli/src/preview-server/routes/add-render.ts
index 4b05f3faf3..3aa435fd34 100644
--- a/packages/cli/src/preview-server/routes/add-render.ts
+++ b/packages/cli/src/preview-server/routes/add-render.ts
@@ -49,7 +49,7 @@ export const handleAddRender: ApiHandler<AddRenderRequest, undefined> = ({
envVariables: input.envVariables,
serializedInputPropsWithCustomSchema:
input.serializedInputPropsWithCustomSchema,
- offthreadVideoCacheSize: input.offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes: input.offthreadVideoCacheSizeInBytes,
},
});
}
@@ -76,7 +76,7 @@ export const handleAddRender: ApiHandler<AddRenderRequest, undefined> = ({
envVariables: input.envVariables,
serializedInputPropsWithCustomSchema:
input.serializedInputPropsWithCustomSchema,
- offthreadVideoCacheSize: input.offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes: input.offthreadVideoCacheSizeInBytes,
},
entryPoint,
remotionRoot,
diff --git a/packages/cli/src/render-flows/render.ts b/packages/cli/src/render-flows/render.ts
index 2eb0f5da2d..3e7e62bc0e 100644
--- a/packages/cli/src/render-flows/render.ts
+++ b/packages/cli/src/render-flows/render.ts
@@ -93,7 +93,7 @@ export const renderVideoFlow = async ({
audioCodec,
serializedInputPropsWithCustomSchema,
disallowParallelEncoding,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
}: {
remotionRoot: string;
fullEntryPoint: string;
@@ -138,7 +138,7 @@ export const renderVideoFlow = async ({
numberOfGifLoops: Loop;
audioCodec: AudioCodec | null;
disallowParallelEncoding: boolean;
- offthreadVideoCacheSize: number | null;
+ offthreadVideoCacheSizeInBytes: number | null;
}) => {
const downloads: DownloadProgress[] = [];
@@ -146,7 +146,7 @@ export const renderVideoFlow = async ({
Log.verboseAdvanced(
{indent, logLevel},
'Browser executable: ',
- browserExecutable
+ browserExecutable,
);
}
@@ -231,7 +231,7 @@ export const renderVideoFlow = async ({
addCleanupCallback(() => RenderInternals.deleteDirectory(dir));
},
quietProgress: updatesDontOverwrite,
- }
+ },
);
addCleanupCallback(() => cleanupBundle());
@@ -255,7 +255,7 @@ export const renderVideoFlow = async ({
remotionRoot,
logLevel,
webpackConfigOrServeUrl: urlOrBundle,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
addCleanupCallback(() => server.closeServer(false));
@@ -277,7 +277,7 @@ export const renderVideoFlow = async ({
timeoutInMilliseconds: puppeteerTimeout,
logLevel,
server,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
const {codec, reason: codecReason} = getFinalOutputCodec({
@@ -286,7 +286,7 @@ export const renderVideoFlow = async ({
downloadName: null,
outName: getUserPassedOutputLocation(
argsAfterComposition,
- outputLocationFromUI
+ outputLocationFromUI,
),
uiCodec,
});
@@ -303,7 +303,7 @@ export const renderVideoFlow = async ({
compositionName: compositionId,
defaultExtension: RenderInternals.getFileExtensionFromCodec(
codec,
- audioCodec
+ audioCodec,
),
args: argsAfterComposition,
indent,
@@ -313,28 +313,28 @@ export const renderVideoFlow = async ({
Log.verboseAdvanced(
{indent, logLevel},
- chalk.gray(`Entry point = ${fullEntryPoint} (${entryPointReason})`)
+ chalk.gray(`Entry point = ${fullEntryPoint} (${entryPointReason})`),
);
Log.infoAdvanced(
{indent, logLevel},
chalk.gray(
- `Composition = ${compositionId} (${reason}), Codec = ${codec} (${codecReason}), Output = ${relativeOutputLocation}`
- )
+ `Composition = ${compositionId} (${reason}), Codec = ${codec} (${codecReason}), Output = ${relativeOutputLocation}`,
+ ),
);
const absoluteOutputFile = getAndValidateAbsoluteOutputFile(
relativeOutputLocation,
- overwrite
+ overwrite,
);
const exists = existsSync(absoluteOutputFile);
const realFrameRange = RenderInternals.getRealFrameRange(
config.durationInFrames,
- frameRange
+ frameRange,
);
const totalFrames: number[] = RenderInternals.getFramesToRender(
realFrameRange,
- everyNthFrame
+ everyNthFrame,
);
renderingProgress = {
@@ -356,14 +356,14 @@ export const renderVideoFlow = async ({
});
if (imageFormat === 'none') {
throw new Error(
- `Cannot render an image sequence with a codec that renders no images. codec = ${codec}, imageFormat = ${imageFormat}`
+ `Cannot render an image sequence with a codec that renders no images. codec = ${codec}, imageFormat = ${imageFormat}`,
);
}
const outputDir = shouldOutputImageSequence
? absoluteOutputFile
: await fs.promises.mkdtemp(
- path.join(os.tmpdir(), 'react-motion-render')
+ path.join(os.tmpdir(), 'react-motion-render'),
);
Log.verboseAdvanced({indent, logLevel}, 'Output dir', outputDir);
@@ -403,11 +403,14 @@ export const renderVideoFlow = async ({
staticBase: null,
data: config.props,
}).serializedString,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
updateRenderProgress({newline: true, printToConsole: true});
- Log.infoAdvanced({indent, logLevel}, chalk.blue(`â–¶ ${absoluteOutputFile}`));
+ Log.infoAdvanced(
+ {indent, logLevel},
+ chalk.blue(`â–¶ ${absoluteOutputFile}`),
+ );
return;
}
@@ -480,20 +483,20 @@ export const renderVideoFlow = async ({
indent: undefined,
staticBase: null,
}).serializedString,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
updateRenderProgress({newline: true, printToConsole: true});
Log.infoAdvanced(
{indent, logLevel},
- chalk.blue(`${exists ? 'â—‹' : '+'} ${absoluteOutputFile}`)
+ chalk.blue(`${exists ? 'â—‹' : '+'} ${absoluteOutputFile}`),
);
Log.verboseAdvanced({indent, logLevel}, `Slowest frames:`);
slowestFrames.forEach(({frame, time}) => {
Log.verboseAdvanced(
{indent, logLevel},
- ` Frame ${frame} (${time.toFixed(3)}ms)`
+ ` Frame ${frame} (${time.toFixed(3)}ms)`,
);
});
diff --git a/packages/cli/src/render-flows/still.ts b/packages/cli/src/render-flows/still.ts
index 627e0a6e4d..eb0ce6e9f5 100644
--- a/packages/cli/src/render-flows/still.ts
+++ b/packages/cli/src/render-flows/still.ts
@@ -66,7 +66,7 @@ export const renderStillFlow = async ({
addCleanupCallback,
cancelSignal,
outputLocationFromUi,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
}: {
remotionRoot: string;
fullEntryPoint: string;
@@ -94,7 +94,7 @@ export const renderStillFlow = async ({
addCleanupCallback: (cb: () => void) => void;
cancelSignal: CancelSignal | null;
outputLocationFromUi: string | null;
- offthreadVideoCacheSize: number | null;
+ offthreadVideoCacheSizeInBytes: number | null;
}) => {
const aggregate: AggregateRenderProgress = initialAggregateRenderProgress();
const updatesDontOverwrite = shouldUseNonOverlayingLogger({logLevel});
@@ -134,7 +134,7 @@ export const renderStillFlow = async ({
Log.verboseAdvanced(
{indent, logLevel},
'Browser executable: ',
- browserExecutable
+ browserExecutable,
);
}
@@ -168,7 +168,7 @@ export const renderStillFlow = async ({
});
},
quietProgress: updatesDontOverwrite,
- }
+ },
);
const server = await RenderInternals.prepareServer({
@@ -178,7 +178,7 @@ export const renderStillFlow = async ({
remotionRoot,
logLevel,
webpackConfigOrServeUrl: urlOrBundle,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
addCleanupCallback(() => server.closeServer(false));
@@ -205,7 +205,7 @@ export const renderStillFlow = async ({
timeoutInMilliseconds: puppeteerTimeout,
logLevel,
server,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
const {format: imageFormat, source} = determineFinalStillImageFormat({
@@ -215,7 +215,7 @@ export const renderStillFlow = async ({
downloadName: null,
outName: getUserPassedOutputLocation(
argsAfterComposition,
- outputLocationFromUi
+ outputLocationFromUi,
),
isLambda: false,
fromUi: imageFormatFromUi,
@@ -231,7 +231,7 @@ export const renderStillFlow = async ({
const absoluteOutputLocation = getAndValidateAbsoluteOutputFile(
relativeOutputLocation,
- overwrite
+ overwrite,
);
const exists = existsSync(absoluteOutputLocation);
@@ -241,13 +241,13 @@ export const renderStillFlow = async ({
Log.verboseAdvanced(
{indent, logLevel},
- chalk.gray(`Entry point = ${fullEntryPoint} (${entryPointReason})`)
+ chalk.gray(`Entry point = ${fullEntryPoint} (${entryPointReason})`),
);
Log.infoAdvanced(
{indent, logLevel},
chalk.gray(
- `Composition = ${compositionId} (${reason}), Format = ${imageFormat} (${source}), Output = ${relativeOutputLocation}`
- )
+ `Composition = ${compositionId} (${reason}), Format = ${imageFormat} (${source}), Output = ${relativeOutputLocation}`,
+ ),
);
const renderStart = Date.now();
@@ -297,7 +297,7 @@ export const renderStillFlow = async ({
staticBase: null,
data: config.props,
}).serializedString,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
aggregate.rendering = {
@@ -310,6 +310,6 @@ export const renderStillFlow = async ({
updateRenderProgress({newline: true, printToConsole: true});
Log.infoAdvanced(
{indent, logLevel},
- chalk.blue(`${exists ? 'â—‹' : '+'} ${absoluteOutputLocation}`)
+ chalk.blue(`${exists ? 'â—‹' : '+'} ${absoluteOutputLocation}`),
);
};
diff --git a/packages/cli/src/render.tsx b/packages/cli/src/render.tsx
index 2c323fe0ac..ada9e6dad4 100644
--- a/packages/cli/src/render.tsx
+++ b/packages/cli/src/render.tsx
@@ -20,7 +20,7 @@ export const render = async (remotionRoot: string, args: string[]) => {
if (!file) {
Log.error('No entry point specified. Pass more arguments:');
Log.error(
- ' npx remotion render [entry-point] [composition-name] [out-name]'
+ ' npx remotion render [entry-point] [composition-name] [out-name]',
);
Log.error('Documentation: https://www.remotion.dev/docs/render');
process.exit(1);
@@ -30,7 +30,7 @@ export const render = async (remotionRoot: string, args: string[]) => {
if (parsedCli.frame) {
Log.error(
- '--frame flag was passed to the `render` command. This flag only works with the `still` command. Did you mean `--frames`? See reference: https://www.remotion.dev/docs/cli/'
+ '--frame flag was passed to the `render` command. This flag only works with the `still` command. Did you mean `--frames`? See reference: https://www.remotion.dev/docs/cli/',
);
process.exit(1);
}
@@ -63,7 +63,7 @@ export const render = async (remotionRoot: string, args: string[]) => {
pixelFormat,
videoBitrate,
numberOfGifLoops,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
} = await getCliOptions({
isLambda: false,
type: 'series',
@@ -122,6 +122,6 @@ export const render = async (remotionRoot: string, args: string[]) => {
numberOfGifLoops,
audioCodec,
disallowParallelEncoding: false,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
};
diff --git a/packages/cli/src/still.ts b/packages/cli/src/still.ts
index c14ba304cf..d4cfb61936 100644
--- a/packages/cli/src/still.ts
+++ b/packages/cli/src/still.ts
@@ -17,7 +17,7 @@ export const still = async (remotionRoot: string, args: string[]) => {
if (!file) {
Log.error('No entry point specified. Pass more arguments:');
Log.error(
- ' npx remotion render [entry-point] [composition-name] [out-name]'
+ ' npx remotion render [entry-point] [composition-name] [out-name]',
);
Log.error('Documentation: https://www.remotion.dev/docs/render');
process.exit(1);
@@ -27,7 +27,7 @@ export const still = async (remotionRoot: string, args: string[]) => {
if (parsedCli.frames) {
Log.error(
- '--frames flag was passed to the `still` command. This flag only works with the `render` command. Did you mean `--frame`? See reference: https://www.remotion.dev/docs/cli/'
+ '--frames flag was passed to the `still` command. This flag only works with the `render` command. Did you mean `--frame`? See reference: https://www.remotion.dev/docs/cli/',
);
process.exit(1);
}
@@ -48,7 +48,7 @@ export const still = async (remotionRoot: string, args: string[]) => {
stillFrame,
width,
logLevel,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
} = await getCliOptions({
isLambda: false,
type: 'still',
@@ -88,6 +88,6 @@ export const still = async (remotionRoot: string, args: string[]) => {
},
cancelSignal: null,
outputLocationFromUi: null,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
};
diff --git a/packages/cloudrun/src/api/render-media-on-cloudrun.ts b/packages/cloudrun/src/api/render-media-on-cloudrun.ts
index 32cfaad4ee..7bfd44faf3 100644
--- a/packages/cloudrun/src/api/render-media-on-cloudrun.ts
+++ b/packages/cloudrun/src/api/render-media-on-cloudrun.ts
@@ -139,7 +139,7 @@ export const renderMediaOnCloudrun = async ({
concurrency,
enforceAudioTrack,
preferLossless,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
}: RenderMediaOnCloudrunInput): Promise<
RenderMediaOnCloudrunOutput | CloudRunCrashResponse
> => {
@@ -193,7 +193,7 @@ export const renderMediaOnCloudrun = async ({
concurrency: concurrency ?? null,
enforceAudioTrack: enforceAudioTrack ?? false,
preferLossless: preferLossless ?? false,
- offthreadVideoCacheSize: offthreadVideoCacheSize ?? null,
+ offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes ?? null,
};
const client = await getAuthClientForUrl(cloudRunEndpoint);
diff --git a/packages/cloudrun/src/api/render-still-on-cloudrun.ts b/packages/cloudrun/src/api/render-still-on-cloudrun.ts
index c50b7b4cc2..0cd7f323f5 100644
--- a/packages/cloudrun/src/api/render-still-on-cloudrun.ts
+++ b/packages/cloudrun/src/api/render-still-on-cloudrun.ts
@@ -87,7 +87,7 @@ export const renderStillOnCloudrun = async ({
forceHeight,
logLevel,
delayRenderTimeoutInMilliseconds,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
}: RenderStillOnCloudrunInput): Promise<
RenderStillOnCloudrunOutput | ErrorResponsePayload | CloudRunCrashResponse
> => {
@@ -126,7 +126,7 @@ export const renderStillOnCloudrun = async ({
logLevel: logLevel ?? 'info',
delayRenderTimeoutInMilliseconds:
delayRenderTimeoutInMilliseconds ?? RenderInternals.DEFAULT_TIMEOUT,
- offthreadVideoCacheSize: offthreadVideoCacheSize ?? null,
+ offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes ?? null,
};
const client = await getAuthClientForUrl(cloudRunEndpoint);
diff --git a/packages/cloudrun/src/cli/commands/render/index.ts b/packages/cloudrun/src/cli/commands/render/index.ts
index 40962db701..8df27937ee 100644
--- a/packages/cloudrun/src/cli/commands/render/index.ts
+++ b/packages/cloudrun/src/cli/commands/render/index.ts
@@ -58,7 +58,7 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
browserExecutable,
port,
enforceAudioTrack,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
} = await CliInternals.getCliOptions({
type: 'series',
isLambda: true,
@@ -73,7 +73,7 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
if (!serveUrl.startsWith('https://') && !serveUrl.startsWith('http://')) {
throw Error(
- 'Passing the shorthand serve URL without composition name is currently not supported.\n Make sure to pass a composition name after the shorthand serve URL or pass the complete serveURL without composition name to get to choose between all compositions.'
+ 'Passing the shorthand serve URL without composition name is currently not supported.\n Make sure to pass a composition name after the shorthand serve URL or pass the complete serveURL without composition name to get to choose between all compositions.',
);
}
@@ -84,7 +84,7 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
remotionRoot,
logLevel,
webpackConfigOrServeUrl: serveUrl,
- offthreadVideoCacheSize: offthreadVideoCacheSize ?? null,
+ offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes ?? null,
});
const {compositionId} =
@@ -108,7 +108,7 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
indent: undefined,
staticBase: null,
}).serializedString,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
composition = compositionId;
}
@@ -126,8 +126,8 @@ Output Bucket = ${forceBucketName}
Output File = ${outName ?? 'out.mp4'}
Output File Privacy = ${privacy}
${downloadName ? ` Downloaded File = ${downloadName}` : ''}
- `.trim()
- )
+ `.trim(),
+ ),
);
Log.info();
@@ -156,7 +156,7 @@ ${downloadName ? ` Downloaded File = ${downloadName}` : ''}
? `${Math.round(renderProgress.progress * 100)}%`
: CliInternals.chalk.gray(`${renderProgress.doneIn}ms`),
].join(' '),
- false
+ false,
);
};
@@ -227,8 +227,8 @@ Bucket Name = ${res.bucketName}
Privacy = ${res.privacy}
Render ID = ${res.renderId}
Codec = ${codec} (${codecReason})
- `.trim()
- )
+ `.trim(),
+ ),
);
if (downloadName) {
@@ -242,7 +242,7 @@ Codec = ${codec} (${codecReason})
});
Log.info(
- CliInternals.chalk.blueBright(`Downloaded file to ${destination}!`)
+ CliInternals.chalk.blueBright(`Downloaded file to ${destination}!`),
);
}
}
diff --git a/packages/cloudrun/src/cli/commands/still.ts b/packages/cloudrun/src/cli/commands/still.ts
index cb8d9b1892..99d503f47d 100644
--- a/packages/cloudrun/src/cli/commands/still.ts
+++ b/packages/cloudrun/src/cli/commands/still.ts
@@ -35,7 +35,7 @@ export const stillCommand = async (args: string[], remotionRoot: string) => {
browserExecutable,
port,
logLevel,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
} = await CliInternals.getCliOptions({
type: 'still',
isLambda: true,
@@ -50,7 +50,7 @@ export const stillCommand = async (args: string[], remotionRoot: string) => {
if (!serveUrl.startsWith('https://') && !serveUrl.startsWith('http://')) {
throw Error(
- 'Passing the shorthand serve URL without composition name is currently not supported.\n Make sure to pass a composition name after the shorthand serve URL or pass the complete serveURL without composition name to get to choose between all compositions.'
+ 'Passing the shorthand serve URL without composition name is currently not supported.\n Make sure to pass a composition name after the shorthand serve URL or pass the complete serveURL without composition name to get to choose between all compositions.',
);
}
@@ -61,7 +61,7 @@ export const stillCommand = async (args: string[], remotionRoot: string) => {
remotionRoot,
logLevel,
webpackConfigOrServeUrl: serveUrl,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
const {compositionId} =
@@ -85,7 +85,7 @@ export const stillCommand = async (args: string[], remotionRoot: string) => {
height,
width,
server: await server,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
composition = compositionId;
}
@@ -113,8 +113,8 @@ Output Bucket = ${forceBucketName}
Output File = ${outName ?? 'out.png'}
Output File Privacy = ${privacy}
${downloadName ? ` Downloaded File = ${downloadName}` : ''}
- `.trim()
- )
+ `.trim(),
+ ),
);
Log.info();
@@ -136,7 +136,7 @@ ${downloadName ? ` Downloaded File = ${downloadName}` : ''}
`Rendering on Cloud Run:`,
`${doneIn === null ? '...' : `Rendered in ${doneIn}ms`}`,
].join(' '),
- newline
+ newline,
);
};
@@ -167,15 +167,15 @@ ${downloadName ? ` Downloaded File = ${downloadName}` : ''}
updateProgress(true);
Log.info(
- CliInternals.chalk.gray(`Cloud Storage Uri = ${res.cloudStorageUri}`)
+ CliInternals.chalk.gray(`Cloud Storage Uri = ${res.cloudStorageUri}`),
);
Log.info(CliInternals.chalk.gray(`Render ID = ${res.renderId}`));
Log.info(
CliInternals.chalk.gray(
`${Math.round(Number(res.size) / 1000)} KB, Privacy: ${
res.privacy
- }, Bucket: ${res.bucketName}`
- )
+ }, Bucket: ${res.bucketName}`,
+ ),
);
Log.info(CliInternals.chalk.blue(`â—‹ ${res.publicUrl}`));
@@ -190,7 +190,7 @@ ${downloadName ? ` Downloaded File = ${downloadName}` : ''}
});
Log.info(
- CliInternals.chalk.blueBright(`Downloaded file to ${destination}!`)
+ CliInternals.chalk.blueBright(`Downloaded file to ${destination}!`),
);
}
}
diff --git a/packages/cloudrun/src/functions/helpers/get-composition-from-body.ts b/packages/cloudrun/src/functions/helpers/get-composition-from-body.ts
index 6822759f81..bd9b47cb72 100644
--- a/packages/cloudrun/src/functions/helpers/get-composition-from-body.ts
+++ b/packages/cloudrun/src/functions/helpers/get-composition-from-body.ts
@@ -18,13 +18,13 @@ export const getCompositionFromBody = async (body: CloudRunPayloadType) => {
puppeteerInstance: undefined,
server: undefined,
timeoutInMilliseconds: body.delayRenderTimeoutInMilliseconds,
- offthreadVideoCacheSize: body.offthreadVideoCacheSize,
- }
+ offthreadVideoCacheSizeInBytes: body.offthreadVideoCacheSizeInBytes,
+ },
);
if (propsSize > 10_000_000) {
RenderInternals.Log.warn(
- `The props of your composition are large (${propsSize} bytes). This may cause slowdown.`
+ `The props of your composition are large (${propsSize} bytes). This may cause slowdown.`,
);
}
diff --git a/packages/cloudrun/src/functions/helpers/payloads.ts b/packages/cloudrun/src/functions/helpers/payloads.ts
index 389d79cb7b..d3599d4d35 100644
--- a/packages/cloudrun/src/functions/helpers/payloads.ts
+++ b/packages/cloudrun/src/functions/helpers/payloads.ts
@@ -51,7 +51,7 @@ export const CloudRunPayload = z.discriminatedUnion('type', [
concurrency: z.number().or(z.string()).nullable(),
enforceAudioTrack: z.boolean(),
preferLossless: z.boolean(),
- offthreadVideoCacheSize: z.number().nullable(),
+ offthreadVideoCacheSizeInBytes: z.number().nullable(),
}),
z.object({
type: z.literal('still'),
@@ -71,7 +71,7 @@ export const CloudRunPayload = z.discriminatedUnion('type', [
frame: z.number(),
delayRenderTimeoutInMilliseconds: z.number(),
logLevel,
- offthreadVideoCacheSize: z.number().nullable(),
+ offthreadVideoCacheSizeInBytes: z.number().nullable(),
}),
]);
@@ -106,7 +106,7 @@ const cloudRunCrashResponse = z.object({
type: z.literal('crash'),
cloudRunEndpoint: z.string(),
message: z.literal(
- 'Service crashed without sending a response. Check the logs in GCP console.'
+ 'Service crashed without sending a response. Check the logs in GCP console.',
),
requestStartTime: z.string().datetime(),
requestCrashTime: z.string().datetime(),
diff --git a/packages/cloudrun/src/functions/render-media-single-thread.ts b/packages/cloudrun/src/functions/render-media-single-thread.ts
index 5c9f7a736a..58d1ff827b 100644
--- a/packages/cloudrun/src/functions/render-media-single-thread.ts
+++ b/packages/cloudrun/src/functions/render-media-single-thread.ts
@@ -13,7 +13,7 @@ import {writeCloudrunError} from './helpers/write-cloudrun-error';
export const renderMediaSingleThread = async (
body: CloudRunPayloadType,
- res: ff.Response
+ res: ff.Response,
) => {
if (body.type !== 'media') {
throw new Error('expected type media');
@@ -26,7 +26,7 @@ export const renderMediaSingleThread = async (
const defaultOutName = `out.${RenderInternals.getFileExtensionFromCodec(
body.codec,
- body.audioCodec
+ body.audioCodec,
)}`;
const tempFilePath = `/tmp/${defaultOutName}`;
let previousProgress = 2;
@@ -96,7 +96,7 @@ export const renderMediaSingleThread = async (
preferLossless: body.preferLossless,
puppeteerInstance: undefined,
server: undefined,
- offthreadVideoCacheSize: body.offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes: body.offthreadVideoCacheSizeInBytes,
});
const storage = new Storage();
diff --git a/packages/cloudrun/src/functions/render-still-single-thread.ts b/packages/cloudrun/src/functions/render-still-single-thread.ts
index 2625d6055c..7ad801ee4e 100644
--- a/packages/cloudrun/src/functions/render-still-single-thread.ts
+++ b/packages/cloudrun/src/functions/render-still-single-thread.ts
@@ -14,7 +14,7 @@ import {writeCloudrunError} from './helpers/write-cloudrun-error';
export const renderStillSingleThread = async (
body: CloudRunPayloadType,
- res: ff.Response
+ res: ff.Response,
) => {
if (body.type !== 'still') {
throw new Error('expected type still');
@@ -69,7 +69,7 @@ export const renderStillSingleThread = async (
port: null,
puppeteerInstance: null,
server: undefined,
- offthreadVideoCacheSize: body.offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes: body.offthreadVideoCacheSizeInBytes,
});
Log.info('Still rendered');
diff --git a/packages/example/src/test/stills.test.ts b/packages/example/src/test/stills.test.ts
index 7e29ae5157..5c82f15b4c 100644
--- a/packages/example/src/test/stills.test.ts
+++ b/packages/example/src/test/stills.test.ts
@@ -24,7 +24,7 @@ test(
const compositions = await getCompositions(bundled);
const composition = compositions.find(
- (c) => c.id === 'react-svg'
+ (c) => c.id === 'react-svg',
) as VideoConfig;
const folder = path.join(tmpdir(), 'remotion-test', 'render-still');
@@ -39,14 +39,14 @@ test(
concurrency: RenderInternals.getActualConcurrency(null),
logLevel: 'info',
indent: false,
- offthreadVideoCacheSize: null,
+ offthreadVideoCacheSizeInBytes: null,
},
{
onDownload: () => undefined,
onError: (err) => {
throw err;
},
- }
+ },
);
const serveUrl = `http://localhost:${server.server.offthreadPort}`;
@@ -58,9 +58,9 @@ test(
output: testOut,
serveUrl,
frame: 500,
- })
+ }),
).rejects.toThrow(
- /Cannot use frame 500: Duration of composition is 300, therefore the highest frame that can be rendered is 299/
+ /Cannot use frame 500: Duration of composition is 300, therefore the highest frame that can be rendered is 299/,
);
await expect(() =>
@@ -68,7 +68,7 @@ test(
composition,
output: process.platform === 'win32' ? fileOSRoot : '/var',
serveUrl,
- })
+ }),
).rejects.toThrow(/already exists, but is not a file/);
await expect(() =>
@@ -77,9 +77,9 @@ test(
output: 'src/index.ts',
serveUrl,
overwrite: false,
- })
+ }),
).rejects.toThrow(
- /Cannot render still - "overwrite" option was set to false, but the output/
+ /Cannot render still - "overwrite" option was set to false, but the output/,
);
await renderStill({
@@ -99,7 +99,7 @@ test(
{
retry: 3,
timeout: 90000,
- }
+ },
);
test(
@@ -123,14 +123,14 @@ test(
concurrency: RenderInternals.getActualConcurrency(null),
logLevel: 'info',
indent: false,
- offthreadVideoCacheSize: null,
+ offthreadVideoCacheSizeInBytes: null,
},
{
onDownload: () => undefined,
onError: (err) => {
throw err;
},
- }
+ },
);
const serveUrl = `http://localhost:${server.server.offthreadPort}`;
@@ -144,12 +144,12 @@ test(
for (const toRenderComposition of toRenderCompositions) {
const composition = compositions.find(
- (c) => c.id === toRenderComposition[0]
+ (c) => c.id === toRenderComposition[0],
) as VideoConfig;
const testOut = path.join(
folder,
- `${toRenderComposition[0]}-${toRenderComposition[1]}.${imageFormat}`
+ `${toRenderComposition[0]}-${toRenderComposition[1]}.${imageFormat}`,
);
await renderStill({
@@ -172,5 +172,5 @@ test(
{
retry: 3,
timeout: 90000,
- }
+ },
);
diff --git a/packages/lambda/src/api/get-compositions-on-lambda.ts b/packages/lambda/src/api/get-compositions-on-lambda.ts
index 18668c4d17..b40fa2c9e6 100644
--- a/packages/lambda/src/api/get-compositions-on-lambda.ts
+++ b/packages/lambda/src/api/get-compositions-on-lambda.ts
@@ -53,7 +53,7 @@ export const getCompositionsOnLambda = async ({
timeoutInMilliseconds,
forceBucketName: bucketName,
dumpBrowserLogs,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
}: GetCompositionsOnLambdaInput): Promise<GetCompositionsOnLambdaOutput> => {
const stringifiedInputProps = serializeOrThrow(inputProps, 'input-props');
@@ -80,7 +80,7 @@ export const getCompositionsOnLambda = async ({
timeoutInMilliseconds: timeoutInMilliseconds ?? 30000,
version: VERSION,
bucketName: bucketName ?? null,
- offthreadVideoCacheSize: offthreadVideoCacheSize ?? null,
+ offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes ?? null,
},
region,
receivedStreamingPayload: () => undefined,
diff --git a/packages/lambda/src/api/make-lambda-payload.ts b/packages/lambda/src/api/make-lambda-payload.ts
index 71a28041e3..86a16a4a8f 100644
--- a/packages/lambda/src/api/make-lambda-payload.ts
+++ b/packages/lambda/src/api/make-lambda-payload.ts
@@ -51,11 +51,11 @@ export const makeLambdaRenderMediaPayload = async ({
dumpBrowserLogs,
jpegQuality,
quality,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
}: RenderMediaOnLambdaInput): Promise<LambdaStartPayload> => {
if (quality) {
throw new Error(
- 'quality has been renamed to jpegQuality. Please rename the option.'
+ 'quality has been renamed to jpegQuality. Please rename the option.',
);
}
@@ -69,7 +69,7 @@ export const makeLambdaRenderMediaPayload = async ({
const stringifiedInputProps = serializeOrThrow(
inputProps ?? {},
- 'input-props'
+ 'input-props',
);
const serialized = await compressInputProps({
@@ -118,7 +118,7 @@ export const makeLambdaRenderMediaPayload = async ({
bucketName: bucketName ?? null,
audioCodec: audioCodec ?? null,
type: LambdaRoutines.start,
- offthreadVideoCacheSize: offthreadVideoCacheSize ?? null,
+ offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes ?? null,
};
};
diff --git a/packages/lambda/src/api/render-still-on-lambda.ts b/packages/lambda/src/api/render-still-on-lambda.ts
index b704f55ac2..5b674b1cd8 100644
--- a/packages/lambda/src/api/render-still-on-lambda.ts
+++ b/packages/lambda/src/api/render-still-on-lambda.ts
@@ -100,7 +100,7 @@ export const renderStillOnLambda = async ({
forceBucketName,
dumpBrowserLogs,
onInit,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
}: RenderStillOnLambdaInput): Promise<RenderStillOnLambdaOutput> => {
if (quality) {
throw new Error(
@@ -143,7 +143,7 @@ export const renderStillOnLambda = async ({
forceHeight: forceHeight ?? null,
forceWidth: forceWidth ?? null,
bucketName: forceBucketName ?? null,
- offthreadVideoCacheSize: offthreadVideoCacheSize ?? null,
+ offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes ?? null,
},
region,
receivedStreamingPayload: (payload) => {
diff --git a/packages/lambda/src/cli/commands/render/render.ts b/packages/lambda/src/cli/commands/render/render.ts
index 9df784dc6d..3058fbdb8f 100644
--- a/packages/lambda/src/cli/commands/render/render.ts
+++ b/packages/lambda/src/cli/commands/render/render.ts
@@ -32,11 +32,11 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
if (!serveUrl) {
Log.error('No serve URL passed.');
Log.info(
- 'Pass an additional argument specifying a URL where your Remotion project is hosted.'
+ 'Pass an additional argument specifying a URL where your Remotion project is hosted.',
);
Log.info();
Log.info(
- `${BINARY_NAME} ${RENDER_COMMAND} <serve-url> <composition-id> [output-location]`
+ `${BINARY_NAME} ${RENDER_COMMAND} <serve-url> <composition-id> [output-location]`,
);
quit(1);
}
@@ -65,7 +65,7 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
width,
browserExecutable,
port,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
} = await CliInternals.getCliOptions({
type: 'series',
isLambda: true,
@@ -80,7 +80,7 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
if (!serveUrl.startsWith('https://') && !serveUrl.startsWith('http://')) {
throw Error(
- 'Passing the shorthand serve URL without composition name is currently not supported.\n Make sure to pass a composition name after the shorthand serve URL or pass the complete serveURL without composition name to get to choose between all compositions.'
+ 'Passing the shorthand serve URL without composition name is currently not supported.\n Make sure to pass a composition name after the shorthand serve URL or pass the complete serveURL without composition name to get to choose between all compositions.',
);
}
@@ -91,7 +91,7 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
remotionRoot,
logLevel,
webpackConfigOrServeUrl: serveUrl,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
const {compositionId} =
@@ -115,7 +115,7 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
logLevel,
width,
server,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
composition = compositionId;
}
@@ -200,17 +200,17 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
Log.info(
CliInternals.chalk.gray(
- `bucket = ${res.bucketName}, function = ${functionName}`
- )
+ `bucket = ${res.bucketName}, function = ${functionName}`,
+ ),
);
Log.info(
CliInternals.chalk.gray(
- `renderId = ${res.renderId}, codec = ${codec} (${reason})`
- )
+ `renderId = ${res.renderId}, codec = ${codec} (${reason})`,
+ ),
);
const verbose = RenderInternals.isEqualOrBelowLogLevel(
ConfigInternals.Logging.getLogLevel(),
- 'verbose'
+ 'verbose',
);
Log.verbose(`CloudWatch logs (if enabled): ${res.cloudWatchLogs}`);
@@ -232,7 +232,7 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
totalFrames: getTotalFrames(status),
timeToEncode: status.timeToEncode,
}),
- false
+ false,
);
// eslint-disable-next-line no-constant-condition
@@ -255,7 +255,7 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
timeToEncode: newStatus.timeToEncode,
totalFrames: getTotalFrames(newStatus),
}),
- false
+ false,
);
if (newStatus.done) {
@@ -269,7 +269,7 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
timeToEncode: newStatus.timeToEncode,
totalFrames: getTotalFrames(newStatus),
}),
- false
+ false,
);
if (downloadName) {
const downloadStart = Date.now();
@@ -293,7 +293,7 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
timeToEncode: newStatus.timeToEncode,
totalFrames: getTotalFrames(newStatus),
}),
- false
+ false,
);
},
});
@@ -311,7 +311,7 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
timeToEncode: newStatus.timeToEncode,
totalFrames: getTotalFrames(newStatus),
}),
- false
+ false,
);
Log.info();
Log.info();
@@ -333,7 +333,7 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
`Estimated cost $${newStatus.costs.displayCost}`,
]
.filter(Boolean)
- .join(', ')
+ .join(', '),
);
if (newStatus.mostExpensiveFrameRanges) {
Log.verbose('Most expensive frame ranges:');
@@ -342,7 +342,7 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
.map((f) => {
return `${f.frameRange[0]}-${f.frameRange[1]} (${f.timeInMilliseconds}ms)`;
})
- .join(', ')
+ .join(', '),
);
}
@@ -376,10 +376,10 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
Log.info();
Log.info(
- `Accrued costs until error was thrown: ${newStatus.costs.displayCost}.`
+ `Accrued costs until error was thrown: ${newStatus.costs.displayCost}.`,
);
Log.info(
- 'This is an estimate and continuing Lambda functions may incur additional costs.'
+ 'This is an estimate and continuing Lambda functions may incur additional costs.',
);
quit(1);
}
@@ -390,7 +390,7 @@ function getTotalFrames(status: RenderProgress): number | null {
return status.renderMetadata
? RenderInternals.getFramesToRender(
status.renderMetadata.frameRange,
- status.renderMetadata.everyNthFrame
+ status.renderMetadata.everyNthFrame,
).length
: null;
}
diff --git a/packages/lambda/src/cli/commands/still.ts b/packages/lambda/src/cli/commands/still.ts
index 73934a2fc3..4498694dd4 100644
--- a/packages/lambda/src/cli/commands/still.ts
+++ b/packages/lambda/src/cli/commands/still.ts
@@ -26,11 +26,11 @@ export const stillCommand = async (args: string[], remotionRoot: string) => {
if (!serveUrl) {
Log.error('No serve URL passed.');
Log.info(
- 'Pass an additional argument specifying a URL where your Remotion project is hosted.'
+ 'Pass an additional argument specifying a URL where your Remotion project is hosted.',
);
Log.info();
Log.info(
- `${BINARY_NAME} ${STILL_COMMAND} <serve-url> <composition-id> [output-location]`
+ `${BINARY_NAME} ${STILL_COMMAND} <serve-url> <composition-id> [output-location]`,
);
quit(1);
}
@@ -48,7 +48,7 @@ export const stillCommand = async (args: string[], remotionRoot: string) => {
width,
browserExecutable,
port,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
} = await CliInternals.getCliOptions({
type: 'still',
isLambda: true,
@@ -64,7 +64,7 @@ export const stillCommand = async (args: string[], remotionRoot: string) => {
if (!serveUrl.startsWith('https://') && !serveUrl.startsWith('http://')) {
throw Error(
- 'Passing the shorthand serve URL without composition name is currently not supported.\n Make sure to pass a composition name after the shorthand serve URL or pass the complete serveURL without composition name to get to choose between all compositions.'
+ 'Passing the shorthand serve URL without composition name is currently not supported.\n Make sure to pass a composition name after the shorthand serve URL or pass the complete serveURL without composition name to get to choose between all compositions.',
);
}
@@ -75,7 +75,7 @@ export const stillCommand = async (args: string[], remotionRoot: string) => {
remotionRoot,
logLevel,
webpackConfigOrServeUrl: serveUrl,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
const {compositionId} =
@@ -99,7 +99,7 @@ export const stillCommand = async (args: string[], remotionRoot: string) => {
height,
width,
server,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
composition = compositionId;
}
@@ -128,8 +128,8 @@ export const stillCommand = async (args: string[], remotionRoot: string) => {
Log.info(
CliInternals.chalk.gray(
- `functionName = ${functionName}, imageFormat = ${imageFormat} (${imageFormatReason})`
- )
+ `functionName = ${functionName}, imageFormat = ${imageFormat} (${imageFormatReason})`,
+ ),
);
const res = await renderStillOnLambda({
diff --git a/packages/lambda/src/functions/compositions.ts b/packages/lambda/src/functions/compositions.ts
index 9fe8c9437f..78f9f8a450 100644
--- a/packages/lambda/src/functions/compositions.ts
+++ b/packages/lambda/src/functions/compositions.ts
@@ -14,7 +14,7 @@ type Options = {
export const compositionsHandler = async (
lambdaParams: LambdaPayload,
- options: Options
+ options: Options,
) => {
if (lambdaParams.type !== LambdaRoutines.compositions) {
throw new TypeError('Expected info compositions');
@@ -23,12 +23,12 @@ export const compositionsHandler = async (
if (lambdaParams.version !== VERSION) {
if (!lambdaParams.version) {
throw new Error(
- `Version mismatch: When calling getCompositionsOnLambda(), you called the function ${process.env.AWS_LAMBDA_FUNCTION_NAME} which has the version ${VERSION} but the @remotion/lambda package is an older version. Deploy a new function and use it to call getCompositionsOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`
+ `Version mismatch: When calling getCompositionsOnLambda(), you called the function ${process.env.AWS_LAMBDA_FUNCTION_NAME} which has the version ${VERSION} but the @remotion/lambda package is an older version. Deploy a new function and use it to call getCompositionsOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`,
);
}
throw new Error(
- `Version mismatch: When calling getCompositionsOnLambda(), you passed ${process.env.AWS_LAMBDA_FUNCTION_NAME} as the function, which has the version ${VERSION}, but the @remotion/lambda package you used to invoke the function has version ${lambdaParams.version}. Deploy a new function and use it to call getCompositionsOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`
+ `Version mismatch: When calling getCompositionsOnLambda(), you passed ${process.env.AWS_LAMBDA_FUNCTION_NAME} as the function, which has the version ${VERSION}, but the @remotion/lambda package you used to invoke the function has version ${lambdaParams.version}. Deploy a new function and use it to call getCompositionsOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`,
);
}
@@ -42,7 +42,7 @@ export const compositionsHandler = async (
getBrowserInstance(
lambdaParams.logLevel,
false,
- lambdaParams.chromiumOptions ?? {}
+ lambdaParams.chromiumOptions ?? {},
),
]);
@@ -73,7 +73,7 @@ export const compositionsHandler = async (
indent: false,
browserExecutable: null,
onBrowserLog: null,
- offthreadVideoCacheSize: lambdaParams.offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes: lambdaParams.offthreadVideoCacheSizeInBytes,
});
return Promise.resolve({
diff --git a/packages/lambda/src/functions/helpers/validate-composition.ts b/packages/lambda/src/functions/helpers/validate-composition.ts
index 663392c281..0fab3af79b 100644
--- a/packages/lambda/src/functions/helpers/validate-composition.ts
+++ b/packages/lambda/src/functions/helpers/validate-composition.ts
@@ -22,7 +22,7 @@ type ValidateCompositionOptions = {
forceWidth: number | null;
logLevel: LogLevel;
server: RemotionServer | undefined;
- offthreadVideoCacheSize: number | null;
+ offthreadVideoCacheSizeInBytes: number | null;
};
export const validateComposition = async ({
@@ -38,7 +38,7 @@ export const validateComposition = async ({
forceWidth,
logLevel,
server,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
}: ValidateCompositionOptions): Promise<VideoConfig> => {
const {metadata: comp} = await RenderInternals.internalSelectComposition({
id: composition,
@@ -54,7 +54,7 @@ export const validateComposition = async ({
indent: false,
onBrowserLog: null,
server,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
return {
diff --git a/packages/lambda/src/functions/launch.ts b/packages/lambda/src/functions/launch.ts
index 8e2c5d70ba..3d3ecca02d 100644
--- a/packages/lambda/src/functions/launch.ts
+++ b/packages/lambda/src/functions/launch.ts
@@ -78,7 +78,7 @@ const callFunctionWithRetry = async ({
FunctionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
Payload: JSON.stringify(payload),
InvocationType: 'Event',
- })
+ }),
);
} catch (err) {
if ((err as Error).name === 'ResourceConflictException') {
@@ -102,7 +102,7 @@ const callFunctionWithRetry = async ({
const innerLaunchHandler = async (
params: LambdaPayload,
- options: Options
+ options: Options,
): Promise<PostRenderData> => {
if (params.type !== LambdaRoutines.launch) {
throw new Error('Expected launch type');
@@ -116,13 +116,13 @@ const innerLaunchHandler = async (
const verbose = RenderInternals.isEqualOrBelowLogLevel(
params.logLevel,
- 'verbose'
+ 'verbose',
);
const browserInstance = await getBrowserInstance(
params.logLevel,
false,
- params.chromiumOptions
+ params.chromiumOptions,
);
const inputPropsPromise = decompressInputProps({
@@ -136,7 +136,7 @@ const innerLaunchHandler = async (
const serializedInputPropsWithCustomSchema = await inputPropsPromise;
RenderInternals.Log.info(
'Validating composition, input props:',
- serializedInputPropsWithCustomSchema
+ serializedInputPropsWithCustomSchema,
);
const comp = await validateComposition({
serveUrl: params.serveUrl,
@@ -151,7 +151,7 @@ const innerLaunchHandler = async (
forceWidth: params.forceWidth,
logLevel: params.logLevel,
server: undefined,
- offthreadVideoCacheSize: params.offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes: params.offthreadVideoCacheSizeInBytes,
});
RenderInternals.Log.info('Composition validated, resolved props', comp.props);
@@ -163,7 +163,7 @@ const innerLaunchHandler = async (
Internals.validateDimension(
comp.height,
'height',
- 'passed to a Lambda render'
+ 'passed to a Lambda render',
);
Internals.validateDimension(comp.width, 'width', 'passed to a Lambda render');
@@ -172,17 +172,17 @@ const innerLaunchHandler = async (
RenderInternals.validateConcurrency(
params.concurrencyPerLambda,
- 'concurrencyPerLambda'
+ 'concurrencyPerLambda',
);
const realFrameRange = RenderInternals.getRealFrameRange(
comp.durationInFrames,
- params.frameRange
+ params.frameRange,
);
const frameCount = RenderInternals.getFramesToRender(
realFrameRange,
- params.everyNthFrame
+ params.everyNthFrame,
);
const framesPerLambda =
@@ -197,7 +197,7 @@ const innerLaunchHandler = async (
if (chunkCount > MAX_FUNCTIONS_PER_RENDER) {
throw new Error(
- `Too many functions: This render would cause ${chunkCount} functions to spawn. We limit this amount to ${MAX_FUNCTIONS_PER_RENDER} functions as more would result in diminishing returns. Values set: frameCount = ${frameCount}, framesPerLambda=${framesPerLambda}. See ${DOCS_URL}/docs/lambda/concurrency#too-many-functions for help.`
+ `Too many functions: This render would cause ${chunkCount} functions to spawn. We limit this amount to ${MAX_FUNCTIONS_PER_RENDER} functions as more would result in diminishing returns. Values set: frameCount = ${frameCount}, framesPerLambda=${framesPerLambda}. See ${DOCS_URL}/docs/lambda/concurrency#too-many-functions for help.`,
);
}
@@ -270,14 +270,14 @@ const innerLaunchHandler = async (
version: VERSION,
},
resolvedProps: serializedResolvedProps,
- offthreadVideoCacheSize: params.offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes: params.offthreadVideoCacheSizeInBytes,
};
return payload;
});
RenderInternals.Log.info(
'Render plan: ',
- chunks.map((c, i) => `Chunk ${i} (Frames ${c[0]} - ${c[1]})`).join(', ')
+ chunks.map((c, i) => `Chunk ${i} (Frames ${c[0]} - ${c[1]})`).join(', '),
);
const renderMetadata: RenderMetadata = {
@@ -314,7 +314,7 @@ const innerLaunchHandler = async (
params.bucketName,
typeof params.outName === 'string' || typeof params.outName === 'undefined'
? null
- : params.outName?.s3OutputProvider ?? null
+ : params.outName?.s3OutputProvider ?? null,
);
const output = await findOutputFileInBucket({
@@ -329,7 +329,7 @@ const innerLaunchHandler = async (
console.info(
'Deleting',
{bucketName: renderBucketName, key},
- 'because it already existed and will be overwritten'
+ 'because it already existed and will be overwritten',
);
await lambdaDeleteFile({
bucketName: renderBucketName,
@@ -339,7 +339,7 @@ const innerLaunchHandler = async (
});
} else {
throw new TypeError(
- `Output file "${key}" in bucket "${renderBucketName}" in region "${getCurrentRegionInFunction()}" already exists. Delete it before re-rendering, or use the overwrite option to delete it before render."`
+ `Output file "${key}" in bucket "${renderBucketName}" in region "${getCurrentRegionInFunction()}" already exists. Delete it before re-rendering, or use the overwrite option to delete it before render."`,
);
}
}
@@ -358,7 +358,7 @@ const innerLaunchHandler = async (
await Promise.all(
lambdaPayloads.map(async (payload) => {
await callFunctionWithRetry({payload, retries: 0, functionName});
- })
+ }),
);
reqSend.end();
@@ -420,12 +420,12 @@ const innerLaunchHandler = async (
}:\n${errors[0].stack
.split('\n')
.map((s) => ` ${s}`)
- .join('\n')}`
+ .join('\n')}`,
);
}
throw new Error(
- `Stopping Lambda function because error occurred: ${errors[0].stack}`
+ `Stopping Lambda function because error occurred: ${errors[0].stack}`,
);
};
@@ -527,7 +527,7 @@ const innerLaunchHandler = async (
const outputUrl = getOutputUrlFromMetadata(
renderMetadata,
params.bucketName,
- customCredentials
+ customCredentials,
);
const postRenderData = createPostRenderData({
expectedBucketOwner: options.expectedBucketOwner,
@@ -572,7 +572,7 @@ const innerLaunchHandler = async (
export const launchHandler = async (
params: LambdaPayload,
- options: Options
+ options: Options,
): Promise<{
type: 'success';
}> => {
@@ -581,54 +581,57 @@ export const launchHandler = async (
}
let webhookInvoked = false;
- const webhookDueToTimeout = setTimeout(async () => {
- if (params.webhook && !webhookInvoked) {
- try {
- await invokeWebhook({
- url: params.webhook.url,
- secret: params.webhook.secret,
- payload: {
- type: 'timeout',
+ const webhookDueToTimeout = setTimeout(
+ async () => {
+ if (params.webhook && !webhookInvoked) {
+ try {
+ await invokeWebhook({
+ url: params.webhook.url,
+ secret: params.webhook.secret,
+ payload: {
+ type: 'timeout',
+ renderId: params.renderId,
+ expectedBucketOwner: options.expectedBucketOwner,
+ bucketName: params.bucketName,
+ },
+ });
+ webhookInvoked = true;
+ } catch (err) {
+ if (process.env.NODE_ENV === 'test') {
+ throw err;
+ }
+
+ await writeLambdaError({
+ bucketName: params.bucketName,
+ errorInfo: {
+ type: 'webhook',
+ message: (err as Error).message,
+ name: (err as Error).name as string,
+ stack: (err as Error).stack as string,
+ tmpDir: null,
+ frame: 0,
+ chunk: 0,
+ isFatal: false,
+ attempt: 1,
+ willRetry: false,
+ totalAttempts: 1,
+ },
renderId: params.renderId,
expectedBucketOwner: options.expectedBucketOwner,
- bucketName: params.bucketName,
- },
- });
- webhookInvoked = true;
- } catch (err) {
- if (process.env.NODE_ENV === 'test') {
- throw err;
+ });
+ RenderInternals.Log.error('Failed to invoke webhook:');
+ RenderInternals.Log.error(err);
}
-
- await writeLambdaError({
- bucketName: params.bucketName,
- errorInfo: {
- type: 'webhook',
- message: (err as Error).message,
- name: (err as Error).name as string,
- stack: (err as Error).stack as string,
- tmpDir: null,
- frame: 0,
- chunk: 0,
- isFatal: false,
- attempt: 1,
- willRetry: false,
- totalAttempts: 1,
- },
- renderId: params.renderId,
- expectedBucketOwner: options.expectedBucketOwner,
- });
- RenderInternals.Log.error('Failed to invoke webhook:');
- RenderInternals.Log.error(err);
}
- }
- }, Math.max(options.getRemainingTimeInMillis() - 1000, 1000));
+ },
+ Math.max(options.getRemainingTimeInMillis() - 1000, 1000),
+ );
RenderInternals.Log.info(
`Function has ${Math.max(
options.getRemainingTimeInMillis() - 1000,
- 1000
- )} before it times out`
+ 1000,
+ )} before it times out`,
);
try {
diff --git a/packages/lambda/src/functions/renderer.ts b/packages/lambda/src/functions/renderer.ts
index 35f6c5d42e..3686b57cfb 100644
--- a/packages/lambda/src/functions/renderer.ts
+++ b/packages/lambda/src/functions/renderer.ts
@@ -36,7 +36,7 @@ type Options = {
const renderHandler = async (
params: LambdaPayload,
options: Options,
- logs: BrowserLog[]
+ logs: BrowserLog[],
): Promise<{}> => {
if (params.type !== LambdaRoutines.renderer) {
throw new Error('Params must be renderer');
@@ -44,7 +44,7 @@ const renderHandler = async (
if (params.launchFunctionConfig.version !== VERSION) {
throw new Error(
- `The version of the function that was specified as "rendererFunctionName" is ${VERSION} but the version of the function that invoked the render is ${params.launchFunctionConfig.version}. Please make sure that the version of the function that is specified as "rendererFunctionName" is the same as the version of the function that is invoked.`
+ `The version of the function that was specified as "rendererFunctionName" is ${VERSION} but the version of the function that invoked the render is ${params.launchFunctionConfig.version}. Please make sure that the version of the function that is specified as "rendererFunctionName" is the same as the version of the function that is invoked.`,
);
}
@@ -67,7 +67,7 @@ const renderHandler = async (
const browserInstance = await getBrowserInstance(
params.logLevel,
false,
- params.chromiumOptions ?? {}
+ params.chromiumOptions ?? {},
);
const outputPath = RenderInternals.tmpDir('remotion-render-');
@@ -81,7 +81,7 @@ const renderHandler = async (
}
RenderInternals.Log.verbose(
- `Rendering frames ${params.frameRange[0]}-${params.frameRange[1]} in this Lambda function`
+ `Rendering frames ${params.frameRange[0]}-${params.frameRange[1]} in this Lambda function`,
);
const start = Date.now();
@@ -103,14 +103,14 @@ const renderHandler = async (
outdir,
`localchunk-${String(params.chunk).padStart(
8,
- '0'
+ '0',
)}.${RenderInternals.getFileExtensionFromCodec(
chunkCodec,
RenderInternals.getDefaultAudioCodec({
codec: params.codec,
preferLossless: true,
- })
- )}`
+ }),
+ )}`,
);
const resolvedProps = await resolvedPropsPromise;
@@ -131,7 +131,7 @@ const renderHandler = async (
onProgress: ({renderedFrames, encodedFrames, stitchStage}) => {
if (renderedFrames % 5 === 0) {
RenderInternals.Log.info(
- `Rendered ${renderedFrames} frames, encoded ${encodedFrames} frames, stage = ${stitchStage}`
+ `Rendered ${renderedFrames} frames, encoded ${encodedFrames} frames, stage = ${stitchStage}`,
);
writeLambdaInitializedFile({
attempt: params.attempt,
@@ -146,13 +146,13 @@ const renderHandler = async (
});
} else {
RenderInternals.Log.verbose(
- `Rendered ${renderedFrames} frames, encoded ${encodedFrames} frames, stage = ${stitchStage}`
+ `Rendered ${renderedFrames} frames, encoded ${encodedFrames} frames, stage = ${stitchStage}`,
);
}
const allFrames = RenderInternals.getFramesToRender(
params.frameRange,
- params.everyNthFrame
+ params.everyNthFrame,
);
if (renderedFrames === allFrames.length) {
@@ -211,7 +211,7 @@ const renderHandler = async (
onCtrlCExit: () => undefined,
server: undefined,
serializedResolvedPropsWithCustomSchema: resolvedProps,
- offthreadVideoCacheSize: params.offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes: params.offthreadVideoCacheSizeInBytes,
})
.then(({slowestFrames}) => {
console.log(`Slowest frames:`);
@@ -273,7 +273,7 @@ const renderHandler = async (
export const rendererHandler = async (
params: LambdaPayload,
- options: Options
+ options: Options,
): Promise<{
type: 'success';
}> => {
diff --git a/packages/lambda/src/functions/start.ts b/packages/lambda/src/functions/start.ts
index 355890932f..342f6f0fbd 100644
--- a/packages/lambda/src/functions/start.ts
+++ b/packages/lambda/src/functions/start.ts
@@ -21,12 +21,12 @@ export const startHandler = async (params: LambdaPayload, options: Options) => {
if (params.version !== VERSION) {
if (!params.version) {
throw new Error(
- `Version mismatch: When calling renderMediaOnLambda(), you called the function ${process.env.AWS_LAMBDA_FUNCTION_NAME} which has the version ${VERSION} but the @remotion/lambda package is an older version. Deploy a new function and use it to call renderMediaOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`
+ `Version mismatch: When calling renderMediaOnLambda(), you called the function ${process.env.AWS_LAMBDA_FUNCTION_NAME} which has the version ${VERSION} but the @remotion/lambda package is an older version. Deploy a new function and use it to call renderMediaOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`,
);
}
throw new Error(
- `Version mismatch: When calling renderMediaOnLambda(), you passed ${process.env.AWS_LAMBDA_FUNCTION_NAME} as the function, which has the version ${VERSION}, but the @remotion/lambda package you used to invoke the function has version ${params.version}. Deploy a new function and use it to call renderMediaOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`
+ `Version mismatch: When calling renderMediaOnLambda(), you passed ${process.env.AWS_LAMBDA_FUNCTION_NAME} as the function, which has the version ${VERSION}, but the @remotion/lambda package you used to invoke the function has version ${params.version}. Deploy a new function and use it to call renderMediaOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`,
);
}
@@ -94,7 +94,7 @@ export const startHandler = async (params: LambdaPayload, options: Options) => {
forceWidth: params.forceWidth,
rendererFunctionName: params.rendererFunctionName,
audioCodec: params.audioCodec,
- offthreadVideoCacheSize: params.offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes: params.offthreadVideoCacheSizeInBytes,
};
// Don't replace with callLambda(), we want to return before the render is snone
@@ -103,7 +103,7 @@ export const startHandler = async (params: LambdaPayload, options: Options) => {
FunctionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
Payload: JSON.stringify(payload),
InvocationType: 'Event',
- })
+ }),
);
await initialFile;
diff --git a/packages/lambda/src/functions/still.ts b/packages/lambda/src/functions/still.ts
index da0ade9295..0fab9e9802 100644
--- a/packages/lambda/src/functions/still.ts
+++ b/packages/lambda/src/functions/still.ts
@@ -60,12 +60,12 @@ const innerStillHandler = async ({
if (lambdaParams.version !== VERSION) {
if (!lambdaParams.version) {
throw new Error(
- `Version mismatch: When calling renderStillOnLambda(), you called the function ${process.env.AWS_LAMBDA_FUNCTION_NAME} which has the version ${VERSION} but the @remotion/lambda package is an older version. Deploy a new function and use it to call renderStillOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`
+ `Version mismatch: When calling renderStillOnLambda(), you called the function ${process.env.AWS_LAMBDA_FUNCTION_NAME} which has the version ${VERSION} but the @remotion/lambda package is an older version. Deploy a new function and use it to call renderStillOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`,
);
}
throw new Error(
- `Version mismatch: When calling renderStillOnLambda(), you passed ${process.env.AWS_LAMBDA_FUNCTION_NAME} as the function, which has the version ${VERSION}, but the @remotion/lambda package you used to invoke the function has version ${lambdaParams.version}. Deploy a new function and use it to call renderStillOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`
+ `Version mismatch: When calling renderStillOnLambda(), you passed ${process.env.AWS_LAMBDA_FUNCTION_NAME} as the function, which has the version ${VERSION}, but the @remotion/lambda package you used to invoke the function has version ${lambdaParams.version}. Deploy a new function and use it to call renderStillOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`,
);
}
@@ -83,7 +83,7 @@ const innerStillHandler = async ({
getBrowserInstance(
lambdaParams.logLevel,
false,
- lambdaParams.chromiumOptions ?? {}
+ lambdaParams.chromiumOptions ?? {},
),
]);
@@ -113,7 +113,7 @@ const innerStillHandler = async ({
remotionRoot: process.cwd(),
logLevel: lambdaParams.logLevel,
webpackConfigOrServeUrl: serveUrl,
- offthreadVideoCacheSize: lambdaParams.offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes: lambdaParams.offthreadVideoCacheSizeInBytes,
});
const composition = await validateComposition({
@@ -129,7 +129,7 @@ const innerStillHandler = async ({
forceWidth: lambdaParams.forceWidth,
logLevel: lambdaParams.logLevel,
server,
- offthreadVideoCacheSize: lambdaParams.offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes: lambdaParams.offthreadVideoCacheSizeInBytes,
});
const renderMetadata: RenderMetadata = {
@@ -197,13 +197,13 @@ const innerStillHandler = async ({
staticBase: null,
data: composition.props,
}).serializedString,
- offthreadVideoCacheSize: lambdaParams.offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes: lambdaParams.offthreadVideoCacheSizeInBytes,
});
const {key, renderBucketName, customCredentials} = getExpectedOutName(
renderMetadata,
bucketName,
- getCredentialsFromOutName(lambdaParams.outName)
+ getCredentialsFromOutName(lambdaParams.outName),
);
const {size} = await fs.promises.stat(outputPath);
@@ -244,7 +244,7 @@ const innerStillHandler = async ({
output: getOutputUrlFromMetadata(
renderMetadata,
bucketName,
- customCredentials
+ customCredentials,
),
size,
bucketName,
@@ -263,7 +263,7 @@ type RenderStillLambdaResponsePayload = {
};
export const stillHandler = async (
- options: Options
+ options: Options,
): Promise<RenderStillLambdaResponsePayload> => {
const {params} = options;
diff --git a/packages/lambda/src/shared/constants.ts b/packages/lambda/src/shared/constants.ts
index 685a306bd7..9969e2ee1a 100644
--- a/packages/lambda/src/shared/constants.ts
+++ b/packages/lambda/src/shared/constants.ts
@@ -72,7 +72,7 @@ export const lambdaChunkInitializedKey = ({
chunk: number;
}) =>
`${lambdaChunkInitializedPrefix(
- renderId
+ renderId,
)}-chunk:${chunk}-attempt:${attempt}.txt`;
export const lambdaTimingsPrefix = (renderId: string) =>
`${rendersPrefix(renderId)}/lambda-timings/chunk:`;
@@ -84,11 +84,11 @@ export const lambdaLogsPrefix = (
renderId: string,
chunk: number,
startFrame: number,
- endFrame: number
+ endFrame: number,
) =>
`${rendersPrefix(renderId)}/logs/chunk:${String(chunk).padStart(
8,
- '0'
+ '0',
)}:frames:${startFrame}-${endFrame}.json`;
export const lambdaTimingsKey = ({
@@ -104,7 +104,7 @@ export const lambdaTimingsKey = ({
}) =>
`${lambdaTimingsPrefixForChunk(
renderId,
- chunk
+ chunk,
)}-start:${start}-rendered:${rendered}.txt`;
export const chunkKey = (renderId: string) =>
`${rendersPrefix(renderId)}/chunks/chunk`;
@@ -159,7 +159,7 @@ export const outStillName = (renderId: string, imageFormat: StillImageFormat) =>
export const customOutName = (
renderId: string,
bucketName: string,
- name: OutNameInput
+ name: OutNameInput,
): OutNameOutput => {
if (typeof name === 'string') {
return {
@@ -259,7 +259,7 @@ export type LambdaStartPayload = {
forceHeight: number | null;
forceWidth: number | null;
bucketName: string | null;
- offthreadVideoCacheSize: number | null;
+ offthreadVideoCacheSizeInBytes: number | null;
};
export type LambdaStatusPayload = {
@@ -312,7 +312,7 @@ export type LambdaPayloads = {
webhook: WebhookOption;
forceHeight: number | null;
forceWidth: number | null;
- offthreadVideoCacheSize: number | null;
+ offthreadVideoCacheSizeInBytes: number | null;
};
status: LambdaStatusPayload;
renderer: {
@@ -352,7 +352,7 @@ export type LambdaPayloads = {
launchFunctionConfig: {
version: string;
};
- offthreadVideoCacheSize: number | null;
+ offthreadVideoCacheSizeInBytes: number | null;
};
still: {
type: LambdaRoutines.still;
@@ -376,7 +376,7 @@ export type LambdaPayloads = {
forceHeight: number | null;
forceWidth: number | null;
bucketName: string | null;
- offthreadVideoCacheSize: number | null;
+ offthreadVideoCacheSizeInBytes: number | null;
};
compositions: {
type: LambdaRoutines.compositions;
@@ -388,7 +388,7 @@ export type LambdaPayloads = {
timeoutInMilliseconds: number;
serveUrl: string;
bucketName: string | null;
- offthreadVideoCacheSize: number | null;
+ offthreadVideoCacheSizeInBytes: number | null;
};
};
diff --git a/packages/lambda/src/test/integration/renders/gif.test.ts b/packages/lambda/src/test/integration/renders/gif.test.ts
index 177aec836e..76986a3d83 100644
--- a/packages/lambda/src/test/integration/renders/gif.test.ts
+++ b/packages/lambda/src/test/integration/renders/gif.test.ts
@@ -63,7 +63,7 @@ test('Should make a distributed GIF', async () => {
rendererFunctionName: null,
bucketName: null,
audioCodec: null,
- offthreadVideoCacheSize: null,
+ offthreadVideoCacheSizeInBytes: null,
},
functionName: 'remotion-dev-lambda',
receivedStreamingPayload: () => undefined,
diff --git a/packages/lambda/src/test/integration/renders/old-version.test.ts b/packages/lambda/src/test/integration/renders/old-version.test.ts
index 84f5f379db..3d9c577ba9 100644
--- a/packages/lambda/src/test/integration/renders/old-version.test.ts
+++ b/packages/lambda/src/test/integration/renders/old-version.test.ts
@@ -61,7 +61,7 @@ test('Should fail when using an incompatible version', async () => {
bucketName: 'remotion-dev-render',
audioCodec: null,
renderId: 'test',
- offthreadVideoCacheSize: null,
+ offthreadVideoCacheSizeInBytes: null,
},
functionName: 'remotion-dev-render',
receivedStreamingPayload: () => undefined,
@@ -73,7 +73,7 @@ test('Should fail when using an incompatible version', async () => {
throw new Error('Should not reach this');
} catch (err) {
expect((err as Error).message).toContain(
- 'Incompatible site: When visiting'
+ 'Incompatible site: When visiting',
);
}
});
diff --git a/packages/lambda/src/test/integration/renders/other-bucket.test.ts b/packages/lambda/src/test/integration/renders/other-bucket.test.ts
index 8daf1e986f..dcfa3bdaec 100644
--- a/packages/lambda/src/test/integration/renders/other-bucket.test.ts
+++ b/packages/lambda/src/test/integration/renders/other-bucket.test.ts
@@ -66,7 +66,7 @@ test('Should be able to render to another bucket', async () => {
rendererFunctionName: null,
bucketName: null,
audioCodec: null,
- offthreadVideoCacheSize: null,
+ offthreadVideoCacheSizeInBytes: null,
},
functionName: 'remotion-dev-render',
receivedStreamingPayload: () => undefined,
diff --git a/packages/lambda/src/test/integration/renders/silent-audio.test.ts b/packages/lambda/src/test/integration/renders/silent-audio.test.ts
index 24ba72f62c..63bb14b7a1 100644
--- a/packages/lambda/src/test/integration/renders/silent-audio.test.ts
+++ b/packages/lambda/src/test/integration/renders/silent-audio.test.ts
@@ -62,7 +62,7 @@ test('Should add silent audio if there is no audio', async () => {
rendererFunctionName: null,
bucketName: null,
audioCodec: null,
- offthreadVideoCacheSize: null,
+ offthreadVideoCacheSizeInBytes: null,
},
functionName: 'remotion-dev-render',
receivedStreamingPayload: () => undefined,
diff --git a/packages/lambda/src/test/integration/renders/transparent-webm.test.ts b/packages/lambda/src/test/integration/renders/transparent-webm.test.ts
index fccef8e78d..de7c595de1 100644
--- a/packages/lambda/src/test/integration/renders/transparent-webm.test.ts
+++ b/packages/lambda/src/test/integration/renders/transparent-webm.test.ts
@@ -66,7 +66,7 @@ test('Should make a transparent video', async () => {
rendererFunctionName: null,
bucketName: null,
audioCodec: null,
- offthreadVideoCacheSize: null,
+ offthreadVideoCacheSizeInBytes: null,
},
functionName: 'remotion-dev-render',
receivedStreamingPayload: () => undefined,
diff --git a/packages/lambda/src/test/integration/webhooks.test.ts b/packages/lambda/src/test/integration/webhooks.test.ts
index bd0ec5c7dd..fd4d213848 100644
--- a/packages/lambda/src/test/integration/webhooks.test.ts
+++ b/packages/lambda/src/test/integration/webhooks.test.ts
@@ -22,7 +22,7 @@ beforeEach(() => {
(
_url: string,
_options: unknown,
- cb: (a: {statusCode: number}) => void
+ cb: (a: {statusCode: number}) => void,
) => {
cb({
statusCode: 201,
@@ -31,7 +31,7 @@ beforeEach(() => {
on: () => undefined,
end: () => undefined,
};
- }
+ },
);
});
@@ -102,7 +102,7 @@ describe('Webhooks', () => {
rendererFunctionName: null,
bucketName: null,
audioCodec: null,
- offthreadVideoCacheSize: null,
+ offthreadVideoCacheSizeInBytes: null,
},
functionName: 'remotion-dev-lambda',
receivedStreamingPayload: () => undefined,
@@ -140,7 +140,7 @@ describe('Webhooks', () => {
},
timeout: 5000,
},
- expect.anything()
+ expect.anything(),
);
});
@@ -153,7 +153,7 @@ describe('Webhooks', () => {
region: 'us-east-1',
type: LambdaRoutines.launch,
payload: {
- offthreadVideoCacheSize: null,
+ offthreadVideoCacheSizeInBytes: null,
serveUrl:
'https://64d3734a6bb69052c34d3616--spiffy-kelpie-71657b.netlify.app/',
chromiumOptions: {},
@@ -217,7 +217,7 @@ describe('Webhooks', () => {
},
timeout: 5000,
},
- expect.anything()
+ expect.anything(),
);
});
});
diff --git a/packages/renderer/src/get-compositions.ts b/packages/renderer/src/get-compositions.ts
index 5f77acc2d6..62f11ab886 100644
--- a/packages/renderer/src/get-compositions.ts
+++ b/packages/renderer/src/get-compositions.ts
@@ -44,7 +44,7 @@ export type GetCompositionsOptions = {
chromiumOptions?: ChromiumOptions;
port?: number | null;
logLevel?: LogLevel;
- offthreadVideoCacheSize?: number | null;
+ offthreadVideoCacheSizeInBytes?: number | null;
};
type InnerGetCompositionsParams = {
@@ -156,7 +156,7 @@ export const internalGetCompositions = async ({
server,
timeoutInMilliseconds,
logLevel,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
}: InternalGetCompositionsOptions) => {
const {page, cleanup: cleanupPage} = await getPageAndCleanupFn({
passedInInstance: puppeteerInstance,
@@ -190,7 +190,7 @@ export const internalGetCompositions = async ({
concurrency: 1,
logLevel,
indent,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
},
{
onDownload: () => undefined,
@@ -265,6 +265,7 @@ export const getCompositions = (
server: undefined,
timeoutInMilliseconds: timeoutInMilliseconds ?? DEFAULT_TIMEOUT,
logLevel: logLevel ?? getLogLevel(),
- offthreadVideoCacheSize: config?.offthreadVideoCacheSize ?? null,
+ offthreadVideoCacheSizeInBytes:
+ config?.offthreadVideoCacheSizeInBytes ?? null,
});
};
diff --git a/packages/renderer/src/options/offthreadvideo-cache-size.tsx b/packages/renderer/src/options/offthreadvideo-cache-size.tsx
index 54f9a33c0a..f316a61124 100644
--- a/packages/renderer/src/options/offthreadvideo-cache-size.tsx
+++ b/packages/renderer/src/options/offthreadvideo-cache-size.tsx
@@ -18,7 +18,7 @@ export const offthreadVideoCacheSizeOption = {
Default: <code>null</code>
</>
),
- ssrName: 'offthreadVideoCacheSize' as const,
+ ssrName: 'offthreadVideoCacheSizeInBytes' as const,
docLink: 'https://www.remotion.dev/docs/offthreadvideo',
type: 0 as number | null,
} satisfies AnyRemotionOption;
diff --git a/packages/renderer/src/prepare-server.ts b/packages/renderer/src/prepare-server.ts
index 5e71bb23f7..7058b0356a 100644
--- a/packages/renderer/src/prepare-server.ts
+++ b/packages/renderer/src/prepare-server.ts
@@ -34,7 +34,7 @@ type PrepareServerOptions = {
concurrency: number;
logLevel: LogLevel;
indent: boolean;
- offthreadVideoCacheSize: number | null;
+ offthreadVideoCacheSizeInBytes: number | null;
};
export const prepareServer = async ({
@@ -44,13 +44,13 @@ export const prepareServer = async ({
concurrency,
logLevel,
indent,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
}: PrepareServerOptions): Promise<RemotionServer> => {
const downloadMap = makeDownloadMap();
Log.verboseAdvanced(
{indent, logLevel},
'Created directory for temporary files',
- downloadMap.assetDir
+ downloadMap.assetDir,
);
if (isServeUrl(webpackConfigOrServeUrl)) {
@@ -65,7 +65,7 @@ export const prepareServer = async ({
concurrency,
logLevel,
indent,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
return Promise.resolve({
@@ -77,12 +77,12 @@ export const prepareServer = async ({
offthreadPort,
compositor: comp,
sourceMap: getSourceMapFromRemoteUrl(
- getBundleMapUrlFromServeUrl(webpackConfigOrServeUrl)
+ getBundleMapUrlFromServeUrl(webpackConfigOrServeUrl),
).catch((err) => {
Log.verbose(
'Could not fetch sourcemap for ',
webpackConfigOrServeUrl,
- err
+ err,
);
return null;
}),
@@ -95,12 +95,12 @@ export const prepareServer = async ({
const exists = existsSync(indexFile);
if (!exists) {
throw new Error(
- `Tried to serve the Webpack bundle on a HTTP server, but the file ${indexFile} does not exist. Is this a valid path to a Webpack bundle?`
+ `Tried to serve the Webpack bundle on a HTTP server, but the file ${indexFile} does not exist. Is this a valid path to a Webpack bundle?`,
);
}
const sourceMap = getSourceMapFromLocalFile(
- path.join(webpackConfigOrServeUrl, Internals.bundleName)
+ path.join(webpackConfigOrServeUrl, Internals.bundleName),
);
const {
@@ -114,7 +114,7 @@ export const prepareServer = async ({
concurrency,
logLevel,
indent,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
return Promise.resolve({
@@ -144,7 +144,7 @@ export const makeOrReuseServer = async (
}: {
onError: (err: Error) => void;
onDownload: RenderMediaOnDownload | null;
- }
+ },
): Promise<{
server: RemotionServer;
cleanupServer: (force: boolean) => Promise<unknown>;
@@ -152,14 +152,14 @@ export const makeOrReuseServer = async (
if (server) {
const cleanupOnDownload = attachDownloadListenerToEmitter(
server.downloadMap,
- onDownload
+ onDownload,
);
const cleanupError = server.downloadMap.emitter.addEventListener(
'error',
({detail: {error}}) => {
onError(error);
- }
+ },
);
return {
@@ -176,14 +176,14 @@ export const makeOrReuseServer = async (
const cleanupOnDownloadNew = attachDownloadListenerToEmitter(
newServer.downloadMap,
- onDownload
+ onDownload,
);
const cleanupErrorNew = newServer.downloadMap.emitter.addEventListener(
'error',
({detail: {error}}) => {
onError(error);
- }
+ },
);
return {
diff --git a/packages/renderer/src/render-frames.ts b/packages/renderer/src/render-frames.ts
index ff198676d7..471b4e7c44 100644
--- a/packages/renderer/src/render-frames.ts
+++ b/packages/renderer/src/render-frames.ts
@@ -171,7 +171,7 @@ export type RenderFramesOptions = {
muted?: boolean;
concurrency?: number | string | null;
serveUrl: string;
- offthreadVideoCacheSize?: number | null;
+ offthreadVideoCacheSizeInBytes?: number | null;
};
const innerRenderFrames = async ({
@@ -597,7 +597,7 @@ export const internalRenderFrames = ({
webpackBundleOrServeUrl,
serializedInputPropsWithCustomSchema,
serializedResolvedPropsWithCustomSchema,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
}: InternalRenderFramesOptions): Promise<RenderFramesOutput> => {
Internals.validateDimension(
composition.height,
@@ -662,7 +662,7 @@ export const internalRenderFrames = ({
concurrency: actualConcurrency,
logLevel,
indent,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
},
{
onDownload,
@@ -790,7 +790,7 @@ export const renderFrames = (
verbose,
quality,
logLevel,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
} = options;
if (!composition) {
@@ -848,6 +848,6 @@ export const renderFrames = (
timeoutInMilliseconds: timeoutInMilliseconds ?? DEFAULT_TIMEOUT,
webpackBundleOrServeUrl: serveUrl,
server: undefined,
- offthreadVideoCacheSize: offthreadVideoCacheSize ?? null,
+ offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes ?? null,
});
};
diff --git a/packages/renderer/src/render-media.ts b/packages/renderer/src/render-media.ts
index 4982dea4c9..c4cd7fdf09 100644
--- a/packages/renderer/src/render-media.ts
+++ b/packages/renderer/src/render-media.ts
@@ -174,7 +174,7 @@ export type RenderMediaOptions = {
serveUrl: string;
concurrency?: number | string | null;
logLevel?: LogLevel;
- offthreadVideoCacheSize?: number | null;
+ offthreadVideoCacheSizeInBytes?: number | null;
};
type Await<T> = T extends PromiseLike<infer U> ? U : T;
@@ -226,7 +226,7 @@ export const internalRenderMedia = ({
server: reusedServer,
logLevel,
serializedResolvedPropsWithCustomSchema,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
}: InternalRenderMediaOptions): Promise<RenderMediaResult> => {
validateJpegQuality(jpegQuality);
validateQualitySettings({crf, codec, videoBitrate});
@@ -489,7 +489,8 @@ export const internalRenderMedia = ({
remotionRoot: findRemotionRoot(),
logLevel,
webpackConfigOrServeUrl: serveUrl,
- offthreadVideoCacheSize: offthreadVideoCacheSize ?? null,
+ offthreadVideoCacheSizeInBytes:
+ offthreadVideoCacheSizeInBytes ?? null,
},
{
onDownload,
@@ -568,7 +569,7 @@ export const internalRenderMedia = ({
indent,
server,
serializedResolvedPropsWithCustomSchema,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
return renderFramesProc;
@@ -738,7 +739,7 @@ export const renderMedia = ({
verbose,
quality,
logLevel,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
}: RenderMediaOptions): Promise<RenderMediaResult> => {
if (quality !== undefined) {
console.warn(
@@ -797,6 +798,6 @@ export const renderMedia = ({
staticBase: null,
data: composition.props ?? {},
}).serializedString,
- offthreadVideoCacheSize: offthreadVideoCacheSize ?? null,
+ offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes ?? null,
});
};
diff --git a/packages/renderer/src/render-still.ts b/packages/renderer/src/render-still.ts
index fee3d7d631..e4da22b68e 100644
--- a/packages/renderer/src/render-still.ts
+++ b/packages/renderer/src/render-still.ts
@@ -63,7 +63,7 @@ type InternalRenderStillOptions = {
logLevel: LogLevel;
serveUrl: string;
port: number | null;
- offthreadVideoCacheSize: number | null;
+ offthreadVideoCacheSizeInBytes: number | null;
} & ToOptions<typeof optionsMap.renderStill>;
export type RenderStillOptions = {
@@ -97,7 +97,7 @@ export type RenderStillOptions = {
* @deprecated Renamed to `jpegQuality`
*/
quality?: never;
- offthreadVideoCacheSize?: number | null;
+ offthreadVideoCacheSizeInBytes?: number | null;
};
type CleanupFn = () => void;
@@ -344,7 +344,7 @@ export const internalRenderStill = (
concurrency: 1,
logLevel: options.logLevel,
indent: options.indent,
- offthreadVideoCacheSize: options.offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes: options.offthreadVideoCacheSizeInBytes,
},
{
onDownload: options.onDownload,
@@ -416,7 +416,7 @@ export const renderStill = (
timeoutInMilliseconds,
verbose,
quality,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
} = options;
if (typeof jpegQuality !== 'undefined' && imageFormat !== 'jpeg') {
@@ -462,6 +462,6 @@ export const renderStill = (
staticBase: null,
data: composition.props ?? {},
}).serializedString,
- offthreadVideoCacheSize: offthreadVideoCacheSize ?? null,
+ offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes ?? null,
});
};
diff --git a/packages/renderer/src/select-composition.ts b/packages/renderer/src/select-composition.ts
index 9d7eb3e2cf..ccaed80cf0 100644
--- a/packages/renderer/src/select-composition.ts
+++ b/packages/renderer/src/select-composition.ts
@@ -45,7 +45,7 @@ export type SelectCompositionOptions = {
chromiumOptions?: ChromiumOptions;
port?: number | null;
verbose?: boolean;
- offthreadVideoCacheSize?: number | null;
+ offthreadVideoCacheSizeInBytes?: number | null;
serveUrl: string;
id: string;
};
@@ -184,7 +184,7 @@ export const internalSelectComposition = async (
onBrowserLog,
server,
timeoutInMilliseconds,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
} = options;
const {page, cleanup: cleanupPage} = await getPageAndCleanupFn({
@@ -218,7 +218,7 @@ export const internalSelectComposition = async (
concurrency: 1,
logLevel,
indent,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
},
{
onDownload: () => undefined,
@@ -244,7 +244,7 @@ export const internalSelectComposition = async (
indent,
puppeteerInstance,
server,
- offthreadVideoCacheSize,
+ offthreadVideoCacheSizeInBytes,
});
})
@@ -301,7 +301,8 @@ export const selectComposition = async (
logLevel: verbose ? 'verbose' : 'info',
indent: false,
server: undefined,
- offthreadVideoCacheSize: options.offthreadVideoCacheSize ?? null,
+ offthreadVideoCacheSizeInBytes:
+ options.offthreadVideoCacheSizeInBytes ?? null,
});
return data.metadata;
};
diff --git a/packages/renderer/src/serve-static.ts b/packages/renderer/src/serve-static.ts
index d4ce9ed2c6..9f7e61df7c 100644
--- a/packages/renderer/src/serve-static.ts
+++ b/packages/renderer/src/serve-static.ts
@@ -16,8 +16,8 @@ export const serveStatic = async (
concurrency: number;
logLevel: LogLevel;
indent: boolean;
- offthreadVideoCacheSize: number | null;
- }
+ offthreadVideoCacheSizeInBytes: number | null;
+ },
): Promise<{
port: number;
close: () => Promise<void>;
@@ -32,7 +32,7 @@ export const serveStatic = async (
concurrency: options.concurrency,
logLevel: options.logLevel,
indent: options.indent,
- offthreadVideoCacheSize: options.offthreadVideoCacheSize,
+ offthreadVideoCacheSize: options.offthreadVideoCacheSizeInBytes,
});
const connections: Record<string, Socket> = {};