Skip to content

🎥 Make videos programmatically with React

`@remotion/renderer`: If a license key is set in Studio, pass it to renderMedia() (#10248)

Jonny Burger64aba6cc0d30
diff --git a/packages/cli/src/render-flows/render.ts b/packages/cli/src/render-flows/render.ts
index d64ae57f06..30bcaa6c89 100644
--- a/packages/cli/src/render-flows/render.ts
+++ b/packages/cli/src/render-flows/render.ts
@@ -140,6 +140,7 @@ export const renderVideoFlow = async ({
bundlerOverride,
rspackOverride,
webpackOverride,
+ licenseKey,
}: {
remotionRoot: string;
fullEntryPoint: string;
@@ -212,6 +213,7 @@ export const renderVideoFlow = async ({
bundlerOverride: BundlerOverrideFn | null;
rspackOverride: RspackOverrideFn | null;
webpackOverride: WebpackOverrideFn | null;
+ licenseKey: string | null;
}) => {
RenderInternals.validateConcurrency({
value: concurrency,
@@ -783,7 +785,7 @@ export const renderVideoFlow = async ({
chromeMode,
mediaCacheSizeInBytes,
onLog,
- licenseKey: null,
+ licenseKey,
isProduction: null,
sampleRate: resolvedSampleRate,
});
diff --git a/packages/cli/src/render-flows/still.ts b/packages/cli/src/render-flows/still.ts
index 8a4a85f430..6dd289143f 100644
--- a/packages/cli/src/render-flows/still.ts
+++ b/packages/cli/src/render-flows/still.ts
@@ -96,6 +96,7 @@ export const renderStillFlow = async ({
bundlerOverride,
rspackOverride,
webpackOverride,
+ licenseKey,
}: {
remotionRoot: string;
fullEntryPoint: string;
@@ -139,6 +140,7 @@ export const renderStillFlow = async ({
bundlerOverride: BundlerOverrideFn | null;
rspackOverride: RspackOverrideFn | null;
webpackOverride: WebpackOverrideFn | null;
+ licenseKey: string | null;
}) => {
const isVerbose = RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose');
Log.verbose(
@@ -446,7 +448,7 @@ export const renderStillFlow = async ({
printToConsole: true,
});
},
- licenseKey: null,
+ licenseKey,
isProduction: null,
});
diff --git a/packages/cli/src/render-queue/process-still.ts b/packages/cli/src/render-queue/process-still.ts
index d169b3339f..2c3c2dbb10 100644
--- a/packages/cli/src/render-queue/process-still.ts
+++ b/packages/cli/src/render-queue/process-still.ts
@@ -89,5 +89,6 @@ export const processStill = async ({
bundlerOverride: fixedConfig.bundlerOverride,
rspackOverride: fixedConfig.rspackOverride,
webpackOverride: fixedConfig.webpackOverride,
+ licenseKey: job.licenseKey,
});
};
diff --git a/packages/cli/src/render-queue/process-video.ts b/packages/cli/src/render-queue/process-video.ts
index 530ed9a53e..4c7d531248 100644
--- a/packages/cli/src/render-queue/process-video.ts
+++ b/packages/cli/src/render-queue/process-video.ts
@@ -135,5 +135,6 @@ export const processVideoJob = async ({
bundlerOverride: fixedConfig.bundlerOverride,
rspackOverride: fixedConfig.rspackOverride,
webpackOverride: fixedConfig.webpackOverride,
+ licenseKey: job.type === 'video' ? job.licenseKey : null,
});
};
diff --git a/packages/cli/src/render.tsx b/packages/cli/src/render.tsx
index 4880634371..60a86133b7 100644
--- a/packages/cli/src/render.tsx
+++ b/packages/cli/src/render.tsx
@@ -62,6 +62,7 @@ const {
bundleCacheOption,
sampleRateOption,
stillFrameOption,
+ publicLicenseKeyOption,
} = BrowserSafeApis.options;
export const render = async (
@@ -336,5 +337,6 @@ export const render = async (
bundlerOverride: null,
rspackOverride: null,
webpackOverride: null,
+ licenseKey: publicLicenseKeyOption.getValue({commandLine: parsedCli}).value,
});
};
diff --git a/packages/cli/src/still.ts b/packages/cli/src/still.ts
index d36d967646..48dfe5986f 100644
--- a/packages/cli/src/still.ts
+++ b/packages/cli/src/still.ts
@@ -40,6 +40,7 @@ const {
overrideDurationOption,
bundleCacheOption,
framesOption,
+ publicLicenseKeyOption,
} = BrowserSafeApis.options;
export const still = async (
@@ -221,5 +222,6 @@ export const still = async (
bundlerOverride: null,
rspackOverride: null,
webpackOverride: null,
+ licenseKey: publicLicenseKeyOption.getValue({commandLine: parsedCli}).value,
});
};
diff --git a/packages/it-tests/src/ssr/render-media.test.ts b/packages/it-tests/src/ssr/render-media.test.ts
index 8d35c95f0c..0dcee0c082 100644
--- a/packages/it-tests/src/ssr/render-media.test.ts
+++ b/packages/it-tests/src/ssr/render-media.test.ts
@@ -1,4 +1,4 @@
-import {expect, test} from 'bun:test';
+import {expect, spyOn, test} from 'bun:test';
import fs, {existsSync} from 'fs';
import os from 'os';
import path from 'path';
@@ -8,6 +8,7 @@ import {
openBrowser,
renderMedia,
} from '@remotion/renderer';
+import {NoReactInternals} from 'remotion/no-react';
const exampleBuild = path.join(__dirname, '..', '..', '..', 'example', 'build');
@@ -30,24 +31,67 @@ test(
const tmpDir = os.tmpdir();
const outPath = path.join(tmpDir, 'out.mp4');
+ const originalFetch = globalThis.fetch;
+ const fetchSpy = spyOn(globalThis, 'fetch').mockImplementation(((
+ input,
+ init,
+ ) => {
+ if (String(input).startsWith('https://www.remotion.pro/api/track/')) {
+ return Promise.resolve(
+ new Response(
+ JSON.stringify({
+ success: true,
+ billable: false,
+ classification: 'development',
+ }),
+ ),
+ );
+ }
- await renderMedia({
- outputLocation: outPath,
- codec: 'h264',
- serveUrl: exampleBuild,
- composition: reactSvg,
- frameRange: [0, 2],
- puppeteerInstance,
- metadata: {Author: 'Lunar'},
- logLevel: 'error',
- });
- await puppeteerInstance.close({silent: false});
- expect(existsSync(outPath)).toBe(true);
+ return originalFetch(input, init);
+ }) as typeof fetch);
+ const warnSpy = spyOn(console, 'warn').mockImplementation(() => undefined);
+
+ try {
+ await renderMedia({
+ outputLocation: outPath,
+ codec: 'h264',
+ serveUrl: exampleBuild,
+ composition: reactSvg,
+ frameRange: [0, 2],
+ puppeteerInstance,
+ metadata: {Author: 'Lunar'},
+ licenseKey: 'free-license',
+ logLevel: 'warn',
+ });
+
+ expect(existsSync(outPath)).toBe(true);
+ const licensingCall = fetchSpy.mock.calls.find(([input]) =>
+ String(input).startsWith('https://www.remotion.pro/api/track/'),
+ );
+ expect(licensingCall).toBeDefined();
+ expect(JSON.parse(String(licensingCall?.[1]?.body))).toMatchObject({
+ apiKey: null,
+ event: 'cloud-render',
+ host: null,
+ isStill: false,
+ });
+ expect(
+ warnSpy.mock.calls.some((args) =>
+ args.join(' ').includes('Pass "licenseKey" to renderMedia()'),
+ ),
+ ).toBe(false);
+ } finally {
+ fetchSpy.mockRestore();
+ warnSpy.mockRestore();
+ await puppeteerInstance.close({silent: false});
+ }
},
{retry: 2},
);
test('Render video with browser instance not open', async () => {
+ const warnSpy = spyOn(console, 'warn').mockImplementation(() => undefined);
const compositions = await getCompositions({
serveUrl: exampleBuild,
inputProps: {},
@@ -63,16 +107,25 @@ test('Render video with browser instance not open', async () => {
const outPath = path.join(tmpDir, 'subdir', 'out.mp4');
- await renderMedia({
- outputLocation: outPath,
- codec: 'h264',
- serveUrl: exampleBuild,
- composition: reactSvg,
- frameRange: [0, 2],
- metadata: {Author: 'Lunar'},
- logLevel: 'error',
- });
- expect(existsSync(outPath)).toBe(true);
+ try {
+ await renderMedia({
+ outputLocation: outPath,
+ codec: 'h264',
+ serveUrl: exampleBuild,
+ composition: reactSvg,
+ frameRange: [0, 2],
+ metadata: {Author: 'Lunar'},
+ logLevel: 'warn',
+ });
+ expect(existsSync(outPath)).toBe(true);
+ expect(
+ warnSpy.mock.calls.some((args) =>
+ args.join(' ').includes('Pass "licenseKey" to renderMedia()'),
+ ),
+ ).toBe(NoReactInternals.ENABLE_V5_BREAKING_CHANGES);
+ } finally {
+ warnSpy.mockRestore();
+ }
});
test('should fail on invalid CRF', async () => {
diff --git a/packages/it-tests/src/ssr/render-still.test.ts b/packages/it-tests/src/ssr/render-still.test.ts
index 1eb1b3e6c4..5f6a405268 100644
--- a/packages/it-tests/src/ssr/render-still.test.ts
+++ b/packages/it-tests/src/ssr/render-still.test.ts
@@ -1,4 +1,4 @@
-import {beforeAll, expect, test} from 'bun:test';
+import {beforeAll, expect, spyOn, test} from 'bun:test';
import {existsSync} from 'fs';
import os from 'os';
import path from 'path';
@@ -8,6 +8,7 @@ import {
openBrowser,
renderStill,
} from '@remotion/renderer';
+import {NoReactInternals} from 'remotion/no-react';
const exampleBuild = path.join(__dirname, '..', '..', '..', 'example', 'build');
@@ -35,14 +36,58 @@ test(
const tmpDir = os.tmpdir();
const outPath = path.join(tmpDir, 'out.mp4');
+ const originalFetch = globalThis.fetch;
+ const fetchSpy = spyOn(globalThis, 'fetch').mockImplementation(((
+ input,
+ init,
+ ) => {
+ if (String(input).startsWith('https://www.remotion.pro/api/track/')) {
+ return Promise.resolve(
+ new Response(
+ JSON.stringify({
+ success: true,
+ billable: false,
+ classification: 'development',
+ }),
+ ),
+ );
+ }
- const {buffer} = await renderStill({
- output: outPath,
- serveUrl: exampleBuild,
- composition: reactSvg,
- puppeteerInstance,
- });
- expect(buffer).toBe(null);
+ return originalFetch(input, init);
+ }) as typeof fetch);
+ const warnSpy = spyOn(console, 'warn').mockImplementation(
+ () => undefined,
+ );
+
+ try {
+ const {buffer} = await renderStill({
+ output: outPath,
+ serveUrl: exampleBuild,
+ composition: reactSvg,
+ puppeteerInstance,
+ licenseKey: 'free-license',
+ logLevel: 'warn',
+ });
+ expect(buffer).toBe(null);
+ const licensingCall = fetchSpy.mock.calls.find(([input]) =>
+ String(input).startsWith('https://www.remotion.pro/api/track/'),
+ );
+ expect(licensingCall).toBeDefined();
+ expect(JSON.parse(String(licensingCall?.[1]?.body))).toMatchObject({
+ apiKey: null,
+ event: 'cloud-render',
+ host: null,
+ isStill: true,
+ });
+ expect(
+ warnSpy.mock.calls.some((args) =>
+ args.join(' ').includes('Pass "licenseKey" to renderStill()'),
+ ),
+ ).toBe(false);
+ } finally {
+ fetchSpy.mockRestore();
+ warnSpy.mockRestore();
+ }
} finally {
await puppeteerInstance.close({silent: false});
}
@@ -53,6 +98,7 @@ test(
test(
'Render still with browser instance not open and legacy webpack config',
async () => {
+ const warnSpy = spyOn(console, 'warn').mockImplementation(() => undefined);
const compositions = await getCompositions({
serveUrl: exampleBuild,
inputProps: {},
@@ -68,12 +114,22 @@ test(
const outPath = path.join(tmpDir, 'subdir', 'out.jpg');
- await renderStill({
- output: outPath,
- serveUrl: exampleBuild,
- composition: reactSvg,
- });
- expect(existsSync(outPath)).toBe(true);
+ try {
+ await renderStill({
+ output: outPath,
+ serveUrl: exampleBuild,
+ composition: reactSvg,
+ logLevel: 'warn',
+ });
+ expect(existsSync(outPath)).toBe(true);
+ expect(
+ warnSpy.mock.calls.some((args) =>
+ args.join(' ').includes('Pass "licenseKey" to renderStill()'),
+ ),
+ ).toBe(NoReactInternals.ENABLE_V5_BREAKING_CHANGES);
+ } finally {
+ warnSpy.mockRestore();
+ }
},
{retry: 3},
);
diff --git a/packages/renderer/src/render-media.ts b/packages/renderer/src/render-media.ts
index f886b7ef49..7c85773f05 100644
--- a/packages/renderer/src/render-media.ts
+++ b/packages/renderer/src/render-media.ts
@@ -105,7 +105,7 @@ type MoreRenderMediaOptions = ToOptions<typeof optionsMap.renderMedia>;
type EitherApiKeyOrLicenseKey =
true extends typeof NoReactInternals.ENABLE_V5_BREAKING_CHANGES
? {
- licenseKey: string | null;
+ licenseKey?: string | null;
}
:
| {
@@ -858,7 +858,7 @@ const internalRenderMediaRaw = ({
event: 'cloud-render',
host: null,
succeeded: true,
- licenseKey: licenseKey ?? null,
+ licenseKey: licenseKey === 'free-license' ? null : licenseKey,
isProduction: isProduction ?? true,
isStill: false,
})
@@ -1034,9 +1034,29 @@ export const renderMedia = ({
}
const licenseKey =
- 'licenseKey' in apiKeyOrLicenseKey ? apiKeyOrLicenseKey.licenseKey : null;
+ 'licenseKey' in apiKeyOrLicenseKey &&
+ typeof apiKeyOrLicenseKey.licenseKey === 'string'
+ ? apiKeyOrLicenseKey.licenseKey
+ : null;
const apiKey =
- 'apiKey' in apiKeyOrLicenseKey ? apiKeyOrLicenseKey.apiKey : null;
+ 'apiKey' in apiKeyOrLicenseKey &&
+ typeof apiKeyOrLicenseKey.apiKey === 'string'
+ ? apiKeyOrLicenseKey.apiKey
+ : null;
+ const effectiveLicenseKey =
+ (NoReactInternals.ENABLE_V5_BREAKING_CHANGES
+ ? licenseKey
+ : (licenseKey ?? apiKey)) ?? null;
+
+ if (
+ NoReactInternals.ENABLE_V5_BREAKING_CHANGES &&
+ effectiveLicenseKey === null
+ ) {
+ Log.warn(
+ {indent, logLevel},
+ 'Pass "licenseKey" to renderMedia(). If you qualify for the Free License (https://remotion.dev/license), pass "free-license" instead.',
+ );
+ }
return internalRenderMedia({
proResProfile: proResProfile ?? undefined,
@@ -1113,7 +1133,7 @@ export const renderMedia = ({
hardwareAcceleration: hardwareAcceleration ?? 'disable',
chromeMode: chromeMode ?? 'headless-shell',
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
- licenseKey: licenseKey ?? apiKey ?? null,
+ licenseKey: effectiveLicenseKey,
onLog: defaultOnLog,
isProduction: isProduction ?? null,
sampleRate: sampleRate ?? composition.defaultSampleRate ?? 48000,
diff --git a/packages/renderer/src/render-still.ts b/packages/renderer/src/render-still.ts
index d9e1302973..b7c8755ff6 100644
--- a/packages/renderer/src/render-still.ts
+++ b/packages/renderer/src/render-still.ts
@@ -80,6 +80,26 @@ type InternalRenderStillOptions = {
isProduction: boolean | null;
} & ToOptions<Omit<typeof optionsMap.renderStill, 'apiKey'>>;
+type MoreRenderStillOptions = ToOptions<
+ Omit<typeof optionsMap.renderStill, 'apiKey' | 'licenseKey'>
+>;
+
+type EitherApiKeyOrLicenseKey =
+ true extends typeof NoReactInternals.ENABLE_V5_BREAKING_CHANGES
+ ? {
+ licenseKey?: string | null;
+ }
+ :
+ | {
+ /**
+ * @deprecated Use `licenseKey` instead
+ */
+ apiKey?: string | null;
+ }
+ | {
+ licenseKey?: string | null;
+ };
+
export type RenderStillOptions = {
port?: number | null;
composition: VideoConfig;
@@ -111,12 +131,8 @@ export type RenderStillOptions = {
quality?: never;
onArtifact?: OnArtifact;
isProduction?: boolean;
-} & Partial<ToOptions<typeof optionsMap.renderStill>> & {
- /**
- * @deprecated Use `licenseKey` instead
- */
- apiKey?: string | null;
- };
+} & Partial<MoreRenderStillOptions> &
+ EitherApiKeyOrLicenseKey;
type CleanupFn = () => Promise<unknown>;
type RenderStillReturnValue = {buffer: Buffer | null; contentType: string};
@@ -442,7 +458,8 @@ const internalRenderStillRaw = (
}
LicensingInternals.internalRegisterUsageEvent({
- licenseKey: options.licenseKey,
+ licenseKey:
+ options.licenseKey === 'free-license' ? null : options.licenseKey,
event: 'cloud-render',
host: null,
succeeded: true,
@@ -521,9 +538,8 @@ export const renderStill = (
chromeMode,
offthreadVideoThreads,
mediaCacheSizeInBytes,
- apiKey,
- licenseKey,
isProduction,
+ ...apiKeyOrLicenseKey
} = options;
if (typeof jpegQuality !== 'undefined' && imageFormat !== 'jpeg') {
@@ -544,6 +560,31 @@ export const renderStill = (
);
}
+ const licenseKey =
+ 'licenseKey' in apiKeyOrLicenseKey &&
+ typeof apiKeyOrLicenseKey.licenseKey === 'string'
+ ? apiKeyOrLicenseKey.licenseKey
+ : null;
+ const apiKey =
+ 'apiKey' in apiKeyOrLicenseKey &&
+ typeof apiKeyOrLicenseKey.apiKey === 'string'
+ ? apiKeyOrLicenseKey.apiKey
+ : null;
+ const effectiveLicenseKey =
+ (NoReactInternals.ENABLE_V5_BREAKING_CHANGES
+ ? licenseKey
+ : (licenseKey ?? apiKey)) ?? null;
+
+ if (
+ NoReactInternals.ENABLE_V5_BREAKING_CHANGES &&
+ effectiveLicenseKey === null
+ ) {
+ Log.warn(
+ {indent, logLevel},
+ 'Pass "licenseKey" to renderStill(). If you qualify for the Free License (https://remotion.dev/license), pass "free-license" instead.',
+ );
+ }
+
return internalRenderStill({
composition,
browserExecutable: browserExecutable ?? null,
@@ -590,7 +631,7 @@ export const renderStill = (
chromeMode: chromeMode ?? 'headless-shell',
offthreadVideoThreads: offthreadVideoThreads ?? null,
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
- licenseKey: licenseKey ?? apiKey ?? null,
+ licenseKey: effectiveLicenseKey,
onLog: defaultOnLog,
isProduction: isProduction ?? null,
});
diff --git a/packages/studio-server/src/preview-server/routes/add-render.ts b/packages/studio-server/src/preview-server/routes/add-render.ts
index 65d070a50d..fe715f2b36 100644
--- a/packages/studio-server/src/preview-server/routes/add-render.ts
+++ b/packages/studio-server/src/preview-server/routes/add-render.ts
@@ -67,6 +67,7 @@ export const handleAddRender: ApiHandler<AddRenderRequest, undefined> = ({
offthreadVideoThreads: input.offthreadVideoThreads,
mediaCacheSizeInBytes: input.mediaCacheSizeInBytes,
sampleRate: input.sampleRate,
+ licenseKey: input.licenseKey,
},
logLevel,
});
@@ -143,6 +144,7 @@ export const handleAddRender: ApiHandler<AddRenderRequest, undefined> = ({
chromeMode: input.chromeMode,
offthreadVideoThreads: input.offthreadVideoThreads,
mediaCacheSizeInBytes: input.mediaCacheSizeInBytes,
+ licenseKey: input.licenseKey,
},
entryPoint,
remotionRoot,
diff --git a/packages/studio-server/src/test/add-render.test.ts b/packages/studio-server/src/test/add-render.test.ts
new file mode 100644
index 0000000000..09a33aa156
--- /dev/null
+++ b/packages/studio-server/src/test/add-render.test.ts
@@ -0,0 +1,108 @@
+import {expect, test} from 'bun:test';
+import type {
+ AddRenderRequest,
+ RenderJobWithCleanup,
+} from '@remotion/studio-shared';
+import {handleAddRender} from '../preview-server/routes/add-render';
+
+test('captures the current public license key for Studio renders', async () => {
+ const addedJobs: RenderJobWithCleanup[] = [];
+ const addRender = (input: AddRenderRequest) =>
+ handleAddRender({
+ binariesDirectory: null,
+ configFile: null,
+ entryPoint: '',
+ getDefaultCodingAgent: () => null,
+ getDefaultEditor: () => null,
+ input,
+ logLevel: 'error',
+ methods: {
+ addJob: ({job}) => addedJobs.push(job),
+ cancelJob: () => undefined,
+ removeJob: () => undefined,
+ },
+ publicDir: '',
+ remotionRoot: '',
+ request: {} as never,
+ response: {} as never,
+ });
+ const common = {
+ compositionId: 'comp',
+ outName: 'out',
+ chromiumOptions: {
+ darkMode: false,
+ disableWebSecurity: false,
+ enableMultiProcessOnLinux: true,
+ gl: null,
+ headless: true,
+ ignoreCertificateErrors: false,
+ userAgent: null,
+ },
+ delayRenderTimeout: 30000,
+ envVariables: {},
+ serializedInputPropsWithCustomSchema: '{}',
+ offthreadVideoCacheSizeInBytes: null,
+ offthreadVideoThreads: null,
+ mediaCacheSizeInBytes: null,
+ multiProcessOnLinux: true,
+ beepOnFinish: false,
+ metadata: null,
+ };
+
+ for (const licenseKey of ['rm_pub_first', 'free-license']) {
+ await addRender({
+ ...common,
+ type: 'video',
+ licenseKey,
+ outName: 'out.mp4',
+ codec: 'h264',
+ audioCodec: 'aac',
+ imageFormat: 'jpeg',
+ jpegQuality: 80,
+ scale: 1,
+ logLevel: 'error',
+ concurrency: 1,
+ crf: 18,
+ gopSize: null,
+ startFrame: 0,
+ endFrame: 29,
+ muted: false,
+ enforceAudioTrack: false,
+ proResProfile: null,
+ x264Preset: null,
+ pixelFormat: 'yuv420p',
+ audioBitrate: null,
+ videoBitrate: null,
+ encodingBufferSize: null,
+ encodingMaxRate: null,
+ everyNthFrame: 1,
+ numberOfGifLoops: null,
+ disallowParallelEncoding: false,
+ colorSpace: 'bt709',
+ repro: false,
+ forSeamlessAacConcatenation: false,
+ separateAudioTo: null,
+ hardwareAcceleration: 'disable',
+ chromeMode: 'headless-shell',
+ sampleRate: 48000,
+ });
+ await addRender({
+ ...common,
+ type: 'still',
+ licenseKey,
+ outName: 'out.png',
+ imageFormat: 'png',
+ jpegQuality: 80,
+ frame: 0,
+ scale: 1,
+ logLevel: 'error',
+ chromeMode: 'headless-shell',
+ });
+ }
+
+ expect(
+ addedJobs.map((job) =>
+ job.type === 'video' || job.type === 'still' ? job.licenseKey : null,
+ ),
+ ).toEqual(['rm_pub_first', 'rm_pub_first', 'free-license', 'free-license']);
+});
diff --git a/packages/studio-shared/src/api-requests.ts b/packages/studio-shared/src/api-requests.ts
index c7d96692d3..e5c162584c 100644
--- a/packages/studio-shared/src/api-requests.ts
+++ b/packages/studio-shared/src/api-requests.ts
@@ -115,6 +115,7 @@ type AddRenderRequestDynamicFields =
scale: number;
logLevel: LogLevel;
chromeMode: ChromeMode;
+ licenseKey: string | null;
}
| {
type: 'sequence';
@@ -161,6 +162,7 @@ type AddRenderRequestDynamicFields =
hardwareAcceleration: HardwareAccelerationOption;
chromeMode: ChromeMode;
sampleRate: number;
+ licenseKey: string | null;
};
export type CancelRenderRequest = {
diff --git a/packages/studio-shared/src/render-job.ts b/packages/studio-shared/src/render-job.ts
index 4933cf9794..f3560b4850 100644
--- a/packages/studio-shared/src/render-job.ts
+++ b/packages/studio-shared/src/render-job.ts
@@ -119,6 +119,7 @@ type RenderJobDynamicFields =
offthreadVideoCacheSizeInBytes: number | null;
mediaCacheSizeInBytes: number | null;
offthreadVideoThreads: number | null;
+ licenseKey: string | null;
} & RenderJobDynamicStatus)
| ({
type: 'sequence';
@@ -164,6 +165,7 @@ type RenderJobDynamicFields =
separateAudioTo: string | null;
hardwareAcceleration: HardwareAccelerationOption;
sampleRate: number;
+ licenseKey: string | null;
} & RenderJobDynamicStatus);
import type {ChromiumOptions, OpenGlRenderer} from '@remotion/renderer';
diff --git a/packages/studio/src/components/RenderModal/ServerRenderModal.tsx b/packages/studio/src/components/RenderModal/ServerRenderModal.tsx
index a62cff3eed..71ea2c63ac 100644
--- a/packages/studio/src/components/RenderModal/ServerRenderModal.tsx
+++ b/packages/studio/src/components/RenderModal/ServerRenderModal.tsx
@@ -765,6 +765,7 @@ const RenderModal: React.FC<
chromeMode,
offthreadVideoThreads,
mediaCacheSizeInBytes,
+ licenseKey: renderDefaults.publicLicenseKey,
})
.then(() => {
dispatchIfMounted({type: 'succeed'});
@@ -795,6 +796,7 @@ const RenderModal: React.FC<
chromeMode,
offthreadVideoThreads,
mediaCacheSizeInBytes,
+ renderDefaults.publicLicenseKey,
]);
const [everyNthFrameSetting, setEveryNthFrameSetting] = useState(
@@ -878,6 +880,7 @@ const RenderModal: React.FC<
offthreadVideoThreads,
mediaCacheSizeInBytes,
sampleRate,
+ licenseKey: renderDefaults.publicLicenseKey,
})
.then(() => {
dispatchIfMounted({type: 'succeed'});
@@ -934,6 +937,7 @@ const RenderModal: React.FC<
offthreadVideoThreads,
mediaCacheSizeInBytes,
sampleRate,
+ renderDefaults.publicLicenseKey,
]);
const onClickSequence = useCallback(() => {
diff --git a/packages/studio/src/components/RenderQueue/actions.ts b/packages/studio/src/components/RenderQueue/actions.ts
index 58f0a80d18..5a29978f65 100644
--- a/packages/studio/src/components/RenderQueue/actions.ts
+++ b/packages/studio/src/components/RenderQueue/actions.ts
@@ -42,6 +42,7 @@ export const addStillRenderJob = ({
metadata,
chromeMode,
mediaCacheSizeInBytes,
+ licenseKey,
}: {
compositionId: string;
outName: string;
@@ -61,6 +62,7 @@ export const addStillRenderJob = ({
metadata: Record<string, string> | null;
chromeMode: ChromeMode;
mediaCacheSizeInBytes: number | null;
+ licenseKey: string | null;
}) => {
return callApi('/api/render', {
compositionId,
@@ -87,6 +89,7 @@ export const addStillRenderJob = ({
metadata,
chromeMode,
mediaCacheSizeInBytes,
+ licenseKey,
});
};
@@ -212,6 +215,7 @@ export const addVideoRenderJob = ({
chromeMode,
mediaCacheSizeInBytes,
sampleRate,
+ licenseKey,
}: {
compositionId: string;
outName: string;
@@ -255,6 +259,7 @@ export const addVideoRenderJob = ({
chromeMode: ChromeMode;
mediaCacheSizeInBytes: number | null;
sampleRate: number;
+ licenseKey: string | null;
}) => {
return callApi('/api/render', {
compositionId,
@@ -305,6 +310,7 @@ export const addVideoRenderJob = ({
chromeMode,
mediaCacheSizeInBytes,
sampleRate,
+ licenseKey,
});
};