@remotion/renderer 4.1.0-alpha1 → 4.1.0-alpha10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/download-and-map-assets-to-file.d.ts +2 -4
- package/dist/assets/download-and-map-assets-to-file.js +14 -10
- package/dist/assets/download-map.d.ts +4 -0
- package/dist/assets/download-map.js +3 -0
- package/dist/audio-codec.d.ts +1 -1
- package/dist/browser/Browser.d.ts +7 -6
- package/dist/browser/Browser.js +13 -13
- package/dist/browser/BrowserPage.d.ts +21 -6
- package/dist/browser/BrowserPage.js +80 -19
- package/dist/browser/BrowserRunner.d.ts +0 -1
- package/dist/browser/BrowserRunner.js +6 -6
- package/dist/browser/Connection.d.ts +9 -3
- package/dist/browser/Connection.js +11 -3
- package/dist/browser/ConsoleMessage.d.ts +8 -1
- package/dist/browser/ConsoleMessage.js +2 -1
- package/dist/browser/DOMWorld.d.ts +10 -4
- package/dist/browser/DOMWorld.js +16 -15
- package/dist/browser/ExecutionContext.js +4 -4
- package/dist/browser/FrameManager.d.ts +3 -6
- package/dist/browser/FrameManager.js +11 -16
- package/dist/browser/LaunchOptions.d.ts +2 -0
- package/dist/browser/Launcher.js +3 -3
- package/dist/browser/NetworkManager.d.ts +4 -1
- package/dist/browser/Target.d.ts +2 -1
- package/dist/browser/Target.js +3 -1
- package/dist/browser/create-browser-fetcher.js +19 -24
- package/dist/browser/devtools-types.d.ts +59 -0
- package/dist/browser/should-log-message.js +14 -0
- package/dist/chalk/index.d.ts +2 -1
- package/dist/chalk/index.js +3 -8
- package/dist/chalk/is-color-supported.d.ts +1 -1
- package/dist/chalk/is-color-supported.js +18 -10
- package/dist/client.d.ts +26 -31
- package/dist/compositor/compose.js +6 -1
- package/dist/compositor/compositor.d.ts +3 -2
- package/dist/compositor/compositor.js +10 -10
- package/dist/compositor/payloads.d.ts +15 -1
- package/dist/create-ffmpeg-merge-filter.js +1 -2
- package/dist/cycle-browser-tabs.d.ts +2 -1
- package/dist/cycle-browser-tabs.js +2 -2
- package/dist/format-logs.d.ts +3 -0
- package/dist/format-logs.js +207 -0
- package/dist/get-browser-instance.d.ts +3 -2
- package/dist/get-browser-instance.js +5 -5
- 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 +7 -6
- package/dist/get-compositions.js +21 -11
- package/dist/get-extension-from-codec.d.ts +2 -2
- package/dist/get-local-browser-executable.js +15 -0
- package/dist/get-video-metadata.d.ts +2 -0
- package/dist/get-video-metadata.js +14 -0
- package/dist/index.d.ts +64 -61
- package/dist/index.js +3 -1
- package/dist/logger.d.ts +2 -2
- package/dist/logger.js +23 -18
- package/dist/offthread-video-server.d.ts +3 -3
- package/dist/offthread-video-server.js +65 -29
- package/dist/open-browser.d.ts +3 -2
- package/dist/open-browser.js +7 -5
- package/dist/options/crf.js +1 -1
- package/dist/options/video-codec.js +1 -1
- package/dist/perf.js +4 -2
- package/dist/prepare-server.d.ts +4 -5
- package/dist/prepare-server.js +16 -14
- package/dist/prespawn-ffmpeg.d.ts +2 -1
- package/dist/prespawn-ffmpeg.js +3 -31
- package/dist/puppeteer-evaluate.d.ts +4 -1
- package/dist/puppeteer-evaluate.js +5 -5
- package/dist/render-frames.d.ts +16 -8
- package/dist/render-frames.js +50 -22
- package/dist/render-media.d.ts +17 -9
- package/dist/render-media.js +41 -26
- package/dist/render-still.d.ts +13 -6
- package/dist/render-still.js +32 -17
- package/dist/replace-browser.d.ts +2 -1
- package/dist/replace-browser.js +2 -2
- package/dist/screenshot-task.js +4 -2
- package/dist/seek-to-frame.d.ts +8 -2
- package/dist/seek-to-frame.js +87 -25
- package/dist/select-composition.d.ts +10 -5
- package/dist/select-composition.js +39 -18
- package/dist/serialize-props.d.ts +6 -0
- package/dist/serialize-props.js +36 -0
- package/dist/serve-handler/index.js +1 -1
- package/dist/serve-static.d.ts +2 -3
- package/dist/serve-static.js +10 -4
- package/dist/set-props-and-env.d.ts +4 -1
- package/dist/set-props-and-env.js +52 -22
- package/dist/stitch-frames-to-video.d.ts +2 -1
- package/dist/stitch-frames-to-video.js +12 -22
- package/dist/symbolicate-stacktrace.d.ts +3 -2
- package/dist/symbolicate-stacktrace.js +14 -7
- package/dist/take-frame-and-compose.js +1 -1
- package/dist/validate-output-filename.d.ts +1 -1
- package/package.json +10 -10
package/dist/serve-static.js
CHANGED
|
@@ -9,10 +9,10 @@ const get_port_1 = require("./get-port");
|
|
|
9
9
|
const offthread_video_server_1 = require("./offthread-video-server");
|
|
10
10
|
const serve_handler_1 = require("./serve-handler");
|
|
11
11
|
const serveStatic = async (path, options) => {
|
|
12
|
-
const { listener: offthreadRequest, close: closeCompositor, compositor,
|
|
12
|
+
const { listener: offthreadRequest, close: closeCompositor, compositor, } = (0, offthread_video_server_1.startOffthreadVideoServer)({
|
|
13
13
|
downloadMap: options.downloadMap,
|
|
14
14
|
concurrency: options.concurrency,
|
|
15
|
-
|
|
15
|
+
logLevel: options.logLevel,
|
|
16
16
|
indent: options.indent,
|
|
17
17
|
});
|
|
18
18
|
const connections = {};
|
|
@@ -67,7 +67,13 @@ const serveStatic = async (path, options) => {
|
|
|
67
67
|
};
|
|
68
68
|
const close = async () => {
|
|
69
69
|
await Promise.all([
|
|
70
|
-
|
|
70
|
+
new Promise((resolve) => {
|
|
71
|
+
// compositor may have already quit before,
|
|
72
|
+
// this is okay as we are in cleanup phase
|
|
73
|
+
closeCompositor().finally(() => {
|
|
74
|
+
resolve();
|
|
75
|
+
});
|
|
76
|
+
}),
|
|
71
77
|
new Promise((resolve, reject) => {
|
|
72
78
|
destroyConnections();
|
|
73
79
|
server.close((err) => {
|
|
@@ -85,7 +91,7 @@ const serveStatic = async (path, options) => {
|
|
|
85
91
|
}),
|
|
86
92
|
]);
|
|
87
93
|
};
|
|
88
|
-
return { port: selectedPort, close, compositor
|
|
94
|
+
return { port: selectedPort, close, compositor };
|
|
89
95
|
}
|
|
90
96
|
catch (err) {
|
|
91
97
|
if (!(err instanceof Error)) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Page } from './browser/BrowserPage';
|
|
2
|
+
import type { LogLevel } from './log-level';
|
|
2
3
|
type SetPropsAndEnv = {
|
|
3
|
-
|
|
4
|
+
serializedInputPropsWithCustomSchema: string;
|
|
4
5
|
envVariables: Record<string, string> | undefined;
|
|
5
6
|
page: Page;
|
|
6
7
|
serveUrl: string;
|
|
@@ -10,6 +11,8 @@ type SetPropsAndEnv = {
|
|
|
10
11
|
retriesRemaining: number;
|
|
11
12
|
audioEnabled: boolean;
|
|
12
13
|
videoEnabled: boolean;
|
|
14
|
+
indent: boolean;
|
|
15
|
+
logLevel: LogLevel;
|
|
13
16
|
};
|
|
14
17
|
export declare const setPropsAndEnv: (params: SetPropsAndEnv) => Promise<unknown>;
|
|
15
18
|
export {};
|
|
@@ -3,11 +3,12 @@ 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 innerSetPropsAndEnv = async ({
|
|
11
|
+
const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVariables, page, serveUrl, initialFrame, timeoutInMilliseconds, proxyPort, retriesRemaining, audioEnabled, videoEnabled, indent, logLevel, }) => {
|
|
11
12
|
(0, validate_puppeteer_timeout_1.validatePuppeteerTimeout)(timeoutInMilliseconds);
|
|
12
13
|
const actualTimeout = timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : TimeoutSettings_1.DEFAULT_TIMEOUT;
|
|
13
14
|
page.setDefaultTimeout(actualTimeout);
|
|
@@ -16,14 +17,9 @@ const innerSetPropsAndEnv = async ({ inputProps, envVariables, page, serveUrl, i
|
|
|
16
17
|
await page.evaluateOnNewDocument((timeout) => {
|
|
17
18
|
window.remotion_puppeteerTimeout = timeout;
|
|
18
19
|
}, actualTimeout);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
if (inputProps) {
|
|
23
|
-
await page.evaluateOnNewDocument((input) => {
|
|
24
|
-
window.remotion_inputProps = input;
|
|
25
|
-
}, JSON.stringify(inputProps));
|
|
26
|
-
}
|
|
20
|
+
await page.evaluateOnNewDocument((input) => {
|
|
21
|
+
window.remotion_inputProps = input;
|
|
22
|
+
}, serializedInputPropsWithCustomSchema);
|
|
27
23
|
if (envVariables) {
|
|
28
24
|
await page.evaluateOnNewDocument((input) => {
|
|
29
25
|
window.remotion_envVariables = input;
|
|
@@ -41,7 +37,7 @@ const innerSetPropsAndEnv = async ({ inputProps, envVariables, page, serveUrl, i
|
|
|
41
37
|
await page.evaluateOnNewDocument((enabled) => {
|
|
42
38
|
window.remotion_videoEnabled = enabled;
|
|
43
39
|
}, videoEnabled);
|
|
44
|
-
const pageRes = await page.goto(urlToVisit);
|
|
40
|
+
const pageRes = await page.goto({ url: urlToVisit, timeout: actualTimeout });
|
|
45
41
|
if (pageRes === null) {
|
|
46
42
|
throw new Error(`Visited "${urlToVisit}" but got no response.`);
|
|
47
43
|
}
|
|
@@ -57,7 +53,7 @@ const innerSetPropsAndEnv = async ({ inputProps, envVariables, page, serveUrl, i
|
|
|
57
53
|
return innerSetPropsAndEnv({
|
|
58
54
|
envVariables,
|
|
59
55
|
initialFrame,
|
|
60
|
-
|
|
56
|
+
serializedInputPropsWithCustomSchema,
|
|
61
57
|
page,
|
|
62
58
|
proxyPort,
|
|
63
59
|
retriesRemaining: retriesRemaining - 1,
|
|
@@ -65,12 +61,14 @@ const innerSetPropsAndEnv = async ({ inputProps, envVariables, page, serveUrl, i
|
|
|
65
61
|
timeoutInMilliseconds,
|
|
66
62
|
audioEnabled,
|
|
67
63
|
videoEnabled,
|
|
64
|
+
indent,
|
|
65
|
+
logLevel,
|
|
68
66
|
});
|
|
69
67
|
}
|
|
70
68
|
if (!redirect_status_codes_1.redirectStatusCodes.every((code) => code !== status)) {
|
|
71
69
|
throw new Error(`Error while getting compositions: Tried to go to ${urlToVisit} but the status code was ${status} instead of 200. Does the site you specified exist?`);
|
|
72
70
|
}
|
|
73
|
-
const isRemotionFn = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
71
|
+
const { value: isRemotionFn } = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
74
72
|
pageFunction: () => {
|
|
75
73
|
return window.getStaticCompositions;
|
|
76
74
|
},
|
|
@@ -78,10 +76,25 @@ const innerSetPropsAndEnv = async ({ inputProps, envVariables, page, serveUrl, i
|
|
|
78
76
|
frame: null,
|
|
79
77
|
page,
|
|
80
78
|
});
|
|
81
|
-
if (isRemotionFn === undefined) {
|
|
82
|
-
|
|
79
|
+
if (typeof isRemotionFn === 'undefined') {
|
|
80
|
+
const { value: body } = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
81
|
+
pageFunction: () => {
|
|
82
|
+
return document.body.innerHTML;
|
|
83
|
+
},
|
|
84
|
+
args: [],
|
|
85
|
+
frame: null,
|
|
86
|
+
page,
|
|
87
|
+
});
|
|
88
|
+
const errorMessage = [
|
|
89
|
+
`Error while getting compositions: Tried to go to ${urlToVisit} and verify that it is a Remotion project by checking if window.getStaticCompositions is defined.`,
|
|
90
|
+
'However, the function was undefined, which indicates that this is not a valid Remotion project. Please check the URL you passed.',
|
|
91
|
+
'The page loaded contained the following markup:',
|
|
92
|
+
body.substring(0, 500) + (body.length > 500 ? '...' : ''),
|
|
93
|
+
'Does this look like a foreign page? If so, try to stop this server.',
|
|
94
|
+
].join('\n');
|
|
95
|
+
throw new Error(errorMessage);
|
|
83
96
|
}
|
|
84
|
-
const siteVersion = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
97
|
+
const { value: siteVersion } = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
85
98
|
pageFunction: () => {
|
|
86
99
|
return window.siteVersion;
|
|
87
100
|
},
|
|
@@ -89,7 +102,7 @@ const innerSetPropsAndEnv = async ({ inputProps, envVariables, page, serveUrl, i
|
|
|
89
102
|
frame: null,
|
|
90
103
|
page,
|
|
91
104
|
});
|
|
92
|
-
const remotionVersion = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
105
|
+
const { value: remotionVersion } = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
93
106
|
pageFunction: () => {
|
|
94
107
|
return window.remotion_version;
|
|
95
108
|
},
|
|
@@ -97,16 +110,33 @@ const innerSetPropsAndEnv = async ({ inputProps, envVariables, page, serveUrl, i
|
|
|
97
110
|
frame: null,
|
|
98
111
|
page,
|
|
99
112
|
});
|
|
100
|
-
const requiredVersion = '
|
|
113
|
+
const requiredVersion = '9';
|
|
101
114
|
if (siteVersion !== requiredVersion) {
|
|
102
|
-
throw new Error(
|
|
115
|
+
throw new Error([
|
|
116
|
+
`Incompatible site: When visiting ${urlToVisit}, a bundle was found, but one that is not compatible with this version of Remotion. Found version: ${siteVersion} - Required version: ${requiredVersion}. To resolve this error:`,
|
|
117
|
+
'▸ Use `npx remotion lambda sites create` to redeploy the site with the latest version.',
|
|
118
|
+
' ℹ Use --site-name with the same name as before to overwrite your site.',
|
|
119
|
+
'▸ Use `deploySite()` if you are using the Node.JS APIs.',
|
|
120
|
+
].join('\n'));
|
|
103
121
|
}
|
|
104
122
|
if (remotionVersion !== version_1.VERSION && process.env.NODE_ENV !== 'test') {
|
|
105
123
|
if (remotionVersion) {
|
|
106
|
-
|
|
124
|
+
logger_1.Log.warnAdvanced({
|
|
125
|
+
indent,
|
|
126
|
+
logLevel,
|
|
127
|
+
}, [
|
|
128
|
+
`The site was bundled with version ${remotionVersion} of @remotion/bundler, while @remotion/renderer is on version ${version_1.VERSION}. You may not have the newest bugfixes and features.`,
|
|
129
|
+
`To resolve this warning:`,
|
|
130
|
+
'▸ Use `npx remotion lambda sites create` to redeploy the site with the latest version.',
|
|
131
|
+
' ℹ Use --site-name with the same name as before to overwrite your site.',
|
|
132
|
+
'▸ Use `deploySite()` if you are using the Node.JS APIs.',
|
|
133
|
+
].join('\n'));
|
|
107
134
|
}
|
|
108
135
|
else {
|
|
109
|
-
|
|
136
|
+
logger_1.Log.warnAdvanced({
|
|
137
|
+
indent,
|
|
138
|
+
logLevel,
|
|
139
|
+
}, `The site was bundled with an old version of Remotion, while @remotion/renderer is on version ${version_1.VERSION}. You may not have the newest bugfixes and features. Re-bundle the site to fix this issue.`);
|
|
110
140
|
}
|
|
111
141
|
}
|
|
112
142
|
};
|
|
@@ -115,8 +145,8 @@ const setPropsAndEnv = (params) => {
|
|
|
115
145
|
innerSetPropsAndEnv(params),
|
|
116
146
|
new Promise((_, reject) => {
|
|
117
147
|
setTimeout(() => {
|
|
118
|
-
reject(new Error(
|
|
119
|
-
},
|
|
148
|
+
reject(new Error(`Timed out after ${params.timeoutInMilliseconds} while setting up the headless browser. This could be because the you specified takes a long time to load (or network resources that it includes like fonts) or because the browser is not responding. Optimize the site or increase the browser timeout.`));
|
|
149
|
+
}, params.timeoutInMilliseconds);
|
|
120
150
|
}),
|
|
121
151
|
]);
|
|
122
152
|
};
|
|
@@ -4,6 +4,7 @@ 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';
|
|
@@ -24,7 +25,7 @@ type InternalStitchFramesToVideoOptions = {
|
|
|
24
25
|
onProgress?: null | ((progress: number) => void);
|
|
25
26
|
onDownload: undefined | RenderMediaOnDownload;
|
|
26
27
|
proResProfile: undefined | ProResProfile;
|
|
27
|
-
|
|
28
|
+
logLevel: LogLevel;
|
|
28
29
|
dir: string;
|
|
29
30
|
cancelSignal: CancelSignal | null;
|
|
30
31
|
preEncodedFileLocation: string | null;
|
|
@@ -59,7 +59,7 @@ const packageJsonPath = node_path_1.default.join(__dirname, '..', 'package.json'
|
|
|
59
59
|
const packageJson = node_fs_1.default.existsSync(packageJsonPath)
|
|
60
60
|
? JSON.parse(node_fs_1.default.readFileSync(packageJsonPath, 'utf-8'))
|
|
61
61
|
: null;
|
|
62
|
-
const getAssetsData = async ({ assets, onDownload, fps, expectedFrames,
|
|
62
|
+
const getAssetsData = async ({ assets, onDownload, fps, expectedFrames, logLevel, onProgress, downloadMap, remotionRoot, indent, }) => {
|
|
63
63
|
const fileUrlAssets = await (0, convert_assets_to_file_urls_1.convertAssetsToFileUrls)({
|
|
64
64
|
assets,
|
|
65
65
|
onDownload: onDownload !== null && onDownload !== void 0 ? onDownload : (() => () => undefined),
|
|
@@ -67,7 +67,7 @@ const getAssetsData = async ({ assets, onDownload, fps, expectedFrames, verbose,
|
|
|
67
67
|
});
|
|
68
68
|
(0, download_and_map_assets_to_file_1.markAllAssetsAsDownloaded)(downloadMap);
|
|
69
69
|
const assetPositions = (0, calculate_asset_positions_1.calculateAssetPositions)(fileUrlAssets);
|
|
70
|
-
logger_1.Log.verboseAdvanced({ indent, logLevel
|
|
70
|
+
logger_1.Log.verboseAdvanced({ indent, logLevel, tag: 'audio' }, 'asset positions', JSON.stringify(assetPositions));
|
|
71
71
|
const preprocessProgress = new Array(assetPositions.length).fill(0);
|
|
72
72
|
const updateProgress = () => {
|
|
73
73
|
onProgress(preprocessProgress.reduce((a, b) => a + b, 0) / assetPositions.length);
|
|
@@ -100,7 +100,7 @@ const getAssetsData = async ({ assets, onDownload, fps, expectedFrames, verbose,
|
|
|
100
100
|
});
|
|
101
101
|
return outName;
|
|
102
102
|
};
|
|
103
|
-
const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec, cancelSignal, codec, crf, dir, enforceAudioTrack, ffmpegOverride, force, fps, height, indent, muted, onDownload, outputLocation, pixelFormat, preEncodedFileLocation, preferLossless, proResProfile,
|
|
103
|
+
const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec, cancelSignal, codec, crf, dir, enforceAudioTrack, ffmpegOverride, force, fps, height, indent, muted, onDownload, outputLocation, pixelFormat, preEncodedFileLocation, preferLossless, proResProfile, logLevel, videoBitrate, width, numberOfGifLoops, onProgress, }, remotionRoot) => {
|
|
104
104
|
var _a;
|
|
105
105
|
remotion_1.Internals.validateDimension(height, 'height', 'passed to `stitchFramesToVideo()`');
|
|
106
106
|
remotion_1.Internals.validateDimension(width, 'width', 'passed to `stitchFramesToVideo()`');
|
|
@@ -136,39 +136,29 @@ const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec,
|
|
|
136
136
|
: node_path_1.default.join(assetsInfo.downloadMap.stitchFrames, `out.${(0, get_extension_from_codec_1.getFileExtensionFromCodec)(codec, resolvedAudioCodec)}`);
|
|
137
137
|
logger_1.Log.verboseAdvanced({
|
|
138
138
|
indent,
|
|
139
|
-
logLevel
|
|
140
|
-
tag: 'stitchFramesToVideo()',
|
|
141
|
-
}, 'encoder', encoderName);
|
|
142
|
-
logger_1.Log.verboseAdvanced({
|
|
143
|
-
indent,
|
|
144
|
-
logLevel: verbose ? 'verbose' : 'info',
|
|
139
|
+
logLevel,
|
|
145
140
|
tag: 'stitchFramesToVideo()',
|
|
146
141
|
}, 'audioCodec', resolvedAudioCodec);
|
|
147
142
|
logger_1.Log.verboseAdvanced({
|
|
148
143
|
indent,
|
|
149
|
-
logLevel
|
|
144
|
+
logLevel,
|
|
150
145
|
tag: 'stitchFramesToVideo()',
|
|
151
146
|
}, 'pixelFormat', pixelFormat);
|
|
152
147
|
logger_1.Log.verboseAdvanced({
|
|
153
148
|
indent,
|
|
154
|
-
logLevel
|
|
149
|
+
logLevel,
|
|
155
150
|
tag: 'stitchFramesToVideo()',
|
|
156
151
|
}, 'codec', codec);
|
|
157
152
|
logger_1.Log.verboseAdvanced({
|
|
158
153
|
indent,
|
|
159
|
-
logLevel
|
|
154
|
+
logLevel,
|
|
160
155
|
tag: 'stitchFramesToVideo()',
|
|
161
156
|
}, 'shouldRenderAudio', shouldRenderAudio);
|
|
162
157
|
logger_1.Log.verboseAdvanced({
|
|
163
158
|
indent,
|
|
164
|
-
logLevel
|
|
159
|
+
logLevel,
|
|
165
160
|
tag: 'stitchFramesToVideo()',
|
|
166
161
|
}, 'shouldRenderVideo', shouldRenderVideo);
|
|
167
|
-
logger_1.Log.verboseAdvanced({
|
|
168
|
-
indent,
|
|
169
|
-
logLevel: verbose ? 'verbose' : 'info',
|
|
170
|
-
tag: 'stitchFramesToVideo()',
|
|
171
|
-
}, 'proResProfileName', proResProfileName);
|
|
172
162
|
(0, crf_1.validateQualitySettings)({
|
|
173
163
|
crf,
|
|
174
164
|
codec,
|
|
@@ -186,7 +176,7 @@ const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec,
|
|
|
186
176
|
onDownload,
|
|
187
177
|
fps,
|
|
188
178
|
expectedFrames,
|
|
189
|
-
|
|
179
|
+
logLevel,
|
|
190
180
|
onProgress: (prog) => updateProgress(prog, 0),
|
|
191
181
|
downloadMap: assetsInfo.downloadMap,
|
|
192
182
|
remotionRoot,
|
|
@@ -288,12 +278,12 @@ const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec,
|
|
|
288
278
|
: ffmpegString;
|
|
289
279
|
logger_1.Log.verboseAdvanced({
|
|
290
280
|
indent: indent !== null && indent !== void 0 ? indent : false,
|
|
291
|
-
logLevel
|
|
281
|
+
logLevel,
|
|
292
282
|
tag: 'stitchFramesToVideo()',
|
|
293
283
|
}, 'Generated final FFMPEG command:');
|
|
294
284
|
logger_1.Log.verboseAdvanced({
|
|
295
285
|
indent,
|
|
296
|
-
logLevel
|
|
286
|
+
logLevel,
|
|
297
287
|
tag: 'stitchFramesToVideo()',
|
|
298
288
|
}, finalFfmpegString.join(' '));
|
|
299
289
|
const task = (0, call_ffmpeg_1.callFf)('ffmpeg', finalFfmpegString, {
|
|
@@ -391,7 +381,7 @@ const stitchFramesToVideo = ({ assetsInfo, force, fps, height, width, audioBitra
|
|
|
391
381
|
outputLocation: outputLocation !== null && outputLocation !== void 0 ? outputLocation : null,
|
|
392
382
|
pixelFormat: pixelFormat !== null && pixelFormat !== void 0 ? pixelFormat : pixel_format_1.DEFAULT_PIXEL_FORMAT,
|
|
393
383
|
proResProfile,
|
|
394
|
-
|
|
384
|
+
logLevel: verbose ? 'verbose' : 'info',
|
|
395
385
|
videoBitrate: videoBitrate !== null && videoBitrate !== void 0 ? videoBitrate : null,
|
|
396
386
|
width,
|
|
397
387
|
preEncodedFileLocation: 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);
|
|
@@ -12,7 +12,7 @@ const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
|
|
|
12
12
|
const truthy_1 = require("./truthy");
|
|
13
13
|
const takeFrameAndCompose = async ({ freePage, imageFormat, jpegQuality, frame, width, height, output, scale, downloadMap, wantsBuffer, compositor, }) => {
|
|
14
14
|
var _a;
|
|
15
|
-
const [clipRegion, collectedAssets] = await Promise.all([
|
|
15
|
+
const [{ value: clipRegion }, { value: collectedAssets }] = await Promise.all([
|
|
16
16
|
(0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
17
17
|
pageFunction: () => {
|
|
18
18
|
if (typeof window.remotion_getClipRegion === 'undefined') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AudioCodec } from './audio-codec';
|
|
2
|
-
export declare const validateOutputFilename: <T extends "h264" | "h265" | "vp8" | "vp9" | "
|
|
2
|
+
export declare const validateOutputFilename: <T extends "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif">({ codec, audioCodec, extension, preferLossless, }: {
|
|
3
3
|
codec: T;
|
|
4
4
|
audioCodec: AudioCodec | null;
|
|
5
5
|
extension: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/renderer",
|
|
3
|
-
"version": "4.1.0-
|
|
3
|
+
"version": "4.1.0-alpha10",
|
|
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.1.0-
|
|
21
|
+
"remotion": "4.1.0-alpha10"
|
|
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-
|
|
46
|
-
"@remotion/compositor-darwin-
|
|
47
|
-
"@remotion/compositor-linux-
|
|
48
|
-
"@remotion/compositor-linux-x64-gnu": "4.1.0-
|
|
49
|
-
"@remotion/compositor-
|
|
50
|
-
"@remotion/compositor-linux-
|
|
51
|
-
"@remotion/compositor-
|
|
45
|
+
"@remotion/compositor-darwin-arm64": "4.1.0-alpha10",
|
|
46
|
+
"@remotion/compositor-darwin-x64": "4.1.0-alpha10",
|
|
47
|
+
"@remotion/compositor-linux-arm64-gnu": "4.1.0-alpha10",
|
|
48
|
+
"@remotion/compositor-linux-x64-gnu": "4.1.0-alpha10",
|
|
49
|
+
"@remotion/compositor-linux-arm64-musl": "4.1.0-alpha10",
|
|
50
|
+
"@remotion/compositor-linux-x64-musl": "4.1.0-alpha10",
|
|
51
|
+
"@remotion/compositor-win32-x64-msvc": "4.1.0-alpha10"
|
|
52
52
|
},
|
|
53
53
|
"keywords": [
|
|
54
54
|
"remotion",
|