@remotion/renderer 2.6.10 → 2.6.13
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/.turbo/turbo-build.log +2 -2
- package/.turbo/turbo-lint.log +21 -0
- package/dist/assets/sanitize-filepath.d.ts.map +1 -1
- package/dist/assets/sanitize-filepath.js +2 -1
- package/dist/assets/sanitize-filepath.js.map +1 -1
- package/dist/convert-mp3-to-pcm.d.ts +7 -0
- package/dist/convert-mp3-to-pcm.d.ts.map +1 -0
- package/dist/convert-mp3-to-pcm.js +41 -0
- package/dist/convert-mp3-to-pcm.js.map +1 -0
- package/dist/delay-render-embedded-stack.d.ts +2 -0
- package/dist/delay-render-embedded-stack.d.ts.map +1 -0
- package/dist/delay-render-embedded-stack.js +25 -0
- package/dist/delay-render-embedded-stack.js.map +1 -0
- package/dist/handle-javascript-exception.d.ts +16 -0
- package/dist/handle-javascript-exception.d.ts.map +1 -0
- package/dist/handle-javascript-exception.js +76 -0
- package/dist/handle-javascript-exception.js.map +1 -0
- package/dist/handle-null-audio.d.ts +1 -0
- package/dist/handle-null-audio.d.ts.map +1 -0
- package/dist/handle-null-audio.js +2 -0
- package/dist/handle-null-audio.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/is-local-file.d.ts +2 -0
- package/dist/is-local-file.d.ts.map +1 -0
- package/dist/is-local-file.js +13 -0
- package/dist/is-local-file.js.map +1 -0
- package/dist/parse-browser-error-stack.d.ts +8 -0
- package/dist/parse-browser-error-stack.d.ts.map +1 -0
- package/dist/parse-browser-error-stack.js +88 -0
- package/dist/parse-browser-error-stack.js.map +1 -0
- package/dist/render-video.d.ts +7 -8
- package/dist/render-video.d.ts.map +1 -1
- package/dist/render-video.js +55 -24
- package/dist/render-video.js.map +1 -1
- package/dist/symbolicate-stacktrace.d.ts +17 -0
- package/dist/symbolicate-stacktrace.d.ts.map +1 -0
- package/dist/symbolicate-stacktrace.js +101 -0
- package/dist/symbolicate-stacktrace.js.map +1 -0
- package/dist/validate-frame.d.ts +2 -0
- package/dist/validate-frame.d.ts.map +1 -0
- package/dist/validate-frame.js +25 -0
- package/dist/validate-frame.js.map +1 -0
- package/dist/validate-quality.d.ts +1 -0
- package/dist/validate-quality.d.ts.map +1 -0
- package/dist/validate-quality.js +2 -0
- package/dist/validate-quality.js.map +1 -0
- package/package.json +15 -4
- package/.turbo/turbo-test.log +0 -39
- package/dist/get-pro-res-profile-name.d.ts +0 -3
- package/dist/get-pro-res-profile-name.d.ts.map +0 -1
- package/dist/get-pro-res-profile-name.js +0 -26
- package/dist/get-pro-res-profile-name.js.map +0 -1
- package/dist/run-ffmpeg-command.d.ts +0 -6
- package/dist/run-ffmpeg-command.d.ts.map +0 -1
- package/dist/run-ffmpeg-command.js +0 -25
- package/dist/run-ffmpeg-command.js.map +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
[35m@remotion/renderer:build: [0mcache hit, replaying output [
|
|
1
|
+
[35m@remotion/renderer:build: [0mcache hit, replaying output [2m7ac85b3a0181b613[0m
|
|
2
2
|
[35m@remotion/renderer:build: [0m
|
|
3
|
-
[35m@remotion/renderer:build: [0m> @remotion/renderer@2.6.
|
|
3
|
+
[35m@remotion/renderer:build: [0m> @remotion/renderer@2.6.12 build /Users/jonathanburger/remotion/packages/renderer
|
|
4
4
|
[35m@remotion/renderer:build: [0m> tsc -d
|
|
5
5
|
[35m@remotion/renderer:build: [0m
|
package/.turbo/turbo-lint.log
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[33m@remotion/renderer:lint: [0mcache hit, replaying output [2me02ff046fad6cec3[0m
|
|
2
|
+
[33m@remotion/renderer:lint: [0m
|
|
3
|
+
[33m@remotion/renderer:lint: [0m> @remotion/renderer@2.6.12 lint /Users/jonathanburger/remotion/packages/renderer
|
|
4
|
+
[33m@remotion/renderer:lint: [0m> eslint src --ext ts,tsx
|
|
5
|
+
[33m@remotion/renderer:lint: [0m
|
|
6
|
+
[33m@remotion/renderer:lint: [0m
|
|
7
|
+
[33m@remotion/renderer:lint: [0m/Users/jonathanburger/remotion/packages/renderer/src/assets/ffmpeg-volume-expression.ts
|
|
8
|
+
[33m@remotion/renderer:lint: [0m 76:1 warning Unexpected 'todo' comment: 'TODO: Should remove irrelevant frames' no-warning-comments
|
|
9
|
+
[33m@remotion/renderer:lint: [0m
|
|
10
|
+
[33m@remotion/renderer:lint: [0m/Users/jonathanburger/remotion/packages/renderer/src/ensure-frames-in-order.ts
|
|
11
|
+
[33m@remotion/renderer:lint: [0m 21:72 warning Async arrow function has no 'await' expression require-await
|
|
12
|
+
[33m@remotion/renderer:lint: [0m
|
|
13
|
+
[33m@remotion/renderer:lint: [0m/Users/jonathanburger/remotion/packages/renderer/src/provide-screenshot.ts
|
|
14
|
+
[33m@remotion/renderer:lint: [0m 18:21 warning Async arrow function has no 'await' expression require-await
|
|
15
|
+
[33m@remotion/renderer:lint: [0m
|
|
16
|
+
[33m@remotion/renderer:lint: [0m/Users/jonathanburger/remotion/packages/renderer/src/test/validate-config-stitcher.test.ts
|
|
17
|
+
[33m@remotion/renderer:lint: [0m 17:34 warning Async arrow function has no 'await' expression require-await
|
|
18
|
+
[33m@remotion/renderer:lint: [0m 29:33 warning Async arrow function has no 'await' expression require-await
|
|
19
|
+
[33m@remotion/renderer:lint: [0m
|
|
20
|
+
[33m@remotion/renderer:lint: [0m✖ 5 problems (0 errors, 5 warnings)
|
|
21
|
+
[33m@remotion/renderer:lint: [0m
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize-filepath.d.ts","sourceRoot":"","sources":["../../src/assets/sanitize-filepath.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sanitize-filepath.d.ts","sourceRoot":"","sources":["../../src/assets/sanitize-filepath.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,mBAAoB,MAAM,WAKtD,CAAC"}
|
|
@@ -6,9 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.sanitizeFilePath = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const sanitize_filename_1 = require("./sanitize-filename");
|
|
9
|
+
const pathSeparators = /[/\\]/;
|
|
9
10
|
const sanitizeFilePath = (pathToSanitize) => {
|
|
10
11
|
return pathToSanitize
|
|
11
|
-
.split(
|
|
12
|
+
.split(pathSeparators)
|
|
12
13
|
.map((s) => (0, sanitize_filename_1.sanitizeFilename)(s))
|
|
13
14
|
.join(path_1.default.sep);
|
|
14
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize-filepath.js","sourceRoot":"","sources":["../../src/assets/sanitize-filepath.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,2DAAqD;
|
|
1
|
+
{"version":3,"file":"sanitize-filepath.js","sourceRoot":"","sources":["../../src/assets/sanitize-filepath.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,2DAAqD;AAErD,MAAM,cAAc,GAAG,OAAO,CAAC;AAExB,MAAM,gBAAgB,GAAG,CAAC,cAAsB,EAAE,EAAE;IAC1D,OAAO,cAAc;SACnB,KAAK,CAAC,cAAc,CAAC;SACrB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,oCAAgB,EAAC,CAAC,CAAC,CAAC;SAC/B,IAAI,CAAC,cAAI,CAAC,GAAG,CAAC,CAAC;AAClB,CAAC,CAAC;AALW,QAAA,gBAAgB,oBAK3B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const getPcmOutputName: (inputName: string) => string;
|
|
2
|
+
export declare const conversionStarted: {
|
|
3
|
+
[key: string]: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare const convertMp3ToPcm: (source: string) => Promise<string>;
|
|
6
|
+
export declare const clearMp3Conversions: () => void;
|
|
7
|
+
//# sourceMappingURL=convert-mp3-to-pcm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-mp3-to-pcm.d.ts","sourceRoot":"","sources":["../src/convert-mp3-to-pcm.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,cAAe,MAAM,WAMjD,CAAC;AAQF,eAAO,MAAM,iBAAiB,EAAE;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAM,CAAC;AAE9D,eAAO,MAAM,eAAe,WAAkB,MAAM,oBAcnD,CAAC;AAEF,eAAO,MAAM,mBAAmB,YAI/B,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// For the h264-mkv format, we need to convert an MP3 file to PCM first
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.clearMp3Conversions = exports.convertMp3ToPcm = exports.conversionStarted = exports.getPcmOutputName = void 0;
|
|
8
|
+
const execa_1 = __importDefault(require("execa"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const getPcmOutputName = (inputName) => {
|
|
11
|
+
const dirname = path_1.default.dirname(inputName);
|
|
12
|
+
const extension = path_1.default.extname(inputName);
|
|
13
|
+
const filename = path_1.default.basename(inputName, extension);
|
|
14
|
+
return path_1.default.join(dirname, `${filename}-converted.wav`);
|
|
15
|
+
};
|
|
16
|
+
exports.getPcmOutputName = getPcmOutputName;
|
|
17
|
+
const isMp3 = async (source) => {
|
|
18
|
+
const { stderr } = await (0, execa_1.default)('ffprobe', [source]);
|
|
19
|
+
return stderr.includes('Audio: mp3');
|
|
20
|
+
};
|
|
21
|
+
exports.conversionStarted = {};
|
|
22
|
+
const convertMp3ToPcm = async (source) => {
|
|
23
|
+
const outname = (0, exports.getPcmOutputName)(source);
|
|
24
|
+
if (!(await isMp3(source))) {
|
|
25
|
+
return source;
|
|
26
|
+
}
|
|
27
|
+
if (exports.conversionStarted[source]) {
|
|
28
|
+
return outname;
|
|
29
|
+
}
|
|
30
|
+
exports.conversionStarted[source] = true;
|
|
31
|
+
await (0, execa_1.default)('ffmpeg', ['-y', '-i', source, (0, exports.getPcmOutputName)(source)]);
|
|
32
|
+
return outname;
|
|
33
|
+
};
|
|
34
|
+
exports.convertMp3ToPcm = convertMp3ToPcm;
|
|
35
|
+
const clearMp3Conversions = () => {
|
|
36
|
+
Object.keys(exports.conversionStarted).forEach((key) => {
|
|
37
|
+
delete exports.conversionStarted[key];
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
exports.clearMp3Conversions = clearMp3Conversions;
|
|
41
|
+
//# sourceMappingURL=convert-mp3-to-pcm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-mp3-to-pcm.js","sourceRoot":"","sources":["../src/convert-mp3-to-pcm.ts"],"names":[],"mappings":";AAAA,uEAAuE;;;;;;AAEvE,kDAA0B;AAC1B,gDAAwB;AAEjB,MAAM,gBAAgB,GAAG,CAAC,SAAiB,EAAE,EAAE;IACrD,MAAM,OAAO,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,SAAS,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,cAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAErD,OAAO,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,QAAQ,gBAAgB,CAAC,CAAC;AACxD,CAAC,CAAC;AANW,QAAA,gBAAgB,oBAM3B;AAEF,MAAM,KAAK,GAAG,KAAK,EAAE,MAAc,EAAE,EAAE;IACtC,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAA,eAAK,EAAC,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAElD,OAAO,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AACtC,CAAC,CAAC;AAEW,QAAA,iBAAiB,GAA6B,EAAE,CAAC;AAEvD,MAAM,eAAe,GAAG,KAAK,EAAE,MAAc,EAAE,EAAE;IACvD,MAAM,OAAO,GAAG,IAAA,wBAAgB,EAAC,MAAM,CAAC,CAAC;IACzC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE;QAC3B,OAAO,MAAM,CAAC;KACd;IAED,IAAI,yBAAiB,CAAC,MAAM,CAAC,EAAE;QAC9B,OAAO,OAAO,CAAC;KACf;IAED,yBAAiB,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAEjC,MAAM,IAAA,eAAK,EAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAA,wBAAgB,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACtE,OAAO,OAAO,CAAC;AAChB,CAAC,CAAC;AAdW,QAAA,eAAe,mBAc1B;AAEK,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACvC,MAAM,CAAC,IAAI,CAAC,yBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAC9C,OAAO,yBAAiB,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AAJW,QAAA,mBAAmB,uBAI9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delay-render-embedded-stack.d.ts","sourceRoot":"","sources":["../src/delay-render-embedded-stack.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,6BAA6B,YAAa,MAAM,gFAkB5D,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseDelayRenderEmbeddedStack = void 0;
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
5
|
+
const parse_browser_error_stack_1 = require("./parse-browser-error-stack");
|
|
6
|
+
const symbolicate_stacktrace_1 = require("./symbolicate-stacktrace");
|
|
7
|
+
const parseDelayRenderEmbeddedStack = (message) => {
|
|
8
|
+
const index = message.indexOf(remotion_1.DELAY_RENDER_CALLSTACK_TOKEN);
|
|
9
|
+
if (index === -1) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const msg = message
|
|
13
|
+
.substring(index + remotion_1.DELAY_RENDER_CALLSTACK_TOKEN.length)
|
|
14
|
+
.trim();
|
|
15
|
+
const parsed = (0, parse_browser_error_stack_1.parseStack)(msg.split('\n'));
|
|
16
|
+
try {
|
|
17
|
+
return (0, symbolicate_stacktrace_1.symbolicateStackTrace)(parsed);
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
console.warn('error symbolicating delayRender() stack: ' + err);
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.parseDelayRenderEmbeddedStack = parseDelayRenderEmbeddedStack;
|
|
25
|
+
//# sourceMappingURL=delay-render-embedded-stack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delay-render-embedded-stack.js","sourceRoot":"","sources":["../src/delay-render-embedded-stack.ts"],"names":[],"mappings":";;;AAAA,uCAAsD;AACtD,2EAAuD;AACvD,qEAA+D;AAExD,MAAM,6BAA6B,GAAG,CAAC,OAAe,EAAE,EAAE;IAChE,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,uCAA4B,CAAC,CAAC;IAC5D,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;QACjB,OAAO,IAAI,CAAC;KACZ;IAED,MAAM,GAAG,GAAG,OAAO;SACjB,SAAS,CAAC,KAAK,GAAG,uCAA4B,CAAC,MAAM,CAAC;SACtD,IAAI,EAAE,CAAC;IAET,MAAM,MAAM,GAAG,IAAA,sCAAU,EAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAE3C,IAAI;QACH,OAAO,IAAA,8CAAqB,EAAC,MAAM,CAAC,CAAC;KACrC;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,CAAC,IAAI,CAAC,2CAA2C,GAAG,GAAG,CAAC,CAAC;QAChE,OAAO,IAAI,CAAC;KACZ;AACF,CAAC,CAAC;AAlBW,QAAA,6BAA6B,iCAkBxC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Page } from 'puppeteer-core';
|
|
2
|
+
import { SymbolicatedStackFrame } from './symbolicate-stacktrace';
|
|
3
|
+
export declare class ErrorWithStackFrame extends Error {
|
|
4
|
+
stackFrames: SymbolicatedStackFrame[];
|
|
5
|
+
frame: number | null;
|
|
6
|
+
errorType: string;
|
|
7
|
+
delayRenderCall: SymbolicatedStackFrame[] | null;
|
|
8
|
+
constructor(m: string, _stackFrames: SymbolicatedStackFrame[], _frame: number | null, _errorType: string, _delayRenderCall: SymbolicatedStackFrame[] | null);
|
|
9
|
+
}
|
|
10
|
+
export declare const removeDelayRenderStack: (message: string) => string;
|
|
11
|
+
export declare const handleJavascriptException: ({ page, onError, frame, }: {
|
|
12
|
+
page: Page;
|
|
13
|
+
frame: number | null;
|
|
14
|
+
onError: (err: Error) => void;
|
|
15
|
+
}) => () => void;
|
|
16
|
+
//# sourceMappingURL=handle-javascript-exception.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle-javascript-exception.d.ts","sourceRoot":"","sources":["../src/handle-javascript-exception.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,IAAI,EAAW,MAAM,gBAAgB,CAAC;AAG1D,OAAO,EACN,sBAAsB,EAEtB,MAAM,0BAA0B,CAAC;AAElC,qBAAa,mBAAoB,SAAQ,KAAK;IAC7C,WAAW,EAAE,sBAAsB,EAAE,CAAC;IACtC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,sBAAsB,EAAE,GAAG,IAAI,CAAC;gBAGhD,CAAC,EAAE,MAAM,EACT,YAAY,EAAE,sBAAsB,EAAE,EACtC,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,UAAU,EAAE,MAAM,EAClB,gBAAgB,EAAE,sBAAsB,EAAE,GAAG,IAAI;CAQlD;AAkBD,eAAO,MAAM,sBAAsB,YAAa,MAAM,WAOrD,CAAC;AAaF,eAAO,MAAM,yBAAyB;UAK/B,IAAI;WACH,MAAM,GAAG,IAAI;mBACL,KAAK,KAAK,IAAI;gBA4C7B,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleJavascriptException = exports.removeDelayRenderStack = exports.ErrorWithStackFrame = void 0;
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
5
|
+
const delay_render_embedded_stack_1 = require("./delay-render-embedded-stack");
|
|
6
|
+
const symbolicate_stacktrace_1 = require("./symbolicate-stacktrace");
|
|
7
|
+
class ErrorWithStackFrame extends Error {
|
|
8
|
+
constructor(m, _stackFrames, _frame, _errorType, _delayRenderCall) {
|
|
9
|
+
super(m);
|
|
10
|
+
this.stackFrames = _stackFrames;
|
|
11
|
+
this.frame = _frame;
|
|
12
|
+
this.errorType = _errorType;
|
|
13
|
+
this.delayRenderCall = _delayRenderCall;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.ErrorWithStackFrame = ErrorWithStackFrame;
|
|
17
|
+
const cleanUpErrorMessage = (exception) => {
|
|
18
|
+
var _a, _b, _c, _d;
|
|
19
|
+
let errorMessage = (_a = exception.exceptionDetails.exception) === null || _a === void 0 ? void 0 : _a.description;
|
|
20
|
+
const errorType = (_b = exception.exceptionDetails.exception) === null || _b === void 0 ? void 0 : _b.className;
|
|
21
|
+
const prefix = `${errorType}: `;
|
|
22
|
+
if (errorMessage.startsWith(prefix)) {
|
|
23
|
+
errorMessage = errorMessage.substring(prefix.length);
|
|
24
|
+
}
|
|
25
|
+
const frames = (_d = (_c = exception.exceptionDetails.stackTrace) === null || _c === void 0 ? void 0 : _c.callFrames.length) !== null && _d !== void 0 ? _d : 0;
|
|
26
|
+
const split = errorMessage.split('\n');
|
|
27
|
+
return split.slice(0, split.length - frames).join('\n');
|
|
28
|
+
};
|
|
29
|
+
const removeDelayRenderStack = (message) => {
|
|
30
|
+
const index = message.indexOf(remotion_1.DELAY_RENDER_CALLSTACK_TOKEN);
|
|
31
|
+
if (index === -1) {
|
|
32
|
+
return message;
|
|
33
|
+
}
|
|
34
|
+
return message.substring(0, index);
|
|
35
|
+
};
|
|
36
|
+
exports.removeDelayRenderStack = removeDelayRenderStack;
|
|
37
|
+
const callFrameToStackFrame = (callFrame) => {
|
|
38
|
+
return {
|
|
39
|
+
columnNumber: callFrame.columnNumber,
|
|
40
|
+
fileName: callFrame.url,
|
|
41
|
+
functionName: callFrame.functionName,
|
|
42
|
+
lineNumber: callFrame.lineNumber,
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
const handleJavascriptException = ({ page, onError, frame, }) => {
|
|
46
|
+
const client = page._client;
|
|
47
|
+
const handler = async (exception) => {
|
|
48
|
+
var _a, _b;
|
|
49
|
+
const rawErrorMessage = (_a = exception.exceptionDetails.exception) === null || _a === void 0 ? void 0 : _a.description;
|
|
50
|
+
const cleanErrorMessage = cleanUpErrorMessage(exception);
|
|
51
|
+
const err = new Error((0, exports.removeDelayRenderStack)(cleanErrorMessage));
|
|
52
|
+
err.stack = rawErrorMessage;
|
|
53
|
+
if (!exception.exceptionDetails.stackTrace) {
|
|
54
|
+
onError(err);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const errorType = (_b = exception.exceptionDetails.exception) === null || _b === void 0 ? void 0 : _b.className;
|
|
58
|
+
const delayRenderStack = await (0, delay_render_embedded_stack_1.parseDelayRenderEmbeddedStack)(cleanErrorMessage);
|
|
59
|
+
try {
|
|
60
|
+
const sym = await (0, symbolicate_stacktrace_1.symbolicateStackTrace)(exception.exceptionDetails.stackTrace
|
|
61
|
+
.callFrames.map((f) => callFrameToStackFrame(f)));
|
|
62
|
+
const symbolicatedErr = new ErrorWithStackFrame((0, exports.removeDelayRenderStack)(cleanErrorMessage), sym, frame, errorType, delayRenderStack);
|
|
63
|
+
onError(symbolicatedErr);
|
|
64
|
+
}
|
|
65
|
+
catch (errorVisualizingError) {
|
|
66
|
+
console.log('error symbolicating error:', errorVisualizingError);
|
|
67
|
+
onError(err);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
client.on('Runtime.exceptionThrown', handler);
|
|
71
|
+
return () => {
|
|
72
|
+
client.off('Runtime.exceptionThrown', handler);
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
exports.handleJavascriptException = handleJavascriptException;
|
|
76
|
+
//# sourceMappingURL=handle-javascript-exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle-javascript-exception.js","sourceRoot":"","sources":["../src/handle-javascript-exception.ts"],"names":[],"mappings":";;;AAEA,uCAAsD;AACtD,+EAA4E;AAC5E,qEAGkC;AAElC,MAAa,mBAAoB,SAAQ,KAAK;IAM7C,YACC,CAAS,EACT,YAAsC,EACtC,MAAqB,EACrB,UAAkB,EAClB,gBAAiD;QAEjD,KAAK,CAAC,CAAC,CAAC,CAAC;QACT,IAAI,CAAC,WAAW,GAAG,YAAY,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC;QAC5B,IAAI,CAAC,eAAe,GAAG,gBAAgB,CAAC;IACzC,CAAC;CACD;AAnBD,kDAmBC;AAED,MAAM,mBAAmB,GAAG,CAC3B,SAAgD,EAC/C,EAAE;;IACH,IAAI,YAAY,GAAG,MAAA,SAAS,CAAC,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EAAE,OAAO,CAAC,CAAC;IAE9C,OAAO,GAAG,EAAE;QACX,MAAM,CAAC,GAAG,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC,CAAC;AACH,CAAC,CAAC;AAnDW,QAAA,yBAAyB,6BAmDpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=handle-null-audio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle-null-audio.d.ts","sourceRoot":"","sources":["../src/handle-null-audio.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle-null-audio.js","sourceRoot":"","sources":["../src/handle-null-audio.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
CHANGED
|
@@ -36,5 +36,7 @@ export declare const RenderInternals: {
|
|
|
36
36
|
scale: number;
|
|
37
37
|
codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv";
|
|
38
38
|
}) => void;
|
|
39
|
+
min: (arr: number[]) => number;
|
|
40
|
+
max: (arr: number[]) => number;
|
|
39
41
|
};
|
|
40
42
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,UAAU,CAAC;AAa/C,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,KAAK,EAAE,OAAO,CAAC;QACf,qBAAqB,EAAE,MAAM,aAAa,EAAE,CAAC;QAC7C,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QAC3C,sBAAsB,EAAE,MAAM,MAAM,EAAE,CAAC;KACvC;CACD;AAED,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AACtC,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,mBAAmB,EAAC,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAC;AACrE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;CAY3B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.RenderInternals = exports.stitchFramesToVideo = exports.renderStill = ex
|
|
|
4
4
|
const ffmpeg_flags_1 = require("./ffmpeg-flags");
|
|
5
5
|
const get_concurrency_1 = require("./get-concurrency");
|
|
6
6
|
const get_local_browser_executable_1 = require("./get-local-browser-executable");
|
|
7
|
+
const min_max_1 = require("./min-max");
|
|
7
8
|
const open_browser_1 = require("./open-browser");
|
|
8
9
|
const validate_even_dimensions_with_codec_1 = require("./validate-even-dimensions-with-codec");
|
|
9
10
|
const validate_ffmpeg_1 = require("./validate-ffmpeg");
|
|
@@ -25,5 +26,7 @@ exports.RenderInternals = {
|
|
|
25
26
|
binaryExists: validate_ffmpeg_1.binaryExists,
|
|
26
27
|
getFfmpegBuildInfo: ffmpeg_flags_1.getFfmpegBuildInfo,
|
|
27
28
|
validateEvenDimensionsWithCodec: validate_even_dimensions_with_codec_1.validateEvenDimensionsWithCodec,
|
|
29
|
+
min: min_max_1.min,
|
|
30
|
+
max: min_max_1.max,
|
|
28
31
|
};
|
|
29
32
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,iDAIwB;AACxB,uDAAuD;AACvD,iFAAkE;AAClE,iDAA2C;AAC3C,+FAAsF;AACtF,uDAA+D;AAY/D,uDAAmD;AAA3C,mHAAA,eAAe,OAAA;AACvB,mCAAsC;AAA9B,sGAAA,YAAY,OAAA;AACpB,+CAA2C;AAAnC,2GAAA,WAAW,OAAA;AACnB,uCAA+C;AAAvC,+GAAA,mBAAmB,OAAA;AAEd,QAAA,eAAe,GAAG;IAC9B,kBAAkB,EAAlB,iDAAkB;IAClB,gBAAgB,EAAhB,+BAAgB;IAChB,oBAAoB,EAApB,sCAAoB;IACpB,gBAAgB,EAAhB,+BAAgB;IAChB,WAAW,EAAX,0BAAW;IACX,cAAc,EAAd,gCAAc;IACd,YAAY,EAAZ,8BAAY;IACZ,kBAAkB,EAAlB,iCAAkB;IAClB,+BAA+B,EAA/B,qEAA+B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,iDAIwB;AACxB,uDAAuD;AACvD,iFAAkE;AAClE,uCAAmC;AACnC,iDAA2C;AAC3C,+FAAsF;AACtF,uDAA+D;AAY/D,uDAAmD;AAA3C,mHAAA,eAAe,OAAA;AACvB,mCAAsC;AAA9B,sGAAA,YAAY,OAAA;AACpB,+CAA2C;AAAnC,2GAAA,WAAW,OAAA;AACnB,uCAA+C;AAAvC,+GAAA,mBAAmB,OAAA;AAEd,QAAA,eAAe,GAAG;IAC9B,kBAAkB,EAAlB,iDAAkB;IAClB,gBAAgB,EAAhB,+BAAgB;IAChB,oBAAoB,EAApB,sCAAoB;IACpB,gBAAgB,EAAhB,+BAAgB;IAChB,WAAW,EAAX,0BAAW;IACX,cAAc,EAAd,gCAAc;IACd,YAAY,EAAZ,8BAAY;IACZ,kBAAkB,EAAlB,iCAAkB;IAClB,+BAA+B,EAA/B,qEAA+B;IAC/B,GAAG,EAAH,aAAG;IACH,GAAG,EAAH,aAAG;CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-local-file.d.ts","sourceRoot":"","sources":["../src/is-local-file.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,iBAAkB,MAAM,YAY9C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isServeUrl = void 0;
|
|
4
|
+
const isServeUrl = (potentialUrl) => {
|
|
5
|
+
// Theoretically not a valid URL but handle the most basic cases of forgetting protocol in front
|
|
6
|
+
if (potentialUrl.startsWith('www.') ||
|
|
7
|
+
potentialUrl.includes('amazonaws.com')) {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
return (potentialUrl.startsWith('https://') || !potentialUrl.startsWith('http://'));
|
|
11
|
+
};
|
|
12
|
+
exports.isServeUrl = isServeUrl;
|
|
13
|
+
//# sourceMappingURL=is-local-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-local-file.js","sourceRoot":"","sources":["../src/is-local-file.ts"],"names":[],"mappings":";;;AAAO,MAAM,UAAU,GAAG,CAAC,YAAoB,EAAE,EAAE;IAClD,gGAAgG;IAChG,IACC,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC;QAC/B,YAAY,CAAC,QAAQ,CAAC,eAAe,CAAC,EACrC;QACD,OAAO,IAAI,CAAC;KACZ;IAED,OAAO,CACN,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,CAC1E,CAAC;AACH,CAAC,CAAC;AAZW,QAAA,UAAU,cAYrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-browser-error-stack.d.ts","sourceRoot":"","sources":["../src/parse-browser-error-stack.ts"],"names":[],"mappings":"AAIA,oBAAY,UAAU,GAAG;IACxB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC;AAuDF,eAAO,MAAM,UAAU,UAAW,MAAM,EAAE,KAAG,UAAU,EAwDtD,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseStack = void 0;
|
|
4
|
+
const regexValidFrame_Chrome = /^\s*(at|in)\s.+(:\d+)/;
|
|
5
|
+
const regexValidFrame_FireFox = /(^|@)\S+:\d+|.+line\s+\d+\s+>\s+(eval|Function).+/;
|
|
6
|
+
const regexExtractLocation = /\(?(.+?)(?::(\d+))?(?::(\d+))?\)?$/;
|
|
7
|
+
function extractLocation(token) {
|
|
8
|
+
const execed = regexExtractLocation.exec(token);
|
|
9
|
+
if (!execed) {
|
|
10
|
+
throw new Error('Could not match in extractLocation');
|
|
11
|
+
}
|
|
12
|
+
return execed.slice(1).map((v) => {
|
|
13
|
+
const p = Number(v);
|
|
14
|
+
if (!isNaN(p)) {
|
|
15
|
+
return p;
|
|
16
|
+
}
|
|
17
|
+
return v;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
const makeStackFrame = ({ functionName, fileName, lineNumber, columnNumber, }) => {
|
|
21
|
+
if (functionName && functionName.indexOf('Object.') === 0) {
|
|
22
|
+
functionName = functionName.slice('Object.'.length);
|
|
23
|
+
}
|
|
24
|
+
if (
|
|
25
|
+
// Chrome has a bug with inferring function.name:
|
|
26
|
+
// https://github.com/facebook/create-react-app/issues/2097
|
|
27
|
+
// Let's ignore a meaningless name we get for top-level modules.
|
|
28
|
+
functionName === 'friendlySyntaxErrorLabel' ||
|
|
29
|
+
functionName === 'exports.__esModule' ||
|
|
30
|
+
functionName === '<anonymous>' ||
|
|
31
|
+
!functionName) {
|
|
32
|
+
functionName = null;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
columnNumber,
|
|
36
|
+
fileName,
|
|
37
|
+
functionName,
|
|
38
|
+
lineNumber,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
const parseStack = (stack) => {
|
|
42
|
+
const frames = stack
|
|
43
|
+
.filter((e) => regexValidFrame_Chrome.test(e) || regexValidFrame_FireFox.test(e))
|
|
44
|
+
.map((e) => {
|
|
45
|
+
if (regexValidFrame_FireFox.test(e)) {
|
|
46
|
+
// Strip eval, we don't care about it
|
|
47
|
+
let isEval = false;
|
|
48
|
+
if (/ > (eval|Function)/.test(e)) {
|
|
49
|
+
e = e.replace(/ line (\d+)(?: > eval line \d+)* > (eval|Function):\d+:\d+/g, ':$1');
|
|
50
|
+
isEval = true;
|
|
51
|
+
}
|
|
52
|
+
const _data = e.split(/[@]/g);
|
|
53
|
+
const _last = _data.pop();
|
|
54
|
+
if (!_last) {
|
|
55
|
+
throw new Error('could not get last');
|
|
56
|
+
}
|
|
57
|
+
const [_fileName, _lineNumber, _columnNumber] = extractLocation(_last);
|
|
58
|
+
return makeStackFrame({
|
|
59
|
+
functionName: _data.join('@') || (isEval ? 'eval' : null),
|
|
60
|
+
fileName: _fileName,
|
|
61
|
+
lineNumber: _lineNumber,
|
|
62
|
+
columnNumber: _columnNumber,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
// Strip eval, we don't care about it
|
|
66
|
+
if (e.indexOf('(eval ') !== -1) {
|
|
67
|
+
e = e.replace(/(\(eval at [^()]*)|(\),.*$)/g, '');
|
|
68
|
+
}
|
|
69
|
+
if (e.indexOf('(at ') !== -1) {
|
|
70
|
+
e = e.replace(/\(at /, '(');
|
|
71
|
+
}
|
|
72
|
+
const data = e.trim().split(/\s+/g).slice(1);
|
|
73
|
+
const last = data.pop();
|
|
74
|
+
if (!last) {
|
|
75
|
+
throw new Error('could not get last');
|
|
76
|
+
}
|
|
77
|
+
const [fileName, lineNumber, columnNumber] = extractLocation(last);
|
|
78
|
+
return makeStackFrame({
|
|
79
|
+
functionName: data.join(' ') || null,
|
|
80
|
+
fileName,
|
|
81
|
+
lineNumber,
|
|
82
|
+
columnNumber,
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
return frames;
|
|
86
|
+
};
|
|
87
|
+
exports.parseStack = parseStack;
|
|
88
|
+
//# sourceMappingURL=parse-browser-error-stack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-browser-error-stack.js","sourceRoot":"","sources":["../src/parse-browser-error-stack.ts"],"names":[],"mappings":";;;AAAA,MAAM,sBAAsB,GAAG,uBAAuB,CAAC;AACvD,MAAM,uBAAuB,GAC5B,mDAAmD,CAAC;AASrD,MAAM,oBAAoB,GAAG,oCAAoC,CAAC;AAElE,SAAS,eAAe,CAAC,KAAa;IACrC,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChD,IAAI,CAAC,MAAM,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;KACtD;IAED,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QAChC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;YACd,OAAO,CAAC,CAAC;SACT;QAED,OAAO,CAAC,CAAC;IACV,CAAC,CAA6B,CAAC;AAChC,CAAC;AAED,MAAM,cAAc,GAAG,CAAC,EACvB,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,YAAY,GAMZ,EAAc,EAAE;IAChB,IAAI,YAAY,IAAI,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;QAC1D,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;KACpD;IAED;I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,IAAI,CAAC;gBACzD,QAAQ,EAAE,SAAS;gBACnB,UAAU,EAAE,WAAW;gBACvB,YAAY,EAAE,aAAa;aAC3B,CAAC,CAAC;SACH;QAED,qCAAqC;QACrC,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;YAC/B,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,8BAA8B,EAAE,EAAE,CAAC,CAAC;SAClD;QAED,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;YAC7B,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;SAC5B;QAED,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,EAAE;YACV,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;SACtC;QAED,MAAM,CAAC,QAAQ,EAAE,UAAU,EAAE,YAAY,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;QACnE,OAAO,cAAc,CAAC;YACrB,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI;YACpC,QAAQ;YACR,UAAU;YACV,YAAY;SACZ,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IACJ,OAAO,MAAM,CAAC;AACf,CAAC,CAAC;AAxDW,QAAA,UAAU,cAwDrB"}
|
package/dist/render-video.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import type { Browser as PuppeteerBrowser } from 'puppeteer-core';
|
|
2
2
|
import { Browser, Codec, FfmpegExecutable, FrameRange, PixelFormat, ProResProfile, TCompMetadata } from 'remotion';
|
|
3
|
-
export declare type
|
|
4
|
-
export declare type
|
|
5
|
-
export declare type RenderMediaOnProgress = (progress: {
|
|
3
|
+
export declare type RenderVideoOnDownload = (src: string) => void;
|
|
4
|
+
export declare type RenderVideoOnProgress = (progress: {
|
|
6
5
|
renderedFrames: number;
|
|
7
6
|
encodedFrames: number;
|
|
8
7
|
encodedDoneIn: number | null;
|
|
9
8
|
renderedDoneIn: number | null;
|
|
10
|
-
stitchStage:
|
|
9
|
+
stitchStage: 'encoding' | 'muxing';
|
|
11
10
|
}) => void;
|
|
12
|
-
export declare type
|
|
11
|
+
export declare type RenderVideoOptions = {
|
|
13
12
|
proResProfile: ProResProfile | undefined;
|
|
14
13
|
parallelism: number | null;
|
|
15
14
|
parallelEncoding: boolean;
|
|
@@ -29,11 +28,11 @@ export declare type RenderMediaOptions = {
|
|
|
29
28
|
openedBrowser: PuppeteerBrowser;
|
|
30
29
|
overwrite: boolean;
|
|
31
30
|
absoluteOutputFile: string;
|
|
32
|
-
onProgress
|
|
31
|
+
onProgress: RenderVideoOnProgress;
|
|
32
|
+
shouldOutputImageSequence: boolean;
|
|
33
33
|
fileExtension: string | null;
|
|
34
34
|
bundled: string;
|
|
35
35
|
onDownload: (src: string) => void;
|
|
36
|
-
dumpBrowserLogs: boolean;
|
|
37
36
|
};
|
|
38
|
-
export declare const
|
|
37
|
+
export declare const renderVideo: ({ parallelism, proResProfile, parallelEncoding, crf, outputDir, config, imageFormat, ffmpegExecutable, inputProps, pixelFormat, codec, envVariables, quality, frameRange, browser, serveUrl, openedBrowser, absoluteOutputFile, onProgress, overwrite, shouldOutputImageSequence, fileExtension, bundled, onDownload, }: RenderVideoOptions) => Promise<void>;
|
|
39
38
|
//# sourceMappingURL=render-video.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-video.d.ts","sourceRoot":"","sources":["../src/render-video.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAChE,OAAO,EACN,O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,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,gBAAgB,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,qBAAqB,CAAC;IAClC,yBAAyB,EAAE,OAAO,CAAC;IACnC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,WAAW,4TAyBrB,kBAAkB,kBAuKpB,CAAC"}
|
package/dist/render-video.js
CHANGED
|
@@ -3,15 +3,14 @@ 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.
|
|
6
|
+
exports.renderVideo = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const remotion_1 = require("remotion");
|
|
10
10
|
const stitcher_1 = require("./stitcher");
|
|
11
11
|
const render_1 = require("./render");
|
|
12
|
-
const
|
|
12
|
+
const renderVideo = async ({ parallelism, proResProfile, parallelEncoding, crf, outputDir, config, imageFormat, ffmpegExecutable, inputProps, pixelFormat, codec, envVariables, quality, frameRange, browser, serveUrl, openedBrowser, absoluteOutputFile, onProgress, overwrite, shouldOutputImageSequence, fileExtension, bundled, onDownload, }) => {
|
|
13
13
|
var _a, _b;
|
|
14
|
-
let stitchStage = 'encoding';
|
|
15
14
|
let stitcherFfmpeg;
|
|
16
15
|
let preStitcher;
|
|
17
16
|
let encodedFrames = 0;
|
|
@@ -20,15 +19,6 @@ const renderMedia = async ({ parallelism, proResProfile, parallelEncoding, crf,
|
|
|
20
19
|
let renderedDoneIn = null;
|
|
21
20
|
let encodedDoneIn = null;
|
|
22
21
|
const renderStart = Date.now();
|
|
23
|
-
const callUpdate = () => {
|
|
24
|
-
onProgress === null || onProgress === void 0 ? void 0 : onProgress({
|
|
25
|
-
encodedDoneIn,
|
|
26
|
-
encodedFrames,
|
|
27
|
-
renderedDoneIn,
|
|
28
|
-
renderedFrames,
|
|
29
|
-
stitchStage,
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
22
|
if (parallelEncoding) {
|
|
33
23
|
if (typeof crf !== 'number') {
|
|
34
24
|
throw new TypeError('CRF is unexpectedly not a number');
|
|
@@ -49,7 +39,13 @@ const renderMedia = async ({ parallelism, proResProfile, parallelEncoding, crf,
|
|
|
49
39
|
parallelism,
|
|
50
40
|
onProgress: (frame) => {
|
|
51
41
|
encodedFrames = frame;
|
|
52
|
-
|
|
42
|
+
onProgress({
|
|
43
|
+
encodedFrames,
|
|
44
|
+
renderedFrames,
|
|
45
|
+
encodedDoneIn: null,
|
|
46
|
+
renderedDoneIn: null,
|
|
47
|
+
stitchStage: 'encoding',
|
|
48
|
+
});
|
|
53
49
|
},
|
|
54
50
|
verbose: remotion_1.Internals.Logging.isEqualOrBelowLogLevel('verbose'),
|
|
55
51
|
parallelEncoding,
|
|
@@ -59,17 +55,31 @@ const renderMedia = async ({ parallelism, proResProfile, parallelEncoding, crf,
|
|
|
59
55
|
});
|
|
60
56
|
stitcherFfmpeg = preStitcher.task;
|
|
61
57
|
}
|
|
62
|
-
const
|
|
58
|
+
const renderer = (0, render_1.renderFrames)({
|
|
63
59
|
config,
|
|
64
60
|
onFrameUpdate: (frame) => {
|
|
65
61
|
renderedFrames = frame;
|
|
66
|
-
|
|
62
|
+
onProgress({
|
|
63
|
+
encodedFrames,
|
|
64
|
+
renderedFrames,
|
|
65
|
+
encodedDoneIn,
|
|
66
|
+
renderedDoneIn,
|
|
67
|
+
stitchStage: 'encoding',
|
|
68
|
+
});
|
|
67
69
|
},
|
|
68
70
|
parallelism,
|
|
71
|
+
parallelEncoding,
|
|
69
72
|
outputDir,
|
|
70
73
|
onStart: () => {
|
|
71
74
|
renderedFrames = 0;
|
|
72
|
-
|
|
75
|
+
onProgress({
|
|
76
|
+
encodedDoneIn,
|
|
77
|
+
encodedFrames,
|
|
78
|
+
renderedDoneIn,
|
|
79
|
+
renderedFrames,
|
|
80
|
+
// TODO: Keep a state
|
|
81
|
+
stitchStage: 'encoding',
|
|
82
|
+
});
|
|
73
83
|
},
|
|
74
84
|
inputProps,
|
|
75
85
|
envVariables,
|
|
@@ -83,8 +93,8 @@ const renderMedia = async ({ parallelism, proResProfile, parallelEncoding, crf,
|
|
|
83
93
|
(_a = stitcherFfmpeg === null || stitcherFfmpeg === void 0 ? void 0 : stitcherFfmpeg.stdin) === null || _a === void 0 ? void 0 : _a.write(buffer);
|
|
84
94
|
},
|
|
85
95
|
serveUrl,
|
|
86
|
-
dumpBrowserLogs,
|
|
87
96
|
});
|
|
97
|
+
const { assetsInfo } = await renderer;
|
|
88
98
|
if (stitcherFfmpeg) {
|
|
89
99
|
(_a = stitcherFfmpeg === null || stitcherFfmpeg === void 0 ? void 0 : stitcherFfmpeg.stdin) === null || _a === void 0 ? void 0 : _a.end();
|
|
90
100
|
await stitcherFfmpeg;
|
|
@@ -92,7 +102,19 @@ const renderMedia = async ({ parallelism, proResProfile, parallelEncoding, crf,
|
|
|
92
102
|
}
|
|
93
103
|
const closeBrowserPromise = openedBrowser.close();
|
|
94
104
|
renderedDoneIn = Date.now() - renderStart;
|
|
95
|
-
|
|
105
|
+
onProgress({
|
|
106
|
+
encodedFrames,
|
|
107
|
+
renderedFrames,
|
|
108
|
+
renderedDoneIn,
|
|
109
|
+
encodedDoneIn,
|
|
110
|
+
stitchStage: 'encoding',
|
|
111
|
+
});
|
|
112
|
+
if (process.env.DEBUG) {
|
|
113
|
+
remotion_1.Internals.perf.logPerf();
|
|
114
|
+
}
|
|
115
|
+
if (shouldOutputImageSequence) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
96
118
|
if (typeof crf !== 'number') {
|
|
97
119
|
throw new TypeError('CRF is unexpectedly not a number');
|
|
98
120
|
}
|
|
@@ -120,19 +142,28 @@ const renderMedia = async ({ parallelism, proResProfile, parallelEncoding, crf,
|
|
|
120
142
|
parallelism,
|
|
121
143
|
ffmpegExecutable,
|
|
122
144
|
onProgress: (frame) => {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
145
|
+
onProgress({
|
|
146
|
+
encodedFrames: frame,
|
|
147
|
+
renderedFrames,
|
|
148
|
+
renderedDoneIn,
|
|
149
|
+
encodedDoneIn,
|
|
150
|
+
stitchStage: 'muxing',
|
|
151
|
+
});
|
|
126
152
|
},
|
|
127
153
|
// TODO: Optimization, Now can download before!
|
|
128
154
|
onDownload,
|
|
129
155
|
webpackBundle: bundled,
|
|
130
156
|
verbose: remotion_1.Internals.Logging.isEqualOrBelowLogLevel('verbose'),
|
|
131
157
|
});
|
|
132
|
-
encodedFrames = config.durationInFrames;
|
|
133
158
|
encodedDoneIn = Date.now() - stitchStart;
|
|
134
|
-
|
|
159
|
+
onProgress({
|
|
160
|
+
encodedDoneIn,
|
|
161
|
+
encodedFrames,
|
|
162
|
+
renderedDoneIn,
|
|
163
|
+
renderedFrames,
|
|
164
|
+
stitchStage: 'muxing',
|
|
165
|
+
});
|
|
135
166
|
await closeBrowserPromise;
|
|
136
167
|
};
|
|
137
|
-
exports.
|
|
168
|
+
exports.renderVideo = renderVideo;
|
|
138
169
|
//# sourceMappingURL=render-video.js.map
|
package/dist/render-video.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-video.js","sourceRoot":"","sources":["../src/render-video.ts"],"names":[],"mappings":";;;;;;AACA,4CAAoB;AACpB,gDAAwB;AAExB,uCASkB;AAClB,yCAA4D;AAC5D,qCAAsC;
|
|
1
|
+
{"version":3,"file":"render-video.js","sourceRoot":"","sources":["../src/render-video.ts"],"names":[],"mappings":";;;;;;AACA,4CAAoB;AACpB,gDAAwB;AAExB,uCASkB;AAClB,yCAA4D;AAC5D,qCAAsC;AAuC/B,MAAM,WAAW,GAAG,KAAK,EAAE,EACjC,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,GAAG,EACH,SAAS,EACT,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,KAAK,EACL,YAAY,EACZ,OAAO,EACP,UAAU,EACV,OAAO,EACP,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,yBAAyB,EACzB,aAAa,EACb,OAAO,EACP,UAAU,GACU,EAAE,EAAE;;IACxB,IAAI,cAAqD,CAAC;IAC1D,IAAI,WAAW,CAAC;IAChB,IAAI,aAAa,GAAG,CAAC,CAAC;IACtB,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,IAAI,sBAA0C,CAAC;IAC/C,IAAI,cAAc,GAAkB,IAAI,CAAC;IACzC,IAAI,aAAa,GAAkB,IAAI,CAAC;IACxC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE/B,IAAI,gBAAgB,EAAE;QACrB,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC5B,MAAM,IAAI,SAAS,CAAC,kCAAkC,CAAC,CAAC;SACxD;QAED,sBAAsB,GAAG,cAAI,CAAC,IAAI,CACjC,SAAS,EACT,aAAa,GAAG,aAAa,CAC7B,CAAC;QAEF,WAAW,GAAG,MAAM,IAAA,sBAAW,EAAC;YAC/B,GAAG,EAAE,SAAS;YACd,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,cAAc,EAAE,sBAAsB;YACtC,KAAK,EAAE,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AM;QACrB,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,cAAc,EAAE,kBAAkB;QAClC,sBAAsB;QACtB,KAAK,EAAE,SAAS;QAChB,WAAW;QACX,WAAW;QACX,KAAK;QACL,aAAa;QACb,GAAG;QACH,UAAU;QACV,WAAW;QACX,gBAAgB;QAChB,UAAU,EAAE,CAAC,KAAa,EAAE,EAAE;YAC7B,UAAU,CAAC;gBACV,aAAa,EAAE,KAAK;gBACpB,cAAc;gBACd,cAAc;gBACd,aAAa;gBACb,WAAW,EAAE,QAAQ;aACrB,CAAC,CAAC;QACJ,CAAC;QACD,+CAA+C;QAC/C,UAAU;QACV,aAAa,EAAE,OAAO;QACtB,OAAO,EAAE,oBAAS,CAAC,OAAO,CAAC,sBAAsB,CAAC,SAAS,CAAC;KAC5D,CAAC,CAAC;IACH,aAAa,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,WAAW,CAAC;IACzC,UAAU,CAAC;QACV,aAAa;QACb,aAAa;QACb,cAAc;QACd,cAAc;QACd,WAAW,EAAE,QAAQ;KACrB,CAAC,CAAC;IAEH,MAAM,mBAAmB,CAAC;AAC3B,CAAC,CAAC;AAhMW,QAAA,WAAW,eAgMtB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SourceMapConsumer } from 'source-map';
|
|
2
|
+
import { StackFrame } from './parse-browser-error-stack';
|
|
3
|
+
export declare function getSourceMap(fileUri: string, fileContents: string): Promise<SourceMapConsumer>;
|
|
4
|
+
export declare type ScriptLine = {
|
|
5
|
+
lineNumber: number;
|
|
6
|
+
content: string;
|
|
7
|
+
highlight: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare type SymbolicatedStackFrame = {
|
|
10
|
+
originalFunctionName: string | null;
|
|
11
|
+
originalFileName: string | null;
|
|
12
|
+
originalLineNumber: number | null;
|
|
13
|
+
originalColumnNumber: number | null;
|
|
14
|
+
originalScriptCode: ScriptLine[] | null;
|
|
15
|
+
};
|
|
16
|
+
export declare const symbolicateStackTrace: (frames: StackFrame[]) => Promise<SymbolicatedStackFrame[]>;
|
|
17
|
+
//# sourceMappingURL=symbolicate-stacktrace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbolicate-stacktrace.d.ts","sourceRoot":"","sources":["../src/symbolicate-stacktrace.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,iBAAiB,EAAC,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAC;AA0BvD,wBAAsB,YAAY,CACjC,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GAClB,OAAO,CAAC,iBAAiB,CAAC,CAmB5B;AAiBD,oBAAY,UAAU,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,oBAAY,sBAAsB,GAAG;IACpC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,kBAAkB,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;CACxC,CAAC;AAmCF,eAAO,MAAM,qBAAqB,WACzB,UAAU,EAAE,KAClB,QAAQ,sBAAsB,EAAE,CAoClC,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.symbolicateStackTrace = exports.getSourceMap = void 0;
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
5
|
+
const read_file_1 = require("./assets/read-file");
|
|
6
|
+
const source_map_1 = require("source-map");
|
|
7
|
+
function extractSourceMapUrl(fileUri, fileContents) {
|
|
8
|
+
const regex = /\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/gm;
|
|
9
|
+
let match = null;
|
|
10
|
+
for (;;) {
|
|
11
|
+
const next = regex.exec(fileContents);
|
|
12
|
+
if (next == null) {
|
|
13
|
+
break;
|
|
14
|
+
}
|
|
15
|
+
match = next;
|
|
16
|
+
}
|
|
17
|
+
if (!(match === null || match === void 0 ? void 0 : match[1])) {
|
|
18
|
+
return Promise.reject(new Error(`Cannot find a source map directive for ${fileUri}.`));
|
|
19
|
+
}
|
|
20
|
+
return Promise.resolve(match[1].toString());
|
|
21
|
+
}
|
|
22
|
+
async function getSourceMap(fileUri, fileContents) {
|
|
23
|
+
const sm = await extractSourceMapUrl(fileUri, fileContents);
|
|
24
|
+
if (sm.indexOf('data:') === 0) {
|
|
25
|
+
const base64 = /^data:application\/json;([\w=:"-]+;)*base64,/;
|
|
26
|
+
const match2 = sm.match(base64);
|
|
27
|
+
if (!match2) {
|
|
28
|
+
throw new Error('Sorry, non-base64 inline source-map encoding is not supported.');
|
|
29
|
+
}
|
|
30
|
+
const converted = window.atob(sm.substring(match2[0].length));
|
|
31
|
+
return new source_map_1.SourceMapConsumer(JSON.parse(converted));
|
|
32
|
+
}
|
|
33
|
+
const index = fileUri.lastIndexOf('/');
|
|
34
|
+
const url = fileUri.substring(0, index + 1) + sm;
|
|
35
|
+
const obj = await fetchUrl(url);
|
|
36
|
+
return new source_map_1.SourceMapConsumer(obj);
|
|
37
|
+
}
|
|
38
|
+
exports.getSourceMap = getSourceMap;
|
|
39
|
+
const fetchUrl = async (url) => {
|
|
40
|
+
const res = await (0, read_file_1.readFile)(url);
|
|
41
|
+
return new Promise((resolve, reject) => {
|
|
42
|
+
let downloaded = '';
|
|
43
|
+
res.on('data', (d) => {
|
|
44
|
+
downloaded += d;
|
|
45
|
+
});
|
|
46
|
+
res.on('end', () => {
|
|
47
|
+
resolve(downloaded);
|
|
48
|
+
});
|
|
49
|
+
res.on('error', (err) => reject(err));
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
function getLinesAround(line, count, lines) {
|
|
53
|
+
const result = [];
|
|
54
|
+
for (let index = Math.max(0, line - 1 - count) + 1; index <= Math.min(lines.length - 1, line - 1 + count); ++index) {
|
|
55
|
+
result.push({
|
|
56
|
+
lineNumber: index + 1,
|
|
57
|
+
content: lines[index],
|
|
58
|
+
highlight: index + 1 === line,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
const getOriginalPosition = (source_map, line, column) => {
|
|
64
|
+
const result = source_map.originalPositionFor({
|
|
65
|
+
line,
|
|
66
|
+
column,
|
|
67
|
+
});
|
|
68
|
+
return { line: result.line, column: result.column, source: result.source };
|
|
69
|
+
};
|
|
70
|
+
const symbolicateStackTrace = async (frames) => {
|
|
71
|
+
const uniqueFileNames = [
|
|
72
|
+
...new Set(frames.map((f) => f.fileName).filter(remotion_1.Internals.truthy)),
|
|
73
|
+
];
|
|
74
|
+
const maps = await Promise.all(uniqueFileNames.map(async (fileName) => {
|
|
75
|
+
const fileContents = await fetchUrl(fileName);
|
|
76
|
+
return getSourceMap(fileName, fileContents);
|
|
77
|
+
}));
|
|
78
|
+
const mapValues = {};
|
|
79
|
+
for (let i = 0; i < uniqueFileNames.length; i++) {
|
|
80
|
+
mapValues[uniqueFileNames[i]] = maps[i];
|
|
81
|
+
}
|
|
82
|
+
return frames.map((frame) => {
|
|
83
|
+
const map = mapValues[frame.fileName];
|
|
84
|
+
const pos = getOriginalPosition(map, frame.lineNumber, frame.columnNumber);
|
|
85
|
+
const { functionName } = frame;
|
|
86
|
+
let hasSource = null;
|
|
87
|
+
hasSource = pos.source ? map.sourceContentFor(pos.source, false) : null;
|
|
88
|
+
const scriptCode = hasSource && pos.line
|
|
89
|
+
? getLinesAround(pos.line, 3, hasSource.split('\n'))
|
|
90
|
+
: null;
|
|
91
|
+
return {
|
|
92
|
+
originalColumnNumber: pos.column,
|
|
93
|
+
originalFileName: pos.source,
|
|
94
|
+
originalFunctionName: functionName,
|
|
95
|
+
originalLineNumber: pos.line ? pos.line : null,
|
|
96
|
+
originalScriptCode: scriptCode,
|
|
97
|
+
};
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
exports.symbolicateStackTrace = symbolicateStackTrace;
|
|
101
|
+
//# sourceMappingURL=symbolicate-stacktrace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbolicate-stacktrace.js","sourceRoot":"","sources":["../src/symbolicate-stacktrace.ts"],"names":[],"mappings":";;;AACA,uCAAmC;AACnC,kDAA4C;AAC5C,2CAA2D;AAG3D,SAAS,mBAAmB,CAC3B,OAAe,EACf,YAAoB;IAEpB,MAAM,KAAK,GAAG,6CAA6C,CAAC;IAC5D,IAAI,KAAK,GAAG,IAAI,CAAC;IACjB,SAAS;QACR,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACtC,IAAI,IAAI,IAAI,IAAI,EAAE;YACjB,MAAM;SACN;QAED,KAAK,GAAG,IAAI,CAAC;KACb;IAED,IAAI,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,CAAC,CAAC,CAAA,EAAE;QAChB,OAAO,OAAO,CAAC,MAAM,CACpB,IAAI,KAAK,CAAC,0CAA0C,OAAO,GAAG,CAAC,CAC/D,CAAC;KACF;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC7C,CAAC;AAEM,KAAK,UAAU,YAAY,CACjC,OAAe,EACf,YAAoB;IAEpB,MAAM,EAAE,GAAG,MAAM,mBAAmB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAC5D,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QAC9B,MAAM,MAAM,GAAG,8CAA8C,CAAC;QAC9D,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACh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C,kBAAkB,EAAE,UAAU;SAC9B,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AAtCW,QAAA,qBAAqB,yBAsChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-frame.d.ts","sourceRoot":"","sources":["../src/validate-frame.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,UAAW,MAAM,oBAAoB,MAAM,SAgCpE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateFrame = void 0;
|
|
4
|
+
const validateFrame = (frame, durationInFrames) => {
|
|
5
|
+
if (typeof frame === 'undefined') {
|
|
6
|
+
throw new TypeError(`Argument missing for parameter "frame"`);
|
|
7
|
+
}
|
|
8
|
+
if (typeof frame !== 'number') {
|
|
9
|
+
throw new TypeError(`Argument passed for "frame" is not a number: ${frame}`);
|
|
10
|
+
}
|
|
11
|
+
if (frame < 0) {
|
|
12
|
+
throw new RangeError(`Frame ${frame} cannot be negative`);
|
|
13
|
+
}
|
|
14
|
+
if (!Number.isFinite(frame)) {
|
|
15
|
+
throw new RangeError(`Frame ${frame} is not finite`);
|
|
16
|
+
}
|
|
17
|
+
if (frame % 1 !== 0) {
|
|
18
|
+
throw new RangeError(`Argument for frame must be an integer, but got ${frame}`);
|
|
19
|
+
}
|
|
20
|
+
if (frame > durationInFrames - 1) {
|
|
21
|
+
throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the highest frame that can be rendered is ${durationInFrames - 1}`);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.validateFrame = validateFrame;
|
|
25
|
+
//# sourceMappingURL=validate-frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-frame.js","sourceRoot":"","sources":["../src/validate-frame.ts"],"names":[],"mappings":";;;AAAO,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,gBAAwB,EAAE,EAAE;IACxE,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;QACjC,MAAM,IAAI,SAAS,CAAC,wCAAwC,CAAC,CAAC;KAC9D;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC9B,MAAM,IAAI,SAAS,CAClB,gDAAgD,KAAK,EAAE,CACvD,CAAC;KACF;IAED,IAAI,KAAK,GAAG,CAAC,EAAE;QACd,MAAM,IAAI,UAAU,CAAC,SAAS,KAAK,qBAAqB,CAAC,CAAC;KAC1D;IAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QAC5B,MAAM,IAAI,UAAU,CAAC,SAAS,KAAK,gBAAgB,CAAC,CAAC;KACrD;IAED,IAAI,KAAK,GAAG,CAAC,KAAK,CAAC,EAAE;QACpB,MAAM,IAAI,UAAU,CACnB,kDAAkD,KAAK,EAAE,CACzD,CAAC;KACF;IAED,IAAI,KAAK,GAAG,gBAAgB,GAAG,CAAC,EAAE;QACjC,MAAM,IAAI,UAAU,CACnB,oBAAoB,KAAK,gCAAgC,gBAAgB,yDACxE,gBAAgB,GAAG,CACpB,EAAE,CACF,CAAC;KACF;AACF,CAAC,CAAC;AAhCW,QAAA,aAAa,iBAgCxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=validate-quality.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-quality.d.ts","sourceRoot":"","sources":["../src/validate-quality.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-quality.js","sourceRoot":"","sources":["../src/validate-quality.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/renderer",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.13",
|
|
4
4
|
"description": "Renderer for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,12 +16,15 @@
|
|
|
16
16
|
"repository": {
|
|
17
17
|
"url": "https://github.com/remotion-dev/remotion"
|
|
18
18
|
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
21
|
+
},
|
|
19
22
|
"dependencies": {
|
|
20
|
-
"@remotion/bundler": "2.6.
|
|
23
|
+
"@remotion/bundler": "2.6.13",
|
|
21
24
|
"execa": "5.1.1",
|
|
22
25
|
"p-limit": "3.1.0",
|
|
23
26
|
"puppeteer-core": "13.1.2",
|
|
24
|
-
"remotion": "2.6.
|
|
27
|
+
"remotion": "2.6.13",
|
|
25
28
|
"serve-handler": "6.1.3"
|
|
26
29
|
},
|
|
27
30
|
"peerDependencies": {
|
|
@@ -44,8 +47,16 @@
|
|
|
44
47
|
"ts-jest": "^27.0.5",
|
|
45
48
|
"typescript": "^4.5.5"
|
|
46
49
|
},
|
|
50
|
+
"keywords": [
|
|
51
|
+
"remotion",
|
|
52
|
+
"ffmpeg",
|
|
53
|
+
"video",
|
|
54
|
+
"react",
|
|
55
|
+
"puppeteer",
|
|
56
|
+
"player"
|
|
57
|
+
],
|
|
47
58
|
"publishConfig": {
|
|
48
59
|
"access": "public"
|
|
49
60
|
},
|
|
50
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "f382c9698d1e43ea56d5d10174fe0a7419e31fd2"
|
|
51
62
|
}
|
package/.turbo/turbo-test.log
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
[33m@remotion/renderer:test: [0mcache hit, replaying output [2mc04be8ea4bb5f865[0m
|
|
2
|
-
[33m@remotion/renderer:test: [0m
|
|
3
|
-
[33m@remotion/renderer:test: [0m> @remotion/renderer@2.6.7 test /Users/jonathanburger/remotion/packages/renderer
|
|
4
|
-
[33m@remotion/renderer:test: [0m> jest
|
|
5
|
-
[33m@remotion/renderer:test: [0m
|
|
6
|
-
[33m@remotion/renderer:test: [0mwatchman warning: Recrawled this watch 45 times, most recently because:
|
|
7
|
-
[33m@remotion/renderer:test: [0mMustScanSubDirs UserDroppedTo resolve, please review the information on
|
|
8
|
-
[33m@remotion/renderer:test: [0mhttps://facebook.github.io/watchman/docs/troubleshooting.html#recrawl
|
|
9
|
-
[33m@remotion/renderer:test: [0mTo clear this warning, run:
|
|
10
|
-
[33m@remotion/renderer:test: [0m`watchman watch-del '/Users/jonathanburger/remotion' ; watchman watch-project '/Users/jonathanburger/remotion'`
|
|
11
|
-
[33m@remotion/renderer:test: [0m
|
|
12
|
-
[33m@remotion/renderer:test: [0mPASS src/test/serve-url.test.js (16.184 s)
|
|
13
|
-
[33m@remotion/renderer:test: [0mPASS src/test/serve-url.test.ts (16.791 s)
|
|
14
|
-
[33m@remotion/renderer:test: [0mPASS src/test/webpack-to-serve-url.test.ts
|
|
15
|
-
[33m@remotion/renderer:test: [0mPASS src/test/split-assets-into-segments.test.tsx (18.526 s)
|
|
16
|
-
[33m@remotion/renderer:test: [0mPASS src/test/ffmpeg-filters.test.ts (18.719 s)
|
|
17
|
-
[33m@remotion/renderer:test: [0mPASS src/test/ffmpeg-volume-expression.test.ts
|
|
18
|
-
[33m@remotion/renderer:test: [0mPASS src/test/dont-skip-assets.test.ts (19.047 s)
|
|
19
|
-
[33m@remotion/renderer:test: [0mPASS src/test/get-audio-channels.test.ts
|
|
20
|
-
[33m@remotion/renderer:test: [0mPASS src/test/parse-ffmpeg-version.test.ts
|
|
21
|
-
[33m@remotion/renderer:test: [0mPASS src/test/download-file.test.ts
|
|
22
|
-
[33m@remotion/renderer:test: [0mPASS src/test/asset-compression.test.ts
|
|
23
|
-
[33m@remotion/renderer:test: [0mPASS src/test/avoid-ffmpeg-stackoverflow.test.ts
|
|
24
|
-
[33m@remotion/renderer:test: [0mPASS src/test/flatten-volume-array.test.tsx
|
|
25
|
-
[33m@remotion/renderer:test: [0mPASS src/test/handle-weird-file-names.test.ts
|
|
26
|
-
[33m@remotion/renderer:test: [0mPASS src/test/parse-ffmpeg-progress.test.ts
|
|
27
|
-
[33m@remotion/renderer:test: [0mPASS src/test/avoid-asset-zero-length.test.ts
|
|
28
|
-
[33m@remotion/renderer:test: [0mPASS src/test/calculate-atempo.test.ts
|
|
29
|
-
[33m@remotion/renderer:test: [0mPASS src/test/validate-config-stitcher.test.ts
|
|
30
|
-
[33m@remotion/renderer:test: [0mPASS src/test/asset-is-used-at-time.test.ts
|
|
31
|
-
[33m@remotion/renderer:test: [0mPASS src/test/validate-config.test.ts (23.089 s)
|
|
32
|
-
[33m@remotion/renderer:test: [0mPASS src/test/render-still.test.ts
|
|
33
|
-
[33m@remotion/renderer:test: [0mPASS src/test/asset-calculation.test.tsx (31.688 s)
|
|
34
|
-
[33m@remotion/renderer:test: [0m
|
|
35
|
-
[33m@remotion/renderer:test: [0mTest Suites: 22 passed, 22 total
|
|
36
|
-
[33m@remotion/renderer:test: [0mTests: 61 passed, 61 total
|
|
37
|
-
[33m@remotion/renderer:test: [0mSnapshots: 0 total
|
|
38
|
-
[33m@remotion/renderer:test: [0mTime: 34.243 s
|
|
39
|
-
[33m@remotion/renderer:test: [0mRan all test suites.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-pro-res-profile-name.d.ts","sourceRoot":"","sources":["../src/get-pro-res-profile-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,aAAa,EAAC,MAAM,UAAU,CAAC;AAE9C,eAAO,MAAM,oBAAoB,UACzB,KAAK,iBACG,aAAa,GAAG,SAAS,KACtC,MAAM,GAAG,IAqBX,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getProResProfileName = void 0;
|
|
4
|
-
const getProResProfileName = (codec, proResProfile) => {
|
|
5
|
-
if (codec !== 'prores') {
|
|
6
|
-
return null;
|
|
7
|
-
}
|
|
8
|
-
switch (proResProfile) {
|
|
9
|
-
case '4444-xq':
|
|
10
|
-
return '5';
|
|
11
|
-
case '4444':
|
|
12
|
-
return '4';
|
|
13
|
-
case 'hq':
|
|
14
|
-
return '3';
|
|
15
|
-
case 'standard':
|
|
16
|
-
return '2';
|
|
17
|
-
case 'light':
|
|
18
|
-
return '1';
|
|
19
|
-
case 'proxy':
|
|
20
|
-
return '0';
|
|
21
|
-
default:
|
|
22
|
-
return '3';
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
exports.getProResProfileName = getProResProfileName;
|
|
26
|
-
//# sourceMappingURL=get-pro-res-profile-name.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-pro-res-profile-name.js","sourceRoot":"","sources":["../src/get-pro-res-profile-name.ts"],"names":[],"mappings":";;;AAEO,MAAM,oBAAoB,GAAG,CACnC,KAAY,EACZ,aAAwC,EACxB,EAAE;IAClB,IAAI,KAAK,KAAK,QAAQ,EAAE;QACvB,OAAO,IAAI,CAAC;KACZ;IAED,QAAQ,aAAa,EAAE;QACtB,KAAK,SAAS;YACb,OAAO,GAAG,CAAC;QACZ,KAAK,MAAM;YACV,OAAO,GAAG,CAAC;QACZ,KAAK,IAAI;YACR,OAAO,GAAG,CAAC;QACZ,KAAK,UAAU;YACd,OAAO,GAAG,CAAC;QACZ,KAAK,OAAO;YACX,OAAO,GAAG,CAAC;QACZ,KAAK,OAAO;YACX,OAAO,GAAG,CAAC;QACZ;YACC,OAAO,GAAG,CAAC;KACZ;AACF,CAAC,CAAC;AAxBW,QAAA,oBAAoB,wBAwB/B"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import execa from 'execa';
|
|
2
|
-
export declare const ENABLE_WASM_FFMPEG = true;
|
|
3
|
-
export declare const wasmFfmpeg: import("@ffmpeg/ffmpeg").FFmpeg;
|
|
4
|
-
export declare const load: Promise<void>;
|
|
5
|
-
export declare const runFfmpegCommand: (args: string[], isRenderBad: boolean, options?: execa.Options<string> | undefined) => Promise<execa.ExecaReturnValue<string>>;
|
|
6
|
-
//# sourceMappingURL=run-ffmpeg-command.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run-ffmpeg-command.d.ts","sourceRoot":"","sources":["../src/run-ffmpeg-command.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC,eAAO,MAAM,UAAU,iCAA4B,CAAC;AACpD,eAAO,MAAM,IAAI,eAAoB,CAAC;AAEtC,eAAO,MAAM,gBAAgB,SACtB,MAAM,EAAE,eACD,OAAO,yFAgBpB,CAAC"}
|
|
@@ -1,25 +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.runFfmpegCommand = exports.load = exports.wasmFfmpeg = exports.ENABLE_WASM_FFMPEG = void 0;
|
|
7
|
-
const ffmpeg_1 = require("@ffmpeg/ffmpeg");
|
|
8
|
-
const execa_1 = __importDefault(require("execa"));
|
|
9
|
-
const fs_1 = __importDefault(require("fs"));
|
|
10
|
-
exports.ENABLE_WASM_FFMPEG = true;
|
|
11
|
-
exports.wasmFfmpeg = ffmpeg_1.createFFmpeg({ log: true });
|
|
12
|
-
exports.load = exports.wasmFfmpeg.load();
|
|
13
|
-
const runFfmpegCommand = async (args, isRenderBad, options) => {
|
|
14
|
-
await exports.load;
|
|
15
|
-
await exports.wasmFfmpeg.run(...args);
|
|
16
|
-
if (isRenderBad) {
|
|
17
|
-
await fs_1.default.promises.writeFile('./hi.mp4',
|
|
18
|
-
// eslint-disable-next-line new-cap
|
|
19
|
-
exports.wasmFfmpeg.FS('readFile', 'hi.mp4'));
|
|
20
|
-
}
|
|
21
|
-
console.log('wasm done');
|
|
22
|
-
return execa_1.default('ffmpeg', args, options);
|
|
23
|
-
};
|
|
24
|
-
exports.runFfmpegCommand = runFfmpegCommand;
|
|
25
|
-
//# sourceMappingURL=run-ffmpeg-command.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run-ffmpeg-command.js","sourceRoot":"","sources":["../src/run-ffmpeg-command.ts"],"names":[],"mappings":";;;;;;AAAA,2CAA4C;AAC5C,kDAA0B;AAC1B,4CAAoB;AAEP,QAAA,kBAAkB,GAAG,IAAI,CAAC;AAE1B,QAAA,UAAU,GAAG,qBAAY,CAAC,EAAC,GAAG,EAAE,IAAI,EAAC,CAAC,CAAC;AACvC,QAAA,IAAI,GAAG,kBAAU,CAAC,IAAI,EAAE,CAAC;AAE/B,MAAM,gBAAgB,GAAG,KAAK,EACpC,IAAc,EACd,WAAoB,EACpB,OAAuB,EACtB,EAAE;IACH,MAAM,YAAI,CAAC;IAEX,MAAM,kBAAU,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IAC9B,IAAI,WAAW,EAAE;QAChB,MAAM,YAAE,CAAC,QAAQ,CAAC,SAAS,CAC1B,UAAU;QACV,mCAAmC;QACnC,kBAAU,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CACnC,CAAC;KACF;IAED,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACzB,OAAO,eAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AACvC,CAAC,CAAC;AAlBW,QAAA,gBAAgB,oBAkB3B"}
|