🎥 Make videos programmatically with React
rename to encodingBufferSize
Jonny Burger4c7edcf57a52
diff --git a/packages/bundler/src/index-html.ts b/packages/bundler/src/index-html.tsindex b04d1abeed..d99fee4583 100644--- a/packages/bundler/src/index-html.ts+++ b/packages/bundler/src/index-html.ts@@ -20,7 +20,7 @@ export type RenderDefaults = {pixelFormat: string;audioBitrate: string | null;videoBitrate: string | null;- bufSize: string | null;+ encodingBufferSize: string | null;maxRate: string | null;everyNthFrame: number;numberOfGifLoops: number | null;diff --git a/packages/cli/src/benchmark.ts b/packages/cli/src/benchmark.tsindex d2948a3a39..81c15598d5 100644--- a/packages/cli/src/benchmark.ts+++ b/packages/cli/src/benchmark.ts@@ -183,7 +183,7 @@ export const benchmarkCommand = async (audioBitrate,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,height,width,concurrency: unparsedConcurrency,@@ -352,7 +352,7 @@ export const benchmarkCommand = async (audioBitrate,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,puppeteerInstance,concurrency: con,audioCodec: null,diff --git a/packages/cli/src/config/bitrate.ts b/packages/cli/src/config/bitrate.tsindex f039f9b864..ce1c1b4e10 100644--- a/packages/cli/src/config/bitrate.ts+++ b/packages/cli/src/config/bitrate.ts@@ -22,22 +22,21 @@ let maxRate: string | null = null;export const setVideoMaxRate = (bitrate: string | null) => {maxRate = bitrate;-}+};export const getVideoMaxRate = () => {return maxRate;-}+};/**- * bufSize is not a bitrate, but it is a bitrate-related option and get validated like a bitrate.+ * encodingBufferSize is not a bitrate, but it is a bitrate-related option and get validated like a bitrate.*/-let bufSize: string | null = null;--export const setVideoBufSize = (bitrate: string | null) => {- bufSize = bitrate;-}+let encodingBufferSize: string | null = null;-export const getVideoBufSize = () => {- return bufSize;-}+export const setEncodingBufferSize = (bitrate: string | null) => {+ encodingBufferSize = bitrate;+};+export const getEncodingBufferSize = () => {+ return encodingBufferSize;+};diff --git a/packages/cli/src/config/index.ts b/packages/cli/src/config/index.tsindex a7ba881b79..9c5d5ee0f9 100644--- a/packages/cli/src/config/index.ts+++ b/packages/cli/src/config/index.ts@@ -59,14 +59,13 @@ import type {import {getAudioCodec, setAudioCodec} from './audio-codec';import {getAudioBitrate,+ getEncodingBufferSize,getVideoBitrate,- getVideoBufSize,getVideoMaxRate,setAudioBitrate,+ setEncodingBufferSize,setVideoBitrate,- setVideoBufSize,- setVideoMaxRate-+ setVideoMaxRate,} from './bitrate';import {setBrowserExecutable} from './browser-executable';import {@@ -439,9 +438,9 @@ declare global {readonly setVideoMaxRate: (bitrate: string | null) => void;/**- * Set a buffer size to be passed to FFMPEG.+ * Set a buffer size to be passed to FFmpeg.*/- readonly setVideoBufSize: (bitrate: string | null) => void;+ readonly setEncodingBufferSize: (bitrate: string | null) => void;/*** Opt into bt709 rendering.@@ -571,7 +570,7 @@ export const Config: FlatConfig = {setStillImageFormat,setVideoImageFormat,setVideoMaxRate,- setVideoBufSize,+ setEncodingBufferSize,setFrameRange,setScale,setEveryNthFrame,@@ -642,7 +641,7 @@ export const ConfigInternals = {getFfmpegOverrideFunction,getAudioBitrate,getVideoBitrate,- getVideoBufSize,+ getEncodingBufferSize,getVideoMaxRate,getHeight,getWidth,diff --git a/packages/cli/src/get-cli-options.ts b/packages/cli/src/get-cli-options.tsindex c7c2214c33..2028cc7b86 100644--- a/packages/cli/src/get-cli-options.ts+++ b/packages/cli/src/get-cli-options.ts@@ -12,7 +12,6 @@ import {getEnvironmentVariables} from './get-env';import {getInputProps} from './get-input-props';import {Log} from './log';-const getAndValidateFrameRange = (logLevel: LogLevel, indent: boolean) => {const frameRange = ConfigInternals.getRange();if (typeof frameRange === 'number') {@@ -130,8 +129,8 @@ export const getCliOptions = async (options: {});const crf = getCrf(shouldOutputImageSequence);const videoBitrate = ConfigInternals.getVideoBitrate();- const bufSize = ConfigInternals.getVideoBufSize()- const maxRate = ConfigInternals.getVideoMaxRate()+ const encodingBufferSize = ConfigInternals.getEncodingBufferSize();+ const maxRate = ConfigInternals.getVideoMaxRate();const pixelFormat = ConfigInternals.getPixelFormat();const proResProfile = getProResProfile();const x264Preset = getx264Preset();@@ -193,7 +192,7 @@ export const getCliOptions = async (options: {ffmpegOverride: ConfigInternals.getFfmpegOverrideFunction(),audioBitrate: ConfigInternals.getAudioBitrate(),videoBitrate,- bufSize,+ encodingBufferSize,maxRate,height,width,diff --git a/packages/cli/src/parse-command-line.ts b/packages/cli/src/parse-command-line.tsindex 259f107ee4..23693067f0 100644--- a/packages/cli/src/parse-command-line.ts+++ b/packages/cli/src/parse-command-line.ts@@ -266,7 +266,7 @@ export const parseCommandLine = () => {}if (typeof parsedCli['buf-size'] !== 'undefined') {- Config.setVideoBufSize(parsedCli['buf-size']);+ Config.setEncodingBufferSize(parsedCli['buf-size']);}if (typeof parsedCli['buf-size'] !== 'undefined') {diff --git a/packages/cli/src/preview-server/render-queue/job.ts b/packages/cli/src/preview-server/render-queue/job.tsindex 16f871a3b3..694c9bcc21 100644--- a/packages/cli/src/preview-server/render-queue/job.ts+++ b/packages/cli/src/preview-server/render-queue/job.ts@@ -81,7 +81,7 @@ type RenderJobDynamicFields =pixelFormat: PixelFormat;audioBitrate: string | null;videoBitrate: string | null;- bufSize: string | null;+ encodingBufferSize: string | null;maxRate: string | null;everyNthFrame: number;numberOfGifLoops: number | null;@@ -148,7 +148,7 @@ type AddRenderRequestDynamicFields =pixelFormat: PixelFormat;audioBitrate: string | null;videoBitrate: string | null;- bufSize: string | null;+ encodingBufferSize: string | null;maxRate: string | null;everyNthFrame: number;numberOfGifLoops: number | null;diff --git a/packages/cli/src/preview-server/render-queue/process-video.ts b/packages/cli/src/preview-server/render-queue/process-video.tsindex 2a3d665e4d..2e17df3c1b 100644--- a/packages/cli/src/preview-server/render-queue/process-video.ts+++ b/packages/cli/src/preview-server/render-queue/process-video.ts@@ -75,7 +75,7 @@ export const processVideoJob = async ({x264Preset: job.type === 'video' ? job.x264Preset ?? undefined : undefined,pixelFormat: job.type === 'video' ? job.pixelFormat : 'yuv420p',videoBitrate: job.type === 'video' ? job.videoBitrate : null,- bufSize: job.type === 'video' ? job.bufSize : null,+ encodingBufferSize: job.type === 'video' ? job.encodingBufferSize : null,maxRate: job.type === 'video' ? job.maxRate : null,numberOfGifLoops: job.type === 'video' ? job.numberOfGifLoops : null,audioCodec: job.type === 'video' ? job.audioCodec : null,diff --git a/packages/cli/src/preview-server/routes.ts b/packages/cli/src/preview-server/routes.tsindex a6ab39b970..395359d774 100644--- a/packages/cli/src/preview-server/routes.ts+++ b/packages/cli/src/preview-server/routes.ts@@ -74,7 +74,7 @@ const handleFallback = async ({const x264Preset = ConfigInternals.getPresetProfile() ?? 'medium';const audioBitrate = ConfigInternals.getAudioBitrate();const videoBitrate = ConfigInternals.getVideoBitrate();- const bufSize = ConfigInternals.getVideoBufSize();+ const encodingBufferSize = ConfigInternals.getEncodingBufferSize();const maxRate = ConfigInternals.getVideoMaxRate();const everyNthFrame = ConfigInternals.getEveryNthFrame();const numberOfGifLoops = ConfigInternals.getNumberOfGifLoops();@@ -134,7 +134,7 @@ const handleFallback = async ({pixelFormat,audioBitrate,videoBitrate,- bufSize,+ encodingBufferSize,maxRate,everyNthFrame,numberOfGifLoops,diff --git a/packages/cli/src/preview-server/routes/add-render.ts b/packages/cli/src/preview-server/routes/add-render.tsindex 06fea7a85a..03868be80c 100644--- a/packages/cli/src/preview-server/routes/add-render.ts+++ b/packages/cli/src/preview-server/routes/add-render.ts@@ -42,7 +42,7 @@ export const handleAddRender: ApiHandler<AddRenderRequest, undefined> = ({audioBitrate: input.audioBitrate,videoBitrate: input.videoBitrate,maxRate: input.maxRate,- bufSize: input.bufSize,+ encodingBufferSize: input.encodingBufferSize,everyNthFrame: input.everyNthFrame,numberOfGifLoops: input.numberOfGifLoops,delayRenderTimeout: input.delayRenderTimeout,@@ -50,7 +50,7 @@ export const handleAddRender: ApiHandler<AddRenderRequest, undefined> = ({chromiumOptions: input.chromiumOptions,envVariables: input.envVariables,serializedInputPropsWithCustomSchema:- input.serializedInputPropsWithCustomSchema,+ input.serializedInputPropsWithCustomSchema,offthreadVideoCacheSizeInBytes: input.offthreadVideoCacheSizeInBytes,colorSpace: input.colorSpace,multiProcessOnLinux: input.multiProcessOnLinux,diff --git a/packages/cli/src/render-flows/render.ts b/packages/cli/src/render-flows/render.tsindex 15e6257190..951c5ab9b4 100644--- a/packages/cli/src/render-flows/render.ts+++ b/packages/cli/src/render-flows/render.ts@@ -91,7 +91,7 @@ export const renderVideoFlow = async ({pixelFormat,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,numberOfGifLoops,audioCodec,serializedInputPropsWithCustomSchema,@@ -135,7 +135,7 @@ export const renderVideoFlow = async ({audioBitrate: string | null;videoBitrate: string | null;maxRate: string | null;- bufSize: string | null;+ encodingBufferSize: string | null;muted: boolean;enforceAudioTrack: boolean;proResProfile: ProResProfile | undefined;@@ -463,7 +463,7 @@ export const renderVideoFlow = async ({audioBitrate,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,onProgress: (update) => {(stitchingProgress as StitchingProgressInput).doneIn =update.encodedDoneIn;diff --git a/packages/cli/src/render.tsx b/packages/cli/src/render.tsxindex 9c84d8a292..bc5d642d28 100644--- a/packages/cli/src/render.tsx+++ b/packages/cli/src/render.tsx@@ -68,7 +68,7 @@ export const render = async (pixelFormat,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,numberOfGifLoops,offthreadVideoCacheSizeInBytes,colorSpace,@@ -130,7 +130,7 @@ export const render = async (pixelFormat,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,numberOfGifLoops,audioCodec,disallowParallelEncoding: false,diff --git a/packages/cloudrun/src/api/render-media-on-cloudrun.ts b/packages/cloudrun/src/api/render-media-on-cloudrun.tsindex ff4b55bcfa..bdbaef081d 100644--- a/packages/cloudrun/src/api/render-media-on-cloudrun.ts+++ b/packages/cloudrun/src/api/render-media-on-cloudrun.ts@@ -49,7 +49,7 @@ type InternalRenderMediaOnCloudrun = {audioBitrate: string | null;videoBitrate: string | null;maxRate: string | null;- bufSize: string | null;+ encodingBufferSize: string | null;proResProfile: ProResProfile | undefined;x264Preset: X264Preset | undefined;crf: Crf | null;@@ -89,7 +89,7 @@ export type RenderMediaOnCloudrunInput = {audioBitrate?: string | null;videoBitrate?: string | null;maxRate?: string | null;- bufSize?: string | null;+ encodingBufferSize?: string | null;proResProfile?: ProResProfile;x264Preset?: X264Preset;crf?: number | undefined;@@ -129,7 +129,7 @@ const internalRenderMediaOnCloudrunRaw = async ({audioBitrate,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,proResProfile,x264Preset,crf,@@ -181,8 +181,8 @@ const internalRenderMediaOnCloudrunRaw = async ({audioCodec: audioCodec ?? null,audioBitrate: audioBitrate ?? null,videoBitrate: videoBitrate ?? null,- bufSize: maxRate ?? null,- maxRate: bufSize ?? null,+ encodingBufferSize: maxRate ?? null,+ maxRate: encodingBufferSize ?? null,crf: crf ?? null,pixelFormat: pixelFormat ?? RenderInternals.DEFAULT_PIXEL_FORMAT,imageFormat: imageFormat ?? RenderInternals.DEFAULT_VIDEO_IMAGE_FORMAT,@@ -313,8 +313,8 @@ export const internalRenderMediaOnCloudrun = PureJSAPIs.wrapWithErrorHandling(* @param params.audioCodec The encoding of the audio of the output video.* @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.bufSize 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 bufsize.+ * @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.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.@@ -353,7 +353,7 @@ export const renderMediaOnCloudrun = ({audioBitrate,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,proResProfile,x264Preset,crf,@@ -395,7 +395,7 @@ export const renderMediaOnCloudrun = ({audioBitrate: audioBitrate ?? null,videoBitrate: videoBitrate ?? null,maxRate: maxRate ?? null,- bufSize: bufSize ?? null,+ encodingBufferSize: encodingBufferSize ?? null,proResProfile: proResProfile ?? undefined,x264Preset: x264Preset ?? undefined,crf: crf ?? null,diff --git a/packages/cloudrun/src/cli/commands/render/index.ts b/packages/cloudrun/src/cli/commands/render/index.tsindex c933c44bd8..91b2b2b83f 100644--- a/packages/cloudrun/src/cli/commands/render/index.ts+++ b/packages/cloudrun/src/cli/commands/render/index.ts@@ -60,7 +60,7 @@ export const renderCommand = async (audioBitrate,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,height,width,browserExecutable,@@ -199,7 +199,7 @@ ${downloadName ? ` Downloaded File = ${downloadName}` : ''}audioBitrate,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,proResProfile,x264Preset,crf,diff --git a/packages/cloudrun/src/functions/helpers/payloads.ts b/packages/cloudrun/src/functions/helpers/payloads.tsindex adaa565c9f..51a1a843e5 100644--- a/packages/cloudrun/src/functions/helpers/payloads.ts+++ b/packages/cloudrun/src/functions/helpers/payloads.ts@@ -32,7 +32,7 @@ export const CloudRunPayload = z.discriminatedUnion('type', [audioBitrate: z.string().nullable(),videoBitrate: z.string().nullable(),maxRate: z.string().nullable(),- bufSize: z.string().nullable(),+ encodingBufferSize: z.string().nullable(),crf: z.number().nullable(),pixelFormat,imageFormat: videoImageFormat,diff --git a/packages/cloudrun/src/functions/render-media-single-thread.ts b/packages/cloudrun/src/functions/render-media-single-thread.tsindex 4f3692efe7..69ea8a6ea8 100644--- a/packages/cloudrun/src/functions/render-media-single-thread.ts+++ b/packages/cloudrun/src/functions/render-media-single-thread.ts@@ -68,7 +68,7 @@ export const renderMediaSingleThread = async (audioBitrate: body.audioBitrate,videoBitrate: body.videoBitrate,maxRate: body.maxRate,- bufSize: body.bufSize,+ encodingBufferSize: body.encodingBufferSize,crf: body.crf,pixelFormat: body.pixelFormat,imageFormat: body.imageFormat,diff --git a/packages/it-tests/src/monorepo/go-package.test.ts b/packages/it-tests/src/monorepo/go-package.test.tsindex 2050e9a1d6..d2590dc1dd 100644--- a/packages/it-tests/src/monorepo/go-package.test.ts+++ b/packages/it-tests/src/monorepo/go-package.test.ts@@ -66,7 +66,7 @@ test("Go package should create the same payload as normal Lambda package", asynctimeoutInMilliseconds: 30000,videoBitrate: null,maxRate: null,- bufSize: null,+ encodingBufferSize: null,webhook: null,x264Preset: null,inputProps: {},diff --git a/packages/it-tests/src/monorepo/php-package.test.ts b/packages/it-tests/src/monorepo/php-package.test.tsindex 2d0460a0d1..5dce4c05b4 100644--- a/packages/it-tests/src/monorepo/php-package.test.ts+++ b/packages/it-tests/src/monorepo/php-package.test.ts@@ -97,7 +97,7 @@ test("PHP package should create the same renderMedia payload as normal Lambda patimeoutInMilliseconds: 30000,videoBitrate: null,maxRate: null,- bufSize: 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.tsindex 734d008dd8..516a6dd742 100644--- a/packages/it-tests/src/monorepo/python-package.test.ts+++ b/packages/it-tests/src/monorepo/python-package.test.ts@@ -80,7 +80,7 @@ test("Python package should create the same renderMedia payload as normal LambdatimeoutInMilliseconds: 30000,videoBitrate: null,maxRate: null,- bufSize: 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.tsindex 250fd623a0..ff6ffa7ad9 100644--- a/packages/lambda/src/api/make-lambda-payload.ts+++ b/packages/lambda/src/api/make-lambda-payload.ts@@ -67,7 +67,7 @@ export type InnerRenderMediaOnLambdaInput = {audioBitrate: string | null;videoBitrate: string | null;maxRate: string | null;- bufSize: string | null;+ encodingBufferSize: string | null;webhook: WebhookOption | null;forceWidth: number | null;forceHeight: number | null;@@ -111,7 +111,7 @@ export const makeLambdaRenderMediaPayload = async ({webhook,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,downloadBehavior,muted,overwrite,@@ -174,7 +174,7 @@ export const makeLambdaRenderMediaPayload = async ({overwrite: overwrite ?? false,audioBitrate: audioBitrate ?? null,videoBitrate: videoBitrate ?? null,- bufSize: bufSize ?? null,+ encodingBufferSize: encodingBufferSize ?? null,maxRate: maxRate ?? null,webhook: webhook ?? null,forceHeight: forceHeight ?? null,diff --git a/packages/lambda/src/api/render-media-on-lambda.ts b/packages/lambda/src/api/render-media-on-lambda.tsindex 298fa67ba1..73f83073c8 100644--- a/packages/lambda/src/api/render-media-on-lambda.ts+++ b/packages/lambda/src/api/render-media-on-lambda.ts@@ -63,7 +63,7 @@ export type RenderMediaOnLambdaInput = {audioBitrate?: string | null;videoBitrate?: string | null;maxRate?: string | null;- bufSize?: string | null;+ encodingBufferSize?: string | null;webhook?: WebhookOption | null;forceWidth?: number | null;forceHeight?: number | null;@@ -203,7 +203,7 @@ export const renderMediaOnLambda = (timeoutInMilliseconds: options.timeoutInMilliseconds ?? 30000,videoBitrate: options.videoBitrate ?? null,maxRate: options.maxRate ?? null,- bufSize: options.bufSize ?? null,+ encodingBufferSize: options.encodingBufferSize ?? null,webhook: options.webhook ?? null,x264Preset: options.x264Preset ?? null,deleteAfter: options.deleteAfter ?? null,diff --git a/packages/lambda/src/cli/commands/render/render.ts b/packages/lambda/src/cli/commands/render/render.tsindex e47883b077..73c4064b32 100644--- a/packages/lambda/src/cli/commands/render/render.ts+++ b/packages/lambda/src/cli/commands/render/render.ts@@ -77,7 +77,7 @@ export const renderCommand = async (audioBitrate,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,height,width,browserExecutable,@@ -199,7 +199,7 @@ export const renderCommand = async (overwrite,audioBitrate,videoBitrate,- bufSize,+ encodingBufferSize,maxRate,forceHeight: height,forceWidth: width,diff --git a/packages/lambda/src/functions/launch.ts b/packages/lambda/src/functions/launch.tsindex d5abb2fa92..9044984982 100644--- a/packages/lambda/src/functions/launch.ts+++ b/packages/lambda/src/functions/launch.ts@@ -272,7 +272,7 @@ const innerLaunchHandler = async ({audioBitrate: params.audioBitrate,videoBitrate: params.videoBitrate,maxRate: params.maxRate,- bufSize: params.bufSize,+ encodingBufferSize: params.encodingBufferSize,launchFunctionConfig: {version: VERSION,},diff --git a/packages/lambda/src/functions/renderer.ts b/packages/lambda/src/functions/renderer.tsindex 62c05736bf..67df92261d 100644--- a/packages/lambda/src/functions/renderer.ts+++ b/packages/lambda/src/functions/renderer.ts@@ -207,7 +207,7 @@ const renderHandler = async (enforceAudioTrack: true,audioBitrate: params.audioBitrate,videoBitrate: params.videoBitrate,- bufSize: params.bufSize,+ encodingBufferSize: params.encodingBufferSize,maxRate: params.maxRate,// Lossless flag takes priority over audio codec// https://github.com/remotion-dev/remotion/issues/1647diff --git a/packages/lambda/src/functions/start.ts b/packages/lambda/src/functions/start.tsindex 1acab324d5..e0bba13723 100644--- a/packages/lambda/src/functions/start.ts+++ b/packages/lambda/src/functions/start.ts@@ -96,7 +96,7 @@ export const startHandler = async (params: LambdaPayload, options: Options) => {webhook: params.webhook,audioBitrate: params.audioBitrate,videoBitrate: params.videoBitrate,- bufSize: params.bufSize,+ encodingBufferSize: params.encodingBufferSize,maxRate: params.maxRate,forceHeight: params.forceHeight,forceWidth: params.forceWidth,diff --git a/packages/lambda/src/shared/constants.ts b/packages/lambda/src/shared/constants.tsindex 19650fcff0..ae0581e181 100644--- a/packages/lambda/src/shared/constants.ts+++ b/packages/lambda/src/shared/constants.ts@@ -270,7 +270,7 @@ export type LambdaStartPayload = {audioBitrate: string | null;videoBitrate: string | null;maxRate: string | null;- bufSize: string | null;+ encodingBufferSize: string | null;webhook: WebhookOption;forceHeight: number | null;forceWidth: number | null;@@ -328,7 +328,7 @@ export type LambdaPayloads = {audioBitrate: string | null;videoBitrate: string | null;maxRate: string | null;- bufSize: string | null;+ encodingBufferSize: string | null;webhook: WebhookOption;forceHeight: number | null;forceWidth: number | null;@@ -371,7 +371,7 @@ export type LambdaPayloads = {muted: boolean;audioBitrate: string | null;videoBitrate: string | null;- bufSize: string | null;+ encodingBufferSize: string | null;maxRate: 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.tsindex e46e53762c..4a8b13cb03 100644--- a/packages/lambda/src/test/integration/renders/gif.test.ts+++ b/packages/lambda/src/test/integration/renders/gif.test.ts@@ -58,7 +58,7 @@ test('Should make a distributed GIF', async () => {webhook: null,audioBitrate: null,videoBitrate: null,- bufSize: null,+ encodingBufferSize: null,maxRate: null,forceHeight: null,forceWidth: null,diff --git a/packages/lambda/src/test/integration/renders/old-version.test.ts b/packages/lambda/src/test/integration/renders/old-version.test.tsindex 306ee54836..c3d7420d16 100644--- a/packages/lambda/src/test/integration/renders/old-version.test.ts+++ b/packages/lambda/src/test/integration/renders/old-version.test.ts@@ -55,7 +55,7 @@ test('Should fail when using an incompatible version', async () => {webhook: null,audioBitrate: null,videoBitrate: null,- bufSize: null,+ encodingBufferSize: null,maxRate: null,forceHeight: null,forceWidth: null,diff --git a/packages/lambda/src/test/integration/renders/other-bucket.test.ts b/packages/lambda/src/test/integration/renders/other-bucket.test.tsindex cb3e719131..b3d80c7af0 100644--- a/packages/lambda/src/test/integration/renders/other-bucket.test.ts+++ b/packages/lambda/src/test/integration/renders/other-bucket.test.ts@@ -61,7 +61,7 @@ test('Should be able to render to another bucket', async () => {webhook: null,audioBitrate: null,videoBitrate: null,- bufSize: null,+ encodingBufferSize: null,maxRate: null,forceHeight: null,forceWidth: null,diff --git a/packages/lambda/src/test/integration/renders/silent-audio.test.ts b/packages/lambda/src/test/integration/renders/silent-audio.test.tsindex 3cdb553310..e3491cb745 100644--- a/packages/lambda/src/test/integration/renders/silent-audio.test.ts+++ b/packages/lambda/src/test/integration/renders/silent-audio.test.ts@@ -58,7 +58,7 @@ test('Should add silent audio if there is no audio', async () => {audioBitrate: null,videoBitrate: null,maxRate: null,- bufSize: null,+ encodingBufferSize: null,forceHeight: null,forceWidth: null,rendererFunctionName: null,diff --git a/packages/lambda/src/test/integration/renders/transparent-webm.test.ts b/packages/lambda/src/test/integration/renders/transparent-webm.test.tsindex 7d31abd0d7..66f64fbde7 100644--- a/packages/lambda/src/test/integration/renders/transparent-webm.test.ts+++ b/packages/lambda/src/test/integration/renders/transparent-webm.test.ts@@ -61,7 +61,7 @@ test('Should make a transparent video', async () => {webhook: null,audioBitrate: null,videoBitrate: null,- bufSize: null,+ encodingBufferSize: null,maxRate: null,forceHeight: null,forceWidth: null,diff --git a/packages/lambda/src/test/integration/webhooks.test.ts b/packages/lambda/src/test/integration/webhooks.test.tsindex 47433f0698..341b211b82 100644--- a/packages/lambda/src/test/integration/webhooks.test.ts+++ b/packages/lambda/src/test/integration/webhooks.test.ts@@ -100,7 +100,7 @@ describe('Webhooks', () => {},audioBitrate: null,videoBitrate: null,- bufSize: null,+ encodingBufferSize: null,maxRate: null,forceHeight: null,forceWidth: null,@@ -200,7 +200,7 @@ describe('Webhooks', () => {},audioBitrate: null,videoBitrate: null,- bufSize: null,+ encodingBufferSize: null,maxRate: null,bucketName: 'abc',renderId: 'abc',diff --git a/packages/renderer/src/crf.ts b/packages/renderer/src/crf.tsindex 52c792d61d..895dfbe5b0 100644--- a/packages/renderer/src/crf.ts+++ b/packages/renderer/src/crf.ts@@ -72,13 +72,13 @@ export const validateQualitySettings = ({crf,videoBitrate,maxRate,- bufSize+ encodingBufferSize,}: {crf: unknown;codec: Codec;- videoBitrate: string | null | undefined;- maxRate: string | null | undefined;- bufSize: string | null | undefined;+ videoBitrate: string | null;+ maxRate: string | null;+ encodingBufferSize: string | null;}): string[] => {if (crf && videoBitrate) {throw new Error(@@ -86,13 +86,13 @@ export const validateQualitySettings = ({);}- if (maxRate && !bufSize) {- throw new Error(- '"maxRate" can not be set without "bufSize".',- );+ if (maxRate && !encodingBufferSize) {+ throw new Error('"maxRate" can not be set without "encodingBufferSize".');}- const bufSizeArray = bufSize ? ['-bufsize', bufSize] : [];+ const bufSizeArray = encodingBufferSize+ ? ['-bufsize', encodingBufferSize]+ : [];const maxRateArray = maxRate ? ['-maxrate', maxRate] : [];if (videoBitrate) {diff --git a/packages/renderer/src/ffmpeg-args.ts b/packages/renderer/src/ffmpeg-args.tsindex fa96f2127b..bfc42472fa 100644--- a/packages/renderer/src/ffmpeg-args.ts+++ b/packages/renderer/src/ffmpeg-args.ts@@ -15,7 +15,7 @@ const firstEncodingStepOnly = ({crf,videoBitrate,maxRate,- bufSize+ encodingBufferSize,}: {hasPreencoded: boolean;proResProfileName: string | null;@@ -23,9 +23,9 @@ const firstEncodingStepOnly = ({x264Preset: X264Preset | null;crf: unknown;codec: Codec;- videoBitrate: string | null | undefined;- maxRate: string | null | undefined;- bufSize: string | null | undefined;+ videoBitrate: string | null;+ maxRate: string | null;+ encodingBufferSize: string | null;}): string[][] => {if (hasPreencoded || codec === 'gif') {return [];@@ -44,7 +44,7 @@ const firstEncodingStepOnly = ({videoBitrate,codec,maxRate,- bufSize+ encodingBufferSize,}),].filter(truthy);};@@ -58,7 +58,7 @@ export const generateFfmpegArgs = ({crf,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,colorSpace,}: {hasPreencoded: boolean;@@ -67,9 +67,9 @@ export const generateFfmpegArgs = ({x264Preset: X264Preset | null;crf: unknown;codec: Codec;- videoBitrate: string | null | undefined;- maxRate: string | null | undefined;- bufSize: string | null | undefined;+ videoBitrate: string | null;+ maxRate: string | null;+ encodingBufferSize: string | null;colorSpace: ColorSpace;}): string[][] => {const encoderName = getCodecName(codec);@@ -101,7 +101,7 @@ export const generateFfmpegArgs = ({proResProfileName,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,x264Preset,}),].filter(truthy);diff --git a/packages/renderer/src/prespawn-ffmpeg.ts b/packages/renderer/src/prespawn-ffmpeg.tsindex 1466a8e726..56304bc509 100644--- a/packages/renderer/src/prespawn-ffmpeg.ts+++ b/packages/renderer/src/prespawn-ffmpeg.ts@@ -51,7 +51,7 @@ type PreStitcherOptions = {signal: CancelSignal;videoBitrate: string | null;maxRate: string | null;- bufSize: string | null;+ encodingBufferSize: string | null;indent: boolean;colorSpace: ColorSpace;};@@ -101,7 +101,7 @@ export const prespawnFfmpeg = (options: PreStitcherOptions) => {crf: options.crf,videoBitrate: options.videoBitrate,maxRate: options.maxRate,- bufSize: options.bufSize,+ encodingBufferSize: options.encodingBufferSize,colorSpace: options.colorSpace,}),diff --git a/packages/renderer/src/render-media.ts b/packages/renderer/src/render-media.tsindex 70aec4bf33..df7754cbd1 100644--- a/packages/renderer/src/render-media.ts+++ b/packages/renderer/src/render-media.ts@@ -122,7 +122,7 @@ export type InternalRenderMediaOptions = {audioBitrate: string | null;videoBitrate: string | null;maxRate: string | null;- bufSize: string | null;+ encodingBufferSize: string | null;disallowParallelEncoding: boolean;audioCodec: AudioCodec | null;serveUrl: string;@@ -176,7 +176,7 @@ export type RenderMediaOptions = {audioBitrate?: string | null;videoBitrate?: string | null;maxRate?: string | null;- bufSize?: string | null;+ encodingBufferSize?: string | null;disallowParallelEncoding?: boolean;audioCodec?: AudioCodec | null;serveUrl: string;@@ -222,7 +222,7 @@ const internalRenderMediaRaw = ({audioBitrate,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,audioCodec,concurrency,disallowParallelEncoding,@@ -241,7 +241,13 @@ const internalRenderMediaRaw = ({colorSpace,}: InternalRenderMediaOptions): Promise<RenderMediaResult> => {validateJpegQuality(jpegQuality);- validateQualitySettings({crf, codec, videoBitrate, maxRate, bufSize});+ validateQualitySettings({+ crf,+ codec,+ videoBitrate,+ maxRate,+ encodingBufferSize,+ });validateBitrate(audioBitrate, 'audioBitrate');validateBitrate(videoBitrate, 'videoBitrate');@@ -454,7 +460,7 @@ const internalRenderMediaRaw = ({ffmpegOverride: ffmpegOverride ?? (({args}) => args),videoBitrate,maxRate,- bufSize,+ encodingBufferSize,indent,x264Preset: x264Preset ?? null,colorSpace,@@ -665,7 +671,7 @@ const internalRenderMediaRaw = ({ffmpegOverride: ffmpegOverride ?? null,audioBitrate,videoBitrate,- bufSize,+ encodingBufferSize,maxRate,audioCodec,x264Preset: x264Preset ?? null,@@ -779,7 +785,7 @@ export const renderMedia = ({audioBitrate,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,audioCodec,jpegQuality,concurrency,@@ -844,7 +850,7 @@ export const renderMedia = ({timeoutInMilliseconds: timeoutInMilliseconds ?? DEFAULT_TIMEOUT,videoBitrate: videoBitrate ?? null,maxRate: maxRate ?? null,- bufSize: bufSize ?? null,+ encodingBufferSize: encodingBufferSize ?? null,logLevel:verbose || dumpBrowserLogs ? 'verbose' : logLevel ?? getLogLevel(),preferLossless: preferLossless ?? false,diff --git a/packages/renderer/src/stitch-frames-to-video.ts b/packages/renderer/src/stitch-frames-to-video.tsindex 4076f52263..6c78401c24 100644--- a/packages/renderer/src/stitch-frames-to-video.ts+++ b/packages/renderer/src/stitch-frames-to-video.ts@@ -57,7 +57,7 @@ type InternalStitchFramesToVideoOptions = {audioBitrate: string | null;videoBitrate: string | null;maxRate: string | null;- bufSize: string | null;+ encodingBufferSize: string | null;fps: number;width: number;height: number;@@ -89,7 +89,7 @@ export type StitchFramesToVideoOptions = {audioBitrate?: string | null;videoBitrate?: string | null;maxRate?: string | null;- bufSize?: string | null;+ encodingBufferSize?: string | null;fps: number;width: number;height: number;@@ -232,7 +232,7 @@ const innerStitchFramesToVideo = async (logLevel,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,width,numberOfGifLoops,onProgress,@@ -258,8 +258,8 @@ const innerStitchFramesToVideo = async (validateBitrate(audioBitrate, 'audioBitrate');validateBitrate(videoBitrate, 'videoBitrate');validateBitrate(maxRate, 'maxRate');- // bufSize is not a bitrate but need to be validated using the same format- validateBitrate(bufSize, 'bufSize');+ // encodingBufferSize is not a bitrate but need to be validated using the same format+ validateBitrate(encodingBufferSize, 'encodingBufferSize');validateFps(fps, 'in `stitchFramesToVideo()`', false);const proResProfileName = getProResProfileName(codec, proResProfile);@@ -342,7 +342,7 @@ const innerStitchFramesToVideo = async (codec,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,});validateSelectedPixelFormatAndCodecCombination(pixelFormat, codec);@@ -440,7 +440,7 @@ const innerStitchFramesToVideo = async (crf,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,hasPreencoded: Boolean(preEncodedFileLocation),proResProfileName,pixelFormat,@@ -592,7 +592,7 @@ export const stitchFramesToVideo = ({verbose,videoBitrate,maxRate,- bufSize,+ encodingBufferSize,x264Preset,colorSpace,}: StitchFramesToVideoOptions): Promise<Buffer | null> => {@@ -600,7 +600,7 @@ export const stitchFramesToVideo = ({assetsInfo,audioBitrate: audioBitrate ?? null,maxRate: maxRate ?? null,- bufSize: bufSize ?? null,+ encodingBufferSize: encodingBufferSize ?? null,audioCodec: audioCodec ?? null,cancelSignal: cancelSignal ?? null,codec: codec ?? DEFAULT_CODEC,diff --git a/packages/renderer/src/test/crf.test.ts b/packages/renderer/src/test/crf.test.tsindex 12f6f0aed2..3ffd9a6b1b 100644--- a/packages/renderer/src/test/crf.test.ts+++ b/packages/renderer/src/test/crf.test.ts@@ -47,7 +47,7 @@ describe('validateSelectedCrfAndCodecCombination valid input', () => {codec: entry[1],videoBitrate: undefined,maxRate: undefined,- bufSize: undefined+ encodingBufferSize: undefined,}),).not.toThrow()),);@@ -77,7 +77,7 @@ describe('validateSelectedCrfAndCodecCombination invalid input', () => {codec: entry[1],videoBitrate: undefined,maxRate: undefined,- bufSize: undefined+ encodingBufferSize: undefined,}),).toThrow(new RegExp(@@ -89,19 +89,37 @@ describe('validateSelectedCrfAndCodecCombination invalid input', () => {test('ProRes', () => {expect(() =>- validateQualitySettings({crf: 3, codec: 'prores', videoBitrate: undefined, maxRate: undefined, bufSize: undefined}),+ validateQualitySettings({+ crf: 3,+ codec: 'prores',+ videoBitrate: undefined,+ maxRate: undefined,+ encodingBufferSize: undefined,+ }),).toThrow(/The "prores" codec does not support the --crf option\./);});test('WAV', () => {expect(() =>- validateQualitySettings({crf: 3, codec: 'wav', videoBitrate: undefined, maxRate: undefined, bufSize: undefined}),+ validateQualitySettings({+ crf: 3,+ codec: 'wav',+ videoBitrate: undefined,+ maxRate: undefined,+ encodingBufferSize: undefined,+ }),).toThrow(/The "wav" codec does not support the --crf option\./);});test('WAV', () => {expect(() =>- validateQualitySettings({crf: 10, codec: 'h264', videoBitrate: '1M', maxRate: undefined, bufSize: undefined}),+ validateQualitySettings({+ crf: 10,+ codec: 'h264',+ videoBitrate: '1M',+ maxRate: undefined,+ encodingBufferSize: undefined,+ }),).toThrow(/"crf" and "videoBitrate" can not both be set. Choose one of either./,);@@ -109,10 +127,14 @@ test('WAV', () => {test('maxRate', () => {expect(() =>- validateQualitySettings({crf: 10, codec: 'h264', videoBitrate: undefined, maxRate: '1M', bufSize: undefined}),- ).toThrow(- /"maxRate" can not be set without "bufSize"./,- );+ validateQualitySettings({+ crf: 10,+ codec: 'h264',+ videoBitrate: null,+ maxRate: '1M',+ encodingBufferSize: null,+ }),+ ).toThrow(/"maxRate" can not be set without "encodingBufferSize"./);});describe('crf tests getValidCrfRanges invalid input', () => {