@remotion/web-renderer 4.0.397 → 4.0.398
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/artifact.d.ts +2 -2
- package/dist/esm/index.mjs +9 -4
- package/dist/index.d.ts +4 -2
- package/dist/mediabunny-mappings.d.ts +3 -3
- package/dist/render-media-on-web.d.ts +4 -4
- package/dist/render-media-on-web.js +8 -3
- package/dist/render-still-on-web.d.ts +2 -2
- package/dist/send-telemetry-event.js +1 -1
- package/package.json +6 -6
package/dist/artifact.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare const onlyArtifact: ({ assets, frameBuffer, }: {
|
|
|
9
9
|
assets: TRenderAsset[];
|
|
10
10
|
frameBuffer: Blob | OffscreenCanvas | null;
|
|
11
11
|
}) => Promise<EmittedArtifact[]>;
|
|
12
|
-
export type
|
|
12
|
+
export type WebRendererOnArtifact = (asset: EmittedArtifact) => void;
|
|
13
13
|
export type ArtifactsRef = React.RefObject<{
|
|
14
14
|
collectAssets: () => TRenderAsset[];
|
|
15
15
|
} | null>;
|
|
@@ -18,6 +18,6 @@ export declare const handleArtifacts: () => {
|
|
|
18
18
|
imageData: Blob | OffscreenCanvas | null;
|
|
19
19
|
frame: number;
|
|
20
20
|
assets: TRenderAsset[];
|
|
21
|
-
onArtifact:
|
|
21
|
+
onArtifact: WebRendererOnArtifact;
|
|
22
22
|
}) => Promise<void>;
|
|
23
23
|
};
|
package/dist/esm/index.mjs
CHANGED
|
@@ -544,7 +544,7 @@ var sendUsageEvent = async ({
|
|
|
544
544
|
return;
|
|
545
545
|
}
|
|
546
546
|
if (licenseKey === null) {
|
|
547
|
-
Internals3.Log.warn({ logLevel: "warn", tag: "web-renderer" }, `Pass "licenseKey" to ${apiName}(). If you qualify for the
|
|
547
|
+
Internals3.Log.warn({ logLevel: "warn", tag: "web-renderer" }, `Pass "licenseKey" to ${apiName}(). If you qualify for the Free License (https://remotion.dev/license), pass "free-license" instead.`);
|
|
548
548
|
}
|
|
549
549
|
await registerUsageEvent({
|
|
550
550
|
apiKey: licenseKey === "free-license" ? null : licenseKey,
|
|
@@ -2775,7 +2775,7 @@ var internalRenderMediaOnWeb = async ({
|
|
|
2775
2775
|
logLevel,
|
|
2776
2776
|
mediaCacheSizeInBytes,
|
|
2777
2777
|
schema,
|
|
2778
|
-
codec,
|
|
2778
|
+
videoCodec: codec,
|
|
2779
2779
|
container,
|
|
2780
2780
|
signal,
|
|
2781
2781
|
onProgress,
|
|
@@ -2969,6 +2969,11 @@ var internalRenderMediaOnWeb = async ({
|
|
|
2969
2969
|
await output.finalize();
|
|
2970
2970
|
const mimeType = getMimeType(container);
|
|
2971
2971
|
if (webFsTarget) {
|
|
2972
|
+
sendUsageEvent({
|
|
2973
|
+
licenseKey: licenseKey ?? null,
|
|
2974
|
+
succeeded: true,
|
|
2975
|
+
apiName: "renderMediaOnWeb"
|
|
2976
|
+
});
|
|
2972
2977
|
await webFsTarget.close();
|
|
2973
2978
|
return {
|
|
2974
2979
|
getBlob: () => {
|
|
@@ -3009,14 +3014,14 @@ var internalRenderMediaOnWeb = async ({
|
|
|
3009
3014
|
};
|
|
3010
3015
|
var renderMediaOnWeb = (options) => {
|
|
3011
3016
|
const container = options.container ?? "mp4";
|
|
3012
|
-
const codec = options.
|
|
3017
|
+
const codec = options.videoCodec ?? getDefaultVideoCodecForContainer(container);
|
|
3013
3018
|
onlyOneRenderAtATimeQueue.ref = onlyOneRenderAtATimeQueue.ref.catch(() => Promise.resolve()).then(() => internalRenderMediaOnWeb({
|
|
3014
3019
|
...options,
|
|
3015
3020
|
delayRenderTimeoutInMilliseconds: options.delayRenderTimeoutInMilliseconds ?? 30000,
|
|
3016
3021
|
logLevel: options.logLevel ?? window.remotion_logLevel ?? "info",
|
|
3017
3022
|
schema: options.schema ?? undefined,
|
|
3018
3023
|
mediaCacheSizeInBytes: options.mediaCacheSizeInBytes ?? null,
|
|
3019
|
-
codec,
|
|
3024
|
+
videoCodec: codec,
|
|
3020
3025
|
container,
|
|
3021
3026
|
signal: options.signal ?? null,
|
|
3022
3027
|
onProgress: options.onProgress ?? null,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { EmittedArtifact, WebRendererOnArtifact } from './artifact';
|
|
2
|
+
export type { FrameRange } from './frame-range';
|
|
3
|
+
export type { WebRendererContainer, WebRendererQuality, WebRendererVideoCodec, } from './mediabunny-mappings';
|
|
2
4
|
export type { WebRendererOutputTarget } from './output-target';
|
|
3
5
|
export { renderMediaOnWeb } from './render-media-on-web';
|
|
4
6
|
export type { RenderMediaOnWebOptions, RenderMediaOnWebProgress, RenderMediaOnWebProgressCallback, RenderMediaOnWebResult, } from './render-media-on-web';
|
|
5
7
|
export { renderStillOnWeb } from './render-still-on-web';
|
|
6
|
-
export type { RenderStillOnWebImageFormat
|
|
8
|
+
export type { RenderStillOnWebImageFormat, RenderStillOnWebOptions, } from './render-still-on-web';
|
|
7
9
|
export type { OnFrameCallback } from './validate-video-frame';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Quality } from 'mediabunny';
|
|
2
2
|
import { type OutputFormat, type VideoCodec } from 'mediabunny';
|
|
3
|
-
export type
|
|
3
|
+
export type WebRendererVideoCodec = 'h264' | 'h265' | 'vp8' | 'vp9' | 'av1';
|
|
4
4
|
export type WebRendererContainer = 'mp4' | 'webm';
|
|
5
5
|
export type WebRendererQuality = 'very-low' | 'low' | 'medium' | 'high' | 'very-high';
|
|
6
|
-
export declare const codecToMediabunnyCodec: (codec:
|
|
6
|
+
export declare const codecToMediabunnyCodec: (codec: WebRendererVideoCodec) => VideoCodec;
|
|
7
7
|
export declare const containerToMediabunnyContainer: (container: WebRendererContainer) => OutputFormat;
|
|
8
|
-
export declare const getDefaultVideoCodecForContainer: (container: WebRendererContainer) =>
|
|
8
|
+
export declare const getDefaultVideoCodecForContainer: (container: WebRendererContainer) => WebRendererVideoCodec;
|
|
9
9
|
export declare const getQualityForWebRendererQuality: (quality: WebRendererQuality) => Quality;
|
|
10
10
|
export declare const getMimeType: (container: WebRendererContainer) => string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type LogLevel } from 'remotion';
|
|
2
2
|
import type { AnyZodObject, z } from 'zod';
|
|
3
|
-
import { type
|
|
3
|
+
import { type WebRendererOnArtifact } from './artifact';
|
|
4
4
|
import { type FrameRange } from './frame-range';
|
|
5
5
|
import type { InternalState } from './internal-state';
|
|
6
6
|
import type { WebRendererContainer, WebRendererQuality } from './mediabunny-mappings';
|
|
7
|
-
import { type
|
|
7
|
+
import { type WebRendererVideoCodec } from './mediabunny-mappings';
|
|
8
8
|
import type { WebRendererOutputTarget } from './output-target';
|
|
9
9
|
import type { CompositionCalculateMetadataOrExplicit } from './props-if-has-props';
|
|
10
10
|
import { type OnFrameCallback } from './validate-video-frame';
|
|
@@ -34,7 +34,7 @@ type OptionalRenderMediaOnWebOptions<Schema extends AnyZodObject> = {
|
|
|
34
34
|
logLevel: LogLevel;
|
|
35
35
|
schema: Schema | undefined;
|
|
36
36
|
mediaCacheSizeInBytes: number | null;
|
|
37
|
-
|
|
37
|
+
videoCodec: WebRendererVideoCodec;
|
|
38
38
|
container: WebRendererContainer;
|
|
39
39
|
signal: AbortSignal | null;
|
|
40
40
|
onProgress: RenderMediaOnWebProgressCallback | null;
|
|
@@ -43,7 +43,7 @@ type OptionalRenderMediaOnWebOptions<Schema extends AnyZodObject> = {
|
|
|
43
43
|
videoBitrate: number | WebRendererQuality;
|
|
44
44
|
frameRange: FrameRange | null;
|
|
45
45
|
transparent: boolean;
|
|
46
|
-
onArtifact:
|
|
46
|
+
onArtifact: WebRendererOnArtifact | null;
|
|
47
47
|
onFrame: OnFrameCallback | null;
|
|
48
48
|
outputTarget: WebRendererOutputTarget | null;
|
|
49
49
|
licenseKey: string | undefined;
|
|
@@ -21,7 +21,7 @@ import { cleanupStaleOpfsFiles, createWebFsTarget } from './web-fs-target';
|
|
|
21
21
|
// TODO: Metadata
|
|
22
22
|
// TODO: Validating inputs
|
|
23
23
|
// TODO: Apply defaultCodec
|
|
24
|
-
const internalRenderMediaOnWeb = async ({ composition, inputProps, delayRenderTimeoutInMilliseconds, logLevel, mediaCacheSizeInBytes, schema, codec, container, signal, onProgress, hardwareAcceleration, keyframeIntervalInSeconds, videoBitrate, frameRange, transparent, onArtifact, onFrame, outputTarget: userDesiredOutputTarget, licenseKey, muted, }) => {
|
|
24
|
+
const internalRenderMediaOnWeb = async ({ composition, inputProps, delayRenderTimeoutInMilliseconds, logLevel, mediaCacheSizeInBytes, schema, videoCodec: codec, container, signal, onProgress, hardwareAcceleration, keyframeIntervalInSeconds, videoBitrate, frameRange, transparent, onArtifact, onFrame, outputTarget: userDesiredOutputTarget, licenseKey, muted, }) => {
|
|
25
25
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
26
26
|
const outputTarget = userDesiredOutputTarget === null
|
|
27
27
|
? (await canUseWebFsWriter())
|
|
@@ -218,6 +218,11 @@ const internalRenderMediaOnWeb = async ({ composition, inputProps, delayRenderTi
|
|
|
218
218
|
await output.finalize();
|
|
219
219
|
const mimeType = getMimeType(container);
|
|
220
220
|
if (webFsTarget) {
|
|
221
|
+
sendUsageEvent({
|
|
222
|
+
licenseKey: licenseKey !== null && licenseKey !== void 0 ? licenseKey : null,
|
|
223
|
+
succeeded: true,
|
|
224
|
+
apiName: 'renderMediaOnWeb',
|
|
225
|
+
});
|
|
221
226
|
await webFsTarget.close();
|
|
222
227
|
return {
|
|
223
228
|
getBlob: () => {
|
|
@@ -261,7 +266,7 @@ const internalRenderMediaOnWeb = async ({ composition, inputProps, delayRenderTi
|
|
|
261
266
|
export const renderMediaOnWeb = (options) => {
|
|
262
267
|
var _a, _b;
|
|
263
268
|
const container = (_a = options.container) !== null && _a !== void 0 ? _a : 'mp4';
|
|
264
|
-
const codec = (_b = options.
|
|
269
|
+
const codec = (_b = options.videoCodec) !== null && _b !== void 0 ? _b : getDefaultVideoCodecForContainer(container);
|
|
265
270
|
onlyOneRenderAtATimeQueue.ref = onlyOneRenderAtATimeQueue.ref
|
|
266
271
|
.catch(() => Promise.resolve())
|
|
267
272
|
.then(() => {
|
|
@@ -272,7 +277,7 @@ export const renderMediaOnWeb = (options) => {
|
|
|
272
277
|
logLevel: (_c = (_b = options.logLevel) !== null && _b !== void 0 ? _b : window.remotion_logLevel) !== null && _c !== void 0 ? _c : 'info',
|
|
273
278
|
schema: (_d = options.schema) !== null && _d !== void 0 ? _d : undefined,
|
|
274
279
|
mediaCacheSizeInBytes: (_e = options.mediaCacheSizeInBytes) !== null && _e !== void 0 ? _e : null,
|
|
275
|
-
codec,
|
|
280
|
+
videoCodec: codec,
|
|
276
281
|
container,
|
|
277
282
|
signal: (_f = options.signal) !== null && _f !== void 0 ? _f : null,
|
|
278
283
|
onProgress: (_g = options.onProgress) !== null && _g !== void 0 ? _g : null,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type LogLevel } from 'remotion';
|
|
2
2
|
import type { AnyZodObject } from 'zod';
|
|
3
|
-
import type {
|
|
3
|
+
import type { WebRendererOnArtifact } from './artifact';
|
|
4
4
|
import type { InternalState } from './internal-state';
|
|
5
5
|
import type { CompositionCalculateMetadataOrExplicit } from './props-if-has-props';
|
|
6
6
|
import type { InputPropsIfHasProps } from './render-media-on-web';
|
|
@@ -17,7 +17,7 @@ type OptionalRenderStillOnWebOptions<Schema extends AnyZodObject> = {
|
|
|
17
17
|
schema: Schema | undefined;
|
|
18
18
|
mediaCacheSizeInBytes: number | null;
|
|
19
19
|
signal: AbortSignal | null;
|
|
20
|
-
onArtifact:
|
|
20
|
+
onArtifact: WebRendererOnArtifact | null;
|
|
21
21
|
licenseKey: string | undefined;
|
|
22
22
|
};
|
|
23
23
|
export type RenderStillOnWebOptions<Schema extends AnyZodObject, Props extends Record<string, unknown>> = MandatoryRenderStillOnWebOptions<Schema, Props> & Partial<OptionalRenderStillOnWebOptions<Schema>> & InputPropsIfHasProps<Schema, Props>;
|
|
@@ -11,7 +11,7 @@ export const sendUsageEvent = async ({ licenseKey, succeeded, apiName, }) => {
|
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
13
|
if (licenseKey === null) {
|
|
14
|
-
Internals.Log.warn({ logLevel: 'warn', tag: 'web-renderer' }, `Pass "licenseKey" to ${apiName}(). If you qualify for the
|
|
14
|
+
Internals.Log.warn({ logLevel: 'warn', tag: 'web-renderer' }, `Pass "licenseKey" to ${apiName}(). If you qualify for the Free License (https://remotion.dev/license), pass "free-license" instead.`);
|
|
15
15
|
}
|
|
16
16
|
await registerUsageEvent({
|
|
17
17
|
apiKey: licenseKey === 'free-license' ? null : licenseKey,
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/web-renderer"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/web-renderer",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.398",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"scripts": {
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
"author": "Remotion <jonny@remotion.dev>",
|
|
17
17
|
"license": "UNLICENSED",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@remotion/licensing": "4.0.
|
|
20
|
-
"remotion": "4.0.
|
|
19
|
+
"@remotion/licensing": "4.0.398",
|
|
20
|
+
"remotion": "4.0.398",
|
|
21
21
|
"mediabunny": "1.27.2"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
25
|
-
"@remotion/player": "4.0.
|
|
26
|
-
"@remotion/media": "4.0.
|
|
24
|
+
"@remotion/eslint-config-internal": "4.0.398",
|
|
25
|
+
"@remotion/player": "4.0.398",
|
|
26
|
+
"@remotion/media": "4.0.398",
|
|
27
27
|
"@vitejs/plugin-react": "4.1.0",
|
|
28
28
|
"@vitest/browser-playwright": "4.0.9",
|
|
29
29
|
"playwright": "1.55.1",
|