@remotion/renderer 4.0.287 → 4.0.289
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-map.js +3 -46
- package/dist/esm/index.mjs +30 -35
- package/ensure-browser.mjs +47 -40
- package/package.json +12 -12
- package/happydom.ts +0 -6
|
@@ -1,44 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
38
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
6
|
exports.cleanDownloadMap = exports.makeDownloadMap = void 0;
|
|
40
|
-
const node_fs_1 =
|
|
7
|
+
const node_fs_1 = require("node:fs");
|
|
41
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const version_1 = require("remotion/version");
|
|
42
10
|
const delete_directory_1 = require("../delete-directory");
|
|
43
11
|
const offthread_video_server_1 = require("../offthread-video-server");
|
|
44
12
|
const tmp_dir_1 = require("../tmp-dir");
|
|
@@ -47,19 +15,8 @@ const makeAndReturn = (dir, name) => {
|
|
|
47
15
|
(0, node_fs_1.mkdirSync)(p);
|
|
48
16
|
return p;
|
|
49
17
|
};
|
|
50
|
-
const dontInlineThis = 'package.json';
|
|
51
|
-
let packageJsonPath = null;
|
|
52
|
-
try {
|
|
53
|
-
packageJsonPath = require.resolve('../../' + dontInlineThis);
|
|
54
|
-
}
|
|
55
|
-
catch (_a) { }
|
|
56
|
-
const packageJson = packageJsonPath && node_fs_1.default.existsSync(packageJsonPath)
|
|
57
|
-
? JSON.parse(node_fs_1.default.readFileSync(packageJsonPath, 'utf-8'))
|
|
58
|
-
: null;
|
|
59
18
|
const makeDownloadMap = () => {
|
|
60
|
-
const dir = (0, tmp_dir_1.tmpDir)(
|
|
61
|
-
? `remotion-v${packageJson.version.replace(/\./g, '-')}-assets`
|
|
62
|
-
: 'remotion-assets');
|
|
19
|
+
const dir = (0, tmp_dir_1.tmpDir)(`remotion-v${version_1.VERSION}-assets`);
|
|
63
20
|
let prevented = false;
|
|
64
21
|
return {
|
|
65
22
|
isDownloadingMap: {},
|
package/dist/esm/index.mjs
CHANGED
|
@@ -14501,8 +14501,9 @@ var attachDownloadListenerToEmitter = (downloadMap, onDownload) => {
|
|
|
14501
14501
|
};
|
|
14502
14502
|
|
|
14503
14503
|
// src/assets/download-map.ts
|
|
14504
|
-
import
|
|
14504
|
+
import { mkdirSync as mkdirSync2 } from "node:fs";
|
|
14505
14505
|
import path14 from "node:path";
|
|
14506
|
+
import { VERSION as VERSION2 } from "remotion/version";
|
|
14506
14507
|
|
|
14507
14508
|
// src/offthread-video-server.ts
|
|
14508
14509
|
import { URLSearchParams } from "node:url";
|
|
@@ -14931,14 +14932,8 @@ var makeAndReturn = (dir, name) => {
|
|
|
14931
14932
|
mkdirSync2(p);
|
|
14932
14933
|
return p;
|
|
14933
14934
|
};
|
|
14934
|
-
var dontInlineThis = "package.json";
|
|
14935
|
-
var packageJsonPath = null;
|
|
14936
|
-
try {
|
|
14937
|
-
packageJsonPath = __require.resolve("../../" + dontInlineThis);
|
|
14938
|
-
} catch {}
|
|
14939
|
-
var packageJson = packageJsonPath && fs12.existsSync(packageJsonPath) ? JSON.parse(fs12.readFileSync(packageJsonPath, "utf-8")) : null;
|
|
14940
14935
|
var makeDownloadMap = () => {
|
|
14941
|
-
const dir = tmpDir(
|
|
14936
|
+
const dir = tmpDir(`remotion-v${VERSION2}-assets`);
|
|
14942
14937
|
let prevented = false;
|
|
14943
14938
|
return {
|
|
14944
14939
|
isDownloadingMap: {},
|
|
@@ -15990,7 +15985,7 @@ var seekToFrame = async ({
|
|
|
15990
15985
|
};
|
|
15991
15986
|
|
|
15992
15987
|
// src/set-props-and-env.ts
|
|
15993
|
-
import { VERSION as
|
|
15988
|
+
import { VERSION as VERSION3 } from "remotion/version";
|
|
15994
15989
|
|
|
15995
15990
|
// src/goto-page-or-throw.ts
|
|
15996
15991
|
var gotoPageOrThrow = async (page, urlToVisit, actualTimeout) => {
|
|
@@ -16179,7 +16174,7 @@ var innerSetPropsAndEnv = async ({
|
|
|
16179
16174
|
throw new Error([
|
|
16180
16175
|
`Incompatible site: When visiting ${urlToVisit}, a bundle was found, but one that is not compatible with this version of Remotion. Found version: ${siteVersion} - Required version: ${requiredVersion}. To resolve this error:`,
|
|
16181
16176
|
"When using server-side rendering:",
|
|
16182
|
-
` ▸ Use 'bundle()' with '@remotion/bundler' of version ${
|
|
16177
|
+
` ▸ Use 'bundle()' with '@remotion/bundler' of version ${VERSION3} to create a compatible bundle.`,
|
|
16183
16178
|
"When using the Remotion Lambda:",
|
|
16184
16179
|
" ▸ Use `npx remotion lambda sites create` to redeploy the site with the latest version.",
|
|
16185
16180
|
" ℹ Use --site-name with the same name as before to overwrite your site.",
|
|
@@ -16187,13 +16182,13 @@ var innerSetPropsAndEnv = async ({
|
|
|
16187
16182
|
].join(`
|
|
16188
16183
|
`));
|
|
16189
16184
|
}
|
|
16190
|
-
if (remotionVersion !==
|
|
16185
|
+
if (remotionVersion !== VERSION3 && true) {
|
|
16191
16186
|
if (remotionVersion) {
|
|
16192
16187
|
Log.warn({
|
|
16193
16188
|
indent,
|
|
16194
16189
|
logLevel
|
|
16195
16190
|
}, [
|
|
16196
|
-
`The site was bundled with version ${remotionVersion} of @remotion/bundler, while @remotion/renderer is on version ${
|
|
16191
|
+
`The site was bundled with version ${remotionVersion} of @remotion/bundler, while @remotion/renderer is on version ${VERSION3}. You may not have the newest bugfixes and features.`,
|
|
16197
16192
|
`To resolve this warning:`,
|
|
16198
16193
|
"▸ Use `npx remotion lambda sites create` to redeploy the site with the latest version.",
|
|
16199
16194
|
" ℹ Use --site-name with the same name as before to overwrite your site.",
|
|
@@ -16204,7 +16199,7 @@ var innerSetPropsAndEnv = async ({
|
|
|
16204
16199
|
Log.warn({
|
|
16205
16200
|
indent,
|
|
16206
16201
|
logLevel
|
|
16207
|
-
}, `The site was bundled with an old version of Remotion, while @remotion/renderer is on version ${
|
|
16202
|
+
}, `The site was bundled with an old version of Remotion, while @remotion/renderer is on version ${VERSION3}. You may not have the newest bugfixes and features. Re-bundle the site to fix this issue.`);
|
|
16208
16203
|
}
|
|
16209
16204
|
}
|
|
16210
16205
|
};
|
|
@@ -16903,7 +16898,7 @@ var validateSelectedPixelFormatAndCodecCombination = (pixelFormat, codec) => {
|
|
|
16903
16898
|
};
|
|
16904
16899
|
|
|
16905
16900
|
// src/render-frames.ts
|
|
16906
|
-
import
|
|
16901
|
+
import fs13 from "node:fs";
|
|
16907
16902
|
import path20 from "node:path";
|
|
16908
16903
|
import { NoReactInternals as NoReactInternals12 } from "remotion/no-react";
|
|
16909
16904
|
|
|
@@ -16957,7 +16952,7 @@ var cycleBrowserTabs = ({
|
|
|
16957
16952
|
// src/combine-audio.ts
|
|
16958
16953
|
import { rmSync as rmSync2, writeFileSync } from "fs";
|
|
16959
16954
|
import { join as join3 } from "path";
|
|
16960
|
-
import { VERSION as
|
|
16955
|
+
import { VERSION as VERSION4 } from "remotion/version";
|
|
16961
16956
|
|
|
16962
16957
|
// src/options/separate-audio.tsx
|
|
16963
16958
|
var DEFAULT = null;
|
|
@@ -17221,7 +17216,7 @@ var encodeAudio = async ({
|
|
|
17221
17216
|
audioBitrate ? audioBitrate : "320k",
|
|
17222
17217
|
"-vn",
|
|
17223
17218
|
addRemotionMetadata ? `-metadata` : null,
|
|
17224
|
-
addRemotionMetadata ? `comment=Made with Remotion ${
|
|
17219
|
+
addRemotionMetadata ? `comment=Made with Remotion ${VERSION4}` : null,
|
|
17225
17220
|
"-y",
|
|
17226
17221
|
output
|
|
17227
17222
|
];
|
|
@@ -17297,7 +17292,7 @@ var combineAudioSeamlessly = async ({
|
|
|
17297
17292
|
"copy",
|
|
17298
17293
|
"-vn",
|
|
17299
17294
|
addRemotionMetadata ? `-metadata` : null,
|
|
17300
|
-
addRemotionMetadata ? `comment=Made with Remotion ${
|
|
17295
|
+
addRemotionMetadata ? `comment=Made with Remotion ${VERSION4}` : null,
|
|
17301
17296
|
"-y",
|
|
17302
17297
|
output
|
|
17303
17298
|
];
|
|
@@ -17761,7 +17756,7 @@ var collectAssets = async ({
|
|
|
17761
17756
|
import * as assert2 from "node:assert";
|
|
17762
17757
|
|
|
17763
17758
|
// src/screenshot-task.ts
|
|
17764
|
-
import
|
|
17759
|
+
import fs12 from "node:fs";
|
|
17765
17760
|
var screenshotTask = async ({
|
|
17766
17761
|
format,
|
|
17767
17762
|
height,
|
|
@@ -17824,7 +17819,7 @@ var screenshotTask = async ({
|
|
|
17824
17819
|
const saveMarker = startPerfMeasure("save");
|
|
17825
17820
|
const buffer = Buffer.from(result.data, "base64");
|
|
17826
17821
|
if (path19)
|
|
17827
|
-
await
|
|
17822
|
+
await fs12.promises.writeFile(path19, buffer);
|
|
17828
17823
|
stopPerfMeasure(saveMarker);
|
|
17829
17824
|
return buffer;
|
|
17830
17825
|
} catch (err) {
|
|
@@ -18477,8 +18472,8 @@ var innerRenderFrames = async ({
|
|
|
18477
18472
|
binariesDirectory
|
|
18478
18473
|
}) => {
|
|
18479
18474
|
if (outputDir) {
|
|
18480
|
-
if (!
|
|
18481
|
-
|
|
18475
|
+
if (!fs13.existsSync(outputDir)) {
|
|
18476
|
+
fs13.mkdirSync(outputDir, {
|
|
18482
18477
|
recursive: true
|
|
18483
18478
|
});
|
|
18484
18479
|
}
|
|
@@ -18886,7 +18881,7 @@ var renderFrames = (options) => {
|
|
|
18886
18881
|
};
|
|
18887
18882
|
|
|
18888
18883
|
// src/render-media.ts
|
|
18889
|
-
import
|
|
18884
|
+
import fs15 from "node:fs";
|
|
18890
18885
|
import os6 from "node:os";
|
|
18891
18886
|
import path25 from "node:path";
|
|
18892
18887
|
import { NoReactInternals as NoReactInternals14 } from "remotion/no-react";
|
|
@@ -19774,7 +19769,7 @@ var createFfmpegMergeFilter = ({
|
|
|
19774
19769
|
};
|
|
19775
19770
|
|
|
19776
19771
|
// src/ffmpeg-filter-file.ts
|
|
19777
|
-
import
|
|
19772
|
+
import fs14, { existsSync as existsSync5 } from "node:fs";
|
|
19778
19773
|
import path21 from "node:path";
|
|
19779
19774
|
var makeFfmpegFilterFile = (complexFilter, downloadMap) => {
|
|
19780
19775
|
return makeFfmpegFilterFileStr(complexFilter.filter, downloadMap);
|
|
@@ -19783,13 +19778,13 @@ var makeFfmpegFilterFileStr = async (complexFilter, downloadMap) => {
|
|
|
19783
19778
|
const random2 = Math.random().toString().replace(".", "");
|
|
19784
19779
|
const filterFile = path21.join(downloadMap.complexFilter, "complex-filter-" + random2 + ".txt");
|
|
19785
19780
|
if (!existsSync5(downloadMap.complexFilter)) {
|
|
19786
|
-
|
|
19781
|
+
fs14.mkdirSync(downloadMap.complexFilter, { recursive: true });
|
|
19787
19782
|
}
|
|
19788
|
-
await
|
|
19783
|
+
await fs14.promises.writeFile(filterFile, complexFilter);
|
|
19789
19784
|
return {
|
|
19790
19785
|
file: filterFile,
|
|
19791
19786
|
cleanup: () => {
|
|
19792
|
-
|
|
19787
|
+
fs14.unlinkSync(filterFile);
|
|
19793
19788
|
}
|
|
19794
19789
|
};
|
|
19795
19790
|
};
|
|
@@ -20401,9 +20396,9 @@ var createAudio = async ({
|
|
|
20401
20396
|
};
|
|
20402
20397
|
|
|
20403
20398
|
// src/make-metadata-args.ts
|
|
20404
|
-
import { VERSION as
|
|
20399
|
+
import { VERSION as VERSION5 } from "remotion/version";
|
|
20405
20400
|
var makeMetadataArgs = (metadata) => {
|
|
20406
|
-
const defaultComment = `Made with Remotion ${
|
|
20401
|
+
const defaultComment = `Made with Remotion ${VERSION5}`;
|
|
20407
20402
|
const newMetadata = {
|
|
20408
20403
|
comment: defaultComment
|
|
20409
20404
|
};
|
|
@@ -21080,7 +21075,7 @@ var internalRenderMediaRaw = ({
|
|
|
21080
21075
|
}
|
|
21081
21076
|
const imageFormat = isAudioCodec(codec) ? "none" : provisionalImageFormat;
|
|
21082
21077
|
validateSelectedPixelFormatAndImageFormatCombination(pixelFormat, imageFormat);
|
|
21083
|
-
const workingDir =
|
|
21078
|
+
const workingDir = fs15.mkdtempSync(path25.join(os6.tmpdir(), "react-motion-render"));
|
|
21084
21079
|
const preEncodedFileLocation = parallelEncoding ? path25.join(workingDir, "pre-encode." + getFileExtensionFromCodec(codec, audioCodec)) : null;
|
|
21085
21080
|
if (onCtrlCExit && workingDir) {
|
|
21086
21081
|
onCtrlCExit(`Delete ${workingDir}`, () => deleteDirectory(workingDir));
|
|
@@ -21365,10 +21360,10 @@ var internalRenderMediaRaw = ({
|
|
|
21365
21360
|
}
|
|
21366
21361
|
reject(err);
|
|
21367
21362
|
}).finally(() => {
|
|
21368
|
-
if (preEncodedFileLocation !== null &&
|
|
21363
|
+
if (preEncodedFileLocation !== null && fs15.existsSync(preEncodedFileLocation)) {
|
|
21369
21364
|
deleteDirectory(path25.dirname(preEncodedFileLocation));
|
|
21370
21365
|
}
|
|
21371
|
-
if (workingDir &&
|
|
21366
|
+
if (workingDir && fs15.existsSync(workingDir)) {
|
|
21372
21367
|
deleteDirectory(workingDir);
|
|
21373
21368
|
}
|
|
21374
21369
|
cleanupServerFn?.(false).catch((err) => {
|
|
@@ -21526,7 +21521,7 @@ var renderMedia = ({
|
|
|
21526
21521
|
};
|
|
21527
21522
|
|
|
21528
21523
|
// src/render-still.ts
|
|
21529
|
-
import
|
|
21524
|
+
import fs16, { statSync as statSync2 } from "node:fs";
|
|
21530
21525
|
import path26 from "node:path";
|
|
21531
21526
|
import { NoReactInternals as NoReactInternals15 } from "remotion/no-react";
|
|
21532
21527
|
var innerRenderStill = async ({
|
|
@@ -21578,7 +21573,7 @@ var innerRenderStill = async ({
|
|
|
21578
21573
|
output = typeof output === "string" ? path26.resolve(process.cwd(), output) : null;
|
|
21579
21574
|
validateJpegQuality(jpegQuality);
|
|
21580
21575
|
if (output) {
|
|
21581
|
-
if (
|
|
21576
|
+
if (fs16.existsSync(output)) {
|
|
21582
21577
|
if (!overwrite) {
|
|
21583
21578
|
throw new Error(`Cannot render still - "overwrite" option was set to false, but the output destination ${output} already exists.`);
|
|
21584
21579
|
}
|
|
@@ -22177,7 +22172,7 @@ var canConcatVideoSeamlessly = (codec) => {
|
|
|
22177
22172
|
// src/combine-video-streams.ts
|
|
22178
22173
|
import { rmSync as rmSync4, writeFileSync as writeFileSync2 } from "fs";
|
|
22179
22174
|
import { join as join4 } from "path";
|
|
22180
|
-
import { VERSION as
|
|
22175
|
+
import { VERSION as VERSION6 } from "remotion/version";
|
|
22181
22176
|
var combineVideoStreams = async ({
|
|
22182
22177
|
fps,
|
|
22183
22178
|
codec,
|
|
@@ -22217,7 +22212,7 @@ var combineVideoStreams = async ({
|
|
|
22217
22212
|
codec === "h265" ? "-tag:v" : null,
|
|
22218
22213
|
codec === "h265" ? "hvc1" : null,
|
|
22219
22214
|
addRemotionMetadata ? `-metadata` : null,
|
|
22220
|
-
addRemotionMetadata ? `comment=Made with Remotion ${
|
|
22215
|
+
addRemotionMetadata ? `comment=Made with Remotion ${VERSION6}` : null,
|
|
22221
22216
|
"-y",
|
|
22222
22217
|
output
|
|
22223
22218
|
].filter(truthy);
|
package/ensure-browser.mjs
CHANGED
|
@@ -412,8 +412,7 @@ var require_browser = __commonJS((exports, module) => {
|
|
|
412
412
|
});
|
|
413
413
|
args.splice(lastC, 0, c);
|
|
414
414
|
}
|
|
415
|
-
exports.log = console.debug || console.log || (() => {
|
|
416
|
-
});
|
|
415
|
+
exports.log = console.debug || console.log || (() => {});
|
|
417
416
|
function save(namespaces) {
|
|
418
417
|
try {
|
|
419
418
|
if (namespaces) {
|
|
@@ -421,15 +420,13 @@ var require_browser = __commonJS((exports, module) => {
|
|
|
421
420
|
} else {
|
|
422
421
|
exports.storage.removeItem("debug");
|
|
423
422
|
}
|
|
424
|
-
} catch (error) {
|
|
425
|
-
}
|
|
423
|
+
} catch (error) {}
|
|
426
424
|
}
|
|
427
425
|
function load() {
|
|
428
426
|
let r;
|
|
429
427
|
try {
|
|
430
428
|
r = exports.storage.getItem("debug");
|
|
431
|
-
} catch (error) {
|
|
432
|
-
}
|
|
429
|
+
} catch (error) {}
|
|
433
430
|
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
434
431
|
r = process.env.DEBUG;
|
|
435
432
|
}
|
|
@@ -438,8 +435,7 @@ var require_browser = __commonJS((exports, module) => {
|
|
|
438
435
|
function localstorage() {
|
|
439
436
|
try {
|
|
440
437
|
return localStorage;
|
|
441
|
-
} catch (error) {
|
|
442
|
-
}
|
|
438
|
+
} catch (error) {}
|
|
443
439
|
}
|
|
444
440
|
module.exports = require_common()(exports);
|
|
445
441
|
var { formatters } = module.exports;
|
|
@@ -571,8 +567,7 @@ var require_node = __commonJS((exports, module) => {
|
|
|
571
567
|
exports.save = save;
|
|
572
568
|
exports.load = load;
|
|
573
569
|
exports.useColors = useColors;
|
|
574
|
-
exports.destroy = util.deprecate(() => {
|
|
575
|
-
}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
570
|
+
exports.destroy = util.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
576
571
|
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
577
572
|
try {
|
|
578
573
|
const supportsColor = require_supports_color();
|
|
@@ -656,8 +651,7 @@ var require_node = __commonJS((exports, module) => {
|
|
|
656
651
|
221
|
|
657
652
|
];
|
|
658
653
|
}
|
|
659
|
-
} catch (error) {
|
|
660
|
-
}
|
|
654
|
+
} catch (error) {}
|
|
661
655
|
exports.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
662
656
|
return /^debug_/i.test(key);
|
|
663
657
|
}).reduce((obj, key) => {
|
|
@@ -818,8 +812,7 @@ var require_once = __commonJS((exports, module) => {
|
|
|
818
812
|
// ../../node_modules/.pnpm/end-of-stream@1.4.4/node_modules/end-of-stream/index.js
|
|
819
813
|
var require_end_of_stream = __commonJS((exports, module) => {
|
|
820
814
|
var once = require_once();
|
|
821
|
-
var noop = function() {
|
|
822
|
-
};
|
|
815
|
+
var noop = function() {};
|
|
823
816
|
var isRequest = function(stream) {
|
|
824
817
|
return stream.setHeader && typeof stream.abort === "function";
|
|
825
818
|
};
|
|
@@ -913,8 +906,7 @@ var require_pump = __commonJS((exports, module) => {
|
|
|
913
906
|
var once = require_once();
|
|
914
907
|
var eos = require_end_of_stream();
|
|
915
908
|
var fs = __require("fs");
|
|
916
|
-
var noop = function() {
|
|
917
|
-
};
|
|
909
|
+
var noop = function() {};
|
|
918
910
|
var ancient = /^v?\.0/.test(process.version);
|
|
919
911
|
var isFn = function(fn) {
|
|
920
912
|
return typeof fn === "function";
|
|
@@ -2207,8 +2199,7 @@ var require_yauzl = __commonJS((exports) => {
|
|
|
2207
2199
|
}
|
|
2208
2200
|
});
|
|
2209
2201
|
};
|
|
2210
|
-
function Entry() {
|
|
2211
|
-
}
|
|
2202
|
+
function Entry() {}
|
|
2212
2203
|
Entry.prototype.getLastModDate = function() {
|
|
2213
2204
|
return dosDateTimeToDate(this.lastModFileDate, this.lastModFileTime);
|
|
2214
2205
|
};
|
|
@@ -2826,13 +2817,15 @@ var getClient = (url) => {
|
|
|
2826
2817
|
var readFileWithoutRedirect = (url) => {
|
|
2827
2818
|
return new Promise((resolve, reject) => {
|
|
2828
2819
|
const client = getClient(url);
|
|
2829
|
-
client(url, typeof Bun === "undefined" ? {
|
|
2820
|
+
const req = client(url, typeof Bun === "undefined" ? {
|
|
2830
2821
|
headers: {
|
|
2831
2822
|
"user-agent": "Mozilla/5.0 (@remotion/renderer - https://remotion.dev)"
|
|
2832
2823
|
}
|
|
2833
2824
|
} : {}, (res) => {
|
|
2834
|
-
resolve(res);
|
|
2835
|
-
})
|
|
2825
|
+
resolve({ request: req, response: res });
|
|
2826
|
+
});
|
|
2827
|
+
req.on("error", (err) => {
|
|
2828
|
+
req.destroy();
|
|
2836
2829
|
return reject(err);
|
|
2837
2830
|
});
|
|
2838
2831
|
});
|
|
@@ -2841,19 +2834,23 @@ var readFile = async (url, redirectsSoFar = 0) => {
|
|
|
2841
2834
|
if (redirectsSoFar > 10) {
|
|
2842
2835
|
throw new Error(`Too many redirects while downloading ${url}`);
|
|
2843
2836
|
}
|
|
2844
|
-
const
|
|
2845
|
-
if (redirectStatusCodes.includes(
|
|
2846
|
-
if (!
|
|
2847
|
-
throw new Error(`Received a status code ${
|
|
2837
|
+
const { request, response } = await readFileWithoutRedirect(url);
|
|
2838
|
+
if (redirectStatusCodes.includes(response.statusCode)) {
|
|
2839
|
+
if (!response.headers.location) {
|
|
2840
|
+
throw new Error(`Received a status code ${response.statusCode} but no "Location" header while calling ${response.headers.location}`);
|
|
2848
2841
|
}
|
|
2849
2842
|
const { origin } = new URL(url);
|
|
2850
|
-
const redirectUrl = new URL(
|
|
2843
|
+
const redirectUrl = new URL(response.headers.location, origin).toString();
|
|
2844
|
+
request.destroy();
|
|
2845
|
+
response.destroy();
|
|
2851
2846
|
return readFile(redirectUrl, redirectsSoFar + 1);
|
|
2852
2847
|
}
|
|
2853
|
-
if (
|
|
2854
|
-
const body = await tryToObtainBody(
|
|
2848
|
+
if (response.statusCode >= 400) {
|
|
2849
|
+
const body = await tryToObtainBody(response);
|
|
2850
|
+
request.destroy();
|
|
2851
|
+
response.destroy();
|
|
2855
2852
|
throw new Error([
|
|
2856
|
-
`Received a status code of ${
|
|
2853
|
+
`Received a status code of ${response.statusCode} while downloading file ${url}.`,
|
|
2857
2854
|
body ? `The response body was:` : null,
|
|
2858
2855
|
body ? `---` : null,
|
|
2859
2856
|
body ? body : null,
|
|
@@ -2861,7 +2858,7 @@ var readFile = async (url, redirectsSoFar = 0) => {
|
|
|
2861
2858
|
].filter(truthy).join(`
|
|
2862
2859
|
`));
|
|
2863
2860
|
}
|
|
2864
|
-
return
|
|
2861
|
+
return { request, response };
|
|
2865
2862
|
};
|
|
2866
2863
|
var tryToObtainBody = async (file) => {
|
|
2867
2864
|
const success = new Promise((resolve) => {
|
|
@@ -2923,12 +2920,19 @@ var downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
|
|
|
2923
2920
|
};
|
|
2924
2921
|
refreshTimeout();
|
|
2925
2922
|
let finishEventSent = false;
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2923
|
+
let closeConnection = () => {
|
|
2924
|
+
return;
|
|
2925
|
+
};
|
|
2926
|
+
readFile(url).then(({ response, request }) => {
|
|
2927
|
+
closeConnection = () => {
|
|
2928
|
+
request.destroy();
|
|
2929
|
+
response.destroy();
|
|
2930
|
+
};
|
|
2931
|
+
const contentDisposition = response.headers["content-disposition"] ?? null;
|
|
2932
|
+
const contentType = response.headers["content-type"] ?? null;
|
|
2929
2933
|
const to = toFn(contentDisposition, contentType);
|
|
2930
2934
|
ensureOutputDirectory(to);
|
|
2931
|
-
const sizeHeader =
|
|
2935
|
+
const sizeHeader = response.headers["content-length"];
|
|
2932
2936
|
const totalSize = typeof sizeHeader === "undefined" ? null : Number(sizeHeader);
|
|
2933
2937
|
const writeStream = createWriteStream(to);
|
|
2934
2938
|
let downloaded = 0;
|
|
@@ -2947,9 +2951,12 @@ var downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
|
|
|
2947
2951
|
return resolveAndFlag({ sizeInBytes: downloaded, to });
|
|
2948
2952
|
});
|
|
2949
2953
|
writeStream.on("error", (err) => rejectAndFlag(err));
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2954
|
+
response.on("error", (err) => {
|
|
2955
|
+
closeConnection();
|
|
2956
|
+
rejectAndFlag(err);
|
|
2957
|
+
});
|
|
2958
|
+
response.pipe(writeStream).on("error", (err) => rejectAndFlag(err));
|
|
2959
|
+
response.on("data", (d) => {
|
|
2953
2960
|
refreshTimeout();
|
|
2954
2961
|
downloaded += d.length;
|
|
2955
2962
|
refreshTimeout();
|
|
@@ -2963,11 +2970,12 @@ var downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
|
|
|
2963
2970
|
finishEventSent = true;
|
|
2964
2971
|
}
|
|
2965
2972
|
});
|
|
2966
|
-
|
|
2973
|
+
response.on("close", () => {
|
|
2967
2974
|
if (totalSize !== null && downloaded !== totalSize) {
|
|
2968
2975
|
rejectAndFlag(new Error(`${incorrectContentLengthToken} ${downloaded} bytes, but expected ${totalSize} bytes from 'Content-Length'.`));
|
|
2969
2976
|
}
|
|
2970
2977
|
writeStream.close();
|
|
2978
|
+
closeConnection();
|
|
2971
2979
|
});
|
|
2972
2980
|
}).catch((err) => {
|
|
2973
2981
|
rejectAndFlag(err);
|
|
@@ -3042,8 +3050,7 @@ var getDownloadsCacheDir = () => {
|
|
|
3042
3050
|
if (fs2.statSync(path2.join(dir, "package.json")).isFile()) {
|
|
3043
3051
|
break;
|
|
3044
3052
|
}
|
|
3045
|
-
} catch (e) {
|
|
3046
|
-
}
|
|
3053
|
+
} catch (e) {}
|
|
3047
3054
|
const parent = path2.dirname(dir);
|
|
3048
3055
|
if (dir === parent) {
|
|
3049
3056
|
dir = undefined;
|
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.289",
|
|
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.289",
|
|
22
|
+
"@remotion/streaming": "4.0.289"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": ">=16.8.0",
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
"react-dom": "19.0.0",
|
|
34
34
|
"@types/ws": "8.5.10",
|
|
35
35
|
"eslint": "9.19.0",
|
|
36
|
-
"@remotion/example-videos": "4.0.
|
|
37
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
36
|
+
"@remotion/example-videos": "4.0.289",
|
|
37
|
+
"@remotion/eslint-config-internal": "4.0.289"
|
|
38
38
|
},
|
|
39
39
|
"optionalDependencies": {
|
|
40
|
-
"@remotion/compositor-darwin-
|
|
41
|
-
"@remotion/compositor-linux-
|
|
42
|
-
"@remotion/compositor-linux-x64-
|
|
43
|
-
"@remotion/compositor-
|
|
44
|
-
"@remotion/compositor-linux-
|
|
45
|
-
"@remotion/compositor-win32-x64-msvc": "4.0.
|
|
46
|
-
"@remotion/compositor-
|
|
40
|
+
"@remotion/compositor-darwin-arm64": "4.0.289",
|
|
41
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.289",
|
|
42
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.289",
|
|
43
|
+
"@remotion/compositor-darwin-x64": "4.0.289",
|
|
44
|
+
"@remotion/compositor-linux-x64-musl": "4.0.289",
|
|
45
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.289",
|
|
46
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.289"
|
|
47
47
|
},
|
|
48
48
|
"keywords": [
|
|
49
49
|
"remotion",
|