Skip to content

🎥 Make videos programmatically with React

renames

Jonny Burger83a2d71df847
diff --git a/packages/bundler/src/index-html.ts b/packages/bundler/src/index-html.ts
index d99fee4583..cc7a65cc1d 100644
--- a/packages/bundler/src/index-html.ts
+++ b/packages/bundler/src/index-html.ts
@@ -21,7 +21,7 @@ export type RenderDefaults = {
audioBitrate: string | null;
videoBitrate: string | null;
encodingBufferSize: string | null;
- maxRate: string | null;
+ encodingMaxRate: string | null;
everyNthFrame: number;
numberOfGifLoops: number | null;
delayRenderTimeout: number;
diff --git a/packages/cli/src/benchmark.ts b/packages/cli/src/benchmark.ts
index 81c15598d5..50675ed439 100644
--- a/packages/cli/src/benchmark.ts
+++ b/packages/cli/src/benchmark.ts
@@ -182,7 +182,7 @@ export const benchmarkCommand = async (
ffmpegOverride,
audioBitrate,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
height,
width,
@@ -351,7 +351,7 @@ export const benchmarkCommand = async (
codec,
audioBitrate,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
puppeteerInstance,
concurrency: con,
diff --git a/packages/cli/src/config/bitrate.ts b/packages/cli/src/config/bitrate.ts
index ce1c1b4e10..5cf0f4d62a 100644
--- a/packages/cli/src/config/bitrate.ts
+++ b/packages/cli/src/config/bitrate.ts
@@ -18,14 +18,14 @@ export const getVideoBitrate = () => {
return videoBitrate;
};
-let maxRate: string | null = null;
+let encodingMaxRate: string | null = null;
-export const setVideoMaxRate = (bitrate: string | null) => {
- maxRate = bitrate;
+export const setEncodingMaxRate = (bitrate: string | null) => {
+ encodingMaxRate = bitrate;
};
-export const getVideoMaxRate = () => {
- return maxRate;
+export const getEncodingMaxRate = () => {
+ return encodingMaxRate;
};
/**
diff --git a/packages/cli/src/config/index.ts b/packages/cli/src/config/index.ts
index 9c5d5ee0f9..33645ae648 100644
--- a/packages/cli/src/config/index.ts
+++ b/packages/cli/src/config/index.ts
@@ -60,12 +60,12 @@ import {getAudioCodec, setAudioCodec} from './audio-codec';
import {
getAudioBitrate,
getEncodingBufferSize,
+ getEncodingMaxRate,
getVideoBitrate,
- getVideoMaxRate,
setAudioBitrate,
setEncodingBufferSize,
+ setEncodingMaxRate,
setVideoBitrate,
- setVideoMaxRate,
} from './bitrate';
import {setBrowserExecutable} from './browser-executable';
import {
@@ -433,9 +433,9 @@ declare global {
readonly setVideoBitrate: (bitrate: string | null) => void;
/**
- * Set a maximum bitrate to be passed to FFMPEG.
+ * Set a maximum bitrate to be passed to FFmpeg.
*/
- readonly setVideoMaxRate: (bitrate: string | null) => void;
+ readonly setEncodingMaxRate: (bitrate: string | null) => void;
/**
* Set a buffer size to be passed to FFmpeg.
@@ -569,7 +569,7 @@ export const Config: FlatConfig = {
setJpegQuality,
setStillImageFormat,
setVideoImageFormat,
- setVideoMaxRate,
+ setEncodingMaxRate,
setEncodingBufferSize,
setFrameRange,
setScale,
@@ -642,7 +642,7 @@ export const ConfigInternals = {
getAudioBitrate,
getVideoBitrate,
getEncodingBufferSize,
- getVideoMaxRate,
+ getEncodingMaxRate,
getHeight,
getWidth,
getCrfOrUndefined,
diff --git a/packages/cli/src/get-cli-options.ts b/packages/cli/src/get-cli-options.ts
index 2028cc7b86..d1dc6e44b1 100644
--- a/packages/cli/src/get-cli-options.ts
+++ b/packages/cli/src/get-cli-options.ts
@@ -130,7 +130,7 @@ export const getCliOptions = async (options: {
const crf = getCrf(shouldOutputImageSequence);
const videoBitrate = ConfigInternals.getVideoBitrate();
const encodingBufferSize = ConfigInternals.getEncodingBufferSize();
- const maxRate = ConfigInternals.getVideoMaxRate();
+ const encodingMaxRate = ConfigInternals.getEncodingMaxRate();
const pixelFormat = ConfigInternals.getPixelFormat();
const proResProfile = getProResProfile();
const x264Preset = getx264Preset();
@@ -193,7 +193,7 @@ export const getCliOptions = async (options: {
audioBitrate: ConfigInternals.getAudioBitrate(),
videoBitrate,
encodingBufferSize,
- maxRate,
+ encodingMaxRate,
height,
width,
configFileImageFormat: ConfigInternals.getUserPreferredVideoImageFormat(),
diff --git a/packages/cli/src/parse-command-line.ts b/packages/cli/src/parse-command-line.ts
index 23693067f0..45ffe501b5 100644
--- a/packages/cli/src/parse-command-line.ts
+++ b/packages/cli/src/parse-command-line.ts
@@ -269,8 +269,8 @@ export const parseCommandLine = () => {
Config.setEncodingBufferSize(parsedCli['buf-size']);
}
- if (typeof parsedCli['buf-size'] !== 'undefined') {
- Config.setVideoMaxRate(parsedCli['buf-size']);
+ if (typeof parsedCli['max-rate'] !== 'undefined') {
+ Config.setEncodingMaxRate(parsedCli['max-rate']);
}
if (typeof parsedCli['offthreadvideo-cache-size-in-bytes'] !== 'undefined') {
diff --git a/packages/cli/src/preview-server/render-queue/job.ts b/packages/cli/src/preview-server/render-queue/job.ts
index 694c9bcc21..2b95bc51b9 100644
--- a/packages/cli/src/preview-server/render-queue/job.ts
+++ b/packages/cli/src/preview-server/render-queue/job.ts
@@ -82,7 +82,7 @@ type RenderJobDynamicFields =
audioBitrate: string | null;
videoBitrate: string | null;
encodingBufferSize: string | null;
- maxRate: string | null;
+ encodingMaxRate: string | null;
everyNthFrame: number;
numberOfGifLoops: number | null;
disallowParallelEncoding: boolean;
@@ -149,7 +149,7 @@ type AddRenderRequestDynamicFields =
audioBitrate: string | null;
videoBitrate: string | null;
encodingBufferSize: string | null;
- maxRate: string | null;
+ encodingMaxRate: string | null;
everyNthFrame: number;
numberOfGifLoops: number | null;
disallowParallelEncoding: boolean;
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 2e17df3c1b..987a83d62c 100644
--- a/packages/cli/src/preview-server/render-queue/process-video.ts
+++ b/packages/cli/src/preview-server/render-queue/process-video.ts
@@ -76,7 +76,7 @@ export const processVideoJob = async ({
pixelFormat: job.type === 'video' ? job.pixelFormat : 'yuv420p',
videoBitrate: job.type === 'video' ? job.videoBitrate : null,
encodingBufferSize: job.type === 'video' ? job.encodingBufferSize : null,
- maxRate: job.type === 'video' ? job.maxRate : null,
+ encodingMaxRate: job.type === 'video' ? job.encodingMaxRate : null,
numberOfGifLoops: job.type === 'video' ? job.numberOfGifLoops : null,
audioCodec: job.type === 'video' ? job.audioCodec : null,
disallowParallelEncoding:
diff --git a/packages/cli/src/preview-server/routes.ts b/packages/cli/src/preview-server/routes.ts
index 395359d774..83e0610acb 100644
--- a/packages/cli/src/preview-server/routes.ts
+++ b/packages/cli/src/preview-server/routes.ts
@@ -75,7 +75,7 @@ const handleFallback = async ({
const audioBitrate = ConfigInternals.getAudioBitrate();
const videoBitrate = ConfigInternals.getVideoBitrate();
const encodingBufferSize = ConfigInternals.getEncodingBufferSize();
- const maxRate = ConfigInternals.getVideoMaxRate();
+ const encodingMaxRate = ConfigInternals.getEncodingMaxRate();
const everyNthFrame = ConfigInternals.getEveryNthFrame();
const numberOfGifLoops = ConfigInternals.getNumberOfGifLoops();
const delayRenderTimeout = ConfigInternals.getCurrentPuppeteerTimeout();
@@ -135,7 +135,7 @@ const handleFallback = async ({
audioBitrate,
videoBitrate,
encodingBufferSize,
- maxRate,
+ encodingMaxRate,
everyNthFrame,
numberOfGifLoops,
delayRenderTimeout,
diff --git a/packages/cli/src/preview-server/routes/add-render.ts b/packages/cli/src/preview-server/routes/add-render.ts
index 03868be80c..677c587413 100644
--- a/packages/cli/src/preview-server/routes/add-render.ts
+++ b/packages/cli/src/preview-server/routes/add-render.ts
@@ -41,7 +41,7 @@ export const handleAddRender: ApiHandler<AddRenderRequest, undefined> = ({
pixelFormat: input.pixelFormat,
audioBitrate: input.audioBitrate,
videoBitrate: input.videoBitrate,
- maxRate: input.maxRate,
+ encodingMaxRate: input.encodingMaxRate,
encodingBufferSize: input.encodingBufferSize,
everyNthFrame: input.everyNthFrame,
numberOfGifLoops: input.numberOfGifLoops,
diff --git a/packages/cli/src/render-flows/render.ts b/packages/cli/src/render-flows/render.ts
index 951c5ab9b4..dcbd386a12 100644
--- a/packages/cli/src/render-flows/render.ts
+++ b/packages/cli/src/render-flows/render.ts
@@ -90,7 +90,7 @@ export const renderVideoFlow = async ({
x264Preset,
pixelFormat,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
numberOfGifLoops,
audioCodec,
@@ -134,7 +134,7 @@ export const renderVideoFlow = async ({
ffmpegOverride: FfmpegOverrideFn;
audioBitrate: string | null;
videoBitrate: string | null;
- maxRate: string | null;
+ encodingMaxRate: string | null;
encodingBufferSize: string | null;
muted: boolean;
enforceAudioTrack: boolean;
@@ -462,7 +462,7 @@ export const renderVideoFlow = async ({
codec,
audioBitrate,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
onProgress: (update) => {
(stitchingProgress as StitchingProgressInput).doneIn =
diff --git a/packages/cli/src/render.tsx b/packages/cli/src/render.tsx
index bc5d642d28..909ffd1ab2 100644
--- a/packages/cli/src/render.tsx
+++ b/packages/cli/src/render.tsx
@@ -67,7 +67,7 @@ export const render = async (
x264Preset,
pixelFormat,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
numberOfGifLoops,
offthreadVideoCacheSizeInBytes,
@@ -129,7 +129,7 @@ export const render = async (
x264Preset,
pixelFormat,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
numberOfGifLoops,
audioCodec,
diff --git a/packages/cloudrun/src/api/render-media-on-cloudrun.ts b/packages/cloudrun/src/api/render-media-on-cloudrun.ts
index bdbaef081d..da357be629 100644
--- a/packages/cloudrun/src/api/render-media-on-cloudrun.ts
+++ b/packages/cloudrun/src/api/render-media-on-cloudrun.ts
@@ -48,7 +48,7 @@ type InternalRenderMediaOnCloudrun = {
jpegQuality: number | undefined;
audioBitrate: string | null;
videoBitrate: string | null;
- maxRate: string | null;
+ encodingMaxRate: string | null;
encodingBufferSize: string | null;
proResProfile: ProResProfile | undefined;
x264Preset: X264Preset | undefined;
@@ -88,7 +88,7 @@ export type RenderMediaOnCloudrunInput = {
jpegQuality?: number;
audioBitrate?: string | null;
videoBitrate?: string | null;
- maxRate?: string | null;
+ encodingMaxRate?: string | null;
encodingBufferSize?: string | null;
proResProfile?: ProResProfile;
x264Preset?: X264Preset;
@@ -128,7 +128,7 @@ const internalRenderMediaOnCloudrunRaw = async ({
audioCodec,
audioBitrate,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
proResProfile,
x264Preset,
@@ -181,8 +181,8 @@ const internalRenderMediaOnCloudrunRaw = async ({
audioCodec: audioCodec ?? null,
audioBitrate: audioBitrate ?? null,
videoBitrate: videoBitrate ?? null,
- encodingBufferSize: maxRate ?? null,
- maxRate: encodingBufferSize ?? null,
+ encodingBufferSize: encodingBufferSize ?? null,
+ encodingMaxRate: encodingMaxRate ?? null,
crf: crf ?? null,
pixelFormat: pixelFormat ?? RenderInternals.DEFAULT_PIXEL_FORMAT,
imageFormat: imageFormat ?? RenderInternals.DEFAULT_VIDEO_IMAGE_FORMAT,
@@ -314,7 +314,7 @@ export const internalRenderMediaOnCloudrun = PureJSAPIs.wrapWithErrorHandling(
* @param params.audioBitrate The target bitrate for the audio of the generated video.
* @param params.videoBitrate The target bitrate of the generated video.
* @param params.encodingBufferSize The decoder buffer size, which determines the variability of the generated video bitrate.
- * @param params.maxRate The maximum bitrate tolerance to be used, this is only used in conjunction with encodingBufferSize.
+ * @param params.encodingMaxRate The maximum bitrate tolerance to be used, this is only used in conjunction with encodingBufferSize.
* @param params.proResProfile Sets a ProRes profile. Only applies to videos rendered with prores codec.
* @param params.x264Preset Sets a Preset profile. Only applies to videos rendered with h.264 codec.
* @param params.crf Constant Rate Factor, controlling the quality.
@@ -352,7 +352,7 @@ export const renderMediaOnCloudrun = ({
audioCodec,
audioBitrate,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
proResProfile,
x264Preset,
@@ -394,7 +394,7 @@ export const renderMediaOnCloudrun = ({
audioCodec: audioCodec ?? undefined,
audioBitrate: audioBitrate ?? null,
videoBitrate: videoBitrate ?? null,
- maxRate: maxRate ?? null,
+ encodingMaxRate: encodingMaxRate ?? null,
encodingBufferSize: encodingBufferSize ?? null,
proResProfile: proResProfile ?? undefined,
x264Preset: x264Preset ?? undefined,
diff --git a/packages/cloudrun/src/cli/commands/render/index.ts b/packages/cloudrun/src/cli/commands/render/index.ts
index 91b2b2b83f..a5f411de4a 100644
--- a/packages/cloudrun/src/cli/commands/render/index.ts
+++ b/packages/cloudrun/src/cli/commands/render/index.ts
@@ -59,7 +59,7 @@ export const renderCommand = async (
muted,
audioBitrate,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
height,
width,
@@ -198,7 +198,7 @@ ${downloadName ? ` Downloaded File = ${downloadName}` : ''}
audioCodec,
audioBitrate,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
proResProfile,
x264Preset,
diff --git a/packages/cloudrun/src/functions/helpers/payloads.ts b/packages/cloudrun/src/functions/helpers/payloads.ts
index 51a1a843e5..a2e32b8b1c 100644
--- a/packages/cloudrun/src/functions/helpers/payloads.ts
+++ b/packages/cloudrun/src/functions/helpers/payloads.ts
@@ -31,7 +31,7 @@ export const CloudRunPayload = z.discriminatedUnion('type', [
audioCodec: audioCodec.nullable(),
audioBitrate: z.string().nullable(),
videoBitrate: z.string().nullable(),
- maxRate: z.string().nullable(),
+ encodingMaxRate: z.string().nullable(),
encodingBufferSize: z.string().nullable(),
crf: z.number().nullable(),
pixelFormat,
diff --git a/packages/cloudrun/src/functions/render-media-single-thread.ts b/packages/cloudrun/src/functions/render-media-single-thread.ts
index 69ea8a6ea8..e539231b9c 100644
--- a/packages/cloudrun/src/functions/render-media-single-thread.ts
+++ b/packages/cloudrun/src/functions/render-media-single-thread.ts
@@ -67,7 +67,7 @@ export const renderMediaSingleThread = async (
audioCodec: body.audioCodec,
audioBitrate: body.audioBitrate,
videoBitrate: body.videoBitrate,
- maxRate: body.maxRate,
+ encodingMaxRate: body.encodingMaxRate,
encodingBufferSize: body.encodingBufferSize,
crf: body.crf,
pixelFormat: body.pixelFormat,
diff --git a/packages/it-tests/src/monorepo/go-package.test.ts b/packages/it-tests/src/monorepo/go-package.test.ts
index d2590dc1dd..3f09b3d60c 100644
--- a/packages/it-tests/src/monorepo/go-package.test.ts
+++ b/packages/it-tests/src/monorepo/go-package.test.ts
@@ -65,7 +65,7 @@ test("Go package should create the same payload as normal Lambda package", async
scale: 1,
timeoutInMilliseconds: 30000,
videoBitrate: null,
- maxRate: null,
+ encodingMaxRate: null,
encodingBufferSize: null,
webhook: null,
x264Preset: null,
diff --git a/packages/it-tests/src/monorepo/php-package.test.ts b/packages/it-tests/src/monorepo/php-package.test.ts
index 5dce4c05b4..e5cf9260d9 100644
--- a/packages/it-tests/src/monorepo/php-package.test.ts
+++ b/packages/it-tests/src/monorepo/php-package.test.ts
@@ -96,7 +96,7 @@ test("PHP package should create the same renderMedia payload as normal Lambda pa
scale: 1,
timeoutInMilliseconds: 30000,
videoBitrate: null,
- maxRate: null,
+ encodingMaxRate: null,
encodingBufferSize: null,
webhook: null,
x264Preset: null,
diff --git a/packages/it-tests/src/monorepo/python-package.test.ts b/packages/it-tests/src/monorepo/python-package.test.ts
index 516a6dd742..c96b688f2d 100644
--- a/packages/it-tests/src/monorepo/python-package.test.ts
+++ b/packages/it-tests/src/monorepo/python-package.test.ts
@@ -79,7 +79,7 @@ test("Python package should create the same renderMedia payload as normal Lambda
scale: 1,
timeoutInMilliseconds: 30000,
videoBitrate: null,
- maxRate: null,
+ encodingMaxRate: null,
encodingBufferSize: null,
webhook: null,
x264Preset: null,
diff --git a/packages/lambda/src/api/make-lambda-payload.ts b/packages/lambda/src/api/make-lambda-payload.ts
index ff6ffa7ad9..043787a8b5 100644
--- a/packages/lambda/src/api/make-lambda-payload.ts
+++ b/packages/lambda/src/api/make-lambda-payload.ts
@@ -66,7 +66,7 @@ export type InnerRenderMediaOnLambdaInput = {
overwrite: boolean;
audioBitrate: string | null;
videoBitrate: string | null;
- maxRate: string | null;
+ encodingMaxRate: string | null;
encodingBufferSize: string | null;
webhook: WebhookOption | null;
forceWidth: number | null;
@@ -110,7 +110,7 @@ export const makeLambdaRenderMediaPayload = async ({
forceWidth,
webhook,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
downloadBehavior,
muted,
@@ -175,7 +175,7 @@ export const makeLambdaRenderMediaPayload = async ({
audioBitrate: audioBitrate ?? null,
videoBitrate: videoBitrate ?? null,
encodingBufferSize: encodingBufferSize ?? null,
- maxRate: maxRate ?? null,
+ encodingMaxRate: encodingMaxRate ?? null,
webhook: webhook ?? null,
forceHeight: forceHeight ?? null,
forceWidth: forceWidth ?? null,
diff --git a/packages/lambda/src/api/render-media-on-lambda.ts b/packages/lambda/src/api/render-media-on-lambda.ts
index 73f83073c8..0bc95f5cae 100644
--- a/packages/lambda/src/api/render-media-on-lambda.ts
+++ b/packages/lambda/src/api/render-media-on-lambda.ts
@@ -62,7 +62,7 @@ export type RenderMediaOnLambdaInput = {
overwrite?: boolean;
audioBitrate?: string | null;
videoBitrate?: string | null;
- maxRate?: string | null;
+ encodingMaxRate?: string | null;
encodingBufferSize?: string | null;
webhook?: WebhookOption | null;
forceWidth?: number | null;
@@ -202,7 +202,7 @@ export const renderMediaOnLambda = (
serveUrl: options.serveUrl,
timeoutInMilliseconds: options.timeoutInMilliseconds ?? 30000,
videoBitrate: options.videoBitrate ?? null,
- maxRate: options.maxRate ?? null,
+ encodingMaxRate: options.encodingMaxRate ?? null,
encodingBufferSize: options.encodingBufferSize ?? null,
webhook: options.webhook ?? null,
x264Preset: options.x264Preset ?? null,
diff --git a/packages/lambda/src/cli/commands/render/render.ts b/packages/lambda/src/cli/commands/render/render.ts
index 73c4064b32..a527f5dc8a 100644
--- a/packages/lambda/src/cli/commands/render/render.ts
+++ b/packages/lambda/src/cli/commands/render/render.ts
@@ -76,7 +76,7 @@ export const renderCommand = async (
overwrite,
audioBitrate,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
height,
width,
@@ -200,7 +200,7 @@ export const renderCommand = async (
audioBitrate,
videoBitrate,
encodingBufferSize,
- maxRate,
+ encodingMaxRate,
forceHeight: height,
forceWidth: width,
webhook: parsedLambdaCli.webhook
diff --git a/packages/lambda/src/functions/launch.ts b/packages/lambda/src/functions/launch.ts
index 9044984982..0ba4a15621 100644
--- a/packages/lambda/src/functions/launch.ts
+++ b/packages/lambda/src/functions/launch.ts
@@ -271,7 +271,7 @@ const innerLaunchHandler = async ({
muted: params.muted,
audioBitrate: params.audioBitrate,
videoBitrate: params.videoBitrate,
- maxRate: params.maxRate,
+ encodingMaxRate: params.encodingMaxRate,
encodingBufferSize: params.encodingBufferSize,
launchFunctionConfig: {
version: VERSION,
diff --git a/packages/lambda/src/functions/renderer.ts b/packages/lambda/src/functions/renderer.ts
index 67df92261d..b257699a3d 100644
--- a/packages/lambda/src/functions/renderer.ts
+++ b/packages/lambda/src/functions/renderer.ts
@@ -208,7 +208,7 @@ const renderHandler = async (
audioBitrate: params.audioBitrate,
videoBitrate: params.videoBitrate,
encodingBufferSize: params.encodingBufferSize,
- maxRate: params.maxRate,
+ encodingMaxRate: params.encodingMaxRate,
// Lossless flag takes priority over audio codec
// https://github.com/remotion-dev/remotion/issues/1647
// Special flag only in Lambda renderer which improves the audio quality
diff --git a/packages/lambda/src/functions/start.ts b/packages/lambda/src/functions/start.ts
index e0bba13723..21132c6504 100644
--- a/packages/lambda/src/functions/start.ts
+++ b/packages/lambda/src/functions/start.ts
@@ -97,7 +97,7 @@ export const startHandler = async (params: LambdaPayload, options: Options) => {
audioBitrate: params.audioBitrate,
videoBitrate: params.videoBitrate,
encodingBufferSize: params.encodingBufferSize,
- maxRate: params.maxRate,
+ encodingMaxRate: params.encodingMaxRate,
forceHeight: params.forceHeight,
forceWidth: params.forceWidth,
rendererFunctionName: params.rendererFunctionName,
diff --git a/packages/lambda/src/shared/constants.ts b/packages/lambda/src/shared/constants.ts
index ae0581e181..67eca1ecfe 100644
--- a/packages/lambda/src/shared/constants.ts
+++ b/packages/lambda/src/shared/constants.ts
@@ -269,7 +269,7 @@ export type LambdaStartPayload = {
overwrite: boolean;
audioBitrate: string | null;
videoBitrate: string | null;
- maxRate: string | null;
+ encodingMaxRate: string | null;
encodingBufferSize: string | null;
webhook: WebhookOption;
forceHeight: number | null;
@@ -327,7 +327,7 @@ export type LambdaPayloads = {
overwrite: boolean;
audioBitrate: string | null;
videoBitrate: string | null;
- maxRate: string | null;
+ encodingMaxRate: string | null;
encodingBufferSize: string | null;
webhook: WebhookOption;
forceHeight: number | null;
@@ -372,7 +372,7 @@ export type LambdaPayloads = {
audioBitrate: string | null;
videoBitrate: string | null;
encodingBufferSize: string | null;
- maxRate: string | null;
+ encodingMaxRate: string | null;
launchFunctionConfig: {
version: string;
};
diff --git a/packages/lambda/src/test/integration/renders/gif.test.ts b/packages/lambda/src/test/integration/renders/gif.test.ts
index 4a8b13cb03..31601ada4b 100644
--- a/packages/lambda/src/test/integration/renders/gif.test.ts
+++ b/packages/lambda/src/test/integration/renders/gif.test.ts
@@ -59,7 +59,7 @@ test('Should make a distributed GIF', async () => {
audioBitrate: null,
videoBitrate: null,
encodingBufferSize: null,
- maxRate: null,
+ encodingMaxRate: null,
forceHeight: null,
forceWidth: null,
rendererFunctionName: null,
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 c3d7420d16..47c6372fec 100644
--- a/packages/lambda/src/test/integration/renders/old-version.test.ts
+++ b/packages/lambda/src/test/integration/renders/old-version.test.ts
@@ -56,7 +56,7 @@ test('Should fail when using an incompatible version', async () => {
audioBitrate: null,
videoBitrate: null,
encodingBufferSize: null,
- maxRate: null,
+ encodingMaxRate: null,
forceHeight: null,
forceWidth: null,
rendererFunctionName: null,
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 b3d80c7af0..7c9546ebe4 100644
--- a/packages/lambda/src/test/integration/renders/other-bucket.test.ts
+++ b/packages/lambda/src/test/integration/renders/other-bucket.test.ts
@@ -62,7 +62,7 @@ test('Should be able to render to another bucket', async () => {
audioBitrate: null,
videoBitrate: null,
encodingBufferSize: null,
- maxRate: null,
+ encodingMaxRate: null,
forceHeight: null,
forceWidth: null,
rendererFunctionName: null,
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 e3491cb745..1d962eaef1 100644
--- a/packages/lambda/src/test/integration/renders/silent-audio.test.ts
+++ b/packages/lambda/src/test/integration/renders/silent-audio.test.ts
@@ -57,7 +57,7 @@ test('Should add silent audio if there is no audio', async () => {
webhook: null,
audioBitrate: null,
videoBitrate: null,
- maxRate: null,
+ encodingMaxRate: null,
encodingBufferSize: null,
forceHeight: null,
forceWidth: null,
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 66f64fbde7..19b58edb11 100644
--- a/packages/lambda/src/test/integration/renders/transparent-webm.test.ts
+++ b/packages/lambda/src/test/integration/renders/transparent-webm.test.ts
@@ -62,7 +62,7 @@ test('Should make a transparent video', async () => {
audioBitrate: null,
videoBitrate: null,
encodingBufferSize: null,
- maxRate: null,
+ encodingMaxRate: null,
forceHeight: null,
forceWidth: null,
rendererFunctionName: null,
diff --git a/packages/lambda/src/test/integration/webhooks.test.ts b/packages/lambda/src/test/integration/webhooks.test.ts
index 341b211b82..ec951003c9 100644
--- a/packages/lambda/src/test/integration/webhooks.test.ts
+++ b/packages/lambda/src/test/integration/webhooks.test.ts
@@ -101,7 +101,7 @@ describe('Webhooks', () => {
audioBitrate: null,
videoBitrate: null,
encodingBufferSize: null,
- maxRate: null,
+ encodingMaxRate: null,
forceHeight: null,
forceWidth: null,
rendererFunctionName: null,
@@ -201,7 +201,7 @@ describe('Webhooks', () => {
audioBitrate: null,
videoBitrate: null,
encodingBufferSize: null,
- maxRate: null,
+ encodingMaxRate: null,
bucketName: 'abc',
renderId: 'abc',
forceHeight: null,
diff --git a/packages/renderer/src/crf.ts b/packages/renderer/src/crf.ts
index 895dfbe5b0..d7bcbec7aa 100644
--- a/packages/renderer/src/crf.ts
+++ b/packages/renderer/src/crf.ts
@@ -71,13 +71,13 @@ export const validateQualitySettings = ({
codec,
crf,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
}: {
crf: unknown;
codec: Codec;
videoBitrate: string | null;
- maxRate: string | null;
+ encodingMaxRate: string | null;
encodingBufferSize: string | null;
}): string[] => {
if (crf && videoBitrate) {
@@ -86,14 +86,16 @@ export const validateQualitySettings = ({
);
}
- if (maxRate && !encodingBufferSize) {
- throw new Error('"maxRate" can not be set without "encodingBufferSize".');
+ if (encodingMaxRate && !encodingBufferSize) {
+ throw new Error(
+ '"encodingMaxRate" can not be set without also setting "encodingBufferSize".',
+ );
}
const bufSizeArray = encodingBufferSize
? ['-bufsize', encodingBufferSize]
: [];
- const maxRateArray = maxRate ? ['-maxrate', maxRate] : [];
+ const maxRateArray = encodingMaxRate ? ['-maxrate', encodingMaxRate] : [];
if (videoBitrate) {
if (codec === 'prores') {
diff --git a/packages/renderer/src/ffmpeg-args.ts b/packages/renderer/src/ffmpeg-args.ts
index bfc42472fa..a087feb02d 100644
--- a/packages/renderer/src/ffmpeg-args.ts
+++ b/packages/renderer/src/ffmpeg-args.ts
@@ -14,7 +14,7 @@ const firstEncodingStepOnly = ({
codec,
crf,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
}: {
hasPreencoded: boolean;
@@ -24,7 +24,7 @@ const firstEncodingStepOnly = ({
crf: unknown;
codec: Codec;
videoBitrate: string | null;
- maxRate: string | null;
+ encodingMaxRate: string | null;
encodingBufferSize: string | null;
}): string[][] => {
if (hasPreencoded || codec === 'gif') {
@@ -43,7 +43,7 @@ const firstEncodingStepOnly = ({
crf,
videoBitrate,
codec,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
}),
].filter(truthy);
@@ -57,7 +57,7 @@ export const generateFfmpegArgs = ({
codec,
crf,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
colorSpace,
}: {
@@ -68,7 +68,7 @@ export const generateFfmpegArgs = ({
crf: unknown;
codec: Codec;
videoBitrate: string | null;
- maxRate: string | null;
+ encodingMaxRate: string | null;
encodingBufferSize: string | null;
colorSpace: ColorSpace;
}): string[][] => {
@@ -100,7 +100,7 @@ export const generateFfmpegArgs = ({
pixelFormat,
proResProfileName,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
x264Preset,
}),
diff --git a/packages/renderer/src/prespawn-ffmpeg.ts b/packages/renderer/src/prespawn-ffmpeg.ts
index 56304bc509..b75d56dd02 100644
--- a/packages/renderer/src/prespawn-ffmpeg.ts
+++ b/packages/renderer/src/prespawn-ffmpeg.ts
@@ -50,7 +50,7 @@ type PreStitcherOptions = {
ffmpegOverride: FfmpegOverrideFn;
signal: CancelSignal;
videoBitrate: string | null;
- maxRate: string | null;
+ encodingMaxRate: string | null;
encodingBufferSize: string | null;
indent: boolean;
colorSpace: ColorSpace;
@@ -100,7 +100,7 @@ export const prespawnFfmpeg = (options: PreStitcherOptions) => {
codec,
crf: options.crf,
videoBitrate: options.videoBitrate,
- maxRate: options.maxRate,
+ encodingMaxRate: options.encodingMaxRate,
encodingBufferSize: options.encodingBufferSize,
colorSpace: options.colorSpace,
}),
diff --git a/packages/renderer/src/render-media.ts b/packages/renderer/src/render-media.ts
index df7754cbd1..a0b8d13bff 100644
--- a/packages/renderer/src/render-media.ts
+++ b/packages/renderer/src/render-media.ts
@@ -121,7 +121,7 @@ export type InternalRenderMediaOptions = {
ffmpegOverride: FfmpegOverrideFn | undefined;
audioBitrate: string | null;
videoBitrate: string | null;
- maxRate: string | null;
+ encodingMaxRate: string | null;
encodingBufferSize: string | null;
disallowParallelEncoding: boolean;
audioCodec: AudioCodec | null;
@@ -175,7 +175,7 @@ export type RenderMediaOptions = {
ffmpegOverride?: FfmpegOverrideFn;
audioBitrate?: string | null;
videoBitrate?: string | null;
- maxRate?: string | null;
+ encodingMaxRate?: string | null;
encodingBufferSize?: string | null;
disallowParallelEncoding?: boolean;
audioCodec?: AudioCodec | null;
@@ -221,7 +221,7 @@ const internalRenderMediaRaw = ({
ffmpegOverride,
audioBitrate,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
audioCodec,
concurrency,
@@ -245,7 +245,7 @@ const internalRenderMediaRaw = ({
crf,
codec,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
});
validateBitrate(audioBitrate, 'audioBitrate');
@@ -459,7 +459,7 @@ const internalRenderMediaRaw = ({
signal: cancelPrestitcher.cancelSignal,
ffmpegOverride: ffmpegOverride ?? (({args}) => args),
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
indent,
x264Preset: x264Preset ?? null,
@@ -672,7 +672,7 @@ const internalRenderMediaRaw = ({
audioBitrate,
videoBitrate,
encodingBufferSize,
- maxRate,
+ encodingMaxRate,
audioCodec,
x264Preset: x264Preset ?? null,
colorSpace,
@@ -784,7 +784,7 @@ export const renderMedia = ({
ffmpegOverride,
audioBitrate,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
audioCodec,
jpegQuality,
@@ -849,7 +849,7 @@ export const renderMedia = ({
scale: scale ?? 1,
timeoutInMilliseconds: timeoutInMilliseconds ?? DEFAULT_TIMEOUT,
videoBitrate: videoBitrate ?? null,
- maxRate: maxRate ?? null,
+ encodingMaxRate: encodingMaxRate ?? null,
encodingBufferSize: encodingBufferSize ?? null,
logLevel:
verbose || dumpBrowserLogs ? 'verbose' : logLevel ?? getLogLevel(),
diff --git a/packages/renderer/src/stitch-frames-to-video.ts b/packages/renderer/src/stitch-frames-to-video.ts
index 6c78401c24..e31d257eaa 100644
--- a/packages/renderer/src/stitch-frames-to-video.ts
+++ b/packages/renderer/src/stitch-frames-to-video.ts
@@ -56,7 +56,7 @@ const packageJson = fs.existsSync(packageJsonPath)
type InternalStitchFramesToVideoOptions = {
audioBitrate: string | null;
videoBitrate: string | null;
- maxRate: string | null;
+ encodingMaxRate: string | null;
encodingBufferSize: string | null;
fps: number;
width: number;
@@ -88,7 +88,7 @@ type InternalStitchFramesToVideoOptions = {
export type StitchFramesToVideoOptions = {
audioBitrate?: string | null;
videoBitrate?: string | null;
- maxRate?: string | null;
+ encodingMaxRate?: string | null;
encodingBufferSize?: string | null;
fps: number;
width: number;
@@ -231,7 +231,7 @@ const innerStitchFramesToVideo = async (
proResProfile,
logLevel,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
width,
numberOfGifLoops,
@@ -257,7 +257,7 @@ const innerStitchFramesToVideo = async (
validateBitrate(audioBitrate, 'audioBitrate');
validateBitrate(videoBitrate, 'videoBitrate');
- validateBitrate(maxRate, 'maxRate');
+ validateBitrate(encodingMaxRate, 'encodingMaxRate');
// encodingBufferSize is not a bitrate but need to be validated using the same format
validateBitrate(encodingBufferSize, 'encodingBufferSize');
validateFps(fps, 'in `stitchFramesToVideo()`', false);
@@ -341,7 +341,7 @@ const innerStitchFramesToVideo = async (
crf,
codec,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
});
validateSelectedPixelFormatAndCodecCombination(pixelFormat, codec);
@@ -439,7 +439,7 @@ const innerStitchFramesToVideo = async (
codec,
crf,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
hasPreencoded: Boolean(preEncodedFileLocation),
proResProfileName,
@@ -591,7 +591,7 @@ export const stitchFramesToVideo = ({
proResProfile,
verbose,
videoBitrate,
- maxRate,
+ encodingMaxRate,
encodingBufferSize,
x264Preset,
colorSpace,
@@ -599,7 +599,7 @@ export const stitchFramesToVideo = ({
return internalStitchFramesToVideo({
assetsInfo,
audioBitrate: audioBitrate ?? null,
- maxRate: maxRate ?? null,
+ encodingMaxRate: encodingMaxRate ?? null,
encodingBufferSize: encodingBufferSize ?? null,
audioCodec: audioCodec ?? null,
cancelSignal: cancelSignal ?? null,
diff --git a/packages/renderer/src/test/crf.test.ts b/packages/renderer/src/test/crf.test.ts
index 3ffd9a6b1b..5d9d025d7c 100644
--- a/packages/renderer/src/test/crf.test.ts
+++ b/packages/renderer/src/test/crf.test.ts
@@ -45,9 +45,9 @@ describe('validateSelectedCrfAndCodecCombination valid input', () => {
validateQualitySettings({
crf: entry[0],
codec: entry[1],
- videoBitrate: undefined,
- maxRate: undefined,
- encodingBufferSize: undefined,
+ videoBitrate: null,
+ encodingMaxRate: null,
+ encodingBufferSize: null,
}),
).not.toThrow()),
);
@@ -75,9 +75,9 @@ describe('validateSelectedCrfAndCodecCombination invalid input', () => {
validateQualitySettings({
crf: entry[0],
codec: entry[1],
- videoBitrate: undefined,
- maxRate: undefined,
- encodingBufferSize: undefined,
+ videoBitrate: null,
+ encodingMaxRate: null,
+ encodingBufferSize: null,
}),
).toThrow(
new RegExp(
@@ -92,9 +92,9 @@ test('ProRes', () => {
validateQualitySettings({
crf: 3,
codec: 'prores',
- videoBitrate: undefined,
- maxRate: undefined,
- encodingBufferSize: undefined,
+ videoBitrate: null,
+ encodingMaxRate: null,
+ encodingBufferSize: null,
}),
).toThrow(/The "prores" codec does not support the --crf option\./);
});
@@ -104,9 +104,9 @@ test('WAV', () => {
validateQualitySettings({
crf: 3,
codec: 'wav',
- videoBitrate: undefined,
- maxRate: undefined,
- encodingBufferSize: undefined,
+ videoBitrate: null,
+ encodingMaxRate: null,
+ encodingBufferSize: null,
}),
).toThrow(/The "wav" codec does not support the --crf option\./);
});
@@ -117,24 +117,24 @@ test('WAV', () => {
crf: 10,
codec: 'h264',
videoBitrate: '1M',
- maxRate: undefined,
- encodingBufferSize: undefined,
+ encodingMaxRate: null,
+ encodingBufferSize: null,
}),
).toThrow(
/"crf" and "videoBitrate" can not both be set. Choose one of either./,
);
});
-test('maxRate', () => {
+test('encodingMaxRate', () => {
expect(() =>
validateQualitySettings({
crf: 10,
codec: 'h264',
videoBitrate: null,
- maxRate: '1M',
+ encodingMaxRate: '1M',
encodingBufferSize: null,
}),
- ).toThrow(/"maxRate" can not be set without "encodingBufferSize"./);
+ ).toThrow(/"encodingMaxRate" can not be set without "encodingBufferSize"./);
});
describe('crf tests getValidCrfRanges invalid input', () => {