@remotion/renderer 3.3.84 → 3.3.87

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "3.3.84",
3
+ "version": "3.3.87",
4
4
  "description": "Renderer for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,7 +16,7 @@
16
16
  "dependencies": {
17
17
  "execa": "5.1.1",
18
18
  "extract-zip": "2.0.1",
19
- "remotion": "3.3.84",
19
+ "remotion": "3.3.87",
20
20
  "source-map": "^0.8.0-beta.0",
21
21
  "ws": "8.7.0"
22
22
  },
@@ -41,13 +41,13 @@
41
41
  "vitest": "0.24.3"
42
42
  },
43
43
  "optionalDependencies": {
44
- "@remotion/compositor-darwin-arm64": "3.3.84",
45
- "@remotion/compositor-darwin-x64": "3.3.84",
46
- "@remotion/compositor-linux-arm64-gnu": "3.3.84",
47
- "@remotion/compositor-linux-arm64-musl": "3.3.84",
48
- "@remotion/compositor-linux-x64-gnu": "3.3.84",
49
- "@remotion/compositor-linux-x64-musl": "3.3.84",
50
- "@remotion/compositor-win32-x64-msvc": "3.3.84"
44
+ "@remotion/compositor-darwin-arm64": "3.3.87",
45
+ "@remotion/compositor-darwin-x64": "3.3.87",
46
+ "@remotion/compositor-linux-arm64-gnu": "3.3.87",
47
+ "@remotion/compositor-linux-arm64-musl": "3.3.87",
48
+ "@remotion/compositor-linux-x64-gnu": "3.3.87",
49
+ "@remotion/compositor-linux-x64-musl": "3.3.87",
50
+ "@remotion/compositor-win32-x64-msvc": "3.3.87"
51
51
  },
