@remotion/cli 4.0.0-offthread.34 → 4.0.0-offthread.42
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/compositions.js +2 -1
- package/dist/get-cli-options.d.ts +1 -0
- package/dist/get-cli-options.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/parse-command-line.js +3 -0
- package/dist/render.js +8 -20
- package/dist/still.js +42 -28
- package/package.json +7 -7
package/dist/compositions.js
CHANGED
|
@@ -34,7 +34,7 @@ const listCompositionsCommand = async () => {
|
|
|
34
34
|
}
|
|
35
35
|
const fullPath = path_1.default.join(process.cwd(), file);
|
|
36
36
|
(0, get_config_file_name_1.loadConfig)();
|
|
37
|
-
const { browserExecutable, ffmpegExecutable, chromiumOptions, envVariables, inputProps, puppeteerTimeout, } = await (0, get_cli_options_1.getCliOptions)({ isLambda: false, type: 'get-compositions' });
|
|
37
|
+
const { browserExecutable, ffmpegExecutable, chromiumOptions, envVariables, inputProps, puppeteerTimeout, port, } = await (0, get_cli_options_1.getCliOptions)({ isLambda: false, type: 'get-compositions' });
|
|
38
38
|
const bundled = await (0, setup_cache_1.bundleOnCli)(fullPath, ['bundling']);
|
|
39
39
|
const compositions = await (0, renderer_1.getCompositions)(bundled, {
|
|
40
40
|
browserExecutable,
|
|
@@ -43,6 +43,7 @@ const listCompositionsCommand = async () => {
|
|
|
43
43
|
envVariables,
|
|
44
44
|
inputProps,
|
|
45
45
|
timeoutInMilliseconds: puppeteerTimeout,
|
|
46
|
+
port,
|
|
46
47
|
});
|
|
47
48
|
log_1.Log.info();
|
|
48
49
|
log_1.Log.info('The following compositions are available:');
|
package/dist/get-cli-options.js
CHANGED
|
@@ -143,6 +143,7 @@ const getCliOptions = async (options) => {
|
|
|
143
143
|
const browserExecutable = remotion_1.Internals.getBrowserExecutable();
|
|
144
144
|
const ffmpegExecutable = remotion_1.Internals.getCustomFfmpegExecutable();
|
|
145
145
|
const scale = remotion_1.Internals.getScale();
|
|
146
|
+
const port = remotion_1.Internals.getServerPort();
|
|
146
147
|
const chromiumOptions = {
|
|
147
148
|
disableWebSecurity: remotion_1.Internals.getChromiumDisableWebSecurity(),
|
|
148
149
|
ignoreCertificateErrors: remotion_1.Internals.getIgnoreCertificateErrors(),
|
|
@@ -173,6 +174,7 @@ const getCliOptions = async (options) => {
|
|
|
173
174
|
logLevel: remotion_1.Internals.Logging.getLogLevel(),
|
|
174
175
|
scale,
|
|
175
176
|
chromiumOptions,
|
|
177
|
+
port: port !== null && port !== void 0 ? port : null,
|
|
176
178
|
};
|
|
177
179
|
};
|
|
178
180
|
exports.getCliOptions = getCliOptions;
|
package/dist/index.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ export declare const CliInternals: {
|
|
|
50
50
|
logLevel: "verbose" | "info" | "warn" | "error";
|
|
51
51
|
scale: number;
|
|
52
52
|
chromiumOptions: import("@remotion/renderer").ChromiumOptions;
|
|
53
|
+
port: number | null;
|
|
53
54
|
}>;
|
|
54
55
|
parseCommandLine: (type: "sequence" | "still" | "lambda" | "preview" | "versions") => void;
|
|
55
56
|
loadConfig: () => Promise<string | null>;
|
|
@@ -113,6 +113,9 @@ const parseCommandLine = (type) => {
|
|
|
113
113
|
if (typeof exports.parsedCli.scale !== 'undefined') {
|
|
114
114
|
remotion_1.Config.Rendering.setScale(exports.parsedCli.scale);
|
|
115
115
|
}
|
|
116
|
+
if (typeof exports.parsedCli.port !== 'undefined') {
|
|
117
|
+
remotion_1.Config.Bundling.setPort(exports.parsedCli.port);
|
|
118
|
+
}
|
|
116
119
|
};
|
|
117
120
|
exports.parseCommandLine = parseCommandLine;
|
|
118
121
|
const quietFlagProvided = () => exports.parsedCli.quiet || exports.parsedCli.q;
|
package/dist/render.js
CHANGED
|
@@ -31,7 +31,7 @@ const render = async () => {
|
|
|
31
31
|
? file
|
|
32
32
|
: path_1.default.join(process.cwd(), file);
|
|
33
33
|
await (0, initialize_render_cli_1.initializeRenderCli)('sequence');
|
|
34
|
-
const { codec, proResProfile, parallelism, frameRange, shouldOutputImageSequence, absoluteOutputFile, overwrite, inputProps, envVariables, quality, browser, crf, pixelFormat, imageFormat, browserExecutable, ffmpegExecutable, scale, chromiumOptions, } = await (0, get_cli_options_1.getCliOptions)({ isLambda: false, type: 'series' });
|
|
34
|
+
const { codec, proResProfile, parallelism, frameRange, shouldOutputImageSequence, absoluteOutputFile, overwrite, inputProps, envVariables, quality, browser, crf, pixelFormat, imageFormat, browserExecutable, ffmpegExecutable, scale, chromiumOptions, port, puppeteerTimeout, } = await (0, get_cli_options_1.getCliOptions)({ isLambda: false, type: 'series' });
|
|
35
35
|
if (!absoluteOutputFile) {
|
|
36
36
|
throw new Error('assertion error - expected absoluteOutputFile to not be null');
|
|
37
37
|
}
|
|
@@ -53,7 +53,6 @@ const render = async () => {
|
|
|
53
53
|
const urlOrBundle = renderer_1.RenderInternals.isServeUrl(fullPath)
|
|
54
54
|
? fullPath
|
|
55
55
|
: await (0, setup_cache_1.bundleOnCli)(fullPath, steps);
|
|
56
|
-
const downloadDir = renderer_1.RenderInternals.makeAssetsDownloadTmpDir();
|
|
57
56
|
const onDownload = (src) => {
|
|
58
57
|
const id = Math.random();
|
|
59
58
|
const download = {
|
|
@@ -68,19 +67,8 @@ const render = async () => {
|
|
|
68
67
|
updateRenderProgress();
|
|
69
68
|
};
|
|
70
69
|
};
|
|
71
|
-
const { serveUrl, closeServer } = await renderer_1.RenderInternals.prepareServer({
|
|
72
|
-
webpackConfigOrServeUrl: urlOrBundle,
|
|
73
|
-
downloadDir,
|
|
74
|
-
onDownload,
|
|
75
|
-
onError: (err) => {
|
|
76
|
-
log_1.Log.error('Error occurred:');
|
|
77
|
-
log_1.Log.error(err);
|
|
78
|
-
process.exit(1);
|
|
79
|
-
},
|
|
80
|
-
ffmpegExecutable,
|
|
81
|
-
});
|
|
82
70
|
const puppeteerInstance = await browserInstance;
|
|
83
|
-
const comps = await (0, renderer_1.getCompositions)(
|
|
71
|
+
const comps = await (0, renderer_1.getCompositions)(urlOrBundle, {
|
|
84
72
|
inputProps,
|
|
85
73
|
puppeteerInstance,
|
|
86
74
|
envVariables,
|
|
@@ -165,17 +153,19 @@ const render = async () => {
|
|
|
165
153
|
}
|
|
166
154
|
},
|
|
167
155
|
outputDir,
|
|
168
|
-
serveUrl,
|
|
156
|
+
serveUrl: urlOrBundle,
|
|
169
157
|
dumpBrowserLogs: remotion_1.Internals.Logging.isEqualOrBelowLogLevel(remotion_1.Internals.Logging.getLogLevel(), 'verbose'),
|
|
170
158
|
envVariables,
|
|
171
159
|
frameRange,
|
|
172
160
|
parallelism,
|
|
173
161
|
puppeteerInstance,
|
|
174
162
|
quality,
|
|
175
|
-
timeoutInMilliseconds:
|
|
163
|
+
timeoutInMilliseconds: puppeteerTimeout,
|
|
176
164
|
chromiumOptions,
|
|
177
165
|
scale,
|
|
178
166
|
ffmpegExecutable,
|
|
167
|
+
browserExecutable,
|
|
168
|
+
port,
|
|
179
169
|
});
|
|
180
170
|
renderedDoneIn = Date.now() - startTime;
|
|
181
171
|
updateRenderProgress();
|
|
@@ -208,7 +198,7 @@ const render = async () => {
|
|
|
208
198
|
pixelFormat,
|
|
209
199
|
proResProfile,
|
|
210
200
|
quality,
|
|
211
|
-
serveUrl,
|
|
201
|
+
serveUrl: urlOrBundle,
|
|
212
202
|
onDownload,
|
|
213
203
|
dumpBrowserLogs: remotion_1.Internals.Logging.isEqualOrBelowLogLevel(remotion_1.Internals.Logging.getLogLevel(), 'verbose'),
|
|
214
204
|
onStart: ({ frameCount }) => {
|
|
@@ -217,6 +207,7 @@ const render = async () => {
|
|
|
217
207
|
chromiumOptions,
|
|
218
208
|
timeoutInMilliseconds: remotion_1.Internals.getCurrentPuppeteerTimeout(),
|
|
219
209
|
scale,
|
|
210
|
+
port,
|
|
220
211
|
});
|
|
221
212
|
log_1.Log.info();
|
|
222
213
|
log_1.Log.info();
|
|
@@ -238,8 +229,5 @@ const render = async () => {
|
|
|
238
229
|
log_1.Log.warn('Do you have minimum required Node.js version?');
|
|
239
230
|
}
|
|
240
231
|
log_1.Log.info(chalk_1.default.green('\nYour video is ready!'));
|
|
241
|
-
closeServer().catch((err) => {
|
|
242
|
-
log_1.Log.error('Could not close web server', err);
|
|
243
|
-
});
|
|
244
232
|
};
|
|
245
233
|
exports.render = render;
|
package/dist/still.js
CHANGED
|
@@ -33,7 +33,7 @@ const still = async () => {
|
|
|
33
33
|
log_1.Log.verbose('Output file has a PNG extension, therefore setting the image format to PNG.');
|
|
34
34
|
remotion_1.Config.Rendering.setImageFormat('png');
|
|
35
35
|
}
|
|
36
|
-
const { inputProps, envVariables, quality, browser, imageFormat, stillFrame, browserExecutable, chromiumOptions, scale, ffmpegExecutable, overwrite, } = await (0, get_cli_options_1.getCliOptions)({ isLambda: false, type: 'still' });
|
|
36
|
+
const { inputProps, envVariables, quality, browser, imageFormat, stillFrame, browserExecutable, chromiumOptions, scale, ffmpegExecutable, overwrite, puppeteerTimeout, port, } = await (0, get_cli_options_1.getCliOptions)({ isLambda: false, type: 'still' });
|
|
37
37
|
log_1.Log.verbose('Browser executable: ', browserExecutable);
|
|
38
38
|
if (imageFormat === 'none') {
|
|
39
39
|
log_1.Log.error('No image format was selected - this is probably an error in Remotion - please post your command on Github Issues for help.');
|
|
@@ -63,27 +63,16 @@ const still = async () => {
|
|
|
63
63
|
const urlOrBundle = renderer_1.RenderInternals.isServeUrl(fullPath)
|
|
64
64
|
? Promise.resolve(fullPath)
|
|
65
65
|
: await (0, setup_cache_1.bundleOnCli)(fullPath, steps);
|
|
66
|
-
const downloadDir = renderer_1.RenderInternals.makeAssetsDownloadTmpDir();
|
|
67
|
-
const onDownload = (src) => {
|
|
68
|
-
log_1.Log.info('Downloading ', src);
|
|
69
|
-
};
|
|
70
|
-
const { serveUrl, closeServer } = await renderer_1.RenderInternals.prepareServer({
|
|
71
|
-
downloadDir,
|
|
72
|
-
onDownload,
|
|
73
|
-
onError: (err) => {
|
|
74
|
-
log_1.Log.error(err);
|
|
75
|
-
process.exit(1);
|
|
76
|
-
},
|
|
77
|
-
ffmpegExecutable,
|
|
78
|
-
webpackConfigOrServeUrl: await urlOrBundle,
|
|
79
|
-
});
|
|
80
66
|
const puppeteerInstance = await browserInstance;
|
|
81
|
-
const comps = await (0, renderer_1.getCompositions)(
|
|
67
|
+
const comps = await (0, renderer_1.getCompositions)(await urlOrBundle, {
|
|
82
68
|
inputProps,
|
|
83
69
|
puppeteerInstance,
|
|
84
70
|
envVariables,
|
|
85
|
-
timeoutInMilliseconds:
|
|
71
|
+
timeoutInMilliseconds: puppeteerTimeout,
|
|
86
72
|
chromiumOptions,
|
|
73
|
+
port,
|
|
74
|
+
browserExecutable,
|
|
75
|
+
ffmpegExecutable,
|
|
87
76
|
});
|
|
88
77
|
const compositionId = (0, get_composition_id_1.getCompositionId)(comps);
|
|
89
78
|
const composition = comps.find((c) => c.id === compositionId);
|
|
@@ -92,11 +81,42 @@ const still = async () => {
|
|
|
92
81
|
}
|
|
93
82
|
const renderProgress = (0, progress_bar_1.createOverwriteableCliOutput)((0, parse_command_line_1.quietFlagProvided)());
|
|
94
83
|
const renderStart = Date.now();
|
|
84
|
+
const downloads = [];
|
|
85
|
+
let frames = 0;
|
|
86
|
+
const totalFrames = 1;
|
|
87
|
+
const updateProgress = () => {
|
|
88
|
+
renderProgress.update((0, progress_bar_1.makeRenderingAndStitchingProgress)({
|
|
89
|
+
rendering: {
|
|
90
|
+
frames,
|
|
91
|
+
concurrency: 1,
|
|
92
|
+
doneIn: frames === totalFrames ? Date.now() - renderStart : null,
|
|
93
|
+
steps,
|
|
94
|
+
totalFrames,
|
|
95
|
+
},
|
|
96
|
+
downloads,
|
|
97
|
+
stitching: null,
|
|
98
|
+
}));
|
|
99
|
+
};
|
|
100
|
+
updateProgress();
|
|
101
|
+
const onDownload = (src) => {
|
|
102
|
+
const id = Math.random();
|
|
103
|
+
const download = {
|
|
104
|
+
id,
|
|
105
|
+
name: src,
|
|
106
|
+
progress: 0,
|
|
107
|
+
};
|
|
108
|
+
downloads.push(download);
|
|
109
|
+
updateProgress();
|
|
110
|
+
return ({ percent }) => {
|
|
111
|
+
download.progress = percent;
|
|
112
|
+
updateProgress();
|
|
113
|
+
};
|
|
114
|
+
};
|
|
95
115
|
await (0, renderer_1.renderStill)({
|
|
96
116
|
composition,
|
|
97
117
|
frame: stillFrame,
|
|
98
118
|
output: userOutput,
|
|
99
|
-
serveUrl,
|
|
119
|
+
serveUrl: await urlOrBundle,
|
|
100
120
|
quality,
|
|
101
121
|
dumpBrowserLogs: remotion_1.Internals.Logging.isEqualOrBelowLogLevel(remotion_1.Internals.Logging.getLogLevel(), 'verbose'),
|
|
102
122
|
envVariables,
|
|
@@ -108,18 +128,12 @@ const still = async () => {
|
|
|
108
128
|
ffmpegExecutable,
|
|
109
129
|
browserExecutable,
|
|
110
130
|
overwrite,
|
|
131
|
+
onDownload,
|
|
111
132
|
});
|
|
133
|
+
frames = 1;
|
|
134
|
+
updateProgress();
|
|
135
|
+
log_1.Log.info();
|
|
112
136
|
const closeBrowserPromise = puppeteerInstance.close();
|
|
113
|
-
closeServer().catch((err) => {
|
|
114
|
-
log_1.Log.error('Could not close web server', err);
|
|
115
|
-
});
|
|
116
|
-
renderProgress.update((0, progress_bar_1.makeRenderingProgress)({
|
|
117
|
-
frames: 1,
|
|
118
|
-
concurrency: 1,
|
|
119
|
-
doneIn: Date.now() - renderStart,
|
|
120
|
-
steps,
|
|
121
|
-
totalFrames: 1,
|
|
122
|
-
}));
|
|
123
137
|
log_1.Log.info(chalk_1.default.green('\nYour still frame is ready!'));
|
|
124
138
|
const seconds = Math.round((Date.now() - startTime) / 1000);
|
|
125
139
|
log_1.Log.info([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/cli",
|
|
3
|
-
"version": "4.0.0-offthread.
|
|
3
|
+
"version": "4.0.0-offthread.42+5cdecb6d7",
|
|
4
4
|
"description": "CLI for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
"author": "Jonny Burger <jonny@remotion.dev>",
|
|
24
24
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@remotion/bundler": "4.0.0-offthread.
|
|
27
|
-
"@remotion/media-utils": "4.0.0-offthread.
|
|
28
|
-
"@remotion/player": "4.0.0-offthread.
|
|
29
|
-
"@remotion/renderer": "4.0.0-offthread.
|
|
26
|
+
"@remotion/bundler": "4.0.0-offthread.42+5cdecb6d7",
|
|
27
|
+
"@remotion/media-utils": "4.0.0-offthread.42+5cdecb6d7",
|
|
28
|
+
"@remotion/player": "4.0.0-offthread.42+5cdecb6d7",
|
|
29
|
+
"@remotion/renderer": "4.0.0-offthread.42+5cdecb6d7",
|
|
30
30
|
"better-opn": "2.1.1",
|
|
31
31
|
"chalk": "4.1.2",
|
|
32
32
|
"dotenv": "9.0.2",
|
|
33
33
|
"execa": "5.1.1",
|
|
34
34
|
"minimist": "1.2.6",
|
|
35
|
-
"remotion": "4.0.0-offthread.
|
|
35
|
+
"remotion": "4.0.0-offthread.42+5cdecb6d7",
|
|
36
36
|
"semver": "7.3.5",
|
|
37
37
|
"webpack": "5.72.0"
|
|
38
38
|
},
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"publishConfig": {
|
|
73
73
|
"access": "public"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "5cdecb6d7971afe3062521d319eb32aac96346f3"
|
|
76
76
|
}
|