@remotion/renderer 4.0.0-alpha5 → 4.0.0-alpha6
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/assets/download-and-map-assets-to-file.js +6 -6
- package/dist/assets/download-file.d.ts +3 -2
- package/dist/assets/download-file.js +18 -3
- package/dist/assets/download-map.js +7 -7
- package/dist/assets/read-file.d.ts +1 -1
- package/dist/assets/read-file.js +2 -2
- package/dist/assets/sanitize-filepath.js +2 -2
- package/dist/audio-codec.d.ts +1 -1
- package/dist/browser/BrowserFetcher.js +13 -13
- package/dist/browser/BrowserRunner.d.ts +1 -1
- package/dist/browser/BrowserRunner.js +2 -2
- package/dist/browser/Launcher.js +4 -4
- package/dist/browser/NodeWebSocketTransport.js +4 -4
- package/dist/browser/get-download-destination.js +8 -8
- package/dist/call-ffmpeg.js +6 -3
- package/dist/client.d.ts +16 -4
- package/dist/combine-videos.js +6 -6
- package/dist/compositor/compose.js +8 -5
- package/dist/compositor/compositor.js +6 -4
- package/dist/delete-directory.js +3 -3
- package/dist/does-have-m2-bug.js +2 -2
- package/dist/ensure-output-directory.js +5 -5
- package/dist/ffmpeg-filter-file.js +7 -7
- package/dist/file-extensions.js +7 -1
- package/dist/find-closest-package-json.js +6 -6
- package/dist/get-concurrency.js +3 -3
- package/dist/get-extension-of-filename.js +2 -2
- package/dist/get-local-browser-executable.js +4 -4
- package/dist/get-video-threads-flag.js +3 -3
- package/dist/index.d.ts +16 -4
- package/dist/merge-audio-track.js +2 -2
- package/dist/mime-types.js +2 -2
- package/dist/offthread-video-server.d.ts +1 -1
- package/dist/offthread-video-server.js +2 -2
- package/dist/options/jpeg-quality.js +1 -1
- package/dist/prepare-server.js +4 -4
- package/dist/prestitcher-memory-usage.js +2 -2
- package/dist/puppeteer-screenshot.js +1 -1
- package/dist/render-frames.js +5 -5
- package/dist/render-media.js +9 -9
- package/dist/render-still.d.ts +2 -0
- package/dist/render-still.js +17 -6
- package/dist/resolve-asset-src.js +2 -2
- package/dist/screenshot-task.js +2 -2
- package/dist/serve-handler/index.d.ts +1 -1
- package/dist/serve-handler/index.js +15 -15
- package/dist/serve-handler/is-path-inside.js +3 -3
- package/dist/serve-static.js +2 -2
- package/dist/stitch-frames-to-video.js +13 -13
- package/dist/take-frame-and-compose.js +6 -6
- package/dist/tmp-dir.js +7 -7
- package/install-toolchain.mjs +2 -2
- package/package.json +9 -9
- package/types/ws/index.d.ts +5 -5
package/dist/serve-static.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.serveStatic = void 0;
|
|
7
|
-
const
|
|
7
|
+
const node_http_1 = __importDefault(require("node:http"));
|
|
8
8
|
const get_port_1 = require("./get-port");
|
|
9
9
|
const offthread_video_server_1 = require("./offthread-video-server");
|
|
10
10
|
const serve_handler_1 = require("./serve-handler");
|
|
@@ -17,7 +17,7 @@ const serveStatic = async (path, options) => {
|
|
|
17
17
|
verbose: options.verbose,
|
|
18
18
|
});
|
|
19
19
|
const connections = {};
|
|
20
|
-
const server =
|
|
20
|
+
const server = node_http_1.default.createServer((request, response) => {
|
|
21
21
|
var _a;
|
|
22
22
|
if ((_a = request.url) === null || _a === void 0 ? void 0 : _a.startsWith('/proxy')) {
|
|
23
23
|
return offthreadRequest(request, response);
|
|
@@ -27,8 +27,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.stitchFramesToVideo = void 0;
|
|
30
|
-
const
|
|
31
|
-
const
|
|
30
|
+
const node_fs_1 = __importStar(require("node:fs"));
|
|
31
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
32
32
|
const remotion_1 = require("remotion");
|
|
33
33
|
const calculate_asset_positions_1 = require("./assets/calculate-asset-positions");
|
|
34
34
|
const convert_assets_to_file_urls_1 = require("./assets/convert-assets-to-file-urls");
|
|
@@ -55,9 +55,9 @@ const prores_profile_1 = require("./prores-profile");
|
|
|
55
55
|
const truthy_1 = require("./truthy");
|
|
56
56
|
const validate_even_dimensions_with_codec_1 = require("./validate-even-dimensions-with-codec");
|
|
57
57
|
const validate_videobitrate_1 = require("./validate-videobitrate");
|
|
58
|
-
const packageJsonPath =
|
|
59
|
-
const packageJson =
|
|
60
|
-
? JSON.parse(
|
|
58
|
+
const packageJsonPath = node_path_1.default.join(__dirname, '..', 'package.json');
|
|
59
|
+
const packageJson = node_fs_1.default.existsSync(packageJsonPath)
|
|
60
|
+
? JSON.parse(node_fs_1.default.readFileSync(packageJsonPath, 'utf-8'))
|
|
61
61
|
: null;
|
|
62
62
|
const getAssetsData = async ({ assets, onDownload, fps, expectedFrames, verbose, onProgress, downloadMap, remotionRoot, }) => {
|
|
63
63
|
const fileUrlAssets = await (0, convert_assets_to_file_urls_1.convertAssetsToFileUrls)({
|
|
@@ -75,7 +75,7 @@ const getAssetsData = async ({ assets, onDownload, fps, expectedFrames, verbose,
|
|
|
75
75
|
onProgress(preprocessProgress.reduce((a, b) => a + b, 0) / assetPositions.length);
|
|
76
76
|
};
|
|
77
77
|
const preprocessed = (await Promise.all(assetPositions.map(async (asset, index) => {
|
|
78
|
-
const filterFile =
|
|
78
|
+
const filterFile = node_path_1.default.join(downloadMap.audioMixing, `${index}.wav`);
|
|
79
79
|
const result = await (0, preprocess_audio_track_1.preprocessAudioTrack)({
|
|
80
80
|
outName: filterFile,
|
|
81
81
|
asset,
|
|
@@ -87,7 +87,7 @@ const getAssetsData = async ({ assets, onDownload, fps, expectedFrames, verbose,
|
|
|
87
87
|
updateProgress();
|
|
88
88
|
return result;
|
|
89
89
|
}))).filter(truthy_1.truthy);
|
|
90
|
-
const outName =
|
|
90
|
+
const outName = node_path_1.default.join(downloadMap.audioPreprocessing, `audio.wav`);
|
|
91
91
|
await (0, merge_audio_track_1.mergeAudioTrack)({
|
|
92
92
|
files: preprocessed,
|
|
93
93
|
outName,
|
|
@@ -138,7 +138,7 @@ const spawnFfmpeg = async (options, remotionRoot) => {
|
|
|
138
138
|
: (_d = options.audioCodec) !== null && _d !== void 0 ? _d : (0, audio_codec_1.getDefaultAudioCodec)({ codec, preferLossless: false });
|
|
139
139
|
const tempFile = options.outputLocation
|
|
140
140
|
? null
|
|
141
|
-
:
|
|
141
|
+
: node_path_1.default.join(options.assetsInfo.downloadMap.stitchFrames, `out.${(0, get_extension_from_codec_1.getFileExtensionFromCodec)(codec, resolvedAudioCodec)}`);
|
|
142
142
|
if (options.verbose) {
|
|
143
143
|
console.log('[verbose] ffmpeg', (0, get_executable_path_1.getExecutablePath)('ffmpeg'));
|
|
144
144
|
console.log('[verbose] encoder', encoderName);
|
|
@@ -197,11 +197,11 @@ const spawnFfmpeg = async (options, remotionRoot) => {
|
|
|
197
197
|
await ffmpegTask;
|
|
198
198
|
(_j = options.onProgress) === null || _j === void 0 ? void 0 : _j.call(options, expectedFrames);
|
|
199
199
|
if (audio) {
|
|
200
|
-
(0, delete_directory_1.deleteDirectory)(
|
|
200
|
+
(0, delete_directory_1.deleteDirectory)(node_path_1.default.dirname(audio));
|
|
201
201
|
}
|
|
202
202
|
const file = await new Promise((resolve, reject) => {
|
|
203
203
|
if (tempFile) {
|
|
204
|
-
|
|
204
|
+
node_fs_1.promises
|
|
205
205
|
.readFile(tempFile)
|
|
206
206
|
.then((f) => {
|
|
207
207
|
return resolve(f);
|
|
@@ -219,10 +219,10 @@ const spawnFfmpeg = async (options, remotionRoot) => {
|
|
|
219
219
|
};
|
|
220
220
|
}
|
|
221
221
|
const ffmpegArgs = [
|
|
222
|
-
['-r', String(options.fps)],
|
|
223
222
|
...(((_k = options.internalOptions) === null || _k === void 0 ? void 0 : _k.preEncodedFileLocation)
|
|
224
223
|
? [['-i', (_l = options.internalOptions) === null || _l === void 0 ? void 0 : _l.preEncodedFileLocation]]
|
|
225
224
|
: [
|
|
225
|
+
['-r', String(options.fps)],
|
|
226
226
|
['-f', 'image2'],
|
|
227
227
|
['-s', `${options.width}x${options.height}`],
|
|
228
228
|
['-start_number', String(options.assetsInfo.firstFrameIndex)],
|
|
@@ -317,12 +317,12 @@ const spawnFfmpeg = async (options, remotionRoot) => {
|
|
|
317
317
|
(0, delete_directory_1.deleteDirectory)(options.assetsInfo.downloadMap.stitchFrames);
|
|
318
318
|
return null;
|
|
319
319
|
}
|
|
320
|
-
return
|
|
320
|
+
return node_fs_1.promises
|
|
321
321
|
.readFile(tempFile)
|
|
322
322
|
.then((file) => {
|
|
323
323
|
return Promise.all([
|
|
324
324
|
file,
|
|
325
|
-
(0, delete_directory_1.deleteDirectory)(
|
|
325
|
+
(0, delete_directory_1.deleteDirectory)(node_path_1.default.dirname(tempFile)),
|
|
326
326
|
(0, delete_directory_1.deleteDirectory)(options.assetsInfo.downloadMap.stitchFrames),
|
|
327
327
|
]);
|
|
328
328
|
})
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.takeFrameAndCompose = void 0;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const compose_1 = require("./compositor/compose");
|
|
10
10
|
const provide_screenshot_1 = require("./provide-screenshot");
|
|
11
11
|
const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
|
|
@@ -39,8 +39,8 @@ const takeFrameAndCompose = async ({ freePage, imageFormat, jpegQuality, frame,
|
|
|
39
39
|
const needsComposing = clipRegion === null
|
|
40
40
|
? null
|
|
41
41
|
: {
|
|
42
|
-
tmpFile:
|
|
43
|
-
finalOutFile: output !== null && output !== void 0 ? output :
|
|
42
|
+
tmpFile: node_path_1.default.join(downloadMap.compositingDir, `${frame}.${imageFormat}`),
|
|
43
|
+
finalOutFile: output !== null && output !== void 0 ? output : node_path_1.default.join(downloadMap.compositingDir, `${frame}-final.${imageFormat}`),
|
|
44
44
|
clipRegion: clipRegion,
|
|
45
45
|
};
|
|
46
46
|
if (clipRegion !== 'hide') {
|
|
@@ -92,8 +92,8 @@ const takeFrameAndCompose = async ({ freePage, imageFormat, jpegQuality, frame,
|
|
|
92
92
|
imageFormat: imageFormat === 'jpeg' ? 'Jpeg' : 'Png',
|
|
93
93
|
});
|
|
94
94
|
if (wantsBuffer) {
|
|
95
|
-
const buffer = await
|
|
96
|
-
await
|
|
95
|
+
const buffer = await node_fs_1.default.promises.readFile(needsComposing.finalOutFile);
|
|
96
|
+
await node_fs_1.default.promises.unlink(needsComposing.finalOutFile);
|
|
97
97
|
return { buffer, collectedAssets };
|
|
98
98
|
}
|
|
99
99
|
}
|
package/dist/tmp-dir.js
CHANGED
|
@@ -27,9 +27,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.tmpDir = void 0;
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
30
|
+
const node_fs_1 = __importStar(require("node:fs"));
|
|
31
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
32
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
33
33
|
const alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
|
34
34
|
const randomHash = () => {
|
|
35
35
|
return new Array(10)
|
|
@@ -40,14 +40,14 @@ const randomHash = () => {
|
|
|
40
40
|
.join('');
|
|
41
41
|
};
|
|
42
42
|
const tmpDir = (str) => {
|
|
43
|
-
const newDir =
|
|
44
|
-
if (
|
|
45
|
-
|
|
43
|
+
const newDir = node_path_1.default.join(node_os_1.default.tmpdir(), str + randomHash());
|
|
44
|
+
if (node_fs_1.default.existsSync(newDir)) {
|
|
45
|
+
node_fs_1.default.rmSync(newDir, {
|
|
46
46
|
recursive: true,
|
|
47
47
|
force: true,
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
(0,
|
|
50
|
+
(0, node_fs_1.mkdirSync)(newDir);
|
|
51
51
|
return newDir;
|
|
52
52
|
};
|
|
53
53
|
exports.tmpDir = tmpDir;
|
package/install-toolchain.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {execSync} from 'child_process';
|
|
2
|
-
import {existsSync, mkdirSync, unlinkSync} from 'fs';
|
|
1
|
+
import {execSync} from 'node:child_process';
|
|
2
|
+
import {existsSync, mkdirSync, unlinkSync} from 'node:fs';
|
|
3
3
|
import {toolchains} from './toolchains.mjs';
|
|
4
4
|
|
|
5
5
|
const unpatched = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/renderer",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-alpha6",
|
|
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": "4.0.0-
|
|
19
|
+
"remotion": "4.0.0-alpha6",
|
|
20
20
|
"source-map": "^0.8.0-beta.0",
|
|
21
21
|
"ws": "8.7.0"
|
|
22
22
|
},
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"zod": "^3.21.4"
|
|
43
43
|
},
|
|
44
44
|
"optionalDependencies": {
|
|
45
|
-
"@remotion/compositor-darwin-arm64": "4.0.0-
|
|
46
|
-
"@remotion/compositor-darwin-x64": "4.0.0-
|
|
47
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.0-
|
|
48
|
-
"@remotion/compositor-linux-arm64-musl": "4.0.0-
|
|
49
|
-
"@remotion/compositor-linux-x64-gnu": "4.0.0-
|
|
50
|
-
"@remotion/compositor-linux-x64-musl": "4.0.0-
|
|
51
|
-
"@remotion/compositor-win32-x64-msvc": "4.0.0-
|
|
45
|
+
"@remotion/compositor-darwin-arm64": "4.0.0-alpha6",
|
|
46
|
+
"@remotion/compositor-darwin-x64": "4.0.0-alpha6",
|
|
47
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.0-alpha6",
|
|
48
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.0-alpha6",
|
|
49
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.0-alpha6",
|
|
50
|
+
"@remotion/compositor-linux-x64-musl": "4.0.0-alpha6",
|
|
51
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.0-alpha6"
|
|
52
52
|
},
|
|
53
53
|
"keywords": [
|
|
54
54
|
"remotion",
|
package/types/ws/index.d.ts
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
/* eslint-disable no-dupe-class-members */
|
|
7
7
|
/// <reference types="node" />
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import type {Server as HTTPSServer} from 'https';
|
|
10
|
+
import {EventEmitter} from 'node:events';
|
|
10
11
|
import type {
|
|
11
12
|
Agent,
|
|
12
13
|
ClientRequest,
|
|
@@ -14,12 +15,11 @@ import type {
|
|
|
14
15
|
IncomingMessage,
|
|
15
16
|
OutgoingHttpHeaders,
|
|
16
17
|
Server as HTTPServer,
|
|
17
|
-
} from 'http';
|
|
18
|
-
import type {
|
|
18
|
+
} from 'node:http';
|
|
19
|
+
import type {URL} from 'node:url';
|
|
20
|
+
import type {ZlibOptions} from 'node:zlib';
|
|
19
21
|
import type {Duplex, DuplexOptions} from 'stream';
|
|
20
22
|
import type {SecureContextOptions} from 'tls';
|
|
21
|
-
import type {URL} from 'url';
|
|
22
|
-
import type {ZlibOptions} from 'zlib';
|
|
23
23
|
declare class WebSocket extends EventEmitter {
|
|
24
24
|
/** The connection is not yet open. */
|
|
25
25
|
static readonly CONNECTING: 0;
|