@remotion/renderer 4.0.5 → 4.0.6
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 +1 -1
- package/dist/browser/Browser.d.ts +3 -3
- package/dist/browser/Browser.js +1 -1
- package/dist/browser/BrowserPage.d.ts +4 -4
- package/dist/browser/BrowserPage.js +26 -8
- package/dist/browser/Target.d.ts +1 -1
- package/dist/browser/create-browser-fetcher.js +19 -24
- package/dist/compositor/compositor.d.ts +1 -1
- package/dist/compositor/compositor.js +1 -1
- package/dist/compositor/payloads.d.ts +10 -0
- package/dist/get-browser-instance.js +2 -2
- package/dist/get-bundle-url-from-serve-url.d.ts +2 -0
- package/dist/get-bundle-url-from-serve-url.js +30 -0
- package/dist/get-compositions.d.ts +1 -1
- package/dist/get-compositions.js +1 -1
- package/dist/get-video-metadata.d.ts +2 -0
- package/dist/get-video-metadata.js +14 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +3 -1
- package/dist/logger.d.ts +1 -0
- package/dist/logger.js +10 -0
- package/dist/prepare-server.d.ts +2 -2
- package/dist/prepare-server.js +3 -2
- package/dist/prespawn-ffmpeg.d.ts +1 -1
- package/dist/render-frames.d.ts +1 -1
- package/dist/render-frames.js +1 -1
- package/dist/render-media.d.ts +1 -1
- package/dist/render-still.d.ts +1 -1
- package/dist/render-still.js +2 -2
- package/dist/select-composition.d.ts +1 -1
- package/dist/set-props-and-env.js +1 -1
- package/dist/stitch-frames-to-video.d.ts +1 -1
- package/dist/symbolicate-stacktrace.d.ts +3 -2
- package/dist/symbolicate-stacktrace.js +14 -7
- package/package.json +10 -10
|
@@ -30,8 +30,8 @@ exports.cleanDownloadMap = exports.makeDownloadMap = void 0;
|
|
|
30
30
|
const node_fs_1 = __importStar(require("node:fs"));
|
|
31
31
|
const node_path_1 = __importDefault(require("node:path"));
|
|
32
32
|
const delete_directory_1 = require("../delete-directory");
|
|
33
|
-
const tmp_dir_1 = require("../tmp-dir");
|
|
34
33
|
const offthread_video_server_1 = require("../offthread-video-server");
|
|
34
|
+
const tmp_dir_1 = require("../tmp-dir");
|
|
35
35
|
const makeAndReturn = (dir, name) => {
|
|
36
36
|
const p = node_path_1.default.join(dir, name);
|
|
37
37
|
(0, node_fs_1.mkdirSync)(p);
|
|
@@ -41,8 +41,8 @@ export declare class HeadlessBrowser extends EventEmitter {
|
|
|
41
41
|
get _targets(): Map<string, Target>;
|
|
42
42
|
constructor(connection: Connection, defaultViewport: Viewport, closeCallback?: BrowserCloseCallback);
|
|
43
43
|
browserContexts(): BrowserContext[];
|
|
44
|
-
newPage(context: AnySourceMapConsumer | null
|
|
45
|
-
_createPageInContext(context: AnySourceMapConsumer | null
|
|
44
|
+
newPage(context: Promise<AnySourceMapConsumer | null>, logLevel: LogLevel, indent: boolean): Promise<Page>;
|
|
45
|
+
_createPageInContext(context: Promise<AnySourceMapConsumer | null>, logLevel: LogLevel, indent: boolean): Promise<Page>;
|
|
46
46
|
targets(): Target[];
|
|
47
47
|
waitForTarget(predicate: (x: Target) => boolean | Promise<boolean>, options?: WaitForTargetOptions): Promise<Target>;
|
|
48
48
|
pages(logLevel: LogLevel, indent: boolean): Promise<Page[]>;
|
|
@@ -57,7 +57,7 @@ export declare class BrowserContext extends EventEmitter {
|
|
|
57
57
|
timeout?: number;
|
|
58
58
|
}): Promise<Target>;
|
|
59
59
|
pages(logLevel: LogLevel, indent: boolean): Promise<Page[]>;
|
|
60
|
-
newPage(context: AnySourceMapConsumer | null
|
|
60
|
+
newPage(context: Promise<AnySourceMapConsumer | null>, logLevel: LogLevel, indent: boolean): Promise<Page>;
|
|
61
61
|
browser(): HeadlessBrowser;
|
|
62
62
|
}
|
|
63
63
|
export {};
|
package/dist/browser/Browser.js
CHANGED
|
@@ -199,7 +199,7 @@ class BrowserContext extends EventEmitter_1.EventEmitter {
|
|
|
199
199
|
async pages(logLevel, indent) {
|
|
200
200
|
const pages = await Promise.all(this.targets()
|
|
201
201
|
.filter((target) => target.type() === 'page')
|
|
202
|
-
.map((target) => target.page(null, logLevel, indent)));
|
|
202
|
+
.map((target) => target.page(Promise.resolve(null), logLevel, indent)));
|
|
203
203
|
return pages.filter((page) => {
|
|
204
204
|
return Boolean(page);
|
|
205
205
|
});
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { LogLevel } from '../log-level';
|
|
16
17
|
import type { AnySourceMapConsumer } from '../symbolicate-stacktrace';
|
|
17
18
|
import type { HeadlessBrowser } from './Browser';
|
|
18
19
|
import type { CDPSession } from './Connection';
|
|
@@ -25,7 +26,6 @@ import type { JSHandle } from './JSHandle';
|
|
|
25
26
|
import type { Viewport } from './PuppeteerViewport';
|
|
26
27
|
import type { Target } from './Target';
|
|
27
28
|
import { TaskQueue } from './TaskQueue';
|
|
28
|
-
import type { LogLevel } from '../log-level';
|
|
29
29
|
interface WaitForOptions {
|
|
30
30
|
timeout?: number;
|
|
31
31
|
}
|
|
@@ -47,7 +47,7 @@ export declare class Page extends EventEmitter {
|
|
|
47
47
|
target: Target;
|
|
48
48
|
defaultViewport: Viewport;
|
|
49
49
|
browser: HeadlessBrowser;
|
|
50
|
-
sourcemapContext: AnySourceMapConsumer | null
|
|
50
|
+
sourcemapContext: Promise<AnySourceMapConsumer | null>;
|
|
51
51
|
logLevel: LogLevel;
|
|
52
52
|
indent: boolean;
|
|
53
53
|
}): Promise<Page>;
|
|
@@ -60,7 +60,7 @@ export declare class Page extends EventEmitter {
|
|
|
60
60
|
client: CDPSession;
|
|
61
61
|
target: Target;
|
|
62
62
|
browser: HeadlessBrowser;
|
|
63
|
-
sourcemapContext: AnySourceMapConsumer | null
|
|
63
|
+
sourcemapContext: Promise<AnySourceMapConsumer | null>;
|
|
64
64
|
logLevel: LogLevel;
|
|
65
65
|
indent: boolean;
|
|
66
66
|
});
|
|
@@ -95,6 +95,6 @@ export declare class Page extends EventEmitter {
|
|
|
95
95
|
close(options?: {
|
|
96
96
|
runBeforeUnload?: boolean;
|
|
97
97
|
}): Promise<void>;
|
|
98
|
-
setBrowserSourceMapContext(context: AnySourceMapConsumer | null): void;
|
|
98
|
+
setBrowserSourceMapContext(context: Promise<AnySourceMapConsumer | null>): void;
|
|
99
99
|
}
|
|
100
100
|
export {};
|
|
@@ -29,6 +29,7 @@ var _Page_instances, _Page_client, _Page_target, _Page_timeoutSettings, _Page_fr
|
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
exports.Page = void 0;
|
|
31
31
|
const remotion_1 = require("remotion");
|
|
32
|
+
const format_logs_1 = require("../format-logs");
|
|
32
33
|
const logger_1 = require("../logger");
|
|
33
34
|
const truthy_1 = require("../truthy");
|
|
34
35
|
const assert_1 = require("./assert");
|
|
@@ -39,7 +40,6 @@ const JSHandle_1 = require("./JSHandle");
|
|
|
39
40
|
const TaskQueue_1 = require("./TaskQueue");
|
|
40
41
|
const TimeoutSettings_1 = require("./TimeoutSettings");
|
|
41
42
|
const util_1 = require("./util");
|
|
42
|
-
const format_logs_1 = require("../format-logs");
|
|
43
43
|
const shouldHideWarning = (log) => {
|
|
44
44
|
// Mixed Content warnings caused by localhost should not be displayed
|
|
45
45
|
if (log.text.includes('Mixed Content:') &&
|
|
@@ -71,13 +71,16 @@ class Page extends EventEmitter_1.EventEmitter {
|
|
|
71
71
|
_Page_timeoutSettings.set(this, new TimeoutSettings_1.TimeoutSettings());
|
|
72
72
|
_Page_frameManager.set(this, void 0);
|
|
73
73
|
_Page_pageBindings.set(this, new Map());
|
|
74
|
+
this.sourcemapContext = null;
|
|
74
75
|
__classPrivateFieldSet(this, _Page_client, client, "f");
|
|
75
76
|
__classPrivateFieldSet(this, _Page_target, target, "f");
|
|
76
77
|
__classPrivateFieldSet(this, _Page_frameManager, new FrameManager_1.FrameManager(client, this, __classPrivateFieldGet(this, _Page_timeoutSettings, "f")), "f");
|
|
77
78
|
this.screenshotTaskQueue = new TaskQueue_1.TaskQueue();
|
|
78
79
|
this.browser = browser;
|
|
79
80
|
this.id = String(Math.random());
|
|
80
|
-
|
|
81
|
+
sourcemapContext.then((context) => {
|
|
82
|
+
this.sourcemapContext = context;
|
|
83
|
+
});
|
|
81
84
|
this.logLevel = logLevel;
|
|
82
85
|
client.on('Target.attachedToTarget', (event) => {
|
|
83
86
|
switch (event.targetInfo.type) {
|
|
@@ -131,11 +134,24 @@ class Page extends EventEmitter_1.EventEmitter {
|
|
|
131
134
|
]
|
|
132
135
|
.filter(truthy_1.truthy)
|
|
133
136
|
.join(':');
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
const tag = [origPosition === null || origPosition === void 0 ? void 0 : origPosition.name, file].filter(truthy_1.truthy).join('@');
|
|
138
|
+
if (log.type === 'error') {
|
|
139
|
+
logger_1.Log.errorAdvanced({
|
|
140
|
+
logLevel,
|
|
141
|
+
tag,
|
|
142
|
+
indent,
|
|
143
|
+
}, log.previewString);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
logger_1.Log.verboseAdvanced({
|
|
147
|
+
logLevel,
|
|
148
|
+
tag,
|
|
149
|
+
indent,
|
|
150
|
+
}, log.previewString);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else if (log.type === 'error') {
|
|
154
|
+
logger_1.Log.errorAdvanced({ logLevel, tag: `console.${log.type}`, indent }, log.text);
|
|
139
155
|
}
|
|
140
156
|
else {
|
|
141
157
|
logger_1.Log.verboseAdvanced({ logLevel, tag: `console.${log.type}`, indent }, log.text);
|
|
@@ -234,7 +250,9 @@ class Page extends EventEmitter_1.EventEmitter {
|
|
|
234
250
|
}
|
|
235
251
|
}
|
|
236
252
|
setBrowserSourceMapContext(context) {
|
|
237
|
-
|
|
253
|
+
context.then((ctx) => {
|
|
254
|
+
this.sourcemapContext = ctx;
|
|
255
|
+
});
|
|
238
256
|
}
|
|
239
257
|
}
|
|
240
258
|
exports.Page = Page;
|
package/dist/browser/Target.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare class Target {
|
|
|
37
37
|
/**
|
|
38
38
|
* If the target is not of type `"page"` or `"background_page"`, returns `null`.
|
|
39
39
|
*/
|
|
40
|
-
page(sourcemapContext: AnySourceMapConsumer | null
|
|
40
|
+
page(sourcemapContext: Promise<AnySourceMapConsumer | null>, logLevel: LogLevel, indent: boolean): Promise<Page | null>;
|
|
41
41
|
url(): string;
|
|
42
42
|
/**
|
|
43
43
|
* Identifies what kind of target this is.
|
|
@@ -31,30 +31,25 @@ function getRevision(product) {
|
|
|
31
31
|
async function downloadBrowser(product) {
|
|
32
32
|
const revision = getRevision(product);
|
|
33
33
|
const revisionInfo = (0, BrowserFetcher_1.getRevisionInfo)(revision, product);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
|
-
catch (err) {
|
|
56
|
-
throw new Error(`Failed to set up ${supportedProducts[product]} r${revision}! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.`);
|
|
57
|
-
}
|
|
34
|
+
await (0, BrowserFetcher_1.download)({
|
|
35
|
+
revision: revisionInfo.revision,
|
|
36
|
+
progressCallback: (downloadedBytes, totalBytes) => {
|
|
37
|
+
console.log('Downloading', supportedProducts[product], toMegabytes(downloadedBytes) + '/' + toMegabytes(totalBytes));
|
|
38
|
+
},
|
|
39
|
+
product,
|
|
40
|
+
platform: (0, BrowserFetcher_1.getPlatform)(product),
|
|
41
|
+
downloadHost: (0, BrowserFetcher_1.getDownloadHost)(product),
|
|
42
|
+
downloadsFolder: (0, BrowserFetcher_1.getDownloadsFolder)(product),
|
|
43
|
+
});
|
|
44
|
+
const _localRevisions = await (0, BrowserFetcher_1.localRevisions)((0, BrowserFetcher_1.getDownloadsFolder)(product), product, (0, BrowserFetcher_1.getPlatform)(product));
|
|
45
|
+
console.log(`${supportedProducts[product]} (${revisionInfo.revision}) downloaded to ${revisionInfo.folderPath}`);
|
|
46
|
+
await Promise.all(_localRevisions
|
|
47
|
+
.filter((__revision) => {
|
|
48
|
+
return __revision !== revisionInfo.revision;
|
|
49
|
+
})
|
|
50
|
+
.map((__revision) => {
|
|
51
|
+
return (0, BrowserFetcher_1.removeBrowser)(__revision, (0, BrowserFetcher_1.getFolderPath)(revision, (0, BrowserFetcher_1.getDownloadsFolder)(product), (0, BrowserFetcher_1.getPlatform)(product)));
|
|
52
|
+
}));
|
|
58
53
|
}
|
|
59
54
|
exports.downloadBrowser = downloadBrowser;
|
|
60
55
|
function toMegabytes(bytes) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import type { CompositorCommand } from './payloads';
|
|
3
2
|
import type { LogLevel } from '../log-level';
|
|
3
|
+
import type { CompositorCommand } from './payloads';
|
|
4
4
|
export type Compositor = {
|
|
5
5
|
finishCommands: () => void;
|
|
6
6
|
executeCommand: <T extends keyof CompositorCommand>(type: T, payload: CompositorCommand[T]) => Promise<Buffer>;
|
|
@@ -9,11 +9,11 @@ const node_fs_1 = require("node:fs");
|
|
|
9
9
|
const node_os_1 = __importDefault(require("node:os"));
|
|
10
10
|
const call_ffmpeg_1 = require("../call-ffmpeg");
|
|
11
11
|
const get_concurrency_1 = require("../get-concurrency");
|
|
12
|
+
const log_level_1 = require("../log-level");
|
|
12
13
|
const logger_1 = require("../logger");
|
|
13
14
|
const compose_1 = require("./compose");
|
|
14
15
|
const get_executable_path_1 = require("./get-executable-path");
|
|
15
16
|
const make_nonce_1 = require("./make-nonce");
|
|
16
|
-
const log_level_1 = require("../log-level");
|
|
17
17
|
const getIdealMaximumFrameCacheItems = () => {
|
|
18
18
|
const freeMemory = node_os_1.default.freemem();
|
|
19
19
|
// Assuming 1 frame is approximately 6MB
|
|
@@ -27,6 +27,12 @@ export type Layer = {
|
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
export type CompositorImageFormat = 'Png' | 'Jpeg';
|
|
30
|
+
export type VideoMetadata = {
|
|
31
|
+
fps: number;
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
durationInSeconds: number;
|
|
35
|
+
};
|
|
30
36
|
export type CompositorCommand = {
|
|
31
37
|
Compose: {
|
|
32
38
|
output: string;
|
|
@@ -54,6 +60,10 @@ export type CompositorCommand = {
|
|
|
54
60
|
FreeUpMemory: {
|
|
55
61
|
percent_of_memory: number;
|
|
56
62
|
};
|
|
63
|
+
GetVideoMetadata: {
|
|
64
|
+
src: string;
|
|
65
|
+
};
|
|
66
|
+
VideoMetadata: VideoMetadata;
|
|
57
67
|
};
|
|
58
68
|
export type CompositorCommandSerialized<T extends keyof CompositorCommand> = {
|
|
59
69
|
nonce: string;
|
|
@@ -5,7 +5,7 @@ const browser_1 = require("./browser");
|
|
|
5
5
|
const open_browser_1 = require("./open-browser");
|
|
6
6
|
const getPageAndCleanupFn = async ({ passedInInstance, browserExecutable, chromiumOptions, context, forceDeviceScaleFactor, indent, logLevel, }) => {
|
|
7
7
|
if (passedInInstance) {
|
|
8
|
-
const page = await passedInInstance.newPage(context, logLevel, indent);
|
|
8
|
+
const page = await passedInInstance.newPage(Promise.resolve(context), logLevel, indent);
|
|
9
9
|
return {
|
|
10
10
|
page,
|
|
11
11
|
cleanup: () => {
|
|
@@ -26,7 +26,7 @@ const getPageAndCleanupFn = async ({ passedInInstance, browserExecutable, chromi
|
|
|
26
26
|
viewport: null,
|
|
27
27
|
logLevel,
|
|
28
28
|
});
|
|
29
|
-
const browserPage = await browserInstance.newPage(context, logLevel, indent);
|
|
29
|
+
const browserPage = await browserInstance.newPage(Promise.resolve(context), logLevel, indent);
|
|
30
30
|
return {
|
|
31
31
|
page: browserPage,
|
|
32
32
|
cleanup: () => {
|
|
@@ -0,0 +1,30 @@
|
|
|
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.getBundleMapUrlFromServeUrl = exports.getBundleUrlFromServeUrl = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const remotion_1 = require("remotion");
|
|
9
|
+
const is_serve_url_1 = require("./is-serve-url");
|
|
10
|
+
const map = (webpackBundleOrServeUrl, suffix) => {
|
|
11
|
+
if ((0, is_serve_url_1.isServeUrl)(webpackBundleOrServeUrl)) {
|
|
12
|
+
const parsed = new URL(webpackBundleOrServeUrl);
|
|
13
|
+
const idx = parsed.pathname.lastIndexOf('/');
|
|
14
|
+
if (idx === -1) {
|
|
15
|
+
return parsed.origin + '/' + suffix;
|
|
16
|
+
}
|
|
17
|
+
return parsed.origin + parsed.pathname.substring(0, idx + 1) + suffix;
|
|
18
|
+
}
|
|
19
|
+
const index = webpackBundleOrServeUrl.lastIndexOf(path_1.default.sep);
|
|
20
|
+
const url = webpackBundleOrServeUrl.substring(0, index + 1) + suffix;
|
|
21
|
+
return url;
|
|
22
|
+
};
|
|
23
|
+
const getBundleUrlFromServeUrl = (serveUrl) => {
|
|
24
|
+
return map(serveUrl, remotion_1.Internals.bundleName);
|
|
25
|
+
};
|
|
26
|
+
exports.getBundleUrlFromServeUrl = getBundleUrlFromServeUrl;
|
|
27
|
+
const getBundleMapUrlFromServeUrl = (serveUrl) => {
|
|
28
|
+
return map(serveUrl, remotion_1.Internals.bundleMapName);
|
|
29
|
+
};
|
|
30
|
+
exports.getBundleMapUrlFromServeUrl = getBundleMapUrlFromServeUrl;
|
|
@@ -2,9 +2,9 @@ import { type VideoConfig } from 'remotion';
|
|
|
2
2
|
import type { BrowserExecutable } from './browser-executable';
|
|
3
3
|
import type { BrowserLog } from './browser-log';
|
|
4
4
|
import type { HeadlessBrowser } from './browser/Browser';
|
|
5
|
+
import { type LogLevel } from './log-level';
|
|
5
6
|
import type { ChromiumOptions } from './open-browser';
|
|
6
7
|
import type { RemotionServer } from './prepare-server';
|
|
7
|
-
import { type LogLevel } from './log-level';
|
|
8
8
|
type InternalGetCompositionsOptions = {
|
|
9
9
|
serializedInputPropsWithCustomSchema: string;
|
|
10
10
|
envVariables: Record<string, string>;
|
package/dist/get-compositions.js
CHANGED
|
@@ -6,12 +6,12 @@ const TimeoutSettings_1 = require("./browser/TimeoutSettings");
|
|
|
6
6
|
const handle_javascript_exception_1 = require("./error-handling/handle-javascript-exception");
|
|
7
7
|
const find_closest_package_json_1 = require("./find-closest-package-json");
|
|
8
8
|
const get_browser_instance_1 = require("./get-browser-instance");
|
|
9
|
+
const logger_1 = require("./logger");
|
|
9
10
|
const prepare_server_1 = require("./prepare-server");
|
|
10
11
|
const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
|
|
11
12
|
const seek_to_frame_1 = require("./seek-to-frame");
|
|
12
13
|
const set_props_and_env_1 = require("./set-props-and-env");
|
|
13
14
|
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
14
|
-
const logger_1 = require("./logger");
|
|
15
15
|
const innerGetCompositions = async ({ envVariables, serializedInputPropsWithCustomSchema, onBrowserLog, page, proxyPort, serveUrl, timeoutInMilliseconds, indent, logLevel, }) => {
|
|
16
16
|
if (onBrowserLog) {
|
|
17
17
|
page.on('console', (log) => {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getVideoMetadata = void 0;
|
|
4
|
+
const compositor_1 = require("./compositor/compositor");
|
|
5
|
+
const getVideoMetadata = async (videoSource) => {
|
|
6
|
+
const compositor = (0, compositor_1.startLongRunningCompositor)((0, compositor_1.getIdealMaximumFrameCacheItems)(), 'info', false);
|
|
7
|
+
const metadataResponse = await compositor.executeCommand('GetVideoMetadata', {
|
|
8
|
+
src: videoSource,
|
|
9
|
+
});
|
|
10
|
+
compositor.finishCommands();
|
|
11
|
+
await compositor.waitForDone();
|
|
12
|
+
return JSON.parse(metadataResponse.toString('utf-8'));
|
|
13
|
+
};
|
|
14
|
+
exports.getVideoMetadata = getVideoMetadata;
|
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export type { FfmpegOverrideFn } from './ffmpeg-override';
|
|
|
17
17
|
export { FileExtension } from './file-extensions';
|
|
18
18
|
export { FrameRange } from './frame-range';
|
|
19
19
|
export { getCompositions, GetCompositionsOptions } from './get-compositions';
|
|
20
|
+
export { getVideoMetadata } from './get-video-metadata';
|
|
20
21
|
export { ImageFormat, StillImageFormat, validateSelectedPixelFormatAndImageFormatCombination, VideoImageFormat, } from './image-format';
|
|
21
22
|
export type { LogLevel } from './log-level';
|
|
22
23
|
export { CancelSignal, makeCancelSignal } from './make-cancel-signal';
|
|
@@ -366,6 +367,12 @@ export declare const RenderInternals: {
|
|
|
366
367
|
logLevel: "verbose" | "info" | "warn" | "error";
|
|
367
368
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
368
369
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
370
|
+
errorAdvanced: (options: {
|
|
371
|
+
indent: boolean;
|
|
372
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
373
|
+
} & {
|
|
374
|
+
tag?: string | undefined;
|
|
375
|
+
}, message?: any, ...optionalParams: any[]) => void;
|
|
369
376
|
};
|
|
370
377
|
getLogLevel: () => "verbose" | "info" | "warn" | "error";
|
|
371
378
|
setLogLevel: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
|
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.RenderInternals = exports.validateOutputFilename = exports.stitchFramesToVideo = exports.selectComposition = exports.renderStill = exports.renderMedia = exports.renderFrames = exports.openBrowser = exports.makeCancelSignal = exports.validateSelectedPixelFormatAndImageFormatCombination = exports.getCompositions = exports.ErrorWithStackFrame = void 0;
|
|
29
|
+
exports.RenderInternals = exports.validateOutputFilename = exports.stitchFramesToVideo = exports.selectComposition = exports.renderStill = exports.renderMedia = exports.renderFrames = exports.openBrowser = exports.makeCancelSignal = exports.validateSelectedPixelFormatAndImageFormatCombination = exports.getVideoMetadata = exports.getCompositions = exports.ErrorWithStackFrame = void 0;
|
|
30
30
|
const execa_1 = __importDefault(require("execa"));
|
|
31
31
|
const download_file_1 = require("./assets/download-file");
|
|
32
32
|
const audio_codec_1 = require("./audio-codec");
|
|
@@ -86,6 +86,8 @@ var handle_javascript_exception_1 = require("./error-handling/handle-javascript-
|
|
|
86
86
|
Object.defineProperty(exports, "ErrorWithStackFrame", { enumerable: true, get: function () { return handle_javascript_exception_1.ErrorWithStackFrame; } });
|
|
87
87
|
var get_compositions_2 = require("./get-compositions");
|
|
88
88
|
Object.defineProperty(exports, "getCompositions", { enumerable: true, get: function () { return get_compositions_2.getCompositions; } });
|
|
89
|
+
var get_video_metadata_1 = require("./get-video-metadata");
|
|
90
|
+
Object.defineProperty(exports, "getVideoMetadata", { enumerable: true, get: function () { return get_video_metadata_1.getVideoMetadata; } });
|
|
89
91
|
var image_format_2 = require("./image-format");
|
|
90
92
|
Object.defineProperty(exports, "validateSelectedPixelFormatAndImageFormatCombination", { enumerable: true, get: function () { return image_format_2.validateSelectedPixelFormatAndImageFormatCombination; } });
|
|
91
93
|
var make_cancel_signal_1 = require("./make-cancel-signal");
|
package/dist/logger.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare const Log: {
|
|
|
17
17
|
warn: (message?: any, ...optionalParams: any[]) => void;
|
|
18
18
|
warnAdvanced: (options: LogOptions, message?: any, ...optionalParams: any[]) => void;
|
|
19
19
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
20
|
+
errorAdvanced: (options: VerboseLogOptions, message?: any, ...optionalParams: any[]) => void;
|
|
20
21
|
};
|
|
21
22
|
export declare const getLogLevel: () => "verbose" | "info" | "warn" | "error";
|
|
22
23
|
export declare const setLogLevel: (newLogLevel: LogLevel) => void;
|
package/dist/logger.js
CHANGED
|
@@ -51,6 +51,16 @@ exports.Log = {
|
|
|
51
51
|
return console.error(...args.map((a) => chalk_1.chalk.red(a)));
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
|
+
errorAdvanced: (options, ...args) => {
|
|
55
|
+
if ((0, log_level_1.isEqualOrBelowLogLevel)((0, exports.getLogLevel)(), 'error')) {
|
|
56
|
+
return console.log(...[
|
|
57
|
+
options.indent ? exports.INDENT_TOKEN : null,
|
|
58
|
+
options.tag ? (0, exports.verboseTag)(options.tag) : null,
|
|
59
|
+
]
|
|
60
|
+
.filter(truthy_1.truthy)
|
|
61
|
+
.concat(args.map((a) => chalk_1.chalk.red(a))));
|
|
62
|
+
}
|
|
63
|
+
},
|
|
54
64
|
};
|
|
55
65
|
let logLevel = 'info';
|
|
56
66
|
const getLogLevel = () => {
|
package/dist/prepare-server.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
|
|
2
2
|
import type { DownloadMap } from './assets/download-map';
|
|
3
3
|
import type { Compositor } from './compositor/compositor';
|
|
4
|
-
import type { AnySourceMapConsumer } from './symbolicate-stacktrace';
|
|
5
4
|
import type { LogLevel } from './log-level';
|
|
5
|
+
import type { AnySourceMapConsumer } from './symbolicate-stacktrace';
|
|
6
6
|
export type RemotionServer = {
|
|
7
7
|
serveUrl: string;
|
|
8
8
|
closeServer: (force: boolean) => Promise<unknown>;
|
|
9
9
|
offthreadPort: number;
|
|
10
10
|
compositor: Compositor;
|
|
11
|
-
sourceMap: AnySourceMapConsumer | null
|
|
11
|
+
sourceMap: Promise<AnySourceMapConsumer | null>;
|
|
12
12
|
downloadMap: DownloadMap;
|
|
13
13
|
};
|
|
14
14
|
type PrepareServerOptions = {
|
package/dist/prepare-server.js
CHANGED
|
@@ -9,6 +9,7 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
9
9
|
const remotion_1 = require("remotion");
|
|
10
10
|
const download_and_map_assets_to_file_1 = require("./assets/download-and-map-assets-to-file");
|
|
11
11
|
const download_map_1 = require("./assets/download-map");
|
|
12
|
+
const get_bundle_url_from_serve_url_1 = require("./get-bundle-url-from-serve-url");
|
|
12
13
|
const is_serve_url_1 = require("./is-serve-url");
|
|
13
14
|
const logger_1 = require("./logger");
|
|
14
15
|
const serve_static_1 = require("./serve-static");
|
|
@@ -34,7 +35,7 @@ const prepareServer = async ({ webpackConfigOrServeUrl, port, remotionRoot, conc
|
|
|
34
35
|
},
|
|
35
36
|
offthreadPort,
|
|
36
37
|
compositor: comp,
|
|
37
|
-
sourceMap:
|
|
38
|
+
sourceMap: (0, symbolicate_stacktrace_1.getSourceMapFromRemoteUrl)((0, get_bundle_url_from_serve_url_1.getBundleMapUrlFromServeUrl)(webpackConfigOrServeUrl)),
|
|
38
39
|
downloadMap,
|
|
39
40
|
});
|
|
40
41
|
}
|
|
@@ -65,7 +66,7 @@ const prepareServer = async ({ webpackConfigOrServeUrl, port, remotionRoot, conc
|
|
|
65
66
|
serveUrl: `http://localhost:${serverPort}`,
|
|
66
67
|
offthreadPort: serverPort,
|
|
67
68
|
compositor,
|
|
68
|
-
sourceMap
|
|
69
|
+
sourceMap,
|
|
69
70
|
downloadMap,
|
|
70
71
|
});
|
|
71
72
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Codec } from './codec';
|
|
2
2
|
import type { FfmpegOverrideFn } from './ffmpeg-override';
|
|
3
3
|
import type { VideoImageFormat } from './image-format';
|
|
4
|
+
import type { LogLevel } from './log-level';
|
|
4
5
|
import type { CancelSignal } from './make-cancel-signal';
|
|
5
6
|
import type { PixelFormat } from './pixel-format';
|
|
6
7
|
import type { ProResProfile } from './prores-profile';
|
|
7
|
-
import type { LogLevel } from './log-level';
|
|
8
8
|
type RunningStatus = {
|
|
9
9
|
type: 'running';
|
|
10
10
|
} | {
|
package/dist/render-frames.d.ts
CHANGED
|
@@ -6,11 +6,11 @@ import type { BrowserLog } from './browser-log';
|
|
|
6
6
|
import type { HeadlessBrowser } from './browser/Browser';
|
|
7
7
|
import type { FrameRange } from './frame-range';
|
|
8
8
|
import type { VideoImageFormat } from './image-format';
|
|
9
|
+
import { type LogLevel } from './log-level';
|
|
9
10
|
import type { CancelSignal } from './make-cancel-signal';
|
|
10
11
|
import type { ChromiumOptions } from './open-browser';
|
|
11
12
|
import type { RemotionServer } from './prepare-server';
|
|
12
13
|
import type { OnStartData, RenderFramesOutput } from './types';
|
|
13
|
-
import { type LogLevel } from './log-level';
|
|
14
14
|
export type InternalRenderFramesOptions = {
|
|
15
15
|
onStart: null | ((data: OnStartData) => void);
|
|
16
16
|
onFrameUpdate: null | ((framesRendered: number, frameIndex: number, timeToRenderInMilliseconds: number) => void);
|
package/dist/render-frames.js
CHANGED
|
@@ -21,6 +21,7 @@ const get_duration_from_frame_range_1 = require("./get-duration-from-frame-range
|
|
|
21
21
|
const get_frame_padded_index_1 = require("./get-frame-padded-index");
|
|
22
22
|
const get_frame_to_render_1 = require("./get-frame-to-render");
|
|
23
23
|
const jpeg_quality_1 = require("./jpeg-quality");
|
|
24
|
+
const logger_1 = require("./logger");
|
|
24
25
|
const make_cancel_signal_1 = require("./make-cancel-signal");
|
|
25
26
|
const open_browser_1 = require("./open-browser");
|
|
26
27
|
const perf_1 = require("./perf");
|
|
@@ -33,7 +34,6 @@ const set_props_and_env_1 = require("./set-props-and-env");
|
|
|
33
34
|
const take_frame_and_compose_1 = require("./take-frame-and-compose");
|
|
34
35
|
const truthy_1 = require("./truthy");
|
|
35
36
|
const validate_scale_1 = require("./validate-scale");
|
|
36
|
-
const logger_1 = require("./logger");
|
|
37
37
|
const MAX_RETRIES_PER_FRAME = 1;
|
|
38
38
|
const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, jpegQuality, imageFormat, frameRange, onError, envVariables, onBrowserLog, onFrameBuffer, onDownload, pagesArray, serveUrl, composition, timeoutInMilliseconds, scale, actualConcurrency, everyNthFrame, proxyPort, cancelSignal, downloadMap, muted, makeBrowser, browserReplacer, compositor, sourcemapContext, logLevel, indent, }) => {
|
|
39
39
|
if (outputDir) {
|
package/dist/render-media.d.ts
CHANGED
|
@@ -9,13 +9,13 @@ import type { Codec } from './codec';
|
|
|
9
9
|
import type { FfmpegOverrideFn } from './ffmpeg-override';
|
|
10
10
|
import type { FrameRange } from './frame-range';
|
|
11
11
|
import type { VideoImageFormat } from './image-format';
|
|
12
|
+
import { type LogLevel } from './log-level';
|
|
12
13
|
import type { CancelSignal } from './make-cancel-signal';
|
|
13
14
|
import type { ChromiumOptions } from './open-browser';
|
|
14
15
|
import type { PixelFormat } from './pixel-format';
|
|
15
16
|
import type { RemotionServer } from './prepare-server';
|
|
16
17
|
import type { ProResProfile } from './prores-profile';
|
|
17
18
|
import type { OnStartData } from './types';
|
|
18
|
-
import { type LogLevel } from './log-level';
|
|
19
19
|
export type StitchingState = 'encoding' | 'muxing';
|
|
20
20
|
export type SlowFrame = {
|
|
21
21
|
frame: number;
|
package/dist/render-still.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ import type { BrowserExecutable } from './browser-executable';
|
|
|
5
5
|
import type { BrowserLog } from './browser-log';
|
|
6
6
|
import type { HeadlessBrowser } from './browser/Browser';
|
|
7
7
|
import type { StillImageFormat } from './image-format';
|
|
8
|
+
import type { LogLevel } from './log-level';
|
|
8
9
|
import type { CancelSignal } from './make-cancel-signal';
|
|
9
10
|
import type { ChromiumOptions } from './open-browser';
|
|
10
11
|
import type { RemotionServer } from './prepare-server';
|
|
11
|
-
import type { LogLevel } from './log-level';
|
|
12
12
|
type InternalRenderStillOptions = {
|
|
13
13
|
composition: VideoConfig;
|
|
14
14
|
output: string | null;
|
package/dist/render-still.js
CHANGED
|
@@ -38,6 +38,7 @@ const handle_javascript_exception_1 = require("./error-handling/handle-javascrip
|
|
|
38
38
|
const find_closest_package_json_1 = require("./find-closest-package-json");
|
|
39
39
|
const image_format_1 = require("./image-format");
|
|
40
40
|
const jpeg_quality_1 = require("./jpeg-quality");
|
|
41
|
+
const logger_1 = require("./logger");
|
|
41
42
|
const make_cancel_signal_1 = require("./make-cancel-signal");
|
|
42
43
|
const open_browser_1 = require("./open-browser");
|
|
43
44
|
const overwrite_1 = require("./overwrite");
|
|
@@ -48,7 +49,6 @@ const set_props_and_env_1 = require("./set-props-and-env");
|
|
|
48
49
|
const take_frame_and_compose_1 = require("./take-frame-and-compose");
|
|
49
50
|
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
50
51
|
const validate_scale_1 = require("./validate-scale");
|
|
51
|
-
const logger_1 = require("./logger");
|
|
52
52
|
const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFAULT_STILL_IMAGE_FORMAT, serveUrl, puppeteerInstance, onError, serializedInputPropsWithCustomSchema, envVariables, output, frame = 0, overwrite, browserExecutable, timeoutInMilliseconds, chromiumOptions, scale, proxyPort, cancelSignal, jpegQuality, onBrowserLog, compositor, sourceMapContext, downloadMap, logLevel, indent, serializedResolvedPropsWithCustomSchema, }) => {
|
|
53
53
|
remotion_1.Internals.validateDimension(composition.height, 'height', 'in the `config` object passed to `renderStill()`');
|
|
54
54
|
remotion_1.Internals.validateDimension(composition.width, 'width', 'in the `config` object passed to `renderStill()`');
|
|
@@ -93,7 +93,7 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
|
|
|
93
93
|
viewport: null,
|
|
94
94
|
logLevel,
|
|
95
95
|
}));
|
|
96
|
-
const page = await browserInstance.newPage(sourceMapContext, logLevel, indent);
|
|
96
|
+
const page = await browserInstance.newPage(Promise.resolve(sourceMapContext), logLevel, indent);
|
|
97
97
|
await page.setViewport({
|
|
98
98
|
width: composition.width,
|
|
99
99
|
height: composition.height,
|
|
@@ -2,9 +2,9 @@ import { type VideoConfig } from 'remotion';
|
|
|
2
2
|
import type { BrowserExecutable } from './browser-executable';
|
|
3
3
|
import type { BrowserLog } from './browser-log';
|
|
4
4
|
import type { HeadlessBrowser } from './browser/Browser';
|
|
5
|
+
import { type LogLevel } from './log-level';
|
|
5
6
|
import type { ChromiumOptions } from './open-browser';
|
|
6
7
|
import type { RemotionServer } from './prepare-server';
|
|
7
|
-
import { type LogLevel } from './log-level';
|
|
8
8
|
type InternalSelectCompositionsConfig = {
|
|
9
9
|
serializedInputPropsWithCustomSchema: string;
|
|
10
10
|
envVariables: Record<string, string>;
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.setPropsAndEnv = void 0;
|
|
4
4
|
const version_1 = require("remotion/version");
|
|
5
5
|
const TimeoutSettings_1 = require("./browser/TimeoutSettings");
|
|
6
|
+
const logger_1 = require("./logger");
|
|
6
7
|
const normalize_serve_url_1 = require("./normalize-serve-url");
|
|
7
8
|
const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
|
|
8
9
|
const redirect_status_codes_1 = require("./redirect-status-codes");
|
|
9
10
|
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
10
|
-
const logger_1 = require("./logger");
|
|
11
11
|
const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVariables, page, serveUrl, initialFrame, timeoutInMilliseconds, proxyPort, retriesRemaining, audioEnabled, videoEnabled, indent, logLevel, }) => {
|
|
12
12
|
(0, validate_puppeteer_timeout_1.validatePuppeteerTimeout)(timeoutInMilliseconds);
|
|
13
13
|
const actualTimeout = timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : TimeoutSettings_1.DEFAULT_TIMEOUT;
|
|
@@ -4,10 +4,10 @@ import type { RenderAssetInfo } from './assets/download-map';
|
|
|
4
4
|
import type { AudioCodec } from './audio-codec';
|
|
5
5
|
import type { Codec } from './codec';
|
|
6
6
|
import type { FfmpegOverrideFn } from './ffmpeg-override';
|
|
7
|
+
import type { LogLevel } from './log-level';
|
|
7
8
|
import type { CancelSignal } from './make-cancel-signal';
|
|
8
9
|
import type { PixelFormat } from './pixel-format';
|
|
9
10
|
import type { ProResProfile } from './prores-profile';
|
|
10
|
-
import type { LogLevel } from './log-level';
|
|
11
11
|
type InternalStitchFramesToVideoOptions = {
|
|
12
12
|
audioBitrate: string | null;
|
|
13
13
|
videoBitrate: string | null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BasicSourceMapConsumer, IndexedSourceMapConsumer } from 'source-map';
|
|
2
2
|
import { SourceMapConsumer } from 'source-map';
|
|
3
3
|
import type { UnsymbolicatedStackFrame } from './parse-browser-error-stack';
|
|
4
|
+
export declare const getSourceMapFromRemoteUrl: (url: string) => Promise<BasicSourceMapConsumer | IndexedSourceMapConsumer>;
|
|
4
5
|
type ScriptLine = {
|
|
5
6
|
lineNumber: number;
|
|
6
7
|
content: string;
|
|
@@ -22,7 +23,7 @@ export declare const symbolicateStackFrame: (frame: UnsymbolicatedStackFrame, ma
|
|
|
22
23
|
originalLineNumber: number | null;
|
|
23
24
|
originalScriptCode: ScriptLine[] | null;
|
|
24
25
|
};
|
|
25
|
-
export declare const getSourceMapFromRemoteFile: (fileName: string) => Promise<
|
|
26
|
-
export declare const getSourceMapFromLocalFile: (fileName: string) => Promise<
|
|
26
|
+
export declare const getSourceMapFromRemoteFile: (fileName: string) => Promise<AnySourceMapConsumer | null>;
|
|
27
|
+
export declare const getSourceMapFromLocalFile: (fileName: string) => Promise<AnySourceMapConsumer | null>;
|
|
27
28
|
export type AnySourceMapConsumer = BasicSourceMapConsumer | IndexedSourceMapConsumer;
|
|
28
29
|
export {};
|
|
@@ -3,7 +3,7 @@ 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.getSourceMapFromLocalFile = exports.getSourceMapFromRemoteFile = exports.symbolicateStackFrame = exports.symbolicateFromSources = exports.symbolicateStackTraceFromRemoteFrames = void 0;
|
|
6
|
+
exports.getSourceMapFromLocalFile = exports.getSourceMapFromRemoteFile = exports.symbolicateStackFrame = exports.symbolicateFromSources = exports.symbolicateStackTraceFromRemoteFrames = exports.getSourceMapFromRemoteUrl = void 0;
|
|
7
7
|
const fs_1 = require("fs");
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const source_map_1 = require("source-map");
|
|
@@ -24,10 +24,18 @@ function extractSourceMapUrl(fileContents) {
|
|
|
24
24
|
}
|
|
25
25
|
return match[1].toString();
|
|
26
26
|
}
|
|
27
|
-
const
|
|
27
|
+
const getSourceMapFromRemoteUrl = async (url) => {
|
|
28
|
+
if (!url.endsWith('.js.map')) {
|
|
29
|
+
throw new Error(`The URL ${url} does not seem to be a valid source map URL.`);
|
|
30
|
+
}
|
|
31
|
+
const obj = await fetchUrl(url);
|
|
32
|
+
return new source_map_1.SourceMapConsumer(obj);
|
|
33
|
+
};
|
|
34
|
+
exports.getSourceMapFromRemoteUrl = getSourceMapFromRemoteUrl;
|
|
35
|
+
const getSourceMap = (filePath, fileContents, type) => {
|
|
28
36
|
const sm = extractSourceMapUrl(fileContents);
|
|
29
37
|
if (sm === null) {
|
|
30
|
-
return null;
|
|
38
|
+
return Promise.resolve(null);
|
|
31
39
|
}
|
|
32
40
|
if (sm.indexOf('data:') === 0) {
|
|
33
41
|
const base64 = /^data:application\/json;([\w=:"-]+;)*base64,/;
|
|
@@ -36,17 +44,16 @@ const getSourceMap = async (filePath, fileContents, type) => {
|
|
|
36
44
|
throw new Error('Sorry, non-base64 inline source-map encoding is not supported.');
|
|
37
45
|
}
|
|
38
46
|
const converted = window.atob(sm.substring(match2[0].length));
|
|
39
|
-
return new source_map_1.SourceMapConsumer(JSON.parse(converted));
|
|
47
|
+
return Promise.resolve(new source_map_1.SourceMapConsumer(JSON.parse(converted)));
|
|
40
48
|
}
|
|
41
49
|
if (type === 'local') {
|
|
42
50
|
// Find adjacent file: bundle.js -> bundle.js.map
|
|
43
51
|
const newFilePath = path_1.default.join(path_1.default.dirname(filePath), sm);
|
|
44
|
-
return new source_map_1.SourceMapConsumer((0, fs_1.readFileSync)(newFilePath, 'utf8'));
|
|
52
|
+
return Promise.resolve(new source_map_1.SourceMapConsumer((0, fs_1.readFileSync)(newFilePath, 'utf8')));
|
|
45
53
|
}
|
|
46
54
|
const index = filePath.lastIndexOf('/');
|
|
47
55
|
const url = filePath.substring(0, index + 1) + sm;
|
|
48
|
-
|
|
49
|
-
return new source_map_1.SourceMapConsumer(obj);
|
|
56
|
+
return (0, exports.getSourceMapFromRemoteUrl)(url);
|
|
50
57
|
};
|
|
51
58
|
const fetchUrl = async (url) => {
|
|
52
59
|
const res = await (0, read_file_1.readFile)(url);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/renderer",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.6",
|
|
4
4
|
"description": "Renderer for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"extract-zip": "2.0.1",
|
|
19
19
|
"source-map": "^0.8.0-beta.0",
|
|
20
20
|
"ws": "8.7.0",
|
|
21
|
-
"remotion": "4.0.
|
|
21
|
+
"remotion": "4.0.6"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": ">=16.8.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@types/react-dom": "18.0.10",
|
|
35
35
|
"eslint": "8.42.0",
|
|
36
36
|
"prettier": "^2.7.1",
|
|
37
|
-
"prettier-plugin-organize-imports": "^2.
|
|
37
|
+
"prettier-plugin-organize-imports": "^3.2.2",
|
|
38
38
|
"react": "18.0.0",
|
|
39
39
|
"react-dom": "18.0.0",
|
|
40
40
|
"typescript": "4.9.5",
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"zod": "^3.21.4"
|
|
43
43
|
},
|
|
44
44
|
"optionalDependencies": {
|
|
45
|
-
"@remotion/compositor-darwin-arm64": "4.0.
|
|
46
|
-
"@remotion/compositor-
|
|
47
|
-
"@remotion/compositor-linux-
|
|
48
|
-
"@remotion/compositor-
|
|
49
|
-
"@remotion/compositor-linux-x64-
|
|
50
|
-
"@remotion/compositor-linux-
|
|
51
|
-
"@remotion/compositor-
|
|
45
|
+
"@remotion/compositor-darwin-arm64": "4.0.6",
|
|
46
|
+
"@remotion/compositor-darwin-x64": "4.0.6",
|
|
47
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.6",
|
|
48
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.6",
|
|
49
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.6",
|
|
50
|
+
"@remotion/compositor-linux-x64-musl": "4.0.6",
|
|
51
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.6"
|
|
52
52
|
},
|
|
53
53
|
"keywords": [
|
|
54
54
|
"remotion",
|