@remotion/renderer 4.0.207 → 4.0.208
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/browser/browser-download-progress-bar.js +0 -1
- package/dist/client.d.ts +3 -3
- package/dist/get-local-browser.d.ts +1 -1
- package/dist/get-local-browser.js +1 -37
- package/dist/index.d.ts +8 -8
- package/dist/is-delay-render-error-with-retry.d.ts +1 -0
- package/dist/is-delay-render-error-with-retry.js +28 -0
- package/dist/open-browser.d.ts +4 -0
- package/dist/options/gl.d.ts +3 -3
- package/dist/options/headless.js +1 -1
- package/dist/options/index.d.ts +3 -3
- package/dist/pixel-format.d.ts +1 -1
- package/dist/render-frames.js +1 -1
- package/dist/render-media.js +5 -0
- package/dist/streaming.d.ts +11 -0
- package/dist/streaming.js +140 -0
- package/package.json +10 -10
|
@@ -4,7 +4,6 @@ exports.defaultBrowserDownloadProgress = void 0;
|
|
|
4
4
|
const logger_1 = require("../logger");
|
|
5
5
|
const to_megabytes_1 = require("../to-megabytes");
|
|
6
6
|
const defaultBrowserDownloadProgress = ({ indent, logLevel, api, }) => () => {
|
|
7
|
-
logger_1.Log.info({ indent, logLevel }, 'No local browser could be found.');
|
|
8
7
|
logger_1.Log.info({ indent, logLevel }, 'Downloading Chrome Headless Shell https://www.remotion.dev/docs/miscellaneous/chrome-headless-shell');
|
|
9
8
|
logger_1.Log.info({ indent, logLevel }, `Customize this behavior by adding a onBrowserDownload function to ${api}.`);
|
|
10
9
|
return {
|
package/dist/client.d.ts
CHANGED
|
@@ -467,19 +467,19 @@ export declare const BrowserSafeApis: {
|
|
|
467
467
|
cliFlag: "gl";
|
|
468
468
|
docLink: string;
|
|
469
469
|
name: string;
|
|
470
|
-
type: "
|
|
470
|
+
type: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
|
|
471
471
|
ssrName: string;
|
|
472
472
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
473
473
|
getValue: ({ commandLine }: {
|
|
474
474
|
commandLine: Record<string, unknown>;
|
|
475
475
|
}) => {
|
|
476
|
-
value: "
|
|
476
|
+
value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
|
|
477
477
|
source: string;
|
|
478
478
|
} | {
|
|
479
479
|
value: null;
|
|
480
480
|
source: string;
|
|
481
481
|
};
|
|
482
|
-
setConfig: (value: "
|
|
482
|
+
setConfig: (value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
|
|
483
483
|
};
|
|
484
484
|
enableLambdaInsights: {
|
|
485
485
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getLocalBrowser: () =>
|
|
1
|
+
export declare const getLocalBrowser: () => null;
|
|
@@ -5,44 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getLocalBrowser = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const node_os_1 = require("node:os");
|
|
9
|
-
const no_react_1 = require("remotion/no-react");
|
|
10
8
|
const getSearchPathsForProduct = () => {
|
|
11
|
-
|
|
12
|
-
if (no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES) {
|
|
13
|
-
return [];
|
|
14
|
-
}
|
|
15
|
-
return [
|
|
16
|
-
(_a = process.env.PUPPETEER_EXECUTABLE_PATH) !== null && _a !== void 0 ? _a : null,
|
|
17
|
-
process.platform === 'darwin'
|
|
18
|
-
? '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
|
|
19
|
-
: null,
|
|
20
|
-
process.platform === 'linux' ? '/usr/bin/google-chrome' : null,
|
|
21
|
-
process.platform === 'linux' ? '/usr/bin/chromium-browser' : null,
|
|
22
|
-
process.platform === 'linux' ? '/usr/bin/chromium' : null, // Debian
|
|
23
|
-
process.platform === 'linux'
|
|
24
|
-
? '/app/.apt/usr/bin/google-chrome-stable'
|
|
25
|
-
: null,
|
|
26
|
-
process.platform === 'win32'
|
|
27
|
-
? 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe'
|
|
28
|
-
: null,
|
|
29
|
-
process.platform === 'win32'
|
|
30
|
-
? 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'
|
|
31
|
-
: null,
|
|
32
|
-
process.platform === 'win32'
|
|
33
|
-
? (0, node_os_1.homedir)() + '\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe'
|
|
34
|
-
: null,
|
|
35
|
-
process.platform === 'win32'
|
|
36
|
-
? 'C:\\Program Files\\Google\\Chrome SxS\\Application\\chrome.exe'
|
|
37
|
-
: null,
|
|
38
|
-
process.platform === 'win32'
|
|
39
|
-
? 'C:\\Program Files (x86)\\Google\\Chrome SxS\\Application\\chrome.exe'
|
|
40
|
-
: null,
|
|
41
|
-
process.platform === 'win32'
|
|
42
|
-
? (0, node_os_1.homedir)() +
|
|
43
|
-
'\\AppData\\Local\\Google\\Chrome SxS\\Application\\chrome.exe'
|
|
44
|
-
: null,
|
|
45
|
-
].filter(Boolean);
|
|
9
|
+
return [];
|
|
46
10
|
};
|
|
47
11
|
const getLocalBrowser = () => {
|
|
48
12
|
for (const p of getSearchPathsForProduct()) {
|
package/dist/index.d.ts
CHANGED
|
@@ -141,8 +141,8 @@ export declare const RenderInternals: {
|
|
|
141
141
|
validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
|
|
142
142
|
DEFAULT_BROWSER: "chrome";
|
|
143
143
|
validateFrameRange: (frameRange: import("./frame-range").FrameRange | null) => void;
|
|
144
|
-
DEFAULT_OPENGL_RENDERER: "
|
|
145
|
-
validateOpenGlRenderer: (option: unknown) => "
|
|
144
|
+
DEFAULT_OPENGL_RENDERER: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
|
|
145
|
+
validateOpenGlRenderer: (option: unknown) => "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
|
|
146
146
|
validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "h264-ts", "gif"];
|
|
147
147
|
DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
148
148
|
validateJpegQuality: (q: unknown) => void;
|
|
@@ -338,7 +338,7 @@ export declare const RenderInternals: {
|
|
|
338
338
|
makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif")[]>;
|
|
339
339
|
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif">;
|
|
340
340
|
getExecutablePath: ({ indent, logLevel, type, binariesDirectory, }: {
|
|
341
|
-
type: "
|
|
341
|
+
type: "compositor" | "ffmpeg" | "ffprobe";
|
|
342
342
|
indent: boolean;
|
|
343
343
|
logLevel: "verbose" | "info" | "warn" | "error";
|
|
344
344
|
binariesDirectory: string | null;
|
|
@@ -354,8 +354,8 @@ export declare const RenderInternals: {
|
|
|
354
354
|
}) => execa.ExecaChildProcess<string>;
|
|
355
355
|
validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
|
|
356
356
|
validVideoImageFormats: readonly ["png", "jpeg", "none"];
|
|
357
|
-
DEFAULT_STILL_IMAGE_FORMAT: "
|
|
358
|
-
DEFAULT_VIDEO_IMAGE_FORMAT: "
|
|
357
|
+
DEFAULT_STILL_IMAGE_FORMAT: "png" | "jpeg" | "pdf" | "webp";
|
|
358
|
+
DEFAULT_VIDEO_IMAGE_FORMAT: "png" | "jpeg" | "none";
|
|
359
359
|
DEFAULT_JPEG_QUALITY: number;
|
|
360
360
|
chalk: {
|
|
361
361
|
enabled: () => boolean;
|
|
@@ -453,7 +453,7 @@ export declare const RenderInternals: {
|
|
|
453
453
|
frame: number;
|
|
454
454
|
serializedInputPropsWithCustomSchema: string;
|
|
455
455
|
serializedResolvedPropsWithCustomSchema: string;
|
|
456
|
-
imageFormat: "
|
|
456
|
+
imageFormat: "png" | "jpeg" | "pdf" | "webp";
|
|
457
457
|
jpegQuality: number;
|
|
458
458
|
puppeteerInstance: HeadlessBrowser | null;
|
|
459
459
|
envVariables: Record<string, string>;
|
|
@@ -754,7 +754,7 @@ export declare const RenderInternals: {
|
|
|
754
754
|
onFrameUpdate: ((framesRendered: number, frameIndex: number, timeToRenderInMilliseconds: number) => void) | null;
|
|
755
755
|
outputDir: string | null;
|
|
756
756
|
envVariables: Record<string, string>;
|
|
757
|
-
imageFormat: "
|
|
757
|
+
imageFormat: "png" | "jpeg" | "none";
|
|
758
758
|
jpegQuality: number;
|
|
759
759
|
frameRange: import("./frame-range").FrameRange | null;
|
|
760
760
|
everyNthFrame: number;
|
|
@@ -767,7 +767,7 @@ export declare const RenderInternals: {
|
|
|
767
767
|
scale: number;
|
|
768
768
|
port: number | null;
|
|
769
769
|
cancelSignal: import("./make-cancel-signal").CancelSignal | undefined;
|
|
770
|
-
composition: Omit<import("remotion").VideoConfig, "
|
|
770
|
+
composition: Omit<import("remotion").VideoConfig, "props" | "defaultProps">;
|
|
771
771
|
indent: boolean;
|
|
772
772
|
server: import("./prepare-server").RemotionServer | undefined;
|
|
773
773
|
muted: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getRetriesLeftFromError: (error: Error | undefined) => number;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRetriesLeftFromError = void 0;
|
|
4
|
+
const no_react_1 = require("remotion/no-react");
|
|
5
|
+
const getRetriesLeftFromError = (error) => {
|
|
6
|
+
if (!error) {
|
|
7
|
+
throw new Error('Expected stack');
|
|
8
|
+
}
|
|
9
|
+
const { stack } = error;
|
|
10
|
+
if (!stack) {
|
|
11
|
+
throw new Error('Expected stack: ' + JSON.stringify(error));
|
|
12
|
+
}
|
|
13
|
+
const beforeIndex = stack.indexOf(no_react_1.NoReactInternals.DELAY_RENDER_ATTEMPT_TOKEN);
|
|
14
|
+
if (beforeIndex === -1) {
|
|
15
|
+
throw new Error('Expected to find attempt token in stack');
|
|
16
|
+
}
|
|
17
|
+
const afterIndex = stack.indexOf(no_react_1.NoReactInternals.DELAY_RENDER_RETRY_TOKEN);
|
|
18
|
+
if (afterIndex === -1) {
|
|
19
|
+
throw new Error('Expected to find retry token in stack');
|
|
20
|
+
}
|
|
21
|
+
const inbetween = stack.substring(beforeIndex + no_react_1.NoReactInternals.DELAY_RENDER_ATTEMPT_TOKEN.length, afterIndex);
|
|
22
|
+
const parsed = Number(inbetween);
|
|
23
|
+
if (Number.isNaN(parsed)) {
|
|
24
|
+
throw new Error(`Expected to find a number in the stack ${stack}`);
|
|
25
|
+
}
|
|
26
|
+
return parsed;
|
|
27
|
+
};
|
|
28
|
+
exports.getRetriesLeftFromError = getRetriesLeftFromError;
|
package/dist/open-browser.d.ts
CHANGED
|
@@ -7,6 +7,10 @@ import type { validOpenGlRenderers } from './options/gl';
|
|
|
7
7
|
import type { OnBrowserDownload } from './options/on-browser-download';
|
|
8
8
|
type OpenGlRenderer = (typeof validOpenGlRenderers)[number];
|
|
9
9
|
type OnlyV4Options = typeof NoReactInternals.ENABLE_V5_BREAKING_CHANGES extends true ? {} : {
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated - Will be removed in v5.
|
|
12
|
+
* Chrome Headless shell does not allow disabling headless mode anymore.
|
|
13
|
+
*/
|
|
10
14
|
headless?: boolean;
|
|
11
15
|
};
|
|
12
16
|
export type ChromiumOptions = {
|
package/dist/options/gl.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export declare const validOpenGlRenderers: readonly ["swangle", "angle", "egl", "swiftshader", "vulkan", "angle-egl"];
|
|
2
2
|
export type OpenGlRenderer = (typeof validOpenGlRenderers)[number];
|
|
3
3
|
export declare const DEFAULT_OPENGL_RENDERER: OpenGlRenderer | null;
|
|
4
|
-
export declare const getChromiumOpenGlRenderer: () => "
|
|
4
|
+
export declare const getChromiumOpenGlRenderer: () => "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
|
|
5
5
|
export declare const setChromiumOpenGlRenderer: (renderer: OpenGlRenderer) => void;
|
|
6
6
|
export declare const glOption: {
|
|
7
7
|
cliFlag: "gl";
|
|
8
8
|
docLink: string;
|
|
9
9
|
name: string;
|
|
10
|
-
type: "
|
|
10
|
+
type: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
|
|
11
11
|
ssrName: string;
|
|
12
12
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
getValue: ({ commandLine }: {
|
|
14
14
|
commandLine: Record<string, unknown>;
|
|
15
15
|
}) => {
|
|
16
|
-
value: "
|
|
16
|
+
value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
|
|
17
17
|
source: string;
|
|
18
18
|
} | {
|
|
19
19
|
value: null;
|
package/dist/options/headless.js
CHANGED
|
@@ -8,7 +8,7 @@ const cliFlag = 'disable-headless';
|
|
|
8
8
|
exports.headlessOption = {
|
|
9
9
|
name: 'Disable Headless Mode',
|
|
10
10
|
cliFlag,
|
|
11
|
-
description: () => ((0, jsx_runtime_1.
|
|
11
|
+
description: () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Deprecated - will be removed in 5.0.0. With the migration to", ' ', (0, jsx_runtime_1.jsx)("a", { href: "/docs/miscellaneous/chrome-headless-shell", children: "Chrome Headless Shell" }), ", this option is not functional anymore.", (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {}), " If disabled, the render will open an actual Chrome window where you can see the render happen. The default is headless mode."] })),
|
|
12
12
|
ssrName: 'headless',
|
|
13
13
|
docLink: 'https://www.remotion.dev/docs/chromium-flags#--disable-headless',
|
|
14
14
|
type: false,
|
package/dist/options/index.d.ts
CHANGED
|
@@ -245,19 +245,19 @@ export declare const allOptions: {
|
|
|
245
245
|
cliFlag: "gl";
|
|
246
246
|
docLink: string;
|
|
247
247
|
name: string;
|
|
248
|
-
type: "
|
|
248
|
+
type: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
|
|
249
249
|
ssrName: string;
|
|
250
250
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
251
251
|
getValue: ({ commandLine }: {
|
|
252
252
|
commandLine: Record<string, unknown>;
|
|
253
253
|
}) => {
|
|
254
|
-
value: "
|
|
254
|
+
value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
|
|
255
255
|
source: string;
|
|
256
256
|
} | {
|
|
257
257
|
value: null;
|
|
258
258
|
source: string;
|
|
259
259
|
};
|
|
260
|
-
setConfig: (value: "
|
|
260
|
+
setConfig: (value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
|
|
261
261
|
};
|
|
262
262
|
enableLambdaInsights: {
|
|
263
263
|
name: string;
|
package/dist/pixel-format.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import type { Codec } from './codec';
|
|
|
2
2
|
export declare const validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
|
|
3
3
|
export type PixelFormat = (typeof validPixelFormats)[number];
|
|
4
4
|
export declare const DEFAULT_PIXEL_FORMAT: PixelFormat;
|
|
5
|
-
export declare const validPixelFormatsForCodec: (codec: Codec) => readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"] | ("yuv420p" | "
|
|
5
|
+
export declare const validPixelFormatsForCodec: (codec: Codec) => readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"] | ("yuv420p" | "yuv422p" | "yuv444p" | "yuva420p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le")[];
|
|
6
6
|
export declare const validateSelectedPixelFormatAndCodecCombination: (pixelFormat: PixelFormat | undefined, codec: Codec) => undefined;
|
package/dist/render-frames.js
CHANGED
|
@@ -23,7 +23,7 @@ const get_duration_from_frame_range_1 = require("./get-duration-from-frame-range
|
|
|
23
23
|
const get_extra_frames_to_capture_1 = require("./get-extra-frames-to-capture");
|
|
24
24
|
const get_frame_padded_index_1 = require("./get-frame-padded-index");
|
|
25
25
|
const get_frame_to_render_1 = require("./get-frame-to-render");
|
|
26
|
-
const is_delay_render_error_with_retry_1 = require("./is-delay-render-error-with
|
|
26
|
+
const is_delay_render_error_with_retry_1 = require("./is-delay-render-error-with-retry");
|
|
27
27
|
const jpeg_quality_1 = require("./jpeg-quality");
|
|
28
28
|
const logger_1 = require("./logger");
|
|
29
29
|
const make_cancel_signal_1 = require("./make-cancel-signal");
|
package/dist/render-media.js
CHANGED
|
@@ -128,6 +128,11 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, s
|
|
|
128
128
|
logLevel,
|
|
129
129
|
tag: 'renderMedia()',
|
|
130
130
|
}, 'Using concurrency:', resolvedConcurrency);
|
|
131
|
+
logger_1.Log.verbose({
|
|
132
|
+
indent,
|
|
133
|
+
logLevel,
|
|
134
|
+
tag: 'renderMedia()',
|
|
135
|
+
}, 'delayRender() timeout:', timeoutInMilliseconds);
|
|
131
136
|
logger_1.Log.verbose({
|
|
132
137
|
indent,
|
|
133
138
|
logLevel,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const streamingKey = "remotion_buffer:";
|
|
2
|
+
export declare const makeStreamer: (onMessage: (statusType: 'success' | 'error', nonce: string, data: Uint8Array) => void) => {
|
|
3
|
+
onData: (data: Uint8Array) => void;
|
|
4
|
+
getOutputBuffer: () => Uint8Array;
|
|
5
|
+
clear: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const makeStreamPayloadMessage: ({ status, body, nonce, }: {
|
|
8
|
+
nonce: string;
|
|
9
|
+
status: 0 | 1;
|
|
10
|
+
body: Uint8Array;
|
|
11
|
+
}) => Uint8Array;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeStreamPayloadMessage = exports.makeStreamer = exports.streamingKey = void 0;
|
|
4
|
+
exports.streamingKey = 'remotion_buffer:';
|
|
5
|
+
const magicWordStr = 'remotion_buffer:';
|
|
6
|
+
const makeStreamer = (onMessage) => {
|
|
7
|
+
const separator = new Uint8Array(magicWordStr.length);
|
|
8
|
+
for (let i = 0; i < magicWordStr.length; i++) {
|
|
9
|
+
separator[i] = magicWordStr.charCodeAt(i);
|
|
10
|
+
}
|
|
11
|
+
let unprocessedBuffers = [];
|
|
12
|
+
let outputBuffer = new Uint8Array(0);
|
|
13
|
+
let missingData = null;
|
|
14
|
+
const processInput = () => {
|
|
15
|
+
let separatorIndex = outputBuffer.indexOf(separator[0]); // Start checking for the first byte of the separator
|
|
16
|
+
if (separatorIndex === -1 ||
|
|
17
|
+
outputBuffer
|
|
18
|
+
.subarray(separatorIndex, separatorIndex + separator.length)
|
|
19
|
+
.toString() !== separator.toString()) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
separatorIndex += separator.length;
|
|
23
|
+
let nonceString = '';
|
|
24
|
+
let lengthString = '';
|
|
25
|
+
let statusString = '';
|
|
26
|
+
// eslint-disable-next-line no-constant-condition
|
|
27
|
+
while (true) {
|
|
28
|
+
if (separatorIndex > outputBuffer.length - 1) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const nextDigit = outputBuffer[separatorIndex];
|
|
32
|
+
separatorIndex++;
|
|
33
|
+
if (nextDigit === 0x3a) {
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
nonceString += String.fromCharCode(nextDigit);
|
|
37
|
+
}
|
|
38
|
+
// eslint-disable-next-line no-constant-condition
|
|
39
|
+
while (true) {
|
|
40
|
+
if (separatorIndex > outputBuffer.length - 1) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const nextDigit = outputBuffer[separatorIndex];
|
|
44
|
+
separatorIndex++;
|
|
45
|
+
if (nextDigit === 0x3a) {
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
lengthString += String.fromCharCode(nextDigit);
|
|
49
|
+
}
|
|
50
|
+
// eslint-disable-next-line no-constant-condition
|
|
51
|
+
while (true) {
|
|
52
|
+
if (separatorIndex > outputBuffer.length - 1) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const nextDigit = outputBuffer[separatorIndex];
|
|
56
|
+
if (nextDigit === 0x3a) {
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
separatorIndex++;
|
|
60
|
+
statusString += String.fromCharCode(nextDigit);
|
|
61
|
+
}
|
|
62
|
+
const length = Number(lengthString);
|
|
63
|
+
const status = Number(statusString);
|
|
64
|
+
const dataLength = outputBuffer.length - separatorIndex - 1;
|
|
65
|
+
if (dataLength < length) {
|
|
66
|
+
missingData = {
|
|
67
|
+
dataMissing: length - dataLength,
|
|
68
|
+
};
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const data = outputBuffer.subarray(separatorIndex + 1, separatorIndex + 1 + Number(lengthString));
|
|
72
|
+
onMessage(status === 1 ? 'error' : 'success', nonceString, data);
|
|
73
|
+
missingData = null;
|
|
74
|
+
outputBuffer = outputBuffer.subarray(separatorIndex + Number(lengthString) + 1);
|
|
75
|
+
processInput();
|
|
76
|
+
};
|
|
77
|
+
const onData = (data) => {
|
|
78
|
+
unprocessedBuffers.push(data);
|
|
79
|
+
const separatorIndex = data.indexOf(separator[0]);
|
|
80
|
+
if (separatorIndex === -1) {
|
|
81
|
+
if (missingData) {
|
|
82
|
+
missingData.dataMissing -= data.length;
|
|
83
|
+
}
|
|
84
|
+
if (!missingData || missingData.dataMissing > 0) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
unprocessedBuffers.unshift(outputBuffer);
|
|
89
|
+
outputBuffer = new Uint8Array(unprocessedBuffers.reduce((acc, val) => acc + val.length, 0));
|
|
90
|
+
let offset = 0;
|
|
91
|
+
for (const buf of unprocessedBuffers) {
|
|
92
|
+
outputBuffer.set(buf, offset);
|
|
93
|
+
offset += buf.length;
|
|
94
|
+
}
|
|
95
|
+
unprocessedBuffers = [];
|
|
96
|
+
processInput();
|
|
97
|
+
};
|
|
98
|
+
return {
|
|
99
|
+
onData,
|
|
100
|
+
getOutputBuffer: () => outputBuffer,
|
|
101
|
+
clear: () => {
|
|
102
|
+
unprocessedBuffers = [];
|
|
103
|
+
outputBuffer = new Uint8Array(0);
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
exports.makeStreamer = makeStreamer;
|
|
108
|
+
const makeStreamPayloadMessage = ({ status, body, nonce, }) => {
|
|
109
|
+
const nonceArr = new TextEncoder().encode(nonce);
|
|
110
|
+
const magicWordArr = new TextEncoder().encode(magicWordStr);
|
|
111
|
+
const separatorArr = new TextEncoder().encode(':');
|
|
112
|
+
const bodyLengthArr = new TextEncoder().encode(body.length.toString());
|
|
113
|
+
const statusArr = new TextEncoder().encode(String(status));
|
|
114
|
+
// Calculate total length of new Uint8Array
|
|
115
|
+
const totalLength = nonceArr.length +
|
|
116
|
+
magicWordArr.length +
|
|
117
|
+
separatorArr.length * 3 +
|
|
118
|
+
bodyLengthArr.length +
|
|
119
|
+
statusArr.length +
|
|
120
|
+
body.length;
|
|
121
|
+
// Create a new Uint8Array to hold all combined parts
|
|
122
|
+
const concat = new Uint8Array(totalLength);
|
|
123
|
+
let offset = 0;
|
|
124
|
+
// Function to append data to concat
|
|
125
|
+
const appendToConcat = (data) => {
|
|
126
|
+
concat.set(data, offset);
|
|
127
|
+
offset += data.length;
|
|
128
|
+
};
|
|
129
|
+
// Building the final Uint8Array
|
|
130
|
+
appendToConcat(magicWordArr);
|
|
131
|
+
appendToConcat(nonceArr);
|
|
132
|
+
appendToConcat(separatorArr);
|
|
133
|
+
appendToConcat(bodyLengthArr);
|
|
134
|
+
appendToConcat(separatorArr);
|
|
135
|
+
appendToConcat(statusArr);
|
|
136
|
+
appendToConcat(separatorArr);
|
|
137
|
+
appendToConcat(body);
|
|
138
|
+
return concat;
|
|
139
|
+
};
|
|
140
|
+
exports.makeStreamPayloadMessage = makeStreamPayloadMessage;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/renderer"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/renderer",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.208",
|
|
7
7
|
"description": "Render Remotion videos using Node.js or Bun",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"extract-zip": "2.0.1",
|
|
19
19
|
"source-map": "^0.8.0-beta.0",
|
|
20
20
|
"ws": "8.17.1",
|
|
21
|
-
"remotion": "4.0.
|
|
22
|
-
"@remotion/streaming": "4.0.
|
|
21
|
+
"remotion": "4.0.208",
|
|
22
|
+
"@remotion/streaming": "4.0.208"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": ">=16.8.0",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"@types/ws": "8.5.10"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
37
|
-
"@remotion/compositor-darwin-
|
|
38
|
-
"@remotion/compositor-darwin-
|
|
39
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.
|
|
40
|
-
"@remotion/compositor-linux-arm64-musl": "4.0.
|
|
41
|
-
"@remotion/compositor-linux-x64-
|
|
42
|
-
"@remotion/compositor-win32-x64-msvc": "4.0.
|
|
43
|
-
"@remotion/compositor-linux-x64-
|
|
37
|
+
"@remotion/compositor-darwin-x64": "4.0.208",
|
|
38
|
+
"@remotion/compositor-darwin-arm64": "4.0.208",
|
|
39
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.208",
|
|
40
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.208",
|
|
41
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.208",
|
|
42
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.208",
|
|
43
|
+
"@remotion/compositor-linux-x64-musl": "4.0.208"
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|
|
46
46
|
"remotion",
|