🎥 Make videos programmatically with React
add new offthreadvideo threads option
Jonny Burgere945fd77dcf1
diff --git a/packages/cli/src/benchmark.ts b/packages/cli/src/benchmark.tsindex 80367ac840..d291a84ca0 100644--- a/packages/cli/src/benchmark.ts+++ b/packages/cli/src/benchmark.ts@@ -53,6 +53,7 @@ const {metadataOption,hardwareAccelerationOption,chromeModeOption,+ offthreadVideoThreadsOption,} = BrowserSafeApis.options;const getValidConcurrency = (cliConcurrency: number | string | null) => {@@ -320,6 +321,9 @@ export const benchmarkCommand = async (offthreadVideoCacheSizeInBytesOption.getValue({commandLine: parsedCli,}).value,+ offthreadVideoThreads: offthreadVideoThreadsOption.getValue({+ commandLine: parsedCli,+ }).value,binariesDirectory: binariesDirectoryOption.getValue({commandLine: parsedCli,}).value,@@ -481,6 +485,9 @@ export const benchmarkCommand = async (indent: undefined,staticBase: null,}).serializedString,+ offthreadVideoThreads: offthreadVideoThreadsOption.getValue({+ commandLine: parsedCli,+ }).value,offthreadVideoCacheSizeInBytes:offthreadVideoCacheSizeInBytesOption.getValue({commandLine: parsedCli,diff --git a/packages/cli/src/compositions.ts b/packages/cli/src/compositions.tsindex fa1d9dc7ef..71b1a07150 100644--- a/packages/cli/src/compositions.ts+++ b/packages/cli/src/compositions.ts@@ -15,6 +15,7 @@ import {bundleOnCliOrTakeServeUrl} from './setup-cache';const {enableMultiprocessOnLinuxOption,offthreadVideoCacheSizeInBytesOption,+ offthreadVideoThreadsOption,glOption,headlessOption,delayRenderTimeoutInMillisecondsOption,@@ -97,6 +98,9 @@ export const listCompositionsCommand = async (offthreadVideoCacheSizeInBytesOption.getValue({commandLine: parsedCli,}).value;+ const offthreadVideoThreads = offthreadVideoThreadsOption.getValue({+ commandLine: parsedCli,+ }).value;const publicDir = publicDirOption.getValue({commandLine: parsedCli}).value;const chromeMode = chromeModeOption.getValue({commandLine: parsedCli,@@ -146,6 +150,7 @@ export const listCompositionsCommand = async (logLevel,server: undefined,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,binariesDirectory,onBrowserDownload: defaultBrowserDownloadProgress({indent: false,diff --git a/packages/cli/src/get-composition-id.ts b/packages/cli/src/get-composition-id.tsindex aa382cc507..298415bfc5 100644--- a/packages/cli/src/get-composition-id.ts+++ b/packages/cli/src/get-composition-id.ts@@ -60,6 +60,7 @@ export const getCompositionId = async ({indent,server,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,binariesDirectory,onBrowserDownload,chromeMode,@@ -78,6 +79,7 @@ export const getCompositionId = async ({indent: boolean;server: RemotionServer;offthreadVideoCacheSizeInBytes: number | null;+ offthreadVideoThreads: number | null;binariesDirectory: string | null;onBrowserDownload: OnBrowserDownload;chromeMode: ChromeMode;@@ -109,6 +111,7 @@ export const getCompositionId = async ({indent,onBrowserLog: null,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,binariesDirectory,onBrowserDownload,onServeUrlVisited: () => undefined,@@ -156,6 +159,7 @@ export const getCompositionId = async ({onBrowserLog: null,serializedInputPropsWithCustomSchema,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,binariesDirectory,onBrowserDownload,chromeMode,diff --git a/packages/cli/src/get-composition-with-dimension-override.ts b/packages/cli/src/get-composition-with-dimension-override.tsindex b0c9292042..be6cd0bca4 100644--- a/packages/cli/src/get-composition-with-dimension-override.ts+++ b/packages/cli/src/get-composition-with-dimension-override.ts@@ -27,6 +27,7 @@ export const getCompositionWithDimensionOverride = async ({logLevel,server,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,binariesDirectory,onBrowserDownload,chromeMode,@@ -47,6 +48,7 @@ export const getCompositionWithDimensionOverride = async ({serializedInputPropsWithCustomSchema: string;server: RemotionServer;offthreadVideoCacheSizeInBytes: number | null;+ offthreadVideoThreads: number | null;binariesDirectory: string | null;onBrowserDownload: OnBrowserDownload;chromeMode: ChromeMode;@@ -74,6 +76,7 @@ export const getCompositionWithDimensionOverride = async ({binariesDirectory,onBrowserDownload,chromeMode,+ offthreadVideoThreads,});return {diff --git a/packages/cli/src/get-render-defaults.ts b/packages/cli/src/get-render-defaults.tsindex 153e428a77..37188a1db3 100644--- a/packages/cli/src/get-render-defaults.ts+++ b/packages/cli/src/get-render-defaults.ts@@ -8,6 +8,7 @@ const {x264Option,audioBitrateOption,offthreadVideoCacheSizeInBytesOption,+ offthreadVideoThreadsOption,scaleOption,jpegQualityOption,videoBitrateOption,@@ -52,6 +53,9 @@ export const getRenderDefaults = (): RenderDefaults => {offthreadVideoCacheSizeInBytesOption.getValue({commandLine: parsedCli,}).value;+ const offthreadVideoThreads = offthreadVideoThreadsOption.getValue({+ commandLine: parsedCli,+ }).value;const defaultScale = scaleOption.getValue({commandLine: parsedCli,}).value;@@ -148,6 +152,7 @@ export const getRenderDefaults = (): RenderDefaults => {ignoreCertificateErrors,openGlRenderer: gl,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,colorSpace,multiProcessOnLinux,userAgent,diff --git a/packages/cli/src/list-of-remotion-packages.ts b/packages/cli/src/list-of-remotion-packages.tsindex bf834b5f67..903bee263d 100644--- a/packages/cli/src/list-of-remotion-packages.ts+++ b/packages/cli/src/list-of-remotion-packages.ts@@ -41,6 +41,7 @@ export const listOfRemotionPackages = ['@remotion/lambda-ruby','@remotion/lambda-python','@remotion/lambda',+ '@remotion/lambda-client','@remotion/layout-utils','@remotion/licensing','@remotion/lottie',@@ -58,6 +59,7 @@ export const listOfRemotionPackages = ['@remotion/promo-pages','@remotion/streaming','@remotion/serverless',+ '@remotion/serverless-client','@remotion/studio-server','@remotion/studio-shared','@remotion/studio',diff --git a/packages/cli/src/render-flows/render.ts b/packages/cli/src/render-flows/render.tsindex 9dc848c82f..9dc94023bf 100644--- a/packages/cli/src/render-flows/render.ts+++ b/packages/cli/src/render-flows/render.ts@@ -105,6 +105,7 @@ export const renderVideoFlow = async ({serializedInputPropsWithCustomSchema,disallowParallelEncoding,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,colorSpace,repro,binariesDirectory,@@ -161,6 +162,7 @@ export const renderVideoFlow = async ({audioCodec: AudioCodec | null;disallowParallelEncoding: boolean;offthreadVideoCacheSizeInBytes: number | null;+ offthreadVideoThreads: number | null;colorSpace: ColorSpace | null;repro: boolean;binariesDirectory: string | null;@@ -306,7 +308,9 @@ export const renderVideoFlow = async ({const resolvedConcurrency = RenderInternals.resolveConcurrency(concurrency);const server = await RenderInternals.prepareServer({- concurrency: resolvedConcurrency,+ offthreadVideoThreads:+ offthreadVideoThreads ??+ RenderInternals.DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS,indent,port,remotionRoot,@@ -337,6 +341,7 @@ export const renderVideoFlow = async ({logLevel,server,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,binariesDirectory,onBrowserDownload,chromeMode,@@ -516,6 +521,7 @@ export const renderVideoFlow = async ({data: config.props,}).serializedString,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,parallelEncodingEnabled: isUsingParallelEncoding,binariesDirectory,compositionStart: 0,@@ -605,6 +611,7 @@ export const renderVideoFlow = async ({staticBase: null,}).serializedString,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,colorSpace,repro: repro ?? false,binariesDirectory,diff --git a/packages/cli/src/render-flows/still.ts b/packages/cli/src/render-flows/still.tsindex 923b1d0b41..44ae633d07 100644--- a/packages/cli/src/render-flows/still.ts+++ b/packages/cli/src/render-flows/still.ts@@ -77,6 +77,7 @@ export const renderStillFlow = async ({binariesDirectory,publicPath,chromeMode,+ offthreadVideoThreads,}: {remotionRoot: string;fullEntryPoint: string;@@ -105,6 +106,7 @@ export const renderStillFlow = async ({cancelSignal: CancelSignal | null;outputLocationFromUi: string | null;offthreadVideoCacheSizeInBytes: number | null;+ offthreadVideoThreads: number | null;binariesDirectory: string | null;publicPath: string | null;chromeMode: ChromeMode;@@ -201,7 +203,9 @@ export const renderStillFlow = async ({);const server = await RenderInternals.prepareServer({- concurrency: 1,+ offthreadVideoThreads:+ offthreadVideoThreads ??+ RenderInternals.DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS,indent,port,remotionRoot,@@ -239,6 +243,7 @@ export const renderStillFlow = async ({logLevel,server,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,binariesDirectory,onBrowserDownload,chromeMode,@@ -372,6 +377,7 @@ export const renderStillFlow = async ({onBrowserDownload,onArtifact,chromeMode,+ offthreadVideoThreads,});aggregate.rendering = {diff --git a/packages/cli/src/render-queue/process-still.ts b/packages/cli/src/render-queue/process-still.tsindex 90212b83af..a236320e25 100644--- a/packages/cli/src/render-queue/process-still.ts+++ b/packages/cli/src/render-queue/process-still.ts@@ -66,6 +66,7 @@ export const processStill = async ({cancelSignal: job.cancelToken.cancelSignal,outputLocationFromUi: job.outName,offthreadVideoCacheSizeInBytes: job.offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads: job.offthreadVideoThreads,binariesDirectory: job.binariesDirectory,publicPath: null,chromeMode: job.chromeMode,diff --git a/packages/cli/src/render-queue/process-video.ts b/packages/cli/src/render-queue/process-video.tsindex 3426038b06..304d4ce927 100644--- a/packages/cli/src/render-queue/process-video.ts+++ b/packages/cli/src/render-queue/process-video.ts@@ -99,5 +99,6 @@ export const processVideoJob = async ({hardwareAcceleration:job.type === 'video' ? job.hardwareAcceleration : 'disable',chromeMode: job.chromeMode,+ offthreadVideoThreads: job.offthreadVideoThreads,});};diff --git a/packages/cli/src/render.tsx b/packages/cli/src/render.tsxindex 138cffc30e..9660452636 100644--- a/packages/cli/src/render.tsx+++ b/packages/cli/src/render.tsx@@ -39,6 +39,7 @@ const {metadataOption,hardwareAccelerationOption,chromeModeOption,+ offthreadVideoThreadsOption,} = BrowserSafeApis.options;export const render = async (@@ -108,6 +109,9 @@ export const render = async (offthreadVideoCacheSizeInBytesOption.getValue({commandLine: parsedCli,}).value;+ const offthreadVideoThreads = offthreadVideoThreadsOption.getValue({+ commandLine: parsedCli,+ }).value;const scale = scaleOption.getValue({commandLine: parsedCli}).value;const jpegQuality = jpegQualityOption.getValue({commandLine: parsedCli,@@ -245,5 +249,6 @@ export const render = async (metadata,hardwareAcceleration,chromeMode,+ offthreadVideoThreads,});};diff --git a/packages/cli/src/still.ts b/packages/cli/src/still.tsindex f93e99e2cc..6de8c7ce4f 100644--- a/packages/cli/src/still.ts+++ b/packages/cli/src/still.ts@@ -23,6 +23,7 @@ const {publicPathOption,publicDirOption,chromeModeOption,+ offthreadVideoThreadsOption,} = BrowserSafeApis.options;export const still = async (@@ -90,6 +91,9 @@ export const still = async (offthreadVideoCacheSizeInBytesOption.getValue({commandLine: parsedCli,}).value;+ const offthreadVideoThreads = offthreadVideoThreadsOption.getValue({+ commandLine: parsedCli,+ }).value;const puppeteerTimeout = delayRenderTimeoutInMillisecondsOption.getValue({commandLine: parsedCli,}).value;@@ -159,6 +163,7 @@ export const still = async (cancelSignal: null,outputLocationFromUi: null,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,binariesDirectory,publicPath,chromeMode,diff --git a/packages/cloudrun/src/api/render-media-on-cloudrun.ts b/packages/cloudrun/src/api/render-media-on-cloudrun.tsindex 604e7e2e13..53101ea136 100644--- a/packages/cloudrun/src/api/render-media-on-cloudrun.ts+++ b/packages/cloudrun/src/api/render-media-on-cloudrun.ts@@ -138,6 +138,7 @@ const internalRenderMediaOnCloudrunRaw = async ({enforceAudioTrack,preferLossless,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,colorSpace,downloadBehavior,metadata,@@ -197,6 +198,7 @@ const internalRenderMediaOnCloudrunRaw = async ({enforceAudioTrack: enforceAudioTrack ?? false,preferLossless: preferLossless ?? false,offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes ?? null,+ offthreadVideoThreads: offthreadVideoThreads ?? null,colorSpace: colorSpace ?? null,clientVersion: VERSION,downloadBehavior,diff --git a/packages/cloudrun/src/api/render-still-on-cloudrun.ts b/packages/cloudrun/src/api/render-still-on-cloudrun.tsindex d35c49b9ac..d0feca84e1 100644--- a/packages/cloudrun/src/api/render-still-on-cloudrun.ts+++ b/packages/cloudrun/src/api/render-still-on-cloudrun.ts@@ -98,6 +98,7 @@ const internalRenderStillOnCloudRun = async ({logLevel,delayRenderTimeoutInMilliseconds,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,downloadBehavior,renderIdOverride,renderStatusWebhook,@@ -140,6 +141,7 @@ const internalRenderStillOnCloudRun = async ({logLevel,delayRenderTimeoutInMilliseconds,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,clientVersion: VERSION,downloadBehavior,renderIdOverride,@@ -242,6 +244,7 @@ export const renderStillOnCloudrun = (options: RenderStillOnCloudrunInput) => {logLevel: options.logLevel ?? 'info',offthreadVideoCacheSizeInBytes:options.offthreadVideoCacheSizeInBytes ?? null,+ offthreadVideoThreads: options.offthreadVideoThreads ?? null,outName: options.outName ?? null,privacy: options.privacy ?? 'public',region: options.region,diff --git a/packages/cloudrun/src/api/test/payloads.test.ts b/packages/cloudrun/src/api/test/payloads.test.tsindex 3bd44014bb..1e1772b723 100644--- a/packages/cloudrun/src/api/test/payloads.test.ts+++ b/packages/cloudrun/src/api/test/payloads.test.ts@@ -19,6 +19,7 @@ test('CloudRunPayload should work with and without optional webhook fields', ()downloadBehavior: {type: 'play-in-browser' as const},outName: null,offthreadVideoCacheSizeInBytes: null,+ offthreadVideoThreads: null,serializedInputPropsWithCustomSchema: JSON.stringify({}),};diff --git a/packages/cloudrun/src/cli/commands/render/index.ts b/packages/cloudrun/src/cli/commands/render/index.tsindex edf176d782..d89b619046 100644--- a/packages/cloudrun/src/cli/commands/render/index.ts+++ b/packages/cloudrun/src/cli/commands/render/index.ts@@ -19,6 +19,7 @@ const {audioBitrateOption,x264Option,offthreadVideoCacheSizeInBytesOption,+ offthreadVideoThreadsOption,scaleOption,crfOption,jpegQualityOption,@@ -93,6 +94,9 @@ export const renderCommand = async (offthreadVideoCacheSizeInBytesOption.getValue({commandLine: CliInternals.parsedCli,}).value;+ const offthreadVideoThreads = offthreadVideoThreadsOption.getValue({+ commandLine: CliInternals.parsedCli,+ }).value;const enableMultiProcessOnLinux = enableMultiprocessOnLinuxOption.getValue({commandLine: CliInternals.parsedCli,}).value;@@ -132,7 +136,7 @@ export const renderCommand = async (}const server = RenderInternals.prepareServer({- concurrency: 1,+ offthreadVideoThreads: 1,indent: false,port: ConfigInternals.getRendererPortFromConfigFileAndCliFlag(),remotionRoot,@@ -168,6 +172,7 @@ export const renderCommand = async (staticBase: null,}).serializedString,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,binariesDirectory,onBrowserDownload: CliInternals.defaultBrowserDownloadProgress({indent,diff --git a/packages/cloudrun/src/cli/commands/still.ts b/packages/cloudrun/src/cli/commands/still.tsindex 6bc33952fa..5509db56da 100644--- a/packages/cloudrun/src/cli/commands/still.ts+++ b/packages/cloudrun/src/cli/commands/still.ts@@ -99,7 +99,7 @@ export const stillCommand = async (}const server = RenderInternals.prepareServer({- concurrency: 1,+ offthreadVideoThreads: 1,indent: false,port: ConfigInternals.getRendererPortFromConfigFileAndCliFlag(),remotionRoot,@@ -142,6 +142,7 @@ export const stillCommand = async (quiet: CliInternals.quietFlagProvided(),}),chromeMode: 'headless-shell',+ offthreadVideoThreads: 1,});composition = compositionId;}diff --git a/packages/cloudrun/src/functions/helpers/get-composition-from-body.ts b/packages/cloudrun/src/functions/helpers/get-composition-from-body.tsindex 4cb3b3994e..2cb550647f 100644--- a/packages/cloudrun/src/functions/helpers/get-composition-from-body.ts+++ b/packages/cloudrun/src/functions/helpers/get-composition-from-body.ts@@ -24,6 +24,7 @@ export const getCompositionFromBody = async (body: CloudRunPayloadType) => {body.delayRenderTimeoutInMilliseconds ??RenderInternals.DEFAULT_TIMEOUT,offthreadVideoCacheSizeInBytes: body.offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads: body.offthreadVideoThreads,binariesDirectory: null,onBrowserDownload: () => {throw new Error('Should not download a browser in Cloud Run');diff --git a/packages/cloudrun/src/functions/helpers/payloads.ts b/packages/cloudrun/src/functions/helpers/payloads.tsindex 9539ce47fb..420c770b98 100644--- a/packages/cloudrun/src/functions/helpers/payloads.ts+++ b/packages/cloudrun/src/functions/helpers/payloads.ts@@ -65,6 +65,7 @@ export const CloudRunPayload = z.discriminatedUnion('type', [enforceAudioTrack: z.boolean(),preferLossless: z.boolean(),offthreadVideoCacheSizeInBytes: z.number().nullable(),+ offthreadVideoThreads: z.number().nullable(),colorSpace: z.enum(BrowserSafeApis.validColorSpaces).nullable(),clientVersion: z.string(),downloadBehavior,@@ -99,6 +100,7 @@ export const CloudRunPayload = z.discriminatedUnion('type', [delayRenderTimeoutInMilliseconds: z.number(),logLevel,offthreadVideoCacheSizeInBytes: z.number().nullable(),+ offthreadVideoThreads: z.number().nullable(),clientVersion: z.string(),downloadBehavior,metadata: z.record(z.string()).optional().nullable(),diff --git a/packages/cloudrun/src/functions/render-media-single-thread.ts b/packages/cloudrun/src/functions/render-media-single-thread.tsindex 6593ce88e6..2ce07f8a22 100644--- a/packages/cloudrun/src/functions/render-media-single-thread.ts+++ b/packages/cloudrun/src/functions/render-media-single-thread.ts@@ -186,6 +186,7 @@ export const renderMediaSingleThread = async (puppeteerInstance: undefined,server: undefined,offthreadVideoCacheSizeInBytes: body.offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads: body.offthreadVideoThreads,colorSpace: body.colorSpace,repro: false,binariesDirectory: null,diff --git a/packages/cloudrun/src/functions/render-still-single-thread.ts b/packages/cloudrun/src/functions/render-still-single-thread.tsindex 8ec4f8c990..488a2337d1 100644--- a/packages/cloudrun/src/functions/render-still-single-thread.ts+++ b/packages/cloudrun/src/functions/render-still-single-thread.ts@@ -94,6 +94,7 @@ export const renderStillSingleThread = async (puppeteerInstance: null,server: undefined,offthreadVideoCacheSizeInBytes: body.offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads: body.offthreadVideoThreads,binariesDirectory: null,onBrowserDownload: () => {throw new Error('Should not download a browser in Cloud Run');diff --git a/packages/create-video/src/list-of-remotion-packages.ts b/packages/create-video/src/list-of-remotion-packages.tsindex bf834b5f67..903bee263d 100644--- a/packages/create-video/src/list-of-remotion-packages.ts+++ b/packages/create-video/src/list-of-remotion-packages.ts@@ -41,6 +41,7 @@ export const listOfRemotionPackages = ['@remotion/lambda-ruby','@remotion/lambda-python','@remotion/lambda',+ '@remotion/lambda-client','@remotion/layout-utils','@remotion/licensing','@remotion/lottie',@@ -58,6 +59,7 @@ export const listOfRemotionPackages = ['@remotion/promo-pages','@remotion/streaming','@remotion/serverless',+ '@remotion/serverless-client','@remotion/studio-server','@remotion/studio-shared','@remotion/studio',diff --git a/packages/docs/docs/cli/compositions.mdx b/packages/docs/docs/cli/compositions.mdxindex a5ecfb45f7..5e4c296283 100644--- a/packages/docs/docs/cli/compositions.mdx+++ b/packages/docs/docs/cli/compositions.mdx@@ -90,6 +90,10 @@ Lets you set a custom user agent that the headless Chrome browser assumes.<Options id="offthreadvideo-cache-size-in-bytes" />+### `--offthreadvideo-threads`<AvailableFrom v="4.0.261"/>++<Options id="offthreadvideo-threads" />+### `--binaries-directory`<AvailableFrom v="4.0.120" /><Options cli id="binaries-directory" />diff --git a/packages/docs/docs/cli/render.mdx b/packages/docs/docs/cli/render.mdxindex 025ff5d9b9..6ac3c355ab 100644--- a/packages/docs/docs/cli/render.mdx+++ b/packages/docs/docs/cli/render.mdx@@ -205,6 +205,10 @@ Lets you set a custom user agent that the headless Chrome browser assumes.<Options cli id="offthreadvideo-cache-size-in-bytes" />+### `--offthreadvideo-threads`<AvailableFrom v="4.0.261"/>++<Options id="offthreadvideo-threads" />+### `--enable-multiprocess-on-linux`<AvailableFrom v="4.0.42"/><Options cli id="enable-multiprocess-on-linux" />diff --git a/packages/docs/docs/cli/still.mdx b/packages/docs/docs/cli/still.mdxindex 3da9e42e93..7ea75d4797 100644--- a/packages/docs/docs/cli/still.mdx+++ b/packages/docs/docs/cli/still.mdx@@ -124,6 +124,10 @@ Lets you set a custom user agent that the headless Chrome browser assumes.<Options id="offthreadvideo-cache-size-in-bytes" />+### `--offthreadvideo-threads`<AvailableFrom v="4.0.261"/>++<Options id="offthreadvideo-threads" />+### `--enable-multiprocess-on-linux`<AvailableFrom v="4.0.42"/><Options cli id="enable-multiprocess-on-linux" />diff --git a/packages/docs/docs/cloudrun/cli/render.mdx b/packages/docs/docs/cloudrun/cli/render.mdxindex 836a99fd35..ffc1035b84 100644--- a/packages/docs/docs/cloudrun/cli/render.mdx+++ b/packages/docs/docs/cloudrun/cli/render.mdx@@ -9,12 +9,7 @@ crumb: 'Cloud Run CLI Reference'<ExperimentalBadge><p>- Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs- may change in any version and documentation is not yet finished. See the{' '}- <a href="https://remotion.dev/changelog">- changelog to stay up to date with breaking changes- </a>- .+ Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs may change in any version and documentation is not yet finished. See the <a href="https://remotion.dev/changelog">changelog to stay up to date with breaking changes</a>.</p></ExperimentalBadge>@@ -135,11 +130,13 @@ Specify the name of the service which should be used to perform the render. ThisYour webhook URL that will be called with the progress of the render. This will be sent using a POST request.Example:+```bash--webhook=https://example.com/webhook```The webhook will receive a POST request with a JSON body containing:+```json{"progress": 0.1,@@ -155,6 +152,7 @@ The webhook will receive a POST request with a JSON body containing:Provide a specific render ID for the render. Otherwise a random one will be generated.Example:+```bash--render-id-override=my-custom-render-id```@@ -197,6 +195,10 @@ For example only every second frame, every third frame and so on. Only works for<Options id="offthreadvideo-cache-size-in-bytes" />+### `--offthreadvideo-threads`<AvailableFrom v="4.0.261"/>++<Options id="offthreadvideo-threads" />+### `--color-space`<AvailableFrom v="4.0.28"/><Options cli id="color-space" />diff --git a/packages/docs/docs/cloudrun/cli/still.mdx b/packages/docs/docs/cloudrun/cli/still.mdxindex 38eda0a429..ed25288d28 100644--- a/packages/docs/docs/cloudrun/cli/still.mdx+++ b/packages/docs/docs/cloudrun/cli/still.mdx@@ -2,13 +2,15 @@image: /generated/articles-docs-cloudrun-cli-still.pngid: stillsidebar_label: still-title: "npx remotion cloudrun still"+title: 'npx remotion cloudrun still'slug: /cloudrun/cli/still-crumb: "Cloud Run CLI Reference"+crumb: 'Cloud Run CLI Reference'---<ExperimentalBadge>-<p>Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs may change in any version and documentation is not yet finished. See the <a href="https://remotion.dev/changelog">changelog to stay up to date with breaking changes</a>.</p>+ <p>+ Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs may change in any version and documentation is not yet finished. See the <a href="https://remotion.dev/changelog">changelog to stay up to date with breaking changes</a>.+ </p></ExperimentalBadge>Using the `npx remotion cloudrun still` command, you can render an image on GCP.@@ -102,3 +104,7 @@ Specify the name of the service which should be used to perform the render. This### `--offthreadvideo-cache-size-in-bytes`<AvailableFrom v="4.0.23"/><Options id="offthreadvideo-cache-size-in-bytes" />++### `--offthreadvideo-threads`<AvailableFrom v="4.0.261"/>++<Options id="offthreadvideo-threads" />diff --git a/packages/docs/docs/cloudrun/rendermediaoncloudrun.mdx b/packages/docs/docs/cloudrun/rendermediaoncloudrun.mdxindex 89674d6b48..32bfb8c237 100644--- a/packages/docs/docs/cloudrun/rendermediaoncloudrun.mdx+++ b/packages/docs/docs/cloudrun/rendermediaoncloudrun.mdx@@ -353,6 +353,10 @@ Render a silent audio track if there wouldn't be any otherwise.<Options id="offthreadvideo-cache-size-in-bytes" />+### `offthreadVideoThreads`<AvailableFrom v="4.0.261"/>++<Options id="offthreadvideo-threads" />+### `colorSpace?`<AvailableFrom v="4.0.28"/><Options id="color-space" />diff --git a/packages/docs/docs/cloudrun/renderstilloncloudrun.mdx b/packages/docs/docs/cloudrun/renderstilloncloudrun.mdxindex d05e233868..1abd2e7403 100644--- a/packages/docs/docs/cloudrun/renderstilloncloudrun.mdx+++ b/packages/docs/docs/cloudrun/renderstilloncloudrun.mdx@@ -194,6 +194,10 @@ A number describing how long the render may take to resolve all [`delayRender()`<Options id="offthreadvideo-cache-size-in-bytes" />+### `offthreadVideoThreads`<AvailableFrom v="4.0.261"/>++<Options id="offthreadvideo-threads" />+## Return valueReturns a promise resolving to an object containing the following:diff --git a/packages/docs/docs/lambda/cli/compositions.mdx b/packages/docs/docs/lambda/cli/compositions.mdxindex 79832451f6..95d041e20b 100644--- a/packages/docs/docs/lambda/cli/compositions.mdx+++ b/packages/docs/docs/lambda/cli/compositions.mdx@@ -109,7 +109,7 @@ This will most notably disable CORS in Chrome among other security features.### ~`--disable-headless`~-<Options id="disable-headless" />+<Options id="disable-headless" />### `--quiet`, `--q`@@ -127,6 +127,10 @@ Lets you set a custom user agent that the headless Chrome browser assumes.<Options id="offthreadvideo-cache-size-in-bytes" />+### `--offthreadvideo-threads`<AvailableFrom v="4.0.261"/>++<Options id="offthreadvideo-threads" />+### `--force-path-style`<AvailableFrom v="4.0.202" />Passes `forcePathStyle` to the AWS S3 client. If you don't know what this is, you probably don't need it.diff --git a/packages/docs/docs/lambda/cli/render.mdx b/packages/docs/docs/lambda/cli/render.mdxindex 439cfc695e..d6f2a337c4 100644--- a/packages/docs/docs/lambda/cli/render.mdx+++ b/packages/docs/docs/lambda/cli/render.mdx@@ -253,6 +253,10 @@ Lets you set a custom user agent that the headless Chrome browser assumes.<Options id="offthreadvideo-cache-size-in-bytes" />+### `--offthreadvideo-threads`<AvailableFrom v="4.0.261"/>++<Options id="offthreadvideo-threads" />+### `--delete-after`<AvailableFrom v="4.0.32"/><Options id="delete-after" cli />diff --git a/packages/docs/docs/lambda/cli/still.mdx b/packages/docs/docs/lambda/cli/still.mdxindex 4453faf75c..f37d05da70 100644--- a/packages/docs/docs/lambda/cli/still.mdx+++ b/packages/docs/docs/lambda/cli/still.mdx@@ -114,6 +114,10 @@ Lets you set a custom user agent that the headless Chrome browser assumes.<Options id="offthreadvideo-cache-size-in-bytes" />+### `--offthreadvideo-threads`<AvailableFrom v="4.0.261"/>++<Options id="offthreadvideo-threads" />+### `--delete-after`<AvailableFrom v="4.0.32"/><Options id="delete-after" cli />diff --git a/packages/docs/docs/lambda/getcompositionsonlambda.mdx b/packages/docs/docs/lambda/getcompositionsonlambda.mdxindex 6339abb9d5..3f9ed1150d 100644--- a/packages/docs/docs/lambda/getcompositionsonlambda.mdx+++ b/packages/docs/docs/lambda/getcompositionsonlambda.mdx@@ -107,6 +107,10 @@ Logs can be read through the CloudWatch URL that this function returns.<Options id="offthreadvideo-cache-size-in-bytes" />+### `offthreadVideoThreads?`<AvailableFrom v="4.0.261"/>++<Options id="offthreadvideo-threads" />+### ~~`dumpBrowserLogs?`~~_optional - default `false`, deprecated in v4.0_diff --git a/packages/docs/docs/lambda/rendermediaonlambda.mdx b/packages/docs/docs/lambda/rendermediaonlambda.mdxindex 1c7f689fca..761b6a7f2f 100644--- a/packages/docs/docs/lambda/rendermediaonlambda.mdx+++ b/packages/docs/docs/lambda/rendermediaonlambda.mdx@@ -351,6 +351,10 @@ If the `logLevel` is set to `verbose`, the Lambda function will not clean up art<Options id="offthreadvideo-cache-size-in-bytes" />+### `offthreadVideoThreads?`<AvailableFrom v="4.0.261"/>++<Options id="offthreadvideo-threads" />+### `colorSpace?`<AvailableFrom v="4.0.28"/><Options id="color-space" />diff --git a/packages/docs/docs/lambda/renderstillonlambda.mdx b/packages/docs/docs/lambda/renderstillonlambda.mdxindex e1f020aff0..3c7b69c340 100644--- a/packages/docs/docs/lambda/renderstillonlambda.mdx+++ b/packages/docs/docs/lambda/renderstillonlambda.mdx@@ -203,6 +203,10 @@ Either:<Options id="offthreadvideo-cache-size-in-bytes" />+### `offthreadVideoThreads?`<AvailableFrom v="4.0.261"/>++<Options id="offthreadvideo-threads" />+### `deleteAfter?`<AvailableFrom v="4.0.32"/><Options id="delete-after" />diff --git a/packages/docs/docs/renderer/get-compositions.mdx b/packages/docs/docs/renderer/get-compositions.mdxindex f6d2224154..d5b1f0e173 100644--- a/packages/docs/docs/renderer/get-compositions.mdx+++ b/packages/docs/docs/renderer/get-compositions.mdx@@ -120,6 +120,10 @@ Allows you to set certain Chromium / Google Chrome flags. See: [Chromium flags](<Options id="offthreadvideo-cache-size-in-bytes" />+### `offthreadVideoThreads?`<AvailableFrom v="4.0.261"/>++<Options id="offthreadvideo-threads" />+### `binariesDirectory?`<AvailableFrom v="4.0.120" /><Options id="binaries-directory" />diff --git a/packages/docs/docs/renderer/render-frames.mdx b/packages/docs/docs/renderer/render-frames.mdxindex 25aa8ec96b..7d1152ece7 100644--- a/packages/docs/docs/renderer/render-frames.mdx+++ b/packages/docs/docs/renderer/render-frames.mdx@@ -278,6 +278,10 @@ Lets you set a custom user agent that the headless Chrome browser assumes.<Options id="offthreadvideo-cache-size-in-bytes" />+### `offthreadVideoThreads?`<AvailableFrom v="4.0.261"/>++<Options id="offthreadvideo-threads" />+### `binariesDirectory?`<AvailableFrom v="4.0.120" /><Options id="binaries-directory" />diff --git a/packages/docs/docs/renderer/render-media.mdx b/packages/docs/docs/renderer/render-media.mdxindex 324985bf73..771459b1c9 100644--- a/packages/docs/docs/renderer/render-media.mdx+++ b/packages/docs/docs/renderer/render-media.mdx@@ -445,6 +445,10 @@ Disallows the renderer from doing rendering frames and encoding at the same time<Options id="offthreadvideo-cache-size-in-bytes" />+### `offthreadVideoThreads?`<AvailableFrom v="4.0.261"/>++<Options id="offthreadvideo-threads" />+### `colorSpace?`<AvailableFrom v="4.0.28"/><Options id="color-space" />diff --git a/packages/docs/docs/renderer/render-still.mdx b/packages/docs/docs/renderer/render-still.mdxindex db2ae0c99a..392a962351 100644--- a/packages/docs/docs/renderer/render-still.mdx+++ b/packages/docs/docs/renderer/render-still.mdx@@ -199,6 +199,10 @@ Lets you set a custom user agent that the headless Chrome browser assumes.<Options id="offthreadvideo-cache-size-in-bytes" />+### `offthreadVideoThreads?`<AvailableFrom v="4.0.261"/>++<Options id="offthreadvideo-threads" />+### `binariesDirectory?`<AvailableFrom v="4.0.120" /><Options id="binaries-directory" />diff --git a/packages/docs/docs/renderer/select-composition.mdx b/packages/docs/docs/renderer/select-composition.mdxindex 6c22dde846..90e294f049 100644--- a/packages/docs/docs/renderer/select-composition.mdx+++ b/packages/docs/docs/renderer/select-composition.mdx@@ -89,6 +89,10 @@ See: [Environment variables](/docs/env-variables/)<Options id="offthreadvideo-cache-size-in-bytes" />+### `offthreadVideoThreads?`<AvailableFrom v="4.0.261"/>++<Options id="offthreadvideo-threads" />+### `binariesDirectory?`<AvailableFrom v="4.0.120" /><Options id="binaries-directory" />diff --git a/packages/it-tests/src/bundle/bundle-studio.test.ts b/packages/it-tests/src/bundle/bundle-studio.test.tsindex 28d2facfa4..6857ac802b 100644--- a/packages/it-tests/src/bundle/bundle-studio.test.ts+++ b/packages/it-tests/src/bundle/bundle-studio.test.ts@@ -24,7 +24,7 @@ test('Bundle studio', async () => {path.join(process.cwd(), '..', 'example', 'build'),{port: null,- concurrency: 1,+ offthreadVideoThreads: 1,downloadMap: RenderInternals.makeDownloadMap(),indent: false,logLevel: 'info',diff --git a/packages/it-tests/src/monorepo/go-package.test.ts b/packages/it-tests/src/monorepo/go-package.test.tsindex 27910a3e8b..50e5063201 100644--- a/packages/it-tests/src/monorepo/go-package.test.ts+++ b/packages/it-tests/src/monorepo/go-package.test.ts@@ -57,6 +57,7 @@ test('Go package should create the same payload as normal Lambda package', asyncmuted: false,numberOfGifLoops: 0,offthreadVideoCacheSizeInBytes: null,+ offthreadVideoThreads: null,outName: null,overwrite: false,pixelFormat: undefined,diff --git a/packages/it-tests/src/monorepo/php-package.test.ts b/packages/it-tests/src/monorepo/php-package.test.tsindex f6238f247b..ca2858094f 100644--- a/packages/it-tests/src/monorepo/php-package.test.ts+++ b/packages/it-tests/src/monorepo/php-package.test.ts@@ -105,6 +105,7 @@ class Semanticmuted: false,numberOfGifLoops: 0,offthreadVideoCacheSizeInBytes: null,+ offthreadVideoThreads: null,outName: null,overwrite: false,pixelFormat: undefined,diff --git a/packages/it-tests/src/monorepo/python-package.test.ts b/packages/it-tests/src/monorepo/python-package.test.tsindex 0c0a746f02..1a4e744c9e 100644--- a/packages/it-tests/src/monorepo/python-package.test.ts+++ b/packages/it-tests/src/monorepo/python-package.test.ts@@ -76,6 +76,7 @@ test('Python package should create the same renderMedia payload as normal Lambdamuted: false,numberOfGifLoops: 0,offthreadVideoCacheSizeInBytes: null,+ offthreadVideoThreads: null,outName: null,overwrite: false,pixelFormat: undefined,@@ -174,6 +175,7 @@ test('Python package should create the same renderStill payload as normal LambdalogLevel: 'info',maxRetries: 1,offthreadVideoCacheSizeInBytes: null,+ offthreadVideoThreads: null,outName: null,privacy: 'public',scale: 1,diff --git a/packages/it-tests/src/monorepo/ruby-package.test.ts b/packages/it-tests/src/monorepo/ruby-package.test.tsindex 1e65e8f4f1..78aba81d50 100644--- a/packages/it-tests/src/monorepo/ruby-package.test.ts+++ b/packages/it-tests/src/monorepo/ruby-package.test.ts@@ -106,6 +106,7 @@ test('Render Media payload', async () => {muted: false,numberOfGifLoops: 0,offthreadVideoCacheSizeInBytes: null,+ offthreadVideoThreads: null,outName: null,overwrite: false,pixelFormat: undefined,@@ -176,6 +177,7 @@ test('Render Still payload', async () => {quality: undefined,forcePathStyle: false,apiKey: null,+ offthreadVideoThreads: null,});expect(JSON.parse(output)).toEqual({...nativeVersion, streamed: false});diff --git a/packages/lambda-client/README.md b/packages/lambda-client/README.mdnew file mode 100644index 0000000000..a9d81115d4--- /dev/null+++ b/packages/lambda-client/README.md@@ -0,0 +1,5 @@+# @remotion/lambda-client++## Usage++This is an internal package and has no documentation.diff --git a/packages/lambda-client/package.json b/packages/lambda-client/package.jsonindex 0ab6fc7170..9805ee5bfd 100644--- a/packages/lambda-client/package.json+++ b/packages/lambda-client/package.json@@ -1,10 +1,9 @@{"repository": {- "url": "https://github.com/remotion-dev/remotion/tree/main/packages/lambda"+ "url": "https://github.com/remotion-dev/remotion/tree/main/packages/lambda-client"},"name": "@remotion/lambda-client","version": "4.0.260",- "description": "Render Remotion videos on AWS Lambda","main": "dist/index.js","sideEffects": false,"scripts": {@@ -68,6 +67,5 @@"dist/regions.d.ts"]}- },- "homepage": "https://www.remotion.dev/docs/lambda"+ }}diff --git a/packages/lambda-client/src/make-lambda-payload.ts b/packages/lambda-client/src/make-lambda-payload.tsindex b995608387..3a07452824 100644--- a/packages/lambda-client/src/make-lambda-payload.ts+++ b/packages/lambda-client/src/make-lambda-payload.ts@@ -131,6 +131,7 @@ export const makeLambdaRenderMediaPayload = async ({forcePathStyle,metadata,apiKey,+ offthreadVideoThreads,}: InnerRenderMediaOnLambdaInput): Promise<ServerlessStartPayload<AwsProvider>> => {@@ -211,6 +212,7 @@ export const makeLambdaRenderMediaPayload = async ({forcePathStyle: forcePathStyle ?? false,metadata: metadata ?? null,apiKey: apiKey ?? null,+ offthreadVideoThreads: offthreadVideoThreads ?? null,};};@@ -313,5 +315,6 @@ export const makeLambdaRenderStillPayload = async ({streamed: true,forcePathStyle,apiKey: apiKey ?? null,+ offthreadVideoThreads: null,};};diff --git a/packages/lambda-client/src/render-media-on-lambda.ts b/packages/lambda-client/src/render-media-on-lambda.tsindex e696a618eb..722cd9c5e3 100644--- a/packages/lambda-client/src/render-media-on-lambda.ts+++ b/packages/lambda-client/src/render-media-on-lambda.ts@@ -142,6 +142,7 @@ export const renderMediaOnLambdaOptionalToRequired = (options: RenderMediaOnLambdaInput,): InnerRenderMediaOnLambdaInput => {return {+ offthreadVideoThreads: options.offthreadVideoThreads ?? null,audioBitrate: options.audioBitrate ?? null,audioCodec: options.audioCodec ?? null,chromiumOptions: options.chromiumOptions ?? {},diff --git a/packages/lambda-client/src/render-still-on-lambda.ts b/packages/lambda-client/src/render-still-on-lambda.tsindex 76f87337db..266e0035e8 100644--- a/packages/lambda-client/src/render-still-on-lambda.ts+++ b/packages/lambda-client/src/render-still-on-lambda.ts@@ -191,5 +191,6 @@ export const renderStillOnLambda = (input: RenderStillOnLambdaInput) => {dumpBrowserLogs: false,forcePathStyle: input.forcePathStyle ?? false,apiKey: input.apiKey ?? null,+ offthreadVideoThreads: input.offthreadVideoThreads ?? null,});};diff --git a/packages/lambda-go/internalops.go b/packages/lambda-go/internalops.goindex 3fa1c97d5a..0e2c831693 100644--- a/packages/lambda-go/internalops.go+++ b/packages/lambda-go/internalops.go@@ -37,6 +37,7 @@ func constructRenderInternals(options *RemotionOptions) (*renderInternalOptions,Webhook: options.Webhook,ForceHeight: options.ForceHeight,OffthreadVideoCacheSizeInBytes: options.OffthreadVideoCacheSizeInBytes,+ OffthreadVideoThreads: options.OffthreadVideoThreads,X264Preset: options.X264Preset,ForceWidth: options.ForceWidth,ApiKey: options.ApiKey,diff --git a/packages/lambda-go/models.go b/packages/lambda-go/models.goindex a481e627c9..556146dfda 100644--- a/packages/lambda-go/models.go+++ b/packages/lambda-go/models.go@@ -37,6 +37,7 @@ type RemotionOptions struct {Webhook interface{} `json:"webhook"`ForceHeight interface{} `json:"forceHeight"`OffthreadVideoCacheSizeInBytes interface{} `json:"offthreadVideoCacheSizeInBytes"`+ OffthreadVideoThreads interface{} `json:"offthreadVideoThreads"`ForceWidth interface{} `json:"forceWidth"`ApiKey interface{} `json:"apiKey"`BucketName interface{} `json:"bucketName"`@@ -86,6 +87,7 @@ type renderInternalOptions struct {EncodingMaxRate interface{} `json:"encodingMaxRate"`Webhook interface{} `json:"webhook"`OffthreadVideoCacheSizeInBytes interface{} `json:"offthreadVideoCacheSizeInBytes"`+ OffthreadVideoThreads interface{} `json:"offthreadVideoThreads"`ForceHeight interface{} `json:"forceHeight"`ForceWidth interface{} `json:"forceWidth"`ApiKey interface{} `json:"apiKey"`diff --git a/packages/lambda-php/composer.lock b/packages/lambda-php/composer.lockindex 8366087977..0e6b6c8ed9 100644--- a/packages/lambda-php/composer.lock+++ b/packages/lambda-php/composer.lock@@ -4,7 +4,7 @@"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies","This file is @generated automatically"],- "content-hash": "c3041a14020304eebe1e70aedc69ceb5",+ "content-hash": "ee6a0d21113f98506055884be022233a","packages": [{"name": "aws/aws-crt-php",diff --git a/packages/lambda-php/src/RenderParams.php b/packages/lambda-php/src/RenderParams.phpindex ff7d6f617b..b636b8bfcd 100644--- a/packages/lambda-php/src/RenderParams.php+++ b/packages/lambda-php/src/RenderParams.php@@ -47,6 +47,7 @@ class RenderParamsprotected $forceWidth = null;protected $apiKey = null;protected $offthreadVideoCacheSizeInBytes = null;+ protected $offthreadVideoThreads = null;protected $audioCodec = null;protected $rendererFunctionName = null;protected $proResProfile = null;@@ -86,6 +87,7 @@ class RenderParams?int $forceWidth = null,?int $apiKey = null,?int $offthreadVideoCacheSizeInBytes = null,+ ?int $offthreadVideoThreads = null,?string $audioCodec = null,?int $framesPerLambda = null,?string $rendererFunctionName = null,@@ -137,6 +139,7 @@ class RenderParams$this->forceWidth = $forceWidth;$this->apiKey = $apiKey;$this->offthreadVideoCacheSizeInBytes = $offthreadVideoCacheSizeInBytes;+ $this->offthreadVideoThreads = $offthreadVideoThreads;$this->audioCodec = $audioCodec;$this->framesPerLambda = $framesPerLambda;$this->rendererFunctionName = $rendererFunctionName;@@ -187,6 +190,7 @@ class RenderParams'forceWidth' => $this->getForceWidth(),'apiKey' => $this->getApiKey(),'offthreadVideoCacheSizeInBytes' => $this->getOffthreadVideoCacheSizeInBytes(),+ 'offthreadVideoThreads' => $this->getOffthreadVideoThreads(),'bucketName' => $this->getBucketName(),'audioCodec' => $this->getAudioCodec(),'x264Preset' => $this->getX264Preset(),@@ -715,6 +719,10 @@ class RenderParams{$this->offthreadVideoCacheSizeInBytes = $offthreadVideoCacheSizeInBytes;}+ public function setOffthreadVideoThreads($offthreadVideoThreads)+ {+ $this->offthreadVideoThreads = $offthreadVideoThreads;+ }// Getter methodspublic function getMuted()@@ -776,6 +784,10 @@ class RenderParams{return $this->offthreadVideoCacheSizeInBytes;}+ public function getOffthreadVideoThreads()+ {+ return $this->offthreadVideoThreads;+ }/*** Get the value of serverUrldiff --git a/packages/lambda-python/remotion_lambda/models.py b/packages/lambda-python/remotion_lambda/models.pyindex a7df6377b7..ff3ec0dcae 100644--- a/packages/lambda-python/remotion_lambda/models.py+++ b/packages/lambda-python/remotion_lambda/models.py@@ -310,6 +310,7 @@ class RenderMediaParams:webhook: Optional[Webhook] = Noneforce_height: Optional[int] = Noneoffthreadvideo_cache_size_in_bytes: Optional[int] = None+ offthreadvideo_threads: Optional[int] = Noneforce_width: Optional[int] = Noneapi_key: Optional[str] = Noneaudio_codec: Optional[str] = None@@ -358,6 +359,7 @@ class RenderMediaParams:'webhook': self.webhook,'forceHeight': self.force_height,'offthreadVideoCacheSizeInBytes': self.offthreadvideo_cache_size_in_bytes,+ 'offthreadVideoThreads': self.offthreadvideo_threads,'forceWidth': self.force_width,'apiKey': self.api_key,'bucketName': self.bucket_name,@@ -431,6 +433,7 @@ class RenderStillParams:delete_after: Optional[DeleteAfter] = Noneforce_path_style: Optional[bool] = Noneoffthreadvideo_cache_size_in_bytes: Optional[int] = None+ offthreadvideo_threads: Optional[int] = Nonestreamed: bool = Falsedef serialize_params(self) -> Dict:@@ -476,6 +479,7 @@ class RenderStillParams:'deleteAfter': self.delete_after,'attempt': self.attempt,'offthreadVideoCacheSizeInBytes': self.offthreadvideo_cache_size_in_bytes,+ 'offthreadVideoThreads': self.offthreadvideo_threads,'streamed': self.streamed,}diff --git a/packages/lambda-ruby/lib/remotion_lambda/render_media_on_lambda_payload.rb b/packages/lambda-ruby/lib/remotion_lambda/render_media_on_lambda_payload.rbindex f65419ac1f..ea92e262a4 100644--- a/packages/lambda-ruby/lib/remotion_lambda/render_media_on_lambda_payload.rb+++ b/packages/lambda-ruby/lib/remotion_lambda/render_media_on_lambda_payload.rb@@ -30,6 +30,7 @@ def get_render_media_on_lambda_payload(muted: false,number_of_gif_loops: 0,offthread_video_cache_size_in_bytes: nil,+ offthread_video_threads: nil,out_name: nil,overwrite: false,pixel_format: nil,@@ -79,6 +80,7 @@ payload = {muted: muted,numberOfGifLoops: number_of_gif_loops,offthreadVideoCacheSizeInBytes: offthread_video_cache_size_in_bytes,+ offthreadVideoThreads: offthread_video_threads,outName: out_name,overwrite: overwrite,pixelFormat: pixel_format,diff --git a/packages/lambda-ruby/lib/remotion_lambda/render_still_on_lambda_payload.rb b/packages/lambda-ruby/lib/remotion_lambda/render_still_on_lambda_payload.rbindex 45a3b54bff..d028377c18 100644--- a/packages/lambda-ruby/lib/remotion_lambda/render_still_on_lambda_payload.rb+++ b/packages/lambda-ruby/lib/remotion_lambda/render_still_on_lambda_payload.rb@@ -16,6 +16,7 @@ def get_render_still_on_lambda_payload(log_level: "info",max_retries: 1,metadata: {},+ offthread_video_threads: nil,offthread_video_cache_size_in_bytes: nil,out_name: nil,overwrite: false,@@ -45,7 +46,9 @@ payload = {jpegQuality: jpeg_quality,logLevel: log_level,maxRetries: max_retries,+ offthreadVideoCacheSizeInBytes: offthread_video_threads,offthreadVideoCacheSizeInBytes: offthread_video_cache_size_in_bytes,+ offthreadVideoThreads: offthread_video_threads,outName: out_name,privacy: privacy,scale: scale,diff --git a/packages/lambda/src/cli/commands/render/render.ts b/packages/lambda/src/cli/commands/render/render.tsindex 7eb7e86436..1329af8ecf 100644--- a/packages/lambda/src/cli/commands/render/render.ts+++ b/packages/lambda/src/cli/commands/render/render.ts@@ -39,6 +39,7 @@ const {x264Option,audioBitrateOption,offthreadVideoCacheSizeInBytesOption,+ offthreadVideoThreadsOption,scaleOption,crfOption,jpegQualityOption,@@ -116,6 +117,9 @@ export const renderCommand = async ({offthreadVideoCacheSizeInBytesOption.getValue({commandLine: CliInternals.parsedCli,}).value;+ const offthreadVideoThreads = offthreadVideoThreadsOption.getValue({+ commandLine: CliInternals.parsedCli,+ }).value;const scale = scaleOption.getValue({commandLine: CliInternals.parsedCli,}).value;@@ -201,7 +205,7 @@ export const renderCommand = async ({}const server = await RenderInternals.prepareServer({- concurrency: 1,+ offthreadVideoThreads: 1,indent: false,port: ConfigInternals.getRendererPortFromConfigFileAndCliFlag(),remotionRoot,@@ -237,6 +241,7 @@ export const renderCommand = async ({width,server,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,binariesDirectory,onBrowserDownload: CliInternals.defaultBrowserDownloadProgress({indent,@@ -333,6 +338,7 @@ export const renderCommand = async ({colorSpace,downloadBehavior: {type: 'play-in-browser'},offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes ?? null,+ offthreadVideoThreads: offthreadVideoThreads ?? null,x264Preset: x264Preset ?? null,preferLossless,indent: false,diff --git a/packages/lambda/src/cli/commands/still.ts b/packages/lambda/src/cli/commands/still.tsindex 9ff30b8eeb..e18291a40e 100644--- a/packages/lambda/src/cli/commands/still.ts+++ b/packages/lambda/src/cli/commands/still.ts@@ -28,6 +28,7 @@ import {makeArtifactProgress} from './render/progress';const {offthreadVideoCacheSizeInBytesOption,+ offthreadVideoThreadsOption,scaleOption,deleteAfterOption,jpegQualityOption,@@ -120,6 +121,9 @@ export const stillCommand = async ({offthreadVideoCacheSizeInBytesOption.getValue({commandLine: parsedCli,}).value;+ const offthreadVideoThreads = offthreadVideoThreadsOption.getValue({+ commandLine: parsedCli,+ }).value;const binariesDirectory = binariesDirectoryOption.getValue({commandLine: parsedCli,}).value;@@ -139,7 +143,7 @@ export const stillCommand = async ({}const server = await RenderInternals.prepareServer({- concurrency: 1,+ offthreadVideoThreads: 1,indent: false,port: ConfigInternals.getRendererPortFromConfigFileAndCliFlag(),remotionRoot,@@ -174,6 +178,7 @@ export const stillCommand = async ({width,server,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,binariesDirectory,onBrowserDownload: CliInternals.defaultBrowserDownloadProgress({indent,diff --git a/packages/lambda/src/test/integration/renders/old-version.test.ts b/packages/lambda/src/test/integration/renders/old-version.test.tsindex 446520b8d5..15668294b2 100644--- a/packages/lambda/src/test/integration/renders/old-version.test.ts+++ b/packages/lambda/src/test/integration/renders/old-version.test.ts@@ -51,6 +51,7 @@ test('Should fail when using an incompatible version', async () => {audioCodec: null,renderId: 'test',offthreadVideoCacheSizeInBytes: null,+ offthreadVideoThreads: null,deleteAfter: null,colorSpace: null,preferLossless: false,diff --git a/packages/lambda/src/test/integration/simulate-lambda-render.ts b/packages/lambda/src/test/integration/simulate-lambda-render.tsindex 4ec8544368..697391b2d6 100644--- a/packages/lambda/src/test/integration/simulate-lambda-render.ts+++ b/packages/lambda/src/test/integration/simulate-lambda-render.ts@@ -19,7 +19,7 @@ export const simulateLambdaRender = async (const {port, close} = await RenderInternals.serveStatic(exampleBuild, {binariesDirectory: null,- concurrency: 1,+ offthreadVideoThreads: 1,downloadMap: RenderInternals.makeDownloadMap(),indent: false,logLevel: 'error',diff --git a/packages/lambda/src/test/integration/webhooks.test.ts b/packages/lambda/src/test/integration/webhooks.test.tsindex f4d5cecead..91bed902c2 100644--- a/packages/lambda/src/test/integration/webhooks.test.ts+++ b/packages/lambda/src/test/integration/webhooks.test.ts@@ -22,7 +22,7 @@ test('Should call webhook upon completion', async () => {const {port, close} = await RenderInternals.serveStatic(exampleBuild, {binariesDirectory: null,- concurrency: 1,+ offthreadVideoThreads: 1,downloadMap: RenderInternals.makeDownloadMap(),indent: false,logLevel: 'error',@@ -85,6 +85,7 @@ test('Should call webhook upon completion', async () => {bucketName: null,audioCodec: null,offthreadVideoCacheSizeInBytes: null,+ offthreadVideoThreads: null,deleteAfter: null,colorSpace: null,preferLossless: false,@@ -132,7 +133,7 @@ test('Should call webhook upon timeout', async () => {// Maybe this can use simulateLambdaRender insteadconst {port, close} = await RenderInternals.serveStatic(exampleBuild, {binariesDirectory: null,- concurrency: 1,+ offthreadVideoThreads: 1,downloadMap: RenderInternals.makeDownloadMap(),indent: false,logLevel: 'error',@@ -151,6 +152,7 @@ test('Should call webhook upon timeout', async () => {payload: {type: ServerlessRoutines.launch,offthreadVideoCacheSizeInBytes: null,+ offthreadVideoThreads: null,serveUrl: `http://localhost:${port}`,chromiumOptions: {},codec: 'h264',diff --git a/packages/renderer/src/compositor/compositor.ts b/packages/renderer/src/compositor/compositor.tsindex 4656b5605a..4e0734d623 100644--- a/packages/renderer/src/compositor/compositor.ts+++ b/packages/renderer/src/compositor/compositor.ts@@ -34,7 +34,7 @@ export const startLongRunningCompositor = ({logLevel,indent,binariesDirectory,- extraThreads: concurrency,+ extraThreads,}: {maximumFrameCacheItemsInBytes: number | null;logLevel: LogLevel;@@ -45,7 +45,7 @@ export const startLongRunningCompositor = ({return startCompositor({type: 'StartLongRunningProcess',payload: {- concurrency,+ concurrency: extraThreads,maximum_frame_cache_size_in_bytes: maximumFrameCacheItemsInBytes,verbose: isEqualOrBelowLogLevel(logLevel, 'verbose'),},diff --git a/packages/renderer/src/get-compositions.ts b/packages/renderer/src/get-compositions.tsindex 5b6237ea12..046bb0e7ff 100644--- a/packages/renderer/src/get-compositions.ts+++ b/packages/renderer/src/get-compositions.ts@@ -10,6 +10,7 @@ import {handleJavascriptException} from './error-handling/handle-javascript-exceimport {findRemotionRoot} from './find-closest-package-json';import {getPageAndCleanupFn} from './get-browser-instance';import type {ChromiumOptions} from './open-browser';+import {DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS} from './options/offthreadvideo-threads';import type {ToOptions} from './options/option';import type {optionsMap} from './options/options-map';import type {RemotionServer} from './prepare-server';@@ -164,6 +165,7 @@ const internalGetCompositionsRaw = async ({binariesDirectory,onBrowserDownload,chromeMode,+ offthreadVideoThreads,}: InternalGetCompositionsOptions) => {const {page, cleanupPage} = await getPageAndCleanupFn({passedInInstance: puppeteerInstance,@@ -196,7 +198,9 @@ const internalGetCompositionsRaw = async ({webpackConfigOrServeUrl: serveUrlOrWebpackUrl,port,remotionRoot: findRemotionRoot(),- concurrency: 1,+ offthreadVideoThreads:+ offthreadVideoThreads ??+ DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS,logLevel,indent,offthreadVideoCacheSizeInBytes,@@ -228,6 +232,7 @@ const internalGetCompositionsRaw = async ({binariesDirectory,onBrowserDownload,chromeMode,+ offthreadVideoThreads,});})@@ -277,6 +282,7 @@ export const getCompositions = (binariesDirectory,offthreadVideoCacheSizeInBytes,chromeMode,+ offthreadVideoThreads,} = config ?? {};const indent = false;@@ -310,5 +316,6 @@ export const getCompositions = (api: 'getCompositions()',}),chromeMode: chromeMode ?? 'headless-shell',+ offthreadVideoThreads: offthreadVideoThreads ?? null,});};diff --git a/packages/renderer/src/index.ts b/packages/renderer/src/index.tsindex 455ed0b298..891b23b586 100644--- a/packages/renderer/src/index.ts+++ b/packages/renderer/src/index.ts@@ -144,6 +144,7 @@ import {resolveAudioCodec,supportedAudioCodecs,} from './options/audio-codec';+import {DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS} from './options/offthreadvideo-threads';import {printUsefulErrorMessage} from './print-useful-error-message';import {getShouldRenderAudio} from './render-has-audio';import {toMegabytes} from './to-megabytes';@@ -238,6 +239,7 @@ export const RenderInternals = {toMegabytes,internalEnsureBrowser,printUsefulErrorMessage,+ DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS,};// Warn of potential performance issues with Apple Silicon (M1 chip under Rosetta)diff --git a/packages/renderer/src/offthread-video-server.ts b/packages/renderer/src/offthread-video-server.tsindex e826dbf2ed..b65eaaafb7 100644--- a/packages/renderer/src/offthread-video-server.ts+++ b/packages/renderer/src/offthread-video-server.ts@@ -49,15 +49,15 @@ const REQUEST_CLOSED_TOKEN = 'Request closed';export const startOffthreadVideoServer = ({downloadMap,- concurrency,logLevel,indent,offthreadVideoCacheSizeInBytes,binariesDirectory,+ offthreadVideoThreads,}: {downloadMap: DownloadMap;offthreadVideoCacheSizeInBytes: number | null;- concurrency: number;+ offthreadVideoThreads: number;logLevel: LogLevel;indent: boolean;binariesDirectory: string | null;@@ -70,7 +70,7 @@ export const startOffthreadVideoServer = ({const compositor = startCompositor({type: 'StartLongRunningProcess',payload: {- concurrency,+ concurrency: offthreadVideoThreads,maximum_frame_cache_size_in_bytes: offthreadVideoCacheSizeInBytes,verbose: isEqualOrBelowLogLevel(logLevel, 'verbose'),},diff --git a/packages/renderer/src/options/index.tsx b/packages/renderer/src/options/index.tsxindex 796d3ffeed..11f3de36e2 100644--- a/packages/renderer/src/options/index.tsx+++ b/packages/renderer/src/options/index.tsx@@ -24,6 +24,7 @@ import {metadataOption} from './metadata';import {mutedOption} from './mute';import {numberOfGifLoopsOption} from './number-of-gif-loops';import {offthreadVideoCacheSizeInBytesOption} from './offthreadvideo-cache-size';+import {offthreadVideoThreadsOption} from './offthreadvideo-threads';import {onBrowserDownloadOption} from './on-browser-download';import type {AnyRemotionOption} from './option';import {overwriteOption} from './overwrite';@@ -51,6 +52,7 @@ export const allOptions = {mutedOption,videoCodecOption,offthreadVideoCacheSizeInBytesOption,+ offthreadVideoThreadsOption,webhookCustomDataOption,colorSpaceOption,deleteAfterOption,diff --git a/packages/renderer/src/options/offthreadvideo-threads.tsx b/packages/renderer/src/options/offthreadvideo-threads.tsxnew file mode 100644index 0000000000..6c565c73d7--- /dev/null+++ b/packages/renderer/src/options/offthreadvideo-threads.tsx@@ -0,0 +1,52 @@+import type {AnyRemotionOption} from './option';++let value: number | null = null;++export const getOffthreadVideoThreads = () => {+ return value;+};++const cliFlag = 'offthreadvideo-video-threads' as const;++export const offthreadVideoThreadsOption = {+ name: 'OffthreadVideo threads',+ cliFlag,+ description: () => (+ <>+ The number of threads that+ <a href="https://remotion.dev/docs/offthreadvideo">+ <code><OffthreadVideo></code>+ </a>{' '}+ can start to extract frames. frames. The default is 2. Increase carefully,+ as too much threads may cause instability.+ </>+ ),+ ssrName: 'offthreadVideoThreads' as const,+ docLink: 'https://www.remotion.dev/docs/offthreadvideo',+ type: 0 as number | null,+ getValue: ({commandLine}) => {+ if (commandLine[cliFlag] !== undefined) {+ return {+ source: 'cli',+ value: commandLine[cliFlag] as number,+ };+ }++ if (value !== null) {+ return {+ source: 'config',+ value,+ };+ }++ return {+ source: 'default',+ value: null,+ };+ },+ setConfig: (size: number | null) => {+ value = size ?? null;+ },+} satisfies AnyRemotionOption<number | null>;++export const DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS = 2;diff --git a/packages/renderer/src/options/options-map.ts b/packages/renderer/src/options/options-map.tsindex 994c998d47..ae20912c63 100644--- a/packages/renderer/src/options/options-map.ts+++ b/packages/renderer/src/options/options-map.ts@@ -16,6 +16,7 @@ import {logLevelOption} from './log-level';import {mutedOption} from './mute';import {numberOfGifLoopsOption} from './number-of-gif-loops';import {offthreadVideoCacheSizeInBytesOption} from './offthreadvideo-cache-size';+import {offthreadVideoThreadsOption} from './offthreadvideo-threads';import {onBrowserDownloadOption} from './on-browser-download';import {preferLosslessAudioOption} from './prefer-lossless';import {reproOption} from './repro';@@ -30,6 +31,7 @@ import {x264Option} from './x264-preset';export const optionsMap = {renderMedia: {offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,+ offthreadVideoThreads: offthreadVideoThreadsOption,videoBitrate: videoBitrateOption,numberOfGifLoops: numberOfGifLoopsOption,repro: reproOption,@@ -57,6 +59,7 @@ export const optionsMap = {},renderStill: {offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,+ offthreadVideoThreads: offthreadVideoThreadsOption,jpegQuality: jpegQualityOption,logLevel: logLevelOption,timeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption,@@ -66,6 +69,7 @@ export const optionsMap = {},getCompositions: {offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,+ offthreadVideoThreads: offthreadVideoThreadsOption,logLevel: logLevelOption,timeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption,binariesDirectory: binariesDirectoryOption,@@ -74,6 +78,7 @@ export const optionsMap = {},selectComposition: {offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,+ offthreadVideoThreads: offthreadVideoThreadsOption,logLevel: logLevelOption,timeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption,binariesDirectory: binariesDirectoryOption,@@ -83,6 +88,7 @@ export const optionsMap = {renderFrames: {forSeamlessAacConcatenation: forSeamlessAacConcatenationOption,offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,+ offthreadVideoThreads: offthreadVideoThreadsOption,jpegQuality: jpegQualityOption,logLevel: logLevelOption,timeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption,@@ -92,6 +98,7 @@ export const optionsMap = {},renderMediaOnLambda: {offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,+ offthreadVideoThreads: offthreadVideoThreadsOption,videoBitrate: videoBitrateOption,numberOfGifLoops: numberOfGifLoopsOption,preferLossless: preferLosslessAudioOption,@@ -108,6 +115,7 @@ export const optionsMap = {},renderStillOnLambda: {offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,+ offthreadVideoThreads: offthreadVideoThreadsOption,jpegQuality: jpegQualityOption,logLevel: logLevelOption,deleteAfter: deleteAfterOption,@@ -117,11 +125,13 @@ export const optionsMap = {},getCompositionsOnLambda: {offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,+ offthreadVideoThreads: offthreadVideoThreadsOption,logLevel: logLevelOption,timeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption,},renderMediaOnCloudRun: {offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,+ offthreadVideoThreads: offthreadVideoThreadsOption,numberOfGifLoops: numberOfGifLoopsOption,preferLossless: preferLosslessAudioOption,colorSpace: colorSpaceOption,@@ -140,6 +150,7 @@ export const optionsMap = {},renderStillOnCloudRun: {offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption,+ offthreadVideoThreads: offthreadVideoThreadsOption,logLevel: logLevelOption,scale: scaleOption,jpegQuality: jpegQualityOption,diff --git a/packages/renderer/src/prepare-server.ts b/packages/renderer/src/prepare-server.tsindex 2aa0bd77a6..6693214d76 100644--- a/packages/renderer/src/prepare-server.ts+++ b/packages/renderer/src/prepare-server.ts@@ -33,7 +33,7 @@ type PrepareServerOptions = {webpackConfigOrServeUrl: string;port: number | null;remotionRoot: string;- concurrency: number;+ offthreadVideoThreads: number;logLevel: LogLevel;indent: boolean;offthreadVideoCacheSizeInBytes: number | null;@@ -45,7 +45,7 @@ export const prepareServer = async ({webpackConfigOrServeUrl,port,remotionRoot,- concurrency,+ offthreadVideoThreads,logLevel,indent,offthreadVideoCacheSizeInBytes,@@ -68,7 +68,7 @@ export const prepareServer = async ({port,downloadMap,remotionRoot,- concurrency,+ offthreadVideoThreads,logLevel,indent,offthreadVideoCacheSizeInBytes,@@ -142,7 +142,7 @@ export const prepareServer = async ({port,downloadMap,remotionRoot,- concurrency,+ offthreadVideoThreads,logLevel,indent,offthreadVideoCacheSizeInBytes,diff --git a/packages/renderer/src/render-frames.ts b/packages/renderer/src/render-frames.tsindex 183e424049..7dab05b42a 100644--- a/packages/renderer/src/render-frames.ts+++ b/packages/renderer/src/render-frames.ts@@ -37,6 +37,7 @@ import {} from './next-frame-to-render';import type {ChromiumOptions} from './open-browser';import {internalOpenBrowser} from './open-browser';+import {DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS} from './options/offthreadvideo-threads';import type {ToOptions} from './options/option';import type {optionsMap} from './options/options-map';import {Pool} from './pool';@@ -457,6 +458,7 @@ const internalRenderFramesRaw = ({onBrowserDownload,onArtifact,chromeMode,+ offthreadVideoThreads,}: InternalRenderFramesOptions): Promise<RenderFramesOutput> => {validateDimension(composition.height,@@ -520,7 +522,9 @@ const internalRenderFramesRaw = ({webpackConfigOrServeUrl: webpackBundleOrServeUrl,port,remotionRoot: findRemotionRoot(),- concurrency: resolvedConcurrency,+ offthreadVideoThreads:+ offthreadVideoThreads ??+ DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS,logLevel,indent,offthreadVideoCacheSizeInBytes,@@ -586,6 +590,7 @@ const internalRenderFramesRaw = ({onBrowserDownload,onArtifact,chromeMode,+ offthreadVideoThreads,});}),])@@ -683,6 +688,7 @@ export const renderFrames = (onBrowserDownload,onArtifact,chromeMode,+ offthreadVideoThreads,} = options;if (!composition) {@@ -756,5 +762,6 @@ export const renderFrames = (defaultBrowserDownloadProgress({indent, logLevel, api: 'renderFrames()'}),onArtifact: onArtifact ?? null,chromeMode: chromeMode ?? 'headless-shell',+ offthreadVideoThreads: offthreadVideoThreads ?? null,});};diff --git a/packages/renderer/src/render-media.ts b/packages/renderer/src/render-media.tsindex c39837c6a5..f2bc975d5a 100644--- a/packages/renderer/src/render-media.ts+++ b/packages/renderer/src/render-media.ts@@ -37,6 +37,7 @@ import type {CancelSignal} from './make-cancel-signal';import {cancelErrorMessages, makeCancelSignal} from './make-cancel-signal';import type {ChromiumOptions} from './open-browser';import {DEFAULT_COLOR_SPACE, type ColorSpace} from './options/color-space';+import {DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS} from './options/offthreadvideo-threads';import type {ToOptions} from './options/option';import type {optionsMap} from './options/options-map';import {validateSelectedCodecAndPresetCombination} from './options/x264-preset';@@ -250,6 +251,7 @@ const internalRenderMediaRaw = ({metadata,hardwareAcceleration,chromeMode,+ offthreadVideoThreads,}: InternalRenderMediaOptions): Promise<RenderMediaResult> => {if (repro) {enableRepro({@@ -567,7 +569,9 @@ const internalRenderMediaRaw = ({return makeOrReuseServer(reusedServer,{- concurrency: resolvedConcurrency,+ offthreadVideoThreads:+ offthreadVideoThreads ??+ DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS,indent,port,remotionRoot: findRemotionRoot(),@@ -663,6 +667,7 @@ const internalRenderMediaRaw = ({server,serializedResolvedPropsWithCustomSchema,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,parallelEncodingEnabled: parallelEncoding,binariesDirectory,compositionStart,@@ -895,6 +900,7 @@ export const renderMedia = ({metadata,hardwareAcceleration,chromeMode,+ offthreadVideoThreads,}: RenderMediaOptions): Promise<RenderMediaResult> => {const indent = false;const logLevel =@@ -962,6 +968,7 @@ export const renderMedia = ({data: composition.props ?? {},}).serializedString,offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes ?? null,+ offthreadVideoThreads: offthreadVideoThreads ?? null,colorSpace: colorSpace ?? DEFAULT_COLOR_SPACE,repro: repro ?? false,binariesDirectory: binariesDirectory ?? null,diff --git a/packages/renderer/src/render-still.ts b/packages/renderer/src/render-still.tsindex 9d558f6e8a..d2f2599af0 100644--- a/packages/renderer/src/render-still.ts+++ b/packages/renderer/src/render-still.ts@@ -68,7 +68,6 @@ type InternalRenderStillOptions = {server: RemotionServer | undefined;serveUrl: string;port: number | null;- offthreadVideoCacheSizeInBytes: number | null;onArtifact: OnArtifact | null;} & ToOptions<typeof optionsMap.renderStill>;@@ -372,7 +371,7 @@ const internalRenderStillRaw = (webpackConfigOrServeUrl: options.serveUrl,port: options.port,remotionRoot: findRemotionRoot(),- concurrency: 1,+ offthreadVideoThreads: options.offthreadVideoThreads ?? 2,logLevel: options.logLevel,indent: options.indent,offthreadVideoCacheSizeInBytes: options.offthreadVideoCacheSizeInBytes,@@ -456,6 +455,7 @@ export const renderStill = (onBrowserDownload,onArtifact,chromeMode,+ offthreadVideoThreads,} = options;if (typeof jpegQuality !== 'undefined' && imageFormat !== 'jpeg') {@@ -520,5 +520,6 @@ export const renderStill = (}),onArtifact: onArtifact ?? null,chromeMode: chromeMode ?? 'headless-shell',+ offthreadVideoThreads: offthreadVideoThreads ?? null,});};diff --git a/packages/renderer/src/select-composition.ts b/packages/renderer/src/select-composition.tsindex 21669764df..b49f8d4cf9 100644--- a/packages/renderer/src/select-composition.ts+++ b/packages/renderer/src/select-composition.ts@@ -56,7 +56,7 @@ type CleanupFn = () => Promise<unknown>;type InnerSelectCompositionConfig = Omit<InternalSelectCompositionsConfig,- 'port'+ 'port' | 'offthreadVideoThreads'> & {page: Page;port: number;@@ -222,7 +222,7 @@ export const internalSelectCompositionRaw = async (webpackConfigOrServeUrl: serveUrlOrWebpackUrl,port,remotionRoot: findRemotionRoot(),- concurrency: 1,+ offthreadVideoThreads: 0,logLevel,indent,offthreadVideoCacheSizeInBytes,@@ -318,6 +318,7 @@ export const selectComposition = async (binariesDirectory,onBrowserDownload,chromeMode,+ offthreadVideoThreads,} = options;const indent = false;@@ -353,6 +354,7 @@ export const selectComposition = async (}),onServeUrlVisited: () => undefined,chromeMode: chromeMode ?? 'headless-shell',+ offthreadVideoThreads: offthreadVideoThreads ?? null,});return data.metadata;};diff --git a/packages/renderer/src/serve-static.ts b/packages/renderer/src/serve-static.tsindex bbe5a26f8b..03faedb767 100644--- a/packages/renderer/src/serve-static.ts+++ b/packages/renderer/src/serve-static.ts@@ -14,7 +14,7 @@ export const serveStatic = async (port: number | null;downloadMap: DownloadMap;remotionRoot: string;- concurrency: number;+ offthreadVideoThreads: number;logLevel: LogLevel;indent: boolean;offthreadVideoCacheSizeInBytes: number | null;@@ -32,7 +32,7 @@ export const serveStatic = async (compositor,} = startOffthreadVideoServer({downloadMap: options.downloadMap,- concurrency: options.concurrency,+ offthreadVideoThreads: options.offthreadVideoThreads,logLevel: options.logLevel,indent: options.indent,offthreadVideoCacheSizeInBytes: options.offthreadVideoCacheSizeInBytes,diff --git a/packages/serverless-client/README.md b/packages/serverless-client/README.mdnew file mode 100644index 0000000000..cf1c2d93af--- /dev/null+++ b/packages/serverless-client/README.md@@ -0,0 +1,5 @@+# @remotion/serverless-client++## Usage++This is an internal package and has no documentation.diff --git a/packages/serverless-client/package.json b/packages/serverless-client/package.jsonindex 409c3d1814..68064cab4a 100644--- a/packages/serverless-client/package.json+++ b/packages/serverless-client/package.json@@ -1,10 +1,9 @@{"repository": {- "url": "https://github.com/remotion-dev/remotion/tree/main/packages/serverless"+ "url": "https://github.com/remotion-dev/remotion/tree/main/packages/serverless-client"},"name": "@remotion/serverless-client","version": "4.0.260",- "description": "A runtime for distributed rendering","main": "dist","sideEffects": false,"scripts": {diff --git a/packages/serverless-client/src/constants.ts b/packages/serverless-client/src/constants.tsindex e8a80057e1..a4bf7d5c2b 100644--- a/packages/serverless-client/src/constants.ts+++ b/packages/serverless-client/src/constants.ts@@ -159,6 +159,7 @@ export type ServerlessStartPayload<Provider extends CloudProvider> = {forceWidth: number | null;bucketName: string | null;offthreadVideoCacheSizeInBytes: number | null;+ offthreadVideoThreads: number | null;deleteAfter: DeleteAfter | null;colorSpace: ColorSpace | null;preferLossless: boolean;@@ -213,6 +214,7 @@ export type ServerlessPayloads<Provider extends CloudProvider> = {forceHeight: number | null;forceWidth: number | null;offthreadVideoCacheSizeInBytes: number | null;+ offthreadVideoThreads: number | null;deleteAfter: DeleteAfter | null;colorSpace: ColorSpace | null;preferLossless: boolean;@@ -262,6 +264,7 @@ export type ServerlessPayloads<Provider extends CloudProvider> = {};preferLossless: boolean;offthreadVideoCacheSizeInBytes: number | null;+ offthreadVideoThreads: number | null;deleteAfter: DeleteAfter | null;colorSpace: ColorSpace | null;compositionStart: number;@@ -293,6 +296,7 @@ export type ServerlessPayloads<Provider extends CloudProvider> = {forceWidth: number | null;bucketName: string | null;offthreadVideoCacheSizeInBytes: number | null;+ offthreadVideoThreads: number | null;deleteAfter: DeleteAfter | null;streamed: boolean;forcePathStyle: boolean;diff --git a/packages/serverless/src/handlers/compositions.ts b/packages/serverless/src/handlers/compositions.tsindex 0680b41e43..11a1d5a869 100644--- a/packages/serverless/src/handlers/compositions.ts+++ b/packages/serverless/src/handlers/compositions.ts@@ -95,6 +95,7 @@ export const compositionsHandler = async <Provider extends CloudProvider>({throw new Error('Should not download a browser in a function');},chromeMode: 'headless-shell',+ offthreadVideoThreads: 1,});return Promise.resolve({diff --git a/packages/serverless/src/handlers/launch.ts b/packages/serverless/src/handlers/launch.tsindex ee18577628..a48c1951c5 100644--- a/packages/serverless/src/handlers/launch.ts+++ b/packages/serverless/src/handlers/launch.ts@@ -128,6 +128,7 @@ const innerLaunchHandler = async <Provider extends CloudProvider>({overallProgress.setServeUrlOpened(Date.now());},providerSpecifics,+ offthreadVideoThreads: params.offthreadVideoThreads,});overallProgress.setCompositionValidated(Date.now());RenderInternals.Log.info(@@ -280,6 +281,7 @@ const innerLaunchHandler = async <Provider extends CloudProvider>({progressEveryNthFrame,forcePathStyle: params.forcePathStyle,metadata: params.metadata,+ offthreadVideoThreads: params.offthreadVideoThreads,};return payload;});diff --git a/packages/serverless/src/handlers/renderer.ts b/packages/serverless/src/handlers/renderer.tsindex f68091e1ee..e6a9585179 100644--- a/packages/serverless/src/handlers/renderer.ts+++ b/packages/serverless/src/handlers/renderer.ts@@ -331,6 +331,7 @@ const renderHandler = async <Provider extends CloudProvider>({metadata: params.metadata,hardwareAcceleration: 'disable',chromeMode: 'headless-shell',+ offthreadVideoThreads: params.offthreadVideoThreads,}).then(({slowestFrames}) => {RenderInternals.Log.verbose(diff --git a/packages/serverless/src/handlers/start.ts b/packages/serverless/src/handlers/start.tsindex 14abd280ae..91ac1e021d 100644--- a/packages/serverless/src/handlers/start.ts+++ b/packages/serverless/src/handlers/start.ts@@ -122,6 +122,7 @@ export const startHandler = async <Provider extends CloudProvider>({forcePathStyle: params.forcePathStyle,metadata: params.metadata,apiKey: params.apiKey,+ offthreadVideoThreads: params.offthreadVideoThreads,};await providerSpecifics.callFunctionAsync({diff --git a/packages/serverless/src/handlers/still.ts b/packages/serverless/src/handlers/still.tsindex f5213276e7..c03201e81e 100644--- a/packages/serverless/src/handlers/still.ts+++ b/packages/serverless/src/handlers/still.ts@@ -123,7 +123,9 @@ const innerStillHandler = async <Provider extends CloudProvider>(const {server, cleanupServer} = await RenderInternals.makeOrReuseServer(undefined,{- concurrency: 1,+ offthreadVideoThreads:+ params.offthreadVideoThreads ??+ RenderInternals.DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS,indent: false,port: null,remotionRoot: process.cwd(),@@ -160,6 +162,7 @@ const innerStillHandler = async <Provider extends CloudProvider>(},onServeUrlVisited: () => undefined,providerSpecifics,+ offthreadVideoThreads: params.offthreadVideoThreads,});const renderMetadata: RenderMetadata<Provider> = {@@ -306,6 +309,7 @@ const innerStillHandler = async <Provider extends CloudProvider>(onBrowserDownload,onArtifact,chromeMode: 'headless-shell',+ offthreadVideoThreads: params.offthreadVideoThreads,});const {size} = await fs.promises.stat(outputPath);diff --git a/packages/serverless/src/validate-composition.ts b/packages/serverless/src/validate-composition.tsindex 4047ec8888..6490068e7c 100644--- a/packages/serverless/src/validate-composition.ts+++ b/packages/serverless/src/validate-composition.ts@@ -32,6 +32,7 @@ type ValidateCompositionOptions<Provider extends CloudProvider> = {logLevel: LogLevel;server: RemotionServer | undefined;offthreadVideoCacheSizeInBytes: number | null;+ offthreadVideoThreads: number | null;onBrowserDownload: OnBrowserDownload;onServeUrlVisited: () => void;providerSpecifics: ProviderSpecifics<Provider>;@@ -54,6 +55,7 @@ export const validateComposition = async <Provider extends CloudProvider>({onBrowserDownload,onServeUrlVisited,providerSpecifics,+ offthreadVideoThreads,}: ValidateCompositionOptions<Provider>): Promise<VideoConfig> => {const {metadata: comp} = await RenderInternals.internalSelectComposition({id: composition,@@ -70,6 +72,7 @@ export const validateComposition = async <Provider extends CloudProvider>({onBrowserLog: null,server,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,binariesDirectory: null,onBrowserDownload,onServeUrlVisited,diff --git a/packages/studio-server/src/preview-server/routes/add-render.ts b/packages/studio-server/src/preview-server/routes/add-render.tsindex 3a99539a15..3a7079ddd1 100644--- a/packages/studio-server/src/preview-server/routes/add-render.ts+++ b/packages/studio-server/src/preview-server/routes/add-render.ts@@ -63,6 +63,7 @@ export const handleAddRender: ApiHandler<AddRenderRequest, undefined> = ({metadata: input.metadata,hardwareAcceleration: input.hardwareAcceleration,chromeMode: input.chromeMode,+ offthreadVideoThreads: input.offthreadVideoThreads,},logLevel,});@@ -101,6 +102,7 @@ export const handleAddRender: ApiHandler<AddRenderRequest, undefined> = ({binariesDirectory,metadata: input.metadata,chromeMode: input.chromeMode,+ offthreadVideoThreads: input.offthreadVideoThreads,},logLevel,});@@ -135,6 +137,7 @@ export const handleAddRender: ApiHandler<AddRenderRequest, undefined> = ({binariesDirectory,metadata: input.metadata,chromeMode: input.chromeMode,+ offthreadVideoThreads: input.offthreadVideoThreads,},entryPoint,remotionRoot,diff --git a/packages/studio-shared/src/api-requests.ts b/packages/studio-shared/src/api-requests.tsindex 788173b081..2253b66c4f 100644--- a/packages/studio-shared/src/api-requests.ts+++ b/packages/studio-shared/src/api-requests.ts@@ -99,6 +99,7 @@ export type AddRenderRequest = {envVariables: Record<string, string>;serializedInputPropsWithCustomSchema: string;offthreadVideoCacheSizeInBytes: number | null;+ offthreadVideoThreads: number | null;multiProcessOnLinux: boolean;beepOnFinish: boolean;metadata: Record<string, string> | null;diff --git a/packages/studio-shared/src/render-defaults.ts b/packages/studio-shared/src/render-defaults.tsindex 3c11017584..0d4159cb92 100644--- a/packages/studio-shared/src/render-defaults.ts+++ b/packages/studio-shared/src/render-defaults.ts@@ -43,6 +43,7 @@ export type RenderDefaults = {openGlRenderer: OpenGlRenderer | null;ignoreCertificateErrors: boolean;offthreadVideoCacheSizeInBytes: number | null;+ offthreadVideoThreads: number | null;headless: boolean;colorSpace: ColorSpace;multiProcessOnLinux: boolean;diff --git a/packages/studio-shared/src/render-job.ts b/packages/studio-shared/src/render-job.tsindex 7574cdfccd..645fd26c7b 100644--- a/packages/studio-shared/src/render-job.ts+++ b/packages/studio-shared/src/render-job.ts@@ -104,6 +104,7 @@ type RenderJobDynamicFields =frame: number;scale: number;offthreadVideoCacheSizeInBytes: number | null;+ offthreadVideoThreads: number | null;} & RenderJobDynamicStatus)| ({type: 'sequence';@@ -114,6 +115,7 @@ type RenderJobDynamicFields =startFrame: number;endFrame: number;offthreadVideoCacheSizeInBytes: number | null;+ offthreadVideoThreads: number | null;} & RenderJobDynamicStatus)| ({type: 'video';@@ -139,6 +141,7 @@ type RenderJobDynamicFields =numberOfGifLoops: number | null;disallowParallelEncoding: boolean;offthreadVideoCacheSizeInBytes: number | null;+ offthreadVideoThreads: number | null;colorSpace: ColorSpace;forSeamlessAacConcatenation: boolean;separateAudioTo: string | null;diff --git a/packages/studio/src/components/Modals.tsx b/packages/studio/src/components/Modals.tsxindex d1997a77c2..4f2e1681bc 100644--- a/packages/studio/src/components/Modals.tsx+++ b/packages/studio/src/components/Modals.tsx@@ -44,6 +44,9 @@ export const Modals: React.FC<{initialOffthreadVideoCacheSizeInBytes={modalContextType.initialOffthreadVideoCacheSizeInBytes}+ initialOffthreadVideoThreads={+ modalContextType.initialOffthreadVideoThreads+ }initialConcurrency={modalContextType.initialConcurrency}maxConcurrency={modalContextType.maxConcurrency}minConcurrency={modalContextType.minConcurrency}diff --git a/packages/studio/src/components/RenderButton.tsx b/packages/studio/src/components/RenderButton.tsxindex 1df75ee11a..491544894f 100644--- a/packages/studio/src/components/RenderButton.tsx+++ b/packages/studio/src/components/RenderButton.tsx@@ -98,6 +98,7 @@ export const RenderButton: React.FC = () => {initialIgnoreCertificateErrors: defaults.ignoreCertificateErrors,initialOffthreadVideoCacheSizeInBytes:defaults.offthreadVideoCacheSizeInBytes,+ initialOffthreadVideoThreads: defaults.offthreadVideoThreads,defaultProps: props[video.id] ?? video.defaultProps,inFrameMark: inFrame,outFrameMark: outFrame,diff --git a/packages/studio/src/components/RenderModal/RenderModal.tsx b/packages/studio/src/components/RenderModal/RenderModal.tsxindex 4ebeacf971..90e51fba12 100644--- a/packages/studio/src/components/RenderModal/RenderModal.tsx+++ b/packages/studio/src/components/RenderModal/RenderModal.tsx@@ -239,6 +239,7 @@ type RenderModalProps = {readonly initialHardwareAcceleration: HardwareAccelerationOption;readonly renderTypeOfLastRender: RenderType | null;readonly initialChromeMode: ChromeMode;+ readonly initialOffthreadVideoThreads: number | null;readonly defaultMetadata: Record<string, string> | null;};@@ -274,6 +275,7 @@ const RenderModal: React.FC<initialIgnoreCertificateErrors,initialEncodingBufferSize,initialEncodingMaxRate,+ initialOffthreadVideoThreads,initialUserAgent,defaultProps,inFrameMark,@@ -488,6 +490,10 @@ const RenderModal: React.FC<const [offthreadVideoCacheSizeInBytes, setOffthreadVideoCacheSizeInBytes] =useState<number | null>(initialOffthreadVideoCacheSizeInBytes);+ const [offthreadVideoThreads, setOffthreadVideoThreads] = useState<+ number | null+ >(() => initialOffthreadVideoThreads);+const codec = useMemo(() => {if (renderMode === 'audio') {return videoCodecForAudioTab;@@ -754,6 +760,7 @@ const RenderModal: React.FC<beepOnFinish,metadata,chromeMode,+ offthreadVideoThreads,}).then(() => {dispatchIfMounted({type: 'succeed'});@@ -782,6 +789,7 @@ const RenderModal: React.FC<setSelectedModal,metadata,chromeMode,+ offthreadVideoThreads,]);const [everyNthFrameSetting, setEveryNthFrameSetting] = useState(@@ -856,6 +864,7 @@ const RenderModal: React.FC<metadata,hardwareAcceleration,chromeMode,+ offthreadVideoThreads,}).then(() => {dispatchIfMounted({type: 'succeed'});@@ -908,6 +917,7 @@ const RenderModal: React.FC<metadata,hardwareAcceleration,chromeMode,+ offthreadVideoThreads,]);const onClickSequence = useCallback(() => {@@ -936,6 +946,7 @@ const RenderModal: React.FC<repro,metadata,chromeMode,+ offthreadVideoThreads,}).then(() => {dispatchIfMounted({type: 'succeed'});@@ -968,6 +979,7 @@ const RenderModal: React.FC<setSelectedModal,metadata,chromeMode,+ offthreadVideoThreads,]);useEffect(() => {@@ -1422,6 +1434,8 @@ const RenderModal: React.FC<setOffthreadVideoCacheSizeInBytes={setOffthreadVideoCacheSizeInBytes}+ offthreadVideoThreads={offthreadVideoThreads}+ setOffthreadVideoThreads={setOffthreadVideoThreads}enableMultiProcessOnLinux={multiProcessOnLinux}setChromiumMultiProcessOnLinux={setChromiumMultiProcessOnLinux}codec={codec}diff --git a/packages/studio/src/components/RenderModal/RenderModalAdvanced.tsx b/packages/studio/src/components/RenderModal/RenderModalAdvanced.tsxindex 79bfa3e6eb..215064cba4 100644--- a/packages/studio/src/components/RenderModal/RenderModalAdvanced.tsx+++ b/packages/studio/src/components/RenderModal/RenderModalAdvanced.tsx@@ -67,6 +67,10 @@ export const RenderModalAdvanced: React.FC<{readonly setOffthreadVideoCacheSizeInBytes: React.Dispatch<React.SetStateAction<number | null>>;+ readonly offthreadVideoThreads: number | null;+ readonly setOffthreadVideoThreads: React.Dispatch<+ React.SetStateAction<number | null>+ >;readonly codec: Codec;readonly enableMultiProcessOnLinux: boolean;readonly setChromiumMultiProcessOnLinux: React.Dispatch<@@ -103,6 +107,8 @@ export const RenderModalAdvanced: React.FC<{codec,offthreadVideoCacheSizeInBytes,setOffthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,+ setOffthreadVideoThreads,enableMultiProcessOnLinux,setChromiumMultiProcessOnLinux,setUserAgent,@@ -138,6 +144,16 @@ export const RenderModalAdvanced: React.FC<{});}, [setOffthreadVideoCacheSizeInBytes]);+ const toggleCustomOffthreadVideoThreads = useCallback(() => {+ setOffthreadVideoThreads((previous) => {+ if (previous === null) {+ return 2;+ }++ return null;+ });+ }, [setOffthreadVideoThreads]);+const toggleCustomUserAgent = useCallback(() => {setUserAgent((previous) => {if (previous === null) {@@ -293,6 +309,25 @@ export const RenderModalAdvanced: React.FC<{[setOffthreadVideoCacheSizeInBytes],);+ const changeOffthreadVideoThreads: React.Dispatch<+ React.SetStateAction<number>+ > = useCallback(+ (cb) => {+ setOffthreadVideoThreads((prev) => {+ if (prev === null) {+ throw new TypeError('Expected previous value');+ }++ if (typeof cb === 'function') {+ return cb(prev);+ }++ return cb;+ });+ },+ [setOffthreadVideoThreads],+ );+return (<div style={container} className={VERTICAL_SCROLLBAR_CLASSNAME}>{renderMode === 'still' ? null : (@@ -377,7 +412,7 @@ export const RenderModalAdvanced: React.FC<{{renderMode === 'audio' ||offthreadVideoCacheSizeInBytes === null ? null : (<NumberSetting- min={minConcurrency}+ min={0}max={2000 * 1024 * 1024}step={1024}name="OffthreadVideo cache size"@@ -386,6 +421,31 @@ export const RenderModalAdvanced: React.FC<{value={offthreadVideoCacheSizeInBytes}/>)}+ {renderMode === 'audio' ? null : (+ <div style={optionRow}>+ <div style={label}>OffthreadVideo threads</div>+ <Spacing x={0.5} />+ <OptionExplainerBubble id="offthreadVideoThreadsOption" />+ <div style={rightRow}>+ <Checkbox+ checked={offthreadVideoThreads !== null}+ onChange={toggleCustomOffthreadVideoThreads}+ name="offthread-video-threads"+ />+ </div>+ </div>+ )}+ {renderMode === 'audio' || offthreadVideoThreads === null ? null : (+ <NumberSetting+ min={0}+ max={16}+ step={1}+ name="OffthreadVideo threads"+ formatter={(w) => `${w}x`}+ onValueChanged={changeOffthreadVideoThreads}+ value={offthreadVideoThreads}+ />+ )}<RenderModalHr /><div style={optionRow}><div style={label}>Disable web security</div>diff --git a/packages/studio/src/components/RenderQueue/actions.ts b/packages/studio/src/components/RenderQueue/actions.tsindex 1512dd8df9..a952e65268 100644--- a/packages/studio/src/components/RenderQueue/actions.ts+++ b/packages/studio/src/components/RenderQueue/actions.ts@@ -36,6 +36,7 @@ export const addStillRenderJob = ({envVariables,inputProps,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,multiProcessOnLinux,beepOnFinish,metadata,@@ -53,6 +54,7 @@ export const addStillRenderJob = ({envVariables: Record<string, string>;inputProps: Record<string, unknown>;offthreadVideoCacheSizeInBytes: number | null;+ offthreadVideoThreads: number | null;multiProcessOnLinux: boolean;beepOnFinish: boolean;metadata: Record<string, string> | null;@@ -77,6 +79,7 @@ export const addStillRenderJob = ({indent: undefined,}).serializedString,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,multiProcessOnLinux,beepOnFinish,metadata,@@ -98,6 +101,7 @@ export const addSequenceRenderJob = ({inputProps,concurrency,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,jpegQuality,disallowParallelEncoding,multiProcessOnLinux,@@ -120,6 +124,7 @@ export const addSequenceRenderJob = ({envVariables: Record<string, string>;inputProps: Record<string, unknown>;offthreadVideoCacheSizeInBytes: number | null;+ offthreadVideoThreads: number | null;disallowParallelEncoding: boolean;multiProcessOnLinux: boolean;beepOnFinish: boolean;@@ -148,6 +153,7 @@ export const addSequenceRenderJob = ({indent: undefined,}).serializedString,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,disallowParallelEncoding,multiProcessOnLinux,beepOnFinish,@@ -185,6 +191,7 @@ export const addVideoRenderJob = ({envVariables,inputProps,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,colorSpace,multiProcessOnLinux,encodingMaxRate,@@ -224,6 +231,7 @@ export const addVideoRenderJob = ({envVariables: Record<string, string>;inputProps: Record<string, unknown>;offthreadVideoCacheSizeInBytes: number | null;+ offthreadVideoThreads: number | null;colorSpace: ColorSpace;multiProcessOnLinux: boolean;encodingMaxRate: string | null;@@ -270,6 +278,7 @@ export const addVideoRenderJob = ({indent: undefined,}).serializedString,offthreadVideoCacheSizeInBytes,+ offthreadVideoThreads,colorSpace,multiProcessOnLinux,encodingBufferSize,diff --git a/packages/studio/src/components/SidebarRenderButton.tsx b/packages/studio/src/components/SidebarRenderButton.tsxindex 520dfcf551..d3e1b88f48 100644--- a/packages/studio/src/components/SidebarRenderButton.tsx+++ b/packages/studio/src/components/SidebarRenderButton.tsx@@ -77,6 +77,7 @@ export const SidebarRenderButton: React.FC<{initialHeadless: defaults.headless,initialOffthreadVideoCacheSizeInBytes:defaults.offthreadVideoCacheSizeInBytes,+ initialOffthreadVideoThreads: defaults.offthreadVideoThreads,initialIgnoreCertificateErrors: defaults.ignoreCertificateErrors,defaultProps: props[composition.id] ?? composition.defaultProps,inFrameMark: null,diff --git a/packages/studio/src/helpers/retry-payload.ts b/packages/studio/src/helpers/retry-payload.tsindex 5cdd8bf8d4..44c373dcaf 100644--- a/packages/studio/src/helpers/retry-payload.ts+++ b/packages/studio/src/helpers/retry-payload.ts@@ -52,6 +52,7 @@ export const makeRetryPayload = (job: RenderJob): RenderModalState => {inFrameMark: null,outFrameMark: null,initialOffthreadVideoCacheSizeInBytes: job.offthreadVideoCacheSizeInBytes,+ initialOffthreadVideoThreads: job.offthreadVideoThreads,initialColorSpace: defaults.colorSpace as ColorSpace,initialMultiProcessOnLinux: job.multiProcessOnLinux,defaultConfigurationVideoCodec: defaults.codec as Codec,@@ -103,6 +104,7 @@ export const makeRetryPayload = (job: RenderJob): RenderModalState => {inFrameMark: job.startFrame,outFrameMark: job.endFrame,initialOffthreadVideoCacheSizeInBytes: job.offthreadVideoCacheSizeInBytes,+ initialOffthreadVideoThreads: job.offthreadVideoThreads,initialColorSpace: defaults.colorSpace as ColorSpace,initialMultiProcessOnLinux: job.multiProcessOnLinux,defaultConfigurationVideoCodec: defaults.codec as Codec,@@ -156,6 +158,7 @@ export const makeRetryPayload = (job: RenderJob): RenderModalState => {inFrameMark: job.startFrame,outFrameMark: job.endFrame,initialOffthreadVideoCacheSizeInBytes: job.offthreadVideoCacheSizeInBytes,+ initialOffthreadVideoThreads: job.offthreadVideoThreads,initialColorSpace: job.colorSpace,initialMultiProcessOnLinux: job.multiProcessOnLinux,defaultConfigurationVideoCodec: job.codec,diff --git a/packages/studio/src/state/modals.ts b/packages/studio/src/state/modals.tsindex 7149763fe3..0bbc1e0c1c 100644--- a/packages/studio/src/state/modals.ts+++ b/packages/studio/src/state/modals.ts@@ -46,6 +46,7 @@ export type RenderModalState = {initialIgnoreCertificateErrors: boolean;initialHeadless: boolean;initialOffthreadVideoCacheSizeInBytes: number | null;+ initialOffthreadVideoThreads: number | null;initialColorSpace: ColorSpace;initialMultiProcessOnLinux: boolean;initialUserAgent: string | null;