52
52
  "keywords": [
53
53
  "remotion",
@@ -1 +0,0 @@
1
- export declare const isTargetClosedErr: (error: Error | undefined) => boolean | undefined;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTargetClosedErr = void 0;
4
- const isTargetClosedErr = (error) => {
5
- var _a, _b;
6
- return (((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.includes('Target closed')) ||
7
- ((_b = error === null || error === void 0 ? void 0 : error.message) === null || _b === void 0 ? void 0 : _b.includes('Session closed')));
8
- };
9
- exports.isTargetClosedErr = isTargetClosedErr;
@@ -1,20 +0,0 @@
1
- import execa from 'execa';
2
- export declare const dynamicLibraryPathOptions: () => {
3
- env: {
4
- DYLD_LIBRARY_PATH: string;
5
- RUST_BACKTRACE: string;
6
- PATH?: undefined;
7
- LD_LIBRARY_PATH?: undefined;
8
- } | {
9
- PATH: string;
10
- DYLD_LIBRARY_PATH?: undefined;
11
- RUST_BACKTRACE?: undefined;
12
- LD_LIBRARY_PATH?: undefined;
13
- } | {
14
- LD_LIBRARY_PATH: string;
15
- DYLD_LIBRARY_PATH?: undefined;
16
- RUST_BACKTRACE?: undefined;
17
- PATH?: undefined;
18
- };
19
- };
20
- export declare const callFf: (bin: 'ffmpeg' | 'ffprobe', args: (string | null)[], options?: execa.Options<string>) => execa.ExecaChildProcess<string>;
@@ -1,35 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.callFf = exports.dynamicLibraryPathOptions = void 0;
7
- const execa_1 = __importDefault(require("execa"));
8
- const path_1 = __importDefault(require("path"));
9
- const get_executable_path_1 = require("./compositor/get-executable-path");
10
- const truthy_1 = require("./truthy");
11
- const dynamicLibraryPathOptions = () => {
12
- const lib = path_1.default.join((0, get_executable_path_1.getExecutablePath)('ffmpeg-cwd'), 'remotion', 'lib');
13
- return {
14
- env: process.platform === 'darwin'
15
- ? {
16
- DYLD_LIBRARY_PATH: lib,
17
- RUST_BACKTRACE: '1',
18
- }
19
- : process.platform === 'win32'
20
- ? {
21
- PATH: `${process.env.PATH};${lib}`,
22
- }
23
- : {
24
- LD_LIBRARY_PATH: lib,
25
- },
26
- };
27
- };
28
- exports.dynamicLibraryPathOptions = dynamicLibraryPathOptions;
29
- const callFf = (bin, args, options) => {
30
- return (0, execa_1.default)((0, get_executable_path_1.getExecutablePath)(bin), args.filter(truthy_1.truthy), {
31
- ...(0, exports.dynamicLibraryPathOptions)(),
32
- ...options,
33
- });
34
- };
35
- exports.callFf = callFf;
@@ -1,15 +0,0 @@
1
- /// <reference types="node" />
2
- import type { CompositorCommand } from './payloads';
3
- export declare type Compositor = {
4
- finishCommands: () => void;
5
- executeCommand: <T extends keyof CompositorCommand>(type: T, payload: CompositorCommand[T]) => Promise<Buffer>;
6
- waitForDone: () => Promise<void>;
7
- };
8
- export declare const spawnCompositorOrReuse: <T extends keyof CompositorCommand>({ initiatePayload, renderId, type, }: {
9
- type: T;
10
- initiatePayload: CompositorCommand[T];
11
- renderId: string;
12
- }) => Compositor;
13
- export declare const releaseCompositorWithId: (renderId: string) => void;
14
- export declare const waitForCompositorWithIdToQuit: (renderId: string) => Promise<void>;
15
- export declare const startCompositor: <T extends keyof CompositorCommand>(type: T, payload: CompositorCommand[T]) => Compositor;
@@ -1,193 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.startCompositor = exports.waitForCompositorWithIdToQuit = exports.releaseCompositorWithId = exports.spawnCompositorOrReuse = void 0;
4
- const child_process_1 = require("child_process");
5
- const call_ffmpeg_1 = require("../call-ffmpeg");
6
- const get_executable_path_1 = require("./get-executable-path");
7
- const make_nonce_1 = require("./make-nonce");
8
- const compositorMap = {};
9
- const spawnCompositorOrReuse = ({ initiatePayload, renderId, type, }) => {
10
- if (!compositorMap[renderId]) {
11
- compositorMap[renderId] = (0, exports.startCompositor)(type, initiatePayload);
12
- }
13
- return compositorMap[renderId];
14
- };
15
- exports.spawnCompositorOrReuse = spawnCompositorOrReuse;
16
- const releaseCompositorWithId = (renderId) => {
17
- if (compositorMap[renderId]) {
18
- compositorMap[renderId].finishCommands();
19
- }
20
- };
21
- exports.releaseCompositorWithId = releaseCompositorWithId;
22
- const waitForCompositorWithIdToQuit = (renderId) => {
23
- if (!compositorMap[renderId]) {
24
- throw new TypeError('No compositor with that id');
25
- }
26
- return compositorMap[renderId].waitForDone();
27
- };
28
- exports.waitForCompositorWithIdToQuit = waitForCompositorWithIdToQuit;
29
- const startCompositor = (type, payload) => {
30
- const bin = (0, get_executable_path_1.getExecutablePath)('compositor');
31
- const fullCommand = {
32
- nonce: (0, make_nonce_1.makeNonce)(),
33
- payload: {
34
- type,
35
- params: payload,
36
- },
37
- };
38
- const child = (0, child_process_1.spawn)(bin, [JSON.stringify(fullCommand)], (0, call_ffmpeg_1.dynamicLibraryPathOptions)());
39
- const stderrChunks = [];
40
- let outputBuffer = Buffer.from('');
41
- const separator = Buffer.from('remotion_buffer:');
42
- const waiters = new Map();
43
- const onMessage = (statusType, nonce, data) => {
44
- if (nonce === '0') {
45
- console.log(data.toString('utf8'));
46
- }
47
- if (waiters.has(nonce)) {
48
- if (statusType === 'error') {
49
- try {
50
- const parsed = JSON.parse(data.toString('utf8'));
51
- waiters.get(nonce).reject(new Error(`Compositor error: ${parsed.error}`));
52
- }
53
- catch (err) {
54
- waiters.get(nonce).reject(new Error(data.toString('utf8')));
55
- }
56
- }
57
- else {
58
- waiters.get(nonce).resolve(data);
59
- }
60
- waiters.delete(nonce);
61
- }
62
- };
63
- let quit = false;
64
- let missingData = null;
65
- const processInput = () => {
66
- let separatorIndex = outputBuffer.indexOf(separator);
67
- if (separatorIndex === -1) {
68
- return;
69
- }
70
- separatorIndex += separator.length;
71
- let nonceString = '';
72
- let lengthString = '';
73
- let statusString = '';
74
- // Each message from Rust is prefixed with `remotion_buffer;{[nonce]}:{[length]}`
75
- // Let's read the buffer to extract the nonce, and if the full length is available,
76
- // we'll extract the data and pass it to the callback.
77
- // eslint-disable-next-line no-constant-condition
78
- while (true) {
79
- const nextDigit = outputBuffer[separatorIndex];
80
- // 0x3a is the character ":"
81
- if (nextDigit === 0x3a) {
82
- separatorIndex++;
83
- break;
84
- }
85
- separatorIndex++;
86
- nonceString += String.fromCharCode(nextDigit);
87
- }
88
- // eslint-disable-next-line no-constant-condition
89
- while (true) {
90
- const nextDigit = outputBuffer[separatorIndex];
91
- if (nextDigit === 0x3a) {
92
- separatorIndex++;
93
- break;
94
- }
95
- separatorIndex++;
96
- lengthString += String.fromCharCode(nextDigit);
97
- }
98
- // eslint-disable-next-line no-constant-condition
99
- while (true) {
100
- const nextDigit = outputBuffer[separatorIndex];
101
- if (nextDigit === 0x3a) {
102
- break;
103
- }
104
- separatorIndex++;
105
- statusString += String.fromCharCode(nextDigit);
106
- }
107
- const length = Number(lengthString);
108
- const status = Number(statusString);
109
- const dataLength = outputBuffer.length - separatorIndex - 1;
110
- if (dataLength < length) {
111
- missingData = {
112
- dataMissing: length - dataLength,
113
- };
114
- return;
115
- }
116
- const data = outputBuffer.subarray(separatorIndex + 1, separatorIndex + 1 + Number(lengthString));
117
- onMessage(status === 1 ? 'error' : 'success', nonceString, data);
118
- missingData = null;
119
- outputBuffer = outputBuffer.subarray(separatorIndex + Number(lengthString) + 1);
120
- processInput();
121
- };
122
- let unprocessedBuffers = [];
123
- child.stdout.on('data', (data) => {
124
- unprocessedBuffers.push(data);
125
- const separatorIndex = data.indexOf(separator);
126
- if (separatorIndex === -1) {
127
- if (missingData) {
128
- missingData.dataMissing -= data.length;
129
- }
130
- if (!missingData || missingData.dataMissing > 0) {
131
- return;
132
- }
133
- }
134
- unprocessedBuffers.unshift(outputBuffer);
135
- outputBuffer = Buffer.concat(unprocessedBuffers);
136
- unprocessedBuffers = [];
137
- processInput();
138
- });
139
- child.stderr.on('data', (data) => {
140
- if (data.toString('utf-8').includes('No accelerated colorspace conversion')) {
141
- return;
142
- }
143
- console.log(data.toString('utf-8'));
144
- });
145
- return {
146
- waitForDone: () => {
147
- return new Promise((resolve, reject) => {
148
- child.on('close', (code) => {
149
- quit = true;
150
- const waitersToKill = Array.from(waiters.values());
151
- for (const waiter of waitersToKill) {
152
- waiter.reject(new Error(`Compositor quit with code ${code}`));
153
- }
154
- waiters.clear();
155
- if (code === 0) {
156
- resolve();
157
- }
158
- else {
159
- reject(Buffer.concat(stderrChunks).toString('utf-8'));
160
- }
161
- });
162
- });
163
- },
164
- finishCommands: () => {
165
- if (quit) {
166
- throw new Error('Compositor already quit');
167
- }
168
- child.stdin.write('EOF\n');
169
- },
170
- executeCommand: (command, params) => {
171
- if (quit) {
172
- throw new Error('Compositor already quit');
173
- }
174
- return new Promise((resolve, reject) => {
175
- const nonce = (0, make_nonce_1.makeNonce)();
176
- const composed = {
177
- nonce,
178
- payload: {
179
- type: command,
180
- params,
181
- },
182
- };
183
- // TODO: Should have a way to error out a single task
184
- child.stdin.write(JSON.stringify(composed) + '\n');
185
- waiters.set(nonce, {
186
- resolve,
187
- reject,
188
- });
189
- });
190
- },
191
- };
192
- };
193
- exports.startCompositor = startCompositor;
@@ -1 +0,0 @@
1
- export declare const makeNonce: () => string;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeNonce = void 0;
4
- const makeNonce = () => {
5
- return (Math.random().toString(36).substring(2, 15) +
6
- Math.random().toString(36).substring(2, 15));
7
- };
8
- exports.makeNonce = makeNonce;
@@ -1 +0,0 @@
1
- export declare const validateJpegQuality: (q: number | undefined) => void;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateJpegQuality = void 0;
4
- const validateJpegQuality = (q) => {
5
- if (typeof q !== 'undefined' && typeof q !== 'number') {
6
- throw new Error(`JPEG Quality option must be a number or undefined. Got ${typeof q} (${JSON.stringify(q)})`);
7
- }
8
- if (typeof q === 'undefined') {
9
- return;
10
- }
11
- if (!Number.isFinite(q)) {
12
- throw new RangeError(`JPEG Quality must be a finite number, but is ${q}`);
13
- }
14
- if (Number.isNaN(q)) {
15
- throw new RangeError(`JPEG Quality is NaN, but must be a real number`);
16
- }
17
- if (q > 100 || q < 0) {
18
- throw new RangeError('JPEG Quality option must be between 0 and 100.');
19
- }
20
- };
21
- exports.validateJpegQuality = validateJpegQuality;
@@ -1,2 +0,0 @@
1
- import type { RemotionOption } from './option';
2
- export declare const audioBitrateOption: RemotionOption;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.audioBitrateOption = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- exports.audioBitrateOption = {
6
- name: 'Audio Bitrate',
7
- cliFlag: '--audio-bitrate',
8
- description: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Specify the target bitrate for the generated video. The syntax for FFMPEGs", (0, jsx_runtime_1.jsx)("code", { children: "-b:a" }), " parameter should be used. FFMPEG may encode the video in a way that will not result in the exact audio bitrate specified. Example values: ", (0, jsx_runtime_1.jsx)("code", { children: "512K" }), " for 512 kbps, ", (0, jsx_runtime_1.jsx)("code", { children: "1M" }), " for 1 Mbps. Default: ", (0, jsx_runtime_1.jsx)("code", { children: "320k" })] })),
9
- ssrName: 'audioBitrate',
10
- docLink: 'https://www.remotion.dev/docs/renderer/render-media#audiobitrate-',
11
- };
@@ -1,2 +0,0 @@
1
- import type { RemotionOption } from './option';
2
- export declare const crfOption: RemotionOption;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.crfOption = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- exports.crfOption = {
6
- name: 'CRF',
7
- cliFlag: '--crf',
8
- description: ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "No matter which codec you end up using, there's always a tradeoff between file size and video quality. You can control it by setting the so called CRF (Constant Rate Factor). The lower the number, the better the quality, the higher the number, the smaller the file is \u2013 of course at the cost of quality." })),
9
- ssrName: 'crf',
10
- docLink: 'https://www.remotion.dev/docs/encoding/#controlling-quality-using-the-crf-setting',
11
- };
@@ -1,2 +0,0 @@
1
- import type { RemotionOption } from './option';
2
- export declare const enforceAudioOption: RemotionOption;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.enforceAudioOption = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- exports.enforceAudioOption = {
6
- name: 'Enforce Audio Track',
7
- cliFlag: '--enforce-audio-track',
8
- description: ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Render a silent audio track if there would be none otherwise." })),
9
- ssrName: 'enforceAudioTrack',
10
- docLink: 'https://www.remotion.dev/docs/config#setenforceaudiotrack-',
11
- };
@@ -1,2 +0,0 @@
1
- import type { RemotionOption } from './option';
2
- export declare const jpegQualityOption: RemotionOption;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jpegQualityOption = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- exports.jpegQualityOption = {
6
- name: 'JPEG Quality',
7
- cliFlag: '--jpeg-quality',
8
- description: ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Sets the quality of the generated JPEG images. Must be an integer between 0 and 100. Default is to leave it up to the browser, current default is 80." })),
9
- ssrName: 'jpegQuality',
10
- docLink: 'https://www.remotion.dev/docs/renderer/render-media#jpeg-quality',
11
- };
@@ -1,2 +0,0 @@
1
- import type { RemotionOption } from './option';
2
- export declare const muteOption: RemotionOption;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.muteOption = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- exports.muteOption = {
6
- name: 'Muted',
7
- cliFlag: '--muted',
8
- description: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "The Audio of the video will be omitted." }),
9
- ssrName: 'muted',
10
- docLink: 'https://www.remotion.dev/docs/using-audio/#muted-property',
11
- };
@@ -1,8 +0,0 @@
1
- import type React from 'react';
2
- export declare type RemotionOption = {
3
- name: string;
4
- cliFlag: string;
5
- ssrName: string;
6
- description: React.ReactNode;
7
- docLink: string;
8
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- import type { RemotionOption } from './option';
2
- export declare const scaleOption: RemotionOption;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.scaleOption = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- exports.scaleOption = {
6
- name: 'Scale',
7
- cliFlag: '--scale',
8
- description: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Scales the output by a factor. For example, a 1280x720px frame will become a 1920x1080px frame with a scale factor of ", (0, jsx_runtime_1.jsx)("code", { children: "1.5" }), ". Vector elements like fonts and HTML markups will be rendered with extra details."] })),
9
- ssrName: 'scale',
10
- docLink: 'https://www.remotion.dev/docs/scaling',
11
- };
@@ -1,2 +0,0 @@
1
- import type { RemotionOption } from './option';
2
- export declare const videoBitrate: RemotionOption;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.videoBitrate = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- exports.videoBitrate = {
6
- name: 'Video Bitrate',
7
- cliFlag: '--video-bitrate',
8
- description: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Specify the target bitrate for the generated video. The syntax for FFMPEGs", (0, jsx_runtime_1.jsx)("code", { children: "-b:v" }), " parameter should be used. FFMPEG may encode the video in a way that will not result in the exact video bitrate specified. Example values: ", (0, jsx_runtime_1.jsx)("code", { children: "512K" }), " for 512 kbps, ", (0, jsx_runtime_1.jsx)("code", { children: "1M" }), " for 1 Mbps."] })),
9
- ssrName: 'videoBitrate',
10
- docLink: 'https://www.remotion.dev/docs/renderer/render-media#videobitrate-',
11
- };
@@ -1,2 +0,0 @@
1
- import type { RemotionOption } from './option';
2
- export declare const videoCodecOption: RemotionOption;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.videoCodecOption = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- exports.videoCodecOption = {
6
- name: 'Codec',
7
- cliFlag: '--codec',
8
- description: ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Remotion supports 5 video codecs: h264 (default), h265, vp8, vp9 and prores. While H264 will work well in most cases, sometimes it's worth going for a different codec. Follow the link below for an overview." })),
9
- ssrName: 'codec',
10
- docLink: 'https://www.remotion.dev/docs/encoding/#choosing-a-codec',
11
- };