@remotion/renderer 4.0.47 → 4.0.48
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/get-port.d.ts +12 -1
- package/dist/get-port.js +39 -25
- package/dist/get-silent-parts.d.ts +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/logger.d.ts +1 -1
- package/dist/serve-static.js +9 -2
- package/package.json +9 -9
- package/dist/options/render-expiry-days.d.ts +0 -8
- package/dist/options/render-expiry-days.js +0 -14
- package/dist/presets-profile.d.ts +0 -7
- package/dist/presets-profile.js +0 -27
package/dist/get-port.d.ts
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
type PortStatus = 'available' | 'unavailable';
|
|
2
|
+
export declare const testPortAvailableOnMultipleHosts: ({ hosts, port, }: {
|
|
3
|
+
port: number;
|
|
4
|
+
hosts: string[];
|
|
5
|
+
}) => Promise<PortStatus>;
|
|
6
|
+
export declare const getDesiredPort: ({ desiredPort, from, hostsToTry, to, }: {
|
|
7
|
+
desiredPort: number | undefined;
|
|
8
|
+
from: number;
|
|
9
|
+
to: number;
|
|
10
|
+
hostsToTry: string[];
|
|
11
|
+
}) => Promise<{
|
|
2
12
|
port: number;
|
|
3
13
|
didUsePort: () => void;
|
|
4
14
|
}>;
|
|
15
|
+
export {};
|
package/dist/get-port.js
CHANGED
|
@@ -3,48 +3,62 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getDesiredPort = void 0;
|
|
6
|
+
exports.getDesiredPort = exports.testPortAvailableOnMultipleHosts = void 0;
|
|
7
7
|
const net_1 = __importDefault(require("net"));
|
|
8
8
|
const locks_1 = require("./locks");
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
const isPortAvailableOnHost = ({ portToTry, host, }) => {
|
|
10
|
+
return new Promise((resolve) => {
|
|
11
|
+
let status = 'unavailable';
|
|
12
|
+
const socket = new net_1.default.Socket();
|
|
13
|
+
socket.on('connect', () => {
|
|
14
|
+
status = 'unavailable';
|
|
15
|
+
socket.destroy();
|
|
16
|
+
});
|
|
17
|
+
socket.setTimeout(3000);
|
|
18
|
+
socket.on('timeout', () => {
|
|
19
|
+
status = 'unavailable';
|
|
20
|
+
socket.destroy();
|
|
21
|
+
resolve(status);
|
|
22
|
+
});
|
|
23
|
+
socket.on('error', () => {
|
|
24
|
+
status = 'available';
|
|
25
|
+
});
|
|
26
|
+
socket.on('close', () => resolve(status));
|
|
27
|
+
socket.connect(portToTry, host);
|
|
16
28
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
socket.on('close', () => resolve(status));
|
|
27
|
-
socket.connect(portToTry, host);
|
|
28
|
-
});
|
|
29
|
-
const getPort = async (from, to) => {
|
|
29
|
+
};
|
|
30
|
+
const testPortAvailableOnMultipleHosts = async ({ hosts, port, }) => {
|
|
31
|
+
const results = await Promise.all(hosts.map((host) => {
|
|
32
|
+
return isPortAvailableOnHost({ portToTry: port, host });
|
|
33
|
+
}));
|
|
34
|
+
return results.every((r) => r === 'available') ? 'available' : 'unavailable';
|
|
35
|
+
};
|
|
36
|
+
exports.testPortAvailableOnMultipleHosts = testPortAvailableOnMultipleHosts;
|
|
37
|
+
const getPort = async ({ from, to, hostsToTest, }) => {
|
|
30
38
|
const ports = makeRange(from, to);
|
|
31
39
|
for (const port of ports) {
|
|
32
|
-
if ((await
|
|
40
|
+
if ((await (0, exports.testPortAvailableOnMultipleHosts)({
|
|
41
|
+
port,
|
|
42
|
+
hosts: hostsToTest,
|
|
43
|
+
})) === 'available') {
|
|
33
44
|
return port;
|
|
34
45
|
}
|
|
35
46
|
}
|
|
36
47
|
throw new Error('No available ports found');
|
|
37
48
|
};
|
|
38
49
|
const portLocks = (0, locks_1.createLock)({ timeout: 10000 });
|
|
39
|
-
const getDesiredPort = async (desiredPort, from, to) => {
|
|
50
|
+
const getDesiredPort = async ({ desiredPort, from, hostsToTry, to, }) => {
|
|
40
51
|
await portLocks.waitForAllToBeDone();
|
|
41
52
|
const lockPortSelection = portLocks.lock();
|
|
42
53
|
const didUsePort = () => portLocks.unlock(lockPortSelection);
|
|
43
54
|
if (typeof desiredPort !== 'undefined' &&
|
|
44
|
-
(await
|
|
55
|
+
(await (0, exports.testPortAvailableOnMultipleHosts)({
|
|
56
|
+
port: desiredPort,
|
|
57
|
+
hosts: ['0.0.0.0', '127.0.0.1'],
|
|
58
|
+
})) === 'available') {
|
|
45
59
|
return { port: desiredPort, didUsePort };
|
|
46
60
|
}
|
|
47
|
-
const actualPort = await getPort(from, to);
|
|
61
|
+
const actualPort = await getPort({ from, to, hostsToTest: hostsToTry });
|
|
48
62
|
// If did specify a port but did not get that one, fail hard.
|
|
49
63
|
if (desiredPort && desiredPort !== actualPort) {
|
|
50
64
|
throw new Error(`You specified port ${desiredPort} to be used for the HTTP server, but it is not available. Choose a different port or remove the setting to let Remotion automatically select a free port.`);
|
|
@@ -3,6 +3,6 @@ import type { LogLevel } from './log-level';
|
|
|
3
3
|
export declare const getSilentParts: ({ src, noiseThresholdInDecibels: passedNoiseThresholdInDecibels, minDurationInSeconds: passedMinDuration, logLevel, }: {
|
|
4
4
|
src: string;
|
|
5
5
|
minDurationInSeconds?: number | undefined;
|
|
6
|
-
logLevel?: "
|
|
6
|
+
logLevel?: "error" | "verbose" | "info" | "warn" | undefined;
|
|
7
7
|
noiseThresholdInDecibels?: number | undefined;
|
|
8
8
|
}) => Promise<GetSilentPartsResponse>;
|
package/dist/index.d.ts
CHANGED
|
@@ -88,7 +88,12 @@ export declare const RenderInternals: {
|
|
|
88
88
|
SymbolicateableError: typeof SymbolicateableError;
|
|
89
89
|
getFramesToRender: (frameRange: [number, number], everyNthFrame: number) => number[];
|
|
90
90
|
getExtensionOfFilename: (filename: string | null) => string | null;
|
|
91
|
-
getDesiredPort: (desiredPort
|
|
91
|
+
getDesiredPort: ({ desiredPort, from, hostsToTry, to, }: {
|
|
92
|
+
desiredPort: number | undefined;
|
|
93
|
+
from: number;
|
|
94
|
+
to: number;
|
|
95
|
+
hostsToTry: string[];
|
|
96
|
+
}) => Promise<{
|
|
92
97
|
port: number;
|
|
93
98
|
didUsePort: () => void;
|
|
94
99
|
}>;
|
package/dist/logger.d.ts
CHANGED
|
@@ -19,6 +19,6 @@ export declare const Log: {
|
|
|
19
19
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
20
20
|
errorAdvanced: (options: VerboseLogOptions, message?: any, ...optionalParams: any[]) => void;
|
|
21
21
|
};
|
|
22
|
-
export declare const getLogLevel: () => "
|
|
22
|
+
export declare const getLogLevel: () => "error" | "verbose" | "info" | "warn";
|
|
23
23
|
export declare const setLogLevel: (newLogLevel: LogLevel) => void;
|
|
24
24
|
export {};
|
package/dist/serve-static.js
CHANGED
|
@@ -45,13 +45,20 @@ const serveStatic = async (path, options) => {
|
|
|
45
45
|
});
|
|
46
46
|
let selectedPort = null;
|
|
47
47
|
const maxTries = 5;
|
|
48
|
+
// Default Node.js host, but explicity
|
|
49
|
+
const host = '0.0.0.0';
|
|
48
50
|
for (let i = 0; i < maxTries; i++) {
|
|
49
51
|
try {
|
|
50
52
|
selectedPort = await new Promise((resolve, reject) => {
|
|
51
53
|
var _a;
|
|
52
|
-
(0, get_port_1.getDesiredPort)(
|
|
54
|
+
(0, get_port_1.getDesiredPort)({
|
|
55
|
+
desiredPort: (_a = options === null || options === void 0 ? void 0 : options.port) !== null && _a !== void 0 ? _a : undefined,
|
|
56
|
+
from: 3000,
|
|
57
|
+
to: 3100,
|
|
58
|
+
hostsToTry: ['0.0.0.0', '127.0.0.1'],
|
|
59
|
+
})
|
|
53
60
|
.then(({ port, didUsePort }) => {
|
|
54
|
-
server.listen(port);
|
|
61
|
+
server.listen({ port, host });
|
|
55
62
|
server.on('listening', () => {
|
|
56
63
|
resolve(port);
|
|
57
64
|
return didUsePort();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/renderer",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.48",
|
|
4
4
|
"description": "Renderer for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"extract-zip": "2.0.1",
|
|
19
19
|
"source-map": "^0.8.0-beta.0",
|
|
20
20
|
"ws": "8.7.0",
|
|
21
|
-
"remotion": "4.0.
|
|
21
|
+
"remotion": "4.0.48"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": ">=16.8.0",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"vitest": "0.31.1"
|
|
41
41
|
},
|
|
42
42
|
"optionalDependencies": {
|
|
43
|
-
"@remotion/compositor-
|
|
44
|
-
"@remotion/compositor-darwin-
|
|
45
|
-
"@remotion/compositor-
|
|
46
|
-
"@remotion/compositor-linux-arm64-musl": "4.0.
|
|
47
|
-
"@remotion/compositor-linux-x64-gnu": "4.0.
|
|
48
|
-
"@remotion/compositor-linux-x64-musl": "4.0.
|
|
49
|
-
"@remotion/compositor-win32-x64-msvc": "4.0.
|
|
43
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.48",
|
|
44
|
+
"@remotion/compositor-darwin-arm64": "4.0.48",
|
|
45
|
+
"@remotion/compositor-darwin-x64": "4.0.48",
|
|
46
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.48",
|
|
47
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.48",
|
|
48
|
+
"@remotion/compositor-linux-x64-musl": "4.0.48",
|
|
49
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.48"
|
|
50
50
|
},
|
|
51
51
|
"keywords": [
|
|
52
52
|
"remotion",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteAfterOption = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
exports.deleteAfterOption = {
|
|
6
|
-
name: 'Render expiry days',
|
|
7
|
-
cliFlag: 'delete-after',
|
|
8
|
-
description: () => {
|
|
9
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Automatically delete the render after a certain period. Accepted values are ", (0, jsx_runtime_1.jsx)("code", { children: "1-day" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "3-days" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "7-days" }), " and", ' ', (0, jsx_runtime_1.jsx)("code", { children: "30-days" }), ".", (0, jsx_runtime_1.jsx)("br", {}), " For this to work, your bucket needs to have", ' ', (0, jsx_runtime_1.jsx)("a", { href: "/docs/lambda/autodelete", children: "lifecycles enabled" }), "."] }));
|
|
10
|
-
},
|
|
11
|
-
ssrName: 'deleteAfter',
|
|
12
|
-
docLink: 'https://www.remotion.dev/docs/autodelete',
|
|
13
|
-
type: 0,
|
|
14
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Codec } from './codec';
|
|
2
|
-
export declare const x264PresetOptions: readonly ["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow", "placebo"];
|
|
3
|
-
export type x264Preset = typeof x264PresetOptions[number];
|
|
4
|
-
export declare const validateSelectedCodecAndPresetCombination: ({ codec, x264Preset, }: {
|
|
5
|
-
codec: Codec;
|
|
6
|
-
x264Preset: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | undefined;
|
|
7
|
-
}) => void;
|
package/dist/presets-profile.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateSelectedCodecAndPresetCombination = exports.x264PresetOptions = void 0;
|
|
4
|
-
exports.x264PresetOptions = [
|
|
5
|
-
'ultrafast',
|
|
6
|
-
'superfast',
|
|
7
|
-
'veryfast',
|
|
8
|
-
'faster',
|
|
9
|
-
'fast',
|
|
10
|
-
'medium',
|
|
11
|
-
'slow',
|
|
12
|
-
'slower',
|
|
13
|
-
'veryslow',
|
|
14
|
-
'placebo',
|
|
15
|
-
];
|
|
16
|
-
const validateSelectedCodecAndPresetCombination = ({ codec, x264Preset, }) => {
|
|
17
|
-
if (typeof x264Preset !== 'undefined' && codec !== 'h264') {
|
|
18
|
-
throw new TypeError(`You have set a Preset profile but the codec is "${codec}". Set the codec to "h264" or remove the Preset profile.`);
|
|
19
|
-
}
|
|
20
|
-
if (x264Preset !== undefined &&
|
|
21
|
-
!exports.x264PresetOptions.includes(x264Preset)) {
|
|
22
|
-
throw new TypeError(`The Preset profile "${x264Preset}" is not valid. Valid options are ${exports.x264PresetOptions
|
|
23
|
-
.map((p) => `"${p}"`)
|
|
24
|
-
.join(', ')}`);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
exports.validateSelectedCodecAndPresetCombination = validateSelectedCodecAndPresetCombination;
|