Skip to content

πŸŽ₯ Make videos programmatically with React

prettier

Jonny Burgere2cebfd0eff7
diff --git a/packages/cli/src/index.tsx b/packages/cli/src/index.tsx
index 95faa7dea4..8c3cb56427 100644
--- a/packages/cli/src/index.tsx
+++ b/packages/cli/src/index.tsx
@@ -79,7 +79,7 @@ export const cli = async () => {
await upgrade(
remotionRoot,
parsedCli['package-manager'],
- parsedCli.version
+ parsedCli.version,
);
} else if (command === VERSIONS_COMMAND) {
await versionsCommand(remotionRoot);
diff --git a/packages/cloudrun/src/api/deploy-site.ts b/packages/cloudrun/src/api/deploy-site.ts
index 335421b1cd..fd548d6f68 100644
--- a/packages/cloudrun/src/api/deploy-site.ts
+++ b/packages/cloudrun/src/api/deploy-site.ts
@@ -94,7 +94,7 @@ const deploySiteRaw = async ({
bucketName,
key: d.name as string,
});
- })
+ }),
),
]);
diff --git a/packages/cloudrun/src/api/render-media-on-cloudrun.ts b/packages/cloudrun/src/api/render-media-on-cloudrun.ts
index c5dddf4640..824d9eef6a 100644
--- a/packages/cloudrun/src/api/render-media-on-cloudrun.ts
+++ b/packages/cloudrun/src/api/render-media-on-cloudrun.ts
@@ -277,5 +277,5 @@ const renderMediaOnCloudrunRaw = async ({
*/
export const renderMediaOnCloudrun = BrowserSafeApis.wrapWithErrorHandling(
- renderMediaOnCloudrunRaw
+ renderMediaOnCloudrunRaw,
) as typeof renderMediaOnCloudrunRaw;
diff --git a/packages/cloudrun/src/api/render-still-on-cloudrun.ts b/packages/cloudrun/src/api/render-still-on-cloudrun.ts
index 73bd173cd6..0f346e914a 100644
--- a/packages/cloudrun/src/api/render-still-on-cloudrun.ts
+++ b/packages/cloudrun/src/api/render-still-on-cloudrun.ts
@@ -205,5 +205,5 @@ const renderStillOnCloudrunRaw = async ({
};
export const renderStillOnCloudrun = BrowserSafeApis.wrapWithErrorHandling(
- renderStillOnCloudrunRaw
+ renderStillOnCloudrunRaw,
) as typeof renderStillOnCloudrunRaw;
diff --git a/packages/lambda/src/api/deploy-function.ts b/packages/lambda/src/api/deploy-function.ts
index 82439e77f2..1dd70a4b4e 100644
--- a/packages/lambda/src/api/deploy-function.ts
+++ b/packages/lambda/src/api/deploy-function.ts
@@ -34,7 +34,7 @@ export type DeployFunctionOutput = {
};
const deployFunctionRaw = async (
- params: DeployFunctionInput
+ params: DeployFunctionInput,
): Promise<DeployFunctionOutput> => {
const diskSizeInMb = params.diskSizeInMb ?? DEFAULT_EPHEMERAL_STORAGE_IN_MB;
@@ -63,7 +63,7 @@ const deployFunctionRaw = async (
f.version === VERSION &&
f.memorySizeInMb === params.memorySizeInMb &&
f.timeoutInSeconds === params.timeoutInSeconds &&
- f.diskSizeInMb === diskSizeInMb
+ f.diskSizeInMb === diskSizeInMb,
);
const created = await createFunction({
@@ -106,5 +106,5 @@ const deployFunctionRaw = async (
*/
export const deployFunction = BrowserSafeApis.wrapWithErrorHandling(
- deployFunctionRaw
+ deployFunctionRaw,
) as typeof deployFunctionRaw;
diff --git a/packages/lambda/src/api/deploy-site.ts b/packages/lambda/src/api/deploy-site.ts
index 34b84284dd..f71bbeccdc 100644
--- a/packages/lambda/src/api/deploy-site.ts
+++ b/packages/lambda/src/api/deploy-site.ts
@@ -120,7 +120,7 @@ const deploySiteRaw = async ({
key: d.Key as string,
region,
});
- })
+ }),
),
]);
@@ -151,5 +151,5 @@ const deploySiteRaw = async ({
* @param {object} params.options Further options, see documentation page for this function.
*/
export const deploySite = BrowserSafeApis.wrapWithErrorHandling(
- deploySiteRaw
+ deploySiteRaw,
) as typeof deploySiteRaw;
diff --git a/packages/lambda/src/api/render-media-on-lambda.ts b/packages/lambda/src/api/render-media-on-lambda.ts
index c41f16d874..e3a0faab95 100644
--- a/packages/lambda/src/api/render-media-on-lambda.ts
+++ b/packages/lambda/src/api/render-media-on-lambda.ts
@@ -77,7 +77,7 @@ export type RenderMediaOnLambdaOutput = {
};
const renderMediaOnLambdaRaw = async (
- input: RenderMediaOnLambdaInput
+ input: RenderMediaOnLambdaInput,
): Promise<RenderMediaOnLambdaOutput> => {
const {functionName, region, rendererFunctionName} = input;
@@ -110,7 +110,7 @@ const renderMediaOnLambdaRaw = async (
} catch (err) {
if ((err as Error).stack?.includes('UnrecognizedClientException')) {
throw new Error(
- 'UnrecognizedClientException: The AWS credentials provided were probably mixed up. Learn how to fix this issue here: https://remotion.dev/docs/lambda/troubleshooting/unrecognizedclientexception'
+ 'UnrecognizedClientException: The AWS credentials provided were probably mixed up. Learn how to fix this issue here: https://remotion.dev/docs/lambda/troubleshooting/unrecognizedclientexception',
);
}
@@ -138,7 +138,7 @@ const renderMediaOnLambdaRaw = async (
* @returns {Promise<RenderMediaOnLambdaOutput>} See documentation for detailed structure
*/
export const renderMediaOnLambda = BrowserSafeApis.wrapWithErrorHandling(
- renderMediaOnLambdaRaw
+ renderMediaOnLambdaRaw,
) as typeof renderMediaOnLambdaRaw;
/**
diff --git a/packages/lambda/src/api/render-still-on-lambda.ts b/packages/lambda/src/api/render-still-on-lambda.ts
index a66c46d673..28863aa10e 100644
--- a/packages/lambda/src/api/render-still-on-lambda.ts
+++ b/packages/lambda/src/api/render-still-on-lambda.ts
@@ -87,7 +87,7 @@ const renderStillOnLambdaRaw = async ({
}: RenderStillOnLambdaInput): Promise<RenderStillOnLambdaOutput> => {
if (quality) {
throw new Error(
- 'The `quality` option is deprecated. Use `jpegQuality` instead.'
+ 'The `quality` option is deprecated. Use `jpegQuality` instead.',
);
}
@@ -164,7 +164,7 @@ const renderStillOnLambdaRaw = async ({
} catch (err) {
if ((err as Error).stack?.includes('UnrecognizedClientException')) {
throw new Error(
- 'UnrecognizedClientException: The AWS credentials provided were probably mixed up. Learn how to fix this issue here: https://remotion.dev/docs/lambda/troubleshooting/unrecognizedclientexception'
+ 'UnrecognizedClientException: The AWS credentials provided were probably mixed up. Learn how to fix this issue here: https://remotion.dev/docs/lambda/troubleshooting/unrecognizedclientexception',
);
}
@@ -189,5 +189,5 @@ const renderStillOnLambdaRaw = async ({
* @returns {Promise<RenderStillOnLambdaOutput>} See documentation for exact response structure.
*/
export const renderStillOnLambda = BrowserSafeApis.wrapWithErrorHandling(
- renderStillOnLambdaRaw
+ renderStillOnLambdaRaw,
) as typeof renderStillOnLambdaRaw;
diff --git a/packages/lambda/src/cli/commands/render/render.ts b/packages/lambda/src/cli/commands/render/render.ts
index e51b69f36b..4bcb5b58eb 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);
}
@@ -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.',
);
}
@@ -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/index.ts b/packages/lambda/src/cli/index.ts
index 145f3be711..3ac6188d65 100644
--- a/packages/lambda/src/cli/index.ts
+++ b/packages/lambda/src/cli/index.ts
@@ -126,7 +126,7 @@ export const executeCommand = async (args: string[], remotionRoot: string) => {
const error = err as Error;
if (
error.message.includes(
- 'The role defined for the function cannot be assumed by Lambda'
+ 'The role defined for the function cannot be assumed by Lambda',
)
) {
if (parsedLambdaCli['custom-role-arn']) {
@@ -137,7 +137,7 @@ export const executeCommand = async (args: string[], remotionRoot: string) => {
- Make sure the role has the same policy assigned as the one returned by "npx ${BINARY_NAME} ${POLICIES_COMMAND} ${ROLE_SUBCOMMAND}"
Revisit ${DOCS_URL}/docs/lambda/setup and make sure you set up the role and role policy correctly. Also see the troubleshooting page: ${DOCS_URL}/docs/lambda/troubleshooting/permissions. The original error message is:
- `.trim()
+ `.trim(),
);
}
@@ -148,7 +148,7 @@ The role "${ROLE_NAME}" does not exist in your AWS account or has the wrong poli
- The policy is not exactly as specified in the setup guide
Revisit ${DOCS_URL}/docs/lambda/setup and make sure you set up the role and role policy correctly. Also see the troubleshooting page: ${DOCS_URL}/docs/lambda/troubleshooting/permissions. The original error message is:
-`.trim()
+`.trim(),
);
}
@@ -156,7 +156,7 @@ Revisit ${DOCS_URL}/docs/lambda/setup and make sure you set up the role and role
Log.error(
`
AWS returned an "AccessDenied" error message meaning a permission is missing. Read the permissions troubleshooting page: ${DOCS_URL}/docs/lambda/troubleshooting/permissions. The original error message is:
-`.trim()
+`.trim(),
);
}
@@ -164,26 +164,26 @@ AWS returned an "AccessDenied" error message meaning a permission is missing. Re
Log.error(
`
AWS returned an "TooManyRequestsException" error message which could mean you reached the concurrency limit of AWS Lambda. You can increase the limit - read this troubleshooting page: ${DOCS_URL}/docs/lambda/troubleshooting/rate-limit. The original error message is:
-`.trim()
+`.trim(),
);
}
if (
error.stack?.includes(
- 'The security token included in the request is invalid'
+ 'The security token included in the request is invalid',
)
) {
Log.error(
`
AWS returned an error message "The security token included in the request is invalid". A possible reason for this is that you did not enable the region in your AWS account under "Account". The original message is:
-`
+`,
);
}
if (error instanceof RenderInternals.SymbolicateableError) {
await CliInternals.printError(
error,
- ConfigInternals.Logging.getLogLevel()
+ ConfigInternals.Logging.getLogLevel(),
);
} else {
const frames = RenderInternals.parseStack(error.stack?.split('\n') ?? []);
@@ -197,7 +197,7 @@ AWS returned an error message "The security token included in the request is inv
});
await CliInternals.printError(
errorWithStackFrame,
- ConfigInternals.Logging.getLogLevel()
+ ConfigInternals.Logging.getLogLevel(),
);
}
diff --git a/packages/renderer/src/get-compositions.ts b/packages/renderer/src/get-compositions.ts
index 61f007a733..8d7bf89347 100644
--- a/packages/renderer/src/get-compositions.ts
+++ b/packages/renderer/src/get-compositions.ts
@@ -133,10 +133,10 @@ const innerGetCompositions = async ({
fps,
durationInFrames,
props: Internals.deserializeJSONWithCustomFields(
- r.serializedResolvedPropsWithCustomSchema
+ r.serializedResolvedPropsWithCustomSchema,
),
defaultProps: Internals.deserializeJSONWithCustomFields(
- r.serializedDefaultPropsWithCustomSchema
+ r.serializedDefaultPropsWithCustomSchema,
),
};
});
@@ -179,7 +179,7 @@ const internalGetCompositionsRaw = async ({
page,
frame: null,
onError,
- })
+ }),
);
makeOrReuseServer(
@@ -196,7 +196,7 @@ const internalGetCompositionsRaw = async ({
{
onDownload: () => undefined,
onError,
- }
+ },
)
.then(({server: {serveUrl, offthreadPort, sourceMap}, cleanupServer}) => {
page.setBrowserSourceMapContext(sourceMap);
@@ -231,7 +231,7 @@ const internalGetCompositionsRaw = async ({
};
export const internalGetCompositions = BrowserSafeApis.wrapWithErrorHandling(
- internalGetCompositionsRaw
+ internalGetCompositionsRaw,
);
/**
@@ -240,7 +240,7 @@ export const internalGetCompositions = BrowserSafeApis.wrapWithErrorHandling(
*/
export const getCompositions = (
serveUrlOrWebpackUrl: string,
- config?: GetCompositionsOptions
+ config?: GetCompositionsOptions,
): Promise<VideoConfig[]> => {
const {
browserExecutable,
diff --git a/packages/renderer/src/print-useful-error-message.ts b/packages/renderer/src/print-useful-error-message.ts
index 14a7b502a7..89cacf6e0d 100644
--- a/packages/renderer/src/print-useful-error-message.ts
+++ b/packages/renderer/src/print-useful-error-message.ts
@@ -14,7 +14,7 @@ export const printUsefulErrorMessage = (err: Error) => {
if (err.message.includes('Could not play video with')) {
Log.info();
Log.info(
- 'πŸ’‘ Get help for this issue at https://remotion.dev/docs/media-playback-error'
+ 'πŸ’‘ Get help for this issue at https://remotion.dev/docs/media-playback-error',
);
}
@@ -29,24 +29,24 @@ export const printUsefulErrorMessage = (err: Error) => {
if (err.message.includes('Target closed')) {
Log.info();
Log.info(
- 'πŸ’‘ Get help for this issue at https://remotion.dev/docs/target-closed'
+ 'πŸ’‘ Get help for this issue at https://remotion.dev/docs/target-closed',
);
}
if (err.message.includes('ENAMETOOLONG')) {
Log.info();
Log.info(
- 'πŸ’‘ Get help for this issue at https://remotion.dev/docs/enametoolong'
+ 'πŸ’‘ Get help for this issue at https://remotion.dev/docs/enametoolong',
);
}
if (err.message.includes('Error creating WebGL context')) {
Log.info();
Log.warn(
- 'πŸ’‘ You might need to set the OpenGL renderer to "angle" (or "swangle" if rendering on lambda). Learn why at https://www.remotion.dev/docs/three'
+ 'πŸ’‘ You might need to set the OpenGL renderer to "angle" (or "swangle" if rendering on lambda). Learn why at https://www.remotion.dev/docs/three',
);
Log.warn(
- "πŸ’‘ Check how it's done at https://www.remotion.dev/docs/chromium-flags#--gl"
+ "πŸ’‘ Check how it's done at https://www.remotion.dev/docs/chromium-flags#--gl",
);
}
@@ -54,8 +54,8 @@ export const printUsefulErrorMessage = (err: Error) => {
Log.info();
Log.info(
chalk.green(
- 'πŸ’‘ Fix this issue https://remotion.dev/docs/lambda/troubleshooting/bucket-disallows-acl'
- )
+ 'πŸ’‘ Fix this issue https://remotion.dev/docs/lambda/troubleshooting/bucket-disallows-acl',
+ ),
);
}
@@ -68,25 +68,25 @@ export const printUsefulErrorMessage = (err: Error) => {
'you are trying to render is not imported correctly.',
]
.filter(truthy)
- .join(' ')
+ .join(' '),
);
Log.info();
Log.info(
- ' Check the root file and ensure that the component is not undefined.'
+ ' Check the root file and ensure that the component is not undefined.',
);
Log.info(
- ' Oftentimes, this happens if the component is missing the `export` keyword'
+ ' Oftentimes, this happens if the component is missing the `export` keyword',
);
Log.info(
- ' or if the component was renamed and the import statement not properly adjusted.'
+ ' or if the component was renamed and the import statement not properly adjusted.',
);
}
if (err.message.includes('GLIBC_')) {
Log.info('πŸ’‘ Remotion requires at least Libc 2.35.');
Log.info(
- 'πŸ’‘ Get help for this issue: https://github.com/remotion-dev/remotion/issues/2439'
+ 'πŸ’‘ Get help for this issue: https://github.com/remotion-dev/remotion/issues/2439',
);
}
diff --git a/packages/renderer/src/render-frames.ts b/packages/renderer/src/render-frames.ts
index 3580a585a2..a61b8aa38b 100644
--- a/packages/renderer/src/render-frames.ts
+++ b/packages/renderer/src/render-frames.ts
@@ -63,7 +63,7 @@ export type InternalRenderFramesOptions = {
| ((
framesRendered: number,
frameIndex: number,
- timeToRenderInMilliseconds: number
+ timeToRenderInMilliseconds: number,
) => void);
outputDir: string | null;
envVariables: Record<string, string>;
@@ -99,7 +99,7 @@ type InnerRenderFramesOptions = {
| ((
framesRendered: number,
frameIndex: number,
- timeToRenderInMilliseconds: number
+ timeToRenderInMilliseconds: number,
) => void);
outputDir: string | null;
envVariables: Record<string, string>;
@@ -136,7 +136,7 @@ export type RenderFramesOptions = {
onFrameUpdate: (
framesRendered: number,
frameIndex: number,
- timeToRenderInMilliseconds: number
+ timeToRenderInMilliseconds: number,
) => void;
outputDir: string | null;
inputProps: Record<string, unknown>;
@@ -219,7 +219,7 @@ const innerRenderFrames = async ({
const realFrameRange = getRealFrameRange(
composition.durationInFrames,
- frameRange
+ frameRange,
);
const framesToRender = getFramesToRender(realFrameRange, everyNthFrame);
@@ -273,7 +273,7 @@ const innerRenderFrames = async ({
durationInFrames: number,
fps: number,
height: number,
- width: number
+ width: number,
) => {
window.remotion_setBundleMode({
type: 'composition',
@@ -330,7 +330,7 @@ const innerRenderFrames = async ({
});
const assets: TRenderAsset[][] = new Array(framesToRender.length).fill(
- undefined
+ undefined,
);
let stopped = false;
cancelSignal?.(() => {
@@ -388,13 +388,13 @@ const innerRenderFrames = async ({
if (!outputDir && !onFrameBuffer && imageFormat !== 'none') {
throw new Error(
- 'Called renderFrames() without specifying either `outputDir` or `onFrameBuffer`'
+ 'Called renderFrames() without specifying either `outputDir` or `onFrameBuffer`',
);
}
if (outputDir && onFrameBuffer && imageFormat !== 'none') {
throw new Error(
- 'Pass either `outputDir` or `onFrameBuffer` to renderFrames(), not both.'
+ 'Pass either `outputDir` or `onFrameBuffer` to renderFrames(), not both.',
);
}
@@ -416,7 +416,7 @@ const innerRenderFrames = async ({
countType,
lastFrame,
totalFrames: framesToRender.length,
- })
+ }),
),
jpegQuality,
width,
@@ -436,7 +436,7 @@ const innerRenderFrames = async ({
stopPerfMeasure(id);
const compressedAssets = collectedAssets.map((asset) =>
- compressAsset(assets.filter(truthy).flat(1), asset)
+ compressAsset(assets.filter(truthy).flat(1), asset),
);
assets[index] = compressedAssets;
compressedAssets.forEach((renderAsset) => {
@@ -446,7 +446,7 @@ const innerRenderFrames = async ({
downloadMap,
}).catch((err) => {
onError(
- new Error(`Error while downloading asset: ${(err as Error).stack}`)
+ new Error(`Error while downloading asset: ${(err as Error).stack}`),
);
});
});
@@ -511,13 +511,13 @@ const innerRenderFrames = async ({
if (retriesLeft === 0) {
console.warn(
- `The browser crashed ${attempt} times while rendering frame ${frame}. Not retrying anymore. Learn more about this error under https://www.remotion.dev/docs/target-closed`
+ `The browser crashed ${attempt} times while rendering frame ${frame}. Not retrying anymore. Learn more about this error under https://www.remotion.dev/docs/target-closed`,
);
throw err;
}
console.warn(
- `The browser crashed while rendering frame ${frame}, retrying ${retriesLeft} more times. Learn more about this error under https://www.remotion.dev/docs/target-closed`
+ `The browser crashed while rendering frame ${frame}, retrying ${retriesLeft} more times. Learn more about this error under https://www.remotion.dev/docs/target-closed`,
);
await browserReplacer.replaceBrowser(makeBrowser, async () => {
const pages = new Array(actualConcurrency)
@@ -545,8 +545,8 @@ const innerRenderFrames = async ({
index,
retriesLeft: MAX_RETRIES_PER_FRAME,
attempt: 1,
- })
- )
+ }),
+ ),
);
const happyPath = progress.then(() => {
@@ -603,17 +603,17 @@ const internalRenderFramesRaw = ({
Internals.validateDimension(
composition.height,
'height',
- 'in the `config` object passed to `renderFrames()`'
+ 'in the `config` object passed to `renderFrames()`',
);
Internals.validateDimension(
composition.width,
'width',
- 'in the `config` object passed to `renderFrames()`'
+ 'in the `config` object passed to `renderFrames()`',
);
Internals.validateFps(
composition.fps,
'in the `config` object of `renderFrames()`',
- false
+ false,
);
Internals.validateDurationInFrames(composition.durationInFrames, {
component: 'in the `config` object passed to `renderFrames()`',
@@ -668,7 +668,7 @@ const internalRenderFramesRaw = ({
{
onDownload,
onError,
- }
+ },
),
browserInstance,
]).then(([{server: openedServer, cleanupServer}, pInstance]) => {
@@ -679,7 +679,7 @@ const internalRenderFramesRaw = ({
cleanup.push(
cycleBrowserTabs(browserReplacer, actualConcurrency, logLevel, indent)
- .stopCycling
+ .stopCycling,
);
cleanup.push(() => cleanupServer(false));
@@ -757,7 +757,7 @@ const internalRenderFramesRaw = ({
};
export const internalRenderFrames = wrapWithErrorHandling(
- internalRenderFramesRaw
+ internalRenderFramesRaw,
);
/**
@@ -765,7 +765,7 @@ export const internalRenderFrames = wrapWithErrorHandling(
* @see [Documentation](https://www.remotion.dev/docs/renderer/render-frames)
*/
export const renderFrames = (
- options: RenderFramesOptions
+ options: RenderFramesOptions,
): Promise<RenderFramesOutput> => {
const {
composition,
@@ -800,19 +800,19 @@ export const renderFrames = (
if (!composition) {
throw new Error(
- 'No `composition` option has been specified for renderFrames()'
+ 'No `composition` option has been specified for renderFrames()',
);
}
if (typeof jpegQuality !== 'undefined' && imageFormat !== 'jpeg') {
throw new Error(
- "You can only pass the `quality` option if `imageFormat` is 'jpeg'."
+ "You can only pass the `quality` option if `imageFormat` is 'jpeg'.",
);
}
if (quality) {
console.warn(
- 'Passing `quality()` to `renderStill` is deprecated. Use `jpegQuality` instead.'
+ 'Passing `quality()` to `renderStill` is deprecated. Use `jpegQuality` instead.',
);
}
diff --git a/packages/renderer/src/render-media.ts b/packages/renderer/src/render-media.ts
index 00157c08e2..1a2a3610c6 100644
--- a/packages/renderer/src/render-media.ts
+++ b/packages/renderer/src/render-media.ts
@@ -297,7 +297,7 @@ const internalRenderMediaRaw = ({
'Free memory:',
freeMemory,
'Estimated usage parallel encoding',
- estimatedUsage
+ estimatedUsage,
);
Log.verboseAdvanced(
{
@@ -306,7 +306,7 @@ const internalRenderMediaRaw = ({
tag: 'renderMedia()',
},
'Codec supports parallel rendering:',
- canUseParallelEncoding(codec)
+ canUseParallelEncoding(codec),
);
if (disallowParallelEncoding) {
Log.verboseAdvanced(
@@ -315,7 +315,7 @@ const internalRenderMediaRaw = ({
logLevel,
tag: 'renderMedia()',
},
- 'User disallowed parallel encoding.'
+ 'User disallowed parallel encoding.',
);
}
@@ -326,7 +326,7 @@ const internalRenderMediaRaw = ({
logLevel,
tag: 'renderMedia()',
},
- 'Parallel encoding is enabled.'
+ 'Parallel encoding is enabled.',
);
} else {
Log.verboseAdvanced(
@@ -335,7 +335,7 @@ const internalRenderMediaRaw = ({
logLevel,
tag: 'renderMedia()',
},
- 'Parallel encoding is disabled.'
+ 'Parallel encoding is disabled.',
);
}
@@ -345,17 +345,17 @@ const internalRenderMediaRaw = ({
validateSelectedPixelFormatAndImageFormatCombination(
pixelFormat,
- imageFormat
+ imageFormat,
);
const workingDir = fs.mkdtempSync(
- path.join(os.tmpdir(), 'react-motion-render')
+ path.join(os.tmpdir(), 'react-motion-render'),
);
const preEncodedFileLocation = parallelEncoding
? path.join(
workingDir,
- 'pre-encode.' + getFileExtensionFromCodec(codec, audioCodec)
+ 'pre-encode.' + getFileExtensionFromCodec(codec, audioCodec),
)
: null;
@@ -372,7 +372,7 @@ const internalRenderMediaRaw = ({
const realFrameRange = getRealFrameRange(
composition.durationInFrames,
- frameRange
+ frameRange,
);
const callUpdate = () => {
@@ -385,7 +385,7 @@ const internalRenderMediaRaw = ({
progress:
Math.round(
(70 * renderedFrames + 15 * encodedFrames + 15 * muxedFrames) /
- totalFramesToRender
+ totalFramesToRender,
) / 100,
});
};
@@ -463,7 +463,7 @@ const internalRenderMediaRaw = ({
} else {
// add frame at appropriate position
const index = slowestFrames.findIndex(
- ({time: indexTime}) => indexTime < time
+ ({time: indexTime}) => indexTime < time,
);
slowestFrames.splice(index, 0, frameTime);
}
@@ -496,7 +496,7 @@ const internalRenderMediaRaw = ({
{
onDownload,
onError: (err) => reject(err),
- }
+ },
);
})
.then(({server, cleanupServer}) => {
@@ -506,7 +506,7 @@ const internalRenderMediaRaw = ({
onFrameUpdate: (
frame: number,
frameIndex: number,
- timeToRenderInMilliseconds
+ timeToRenderInMilliseconds,
) => {
renderedFrames = frame;
callUpdate();
@@ -538,13 +538,13 @@ const internalRenderMediaRaw = ({
const exitStatus = preStitcher?.getExitStatus();
if (exitStatus?.type === 'quit-successfully') {
throw new Error(
- `FFmpeg already quit while trying to pipe frame ${frame} to it. Stderr: ${exitStatus.stderr}}`
+ `FFmpeg already quit while trying to pipe frame ${frame} to it. Stderr: ${exitStatus.stderr}}`,
);
}
if (exitStatus?.type === 'quit-with-error') {
throw new Error(
- `FFmpeg quit with code ${exitStatus.exitCode} while piping frame ${frame}. Stderr: ${exitStatus.stderr}}`
+ `FFmpeg quit with code ${exitStatus.exitCode} while piping frame ${frame}. Stderr: ${exitStatus.stderr}}`,
);
}
@@ -552,7 +552,7 @@ const internalRenderMediaRaw = ({
stopPerfMeasure(id);
setFrameToStitch(
- Math.min(realFrameRange[1] + 1, frame + everyNthFrame)
+ Math.min(realFrameRange[1] + 1, frame + everyNthFrame),
);
}
: null,
@@ -695,7 +695,7 @@ const internalRenderMediaRaw = ({
};
export const internalRenderMedia = wrapWithErrorHandling(
- internalRenderMediaRaw
+ internalRenderMediaRaw,
);
/**
@@ -748,7 +748,7 @@ export const renderMedia = ({
}: RenderMediaOptions): Promise<RenderMediaResult> => {
if (quality !== undefined) {
console.warn(
- `The "quality" option has been renamed. Please use "jpegQuality" instead.`
+ `The "quality" option has been renamed. Please use "jpegQuality" instead.`,
);
}
diff --git a/packages/renderer/src/render-still.ts b/packages/renderer/src/render-still.ts
index b59180e234..b60ef4b379 100644
--- a/packages/renderer/src/render-still.ts
+++ b/packages/renderer/src/render-still.ts
@@ -140,17 +140,17 @@ const innerRenderStill = async ({
Internals.validateDimension(
composition.height,
'height',
- 'in the `config` object passed to `renderStill()`'
+ 'in the `config` object passed to `renderStill()`',
);
Internals.validateDimension(
composition.width,
'width',
- 'in the `config` object passed to `renderStill()`'
+ 'in the `config` object passed to `renderStill()`',
);
Internals.validateFps(
composition.fps,
'in the `config` object of `renderStill()`',
- false
+ false,
);
Internals.validateDurationInFrames(composition.durationInFrames, {
component: 'in the `config` object passed to `renderStill()`',
@@ -178,7 +178,7 @@ const innerRenderStill = async ({
if (fs.existsSync(output)) {
if (!overwrite) {
throw new Error(
- `Cannot render still - "overwrite" option was set to false, but the output destination ${output} already exists.`
+ `Cannot render still - "overwrite" option was set to false, but the output destination ${output} already exists.`,
);
}
@@ -186,7 +186,7 @@ const innerRenderStill = async ({
if (!stat.isFile()) {
throw new Error(
- `The output location ${output} already exists, but is not a file, but something else (e.g. folder). Cannot save to it.`
+ `The output location ${output} already exists, but is not a file, but something else (e.g. folder). Cannot save to it.`,
);
}
}
@@ -208,7 +208,7 @@ const innerRenderStill = async ({
const page = await browserInstance.newPage(
Promise.resolve(sourceMapContext),
logLevel,
- indent
+ indent,
);
await page.setViewport({
width: composition.width,
@@ -279,7 +279,7 @@ const innerRenderStill = async ({
durationInFrames: number,
fps: number,
height: number,
- width: number
+ width: number,
) => {
window.remotion_setBundleMode({
type: 'composition',
@@ -329,7 +329,7 @@ const innerRenderStill = async ({
};
const internalRenderStillRaw = (
- options: InternalRenderStillOptions
+ options: InternalRenderStillOptions,
): Promise<RenderStillReturnValue> => {
const cleanup: CleanupFn[] = [];
@@ -350,7 +350,7 @@ const internalRenderStillRaw = (
{
onDownload: options.onDownload,
onError,
- }
+ },
)
.then(({server, cleanupServer}) => {
cleanup.push(() => cleanupServer(false));
@@ -388,7 +388,7 @@ const internalRenderStillRaw = (
};
export const internalRenderStill = wrapWithErrorHandling(
- internalRenderStillRaw
+ internalRenderStillRaw,
);
/**
@@ -397,7 +397,7 @@ export const internalRenderStill = wrapWithErrorHandling(
* @see [Documentation](https://www.remotion.dev/docs/renderer/render-still)
*/
export const renderStill = (
- options: RenderStillOptions
+ options: RenderStillOptions,
): Promise<RenderStillReturnValue> => {
const {
composition,
@@ -426,13 +426,13 @@ export const renderStill = (
if (typeof jpegQuality !== 'undefined' && imageFormat !== 'jpeg') {
throw new Error(
- "You can only pass the `quality` option if `imageFormat` is 'jpeg'."
+ "You can only pass the `quality` option if `imageFormat` is 'jpeg'.",
);
}
if (quality) {
console.warn(
- 'Passing `quality()` to `renderStill` is deprecated. Use `jpegQuality` instead.'
+ 'Passing `quality()` to `renderStill` is deprecated. Use `jpegQuality` instead.',
);
}
diff --git a/packages/renderer/src/select-composition.ts b/packages/renderer/src/select-composition.ts
index 9ed16687d3..20ee60a9a0 100644
--- a/packages/renderer/src/select-composition.ts
+++ b/packages/renderer/src/select-composition.ts
@@ -119,7 +119,7 @@ const innerSelectComposition = async ({
tag: 'selectComposition()',
logLevel,
},
- 'Running calculateMetadata()...'
+ 'Running calculateMetadata()...',
);
const time = Date.now();
const {value: result, size} = await puppeteerEvaluateWithCatch({
@@ -136,7 +136,7 @@ const innerSelectComposition = async ({
tag: 'selectComposition()',
logLevel,
},
- `calculateMetadata() took ${Date.now() - time}ms`
+ `calculateMetadata() took ${Date.now() - time}ms`,
);
const res = result as Awaited<
@@ -152,10 +152,10 @@ const innerSelectComposition = async ({
fps,
durationInFrames,
props: Internals.deserializeJSONWithCustomFields(
- res.serializedResolvedPropsWithCustomSchema
+ res.serializedResolvedPropsWithCustomSchema,
),
defaultProps: Internals.deserializeJSONWithCustomFields(
- res.serializedDefaultPropsWithCustomSchema
+ res.serializedDefaultPropsWithCustomSchema,
),
},
propsSize: size,
@@ -168,7 +168,7 @@ type InternalReturnType = {
};
export const internalSelectCompositionRaw = async (
- options: InternalSelectCompositionsConfig
+ options: InternalSelectCompositionsConfig,
): Promise<InternalReturnType> => {
const cleanup: CleanupFn[] = [];
const {
@@ -207,7 +207,7 @@ export const internalSelectCompositionRaw = async (
page,
frame: null,
onError,
- })
+ }),
);
makeOrReuseServer(
@@ -224,7 +224,7 @@ export const internalSelectCompositionRaw = async (
{
onDownload: () => undefined,
onError,
- }
+ },
)
.then(({server: {serveUrl, offthreadPort, sourceMap}, cleanupServer}) => {
page.setBrowserSourceMapContext(sourceMap);
@@ -264,7 +264,7 @@ export const internalSelectCompositionRaw = async (
};
export const internalSelectComposition = wrapWithErrorHandling(
- internalSelectCompositionRaw
+ internalSelectCompositionRaw,
);
/**
@@ -272,7 +272,7 @@ export const internalSelectComposition = wrapWithErrorHandling(
* @see [Documentation](https://www.remotion.dev/docs/renderer/select-composition)
*/
export const selectComposition = async (
- options: SelectCompositionOptions
+ options: SelectCompositionOptions,
): Promise<VideoConfig> => {
const {
id,
diff --git a/packages/renderer/src/wrap-with-error-handling.ts b/packages/renderer/src/wrap-with-error-handling.ts
index 1911004dd5..5c4b154e9e 100644
--- a/packages/renderer/src/wrap-with-error-handling.ts
+++ b/packages/renderer/src/wrap-with-error-handling.ts
@@ -3,7 +3,7 @@ import {printUsefulErrorMessage} from './print-useful-error-message';
type AsyncFunction<A extends unknown[], R> = (...args: A) => Promise<R>;
export const wrapWithErrorHandling = <A extends unknown[], R>(
- fn: AsyncFunction<A, R>
+ fn: AsyncFunction<A, R>,
): AsyncFunction<A, R> => {
return async (...args: A): Promise<R> => {
try {