@remotion/cli 4.0.0-preload.13 → 4.0.0-preload.17
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 +11 -1
- package/dist/get-cli-options.d.ts +2 -1
- package/dist/get-cli-options.js +3 -1
- package/dist/index.d.ts +2 -1
- package/dist/parse-command-line.js +3 -0
- package/dist/render.js +25 -24
- package/dist/still.js +45 -15
- package/package.json +7 -7
package/dist/compositions.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.listCompositionsCommand = void 0;
|
|
7
7
|
const renderer_1 = require("@remotion/renderer");
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const get_cli_options_1 = require("./get-cli-options");
|
|
9
10
|
const get_config_file_name_1 = require("./get-config-file-name");
|
|
10
11
|
const log_1 = require("./log");
|
|
11
12
|
const parse_command_line_1 = require("./parse-command-line");
|
|
@@ -33,8 +34,17 @@ const listCompositionsCommand = async () => {
|
|
|
33
34
|
}
|
|
34
35
|
const fullPath = path_1.default.join(process.cwd(), file);
|
|
35
36
|
(0, get_config_file_name_1.loadConfig)();
|
|
37
|
+
const { browserExecutable, ffmpegExecutable, chromiumOptions, envVariables, inputProps, puppeteerTimeout, port, } = await (0, get_cli_options_1.getCliOptions)({ isLambda: false, type: 'get-compositions' });
|
|
36
38
|
const bundled = await (0, setup_cache_1.bundleOnCli)(fullPath, ['bundling']);
|
|
37
|
-
const compositions = await (0, renderer_1.getCompositions)(bundled
|
|
39
|
+
const compositions = await (0, renderer_1.getCompositions)(bundled, {
|
|
40
|
+
browserExecutable,
|
|
41
|
+
ffmpegExecutable,
|
|
42
|
+
chromiumOptions,
|
|
43
|
+
envVariables,
|
|
44
|
+
inputProps,
|
|
45
|
+
timeoutInMilliseconds: puppeteerTimeout,
|
|
46
|
+
port,
|
|
47
|
+
});
|
|
38
48
|
log_1.Log.info();
|
|
39
49
|
log_1.Log.info('The following compositions are available:');
|
|
40
50
|
log_1.Log.info();
|
|
@@ -2,7 +2,7 @@ import { ChromiumOptions } from '@remotion/renderer';
|
|
|
2
2
|
import { BrowserExecutable, FrameRange } from 'remotion';
|
|
3
3
|
export declare const getCliOptions: (options: {
|
|
4
4
|
isLambda: boolean;
|
|
5
|
-
type: 'still' | 'series';
|
|
5
|
+
type: 'still' | 'series' | 'get-compositions';
|
|
6
6
|
}) => Promise<{
|
|
7
7
|
puppeteerTimeout: number;
|
|
8
8
|
parallelism: number | null;
|
|
@@ -25,4 +25,5 @@ export declare const getCliOptions: (options: {
|
|
|
25
25
|
logLevel: "verbose" | "info" | "warn" | "error";
|
|
26
26
|
scale: number;
|
|
27
27
|
chromiumOptions: ChromiumOptions;
|
|
28
|
+
port: number | null;
|
|
28
29
|
}>;
|
package/dist/get-cli-options.js
CHANGED
|
@@ -124,7 +124,7 @@ const getCliOptions = async (options) => {
|
|
|
124
124
|
frameRange,
|
|
125
125
|
isLambda: options.isLambda,
|
|
126
126
|
});
|
|
127
|
-
const outputFile = options.isLambda
|
|
127
|
+
const outputFile = options.isLambda || options.type === 'get-compositions'
|
|
128
128
|
? null
|
|
129
129
|
: (0, get_filename_1.getOutputFilename)({
|
|
130
130
|
codec,
|
|
@@ -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
|
@@ -27,7 +27,7 @@ export declare const CliInternals: {
|
|
|
27
27
|
loadConfigFile: (configFileName: string, isJavascript: boolean) => Promise<string | null>;
|
|
28
28
|
getCliOptions: (options: {
|
|
29
29
|
isLambda: boolean;
|
|
30
|
-
type: "still" | "series";
|
|
30
|
+
type: "still" | "series" | "get-compositions";
|
|
31
31
|
}) => Promise<{
|
|
32
32
|
puppeteerTimeout: number;
|
|
33
33
|
parallelism: number | null;
|
|
@@ -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,13 +31,13 @@ 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
|
}
|
|
38
38
|
log_1.Log.verbose('Browser executable: ', browserExecutable);
|
|
39
39
|
await (0, validate_ffmpeg_version_1.checkAndValidateFfmpegVersion)({
|
|
40
|
-
ffmpegExecutable
|
|
40
|
+
ffmpegExecutable,
|
|
41
41
|
});
|
|
42
42
|
const browserInstance = (0, renderer_1.openBrowser)(browser, {
|
|
43
43
|
browserExecutable,
|
|
@@ -53,9 +53,22 @@ 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
|
|
56
|
+
const onDownload = (src) => {
|
|
57
|
+
const id = Math.random();
|
|
58
|
+
const download = {
|
|
59
|
+
id,
|
|
60
|
+
name: src,
|
|
61
|
+
progress: 0,
|
|
62
|
+
};
|
|
63
|
+
downloads.push(download);
|
|
64
|
+
updateRenderProgress();
|
|
65
|
+
return ({ percent }) => {
|
|
66
|
+
download.progress = percent;
|
|
67
|
+
updateRenderProgress();
|
|
68
|
+
};
|
|
69
|
+
};
|
|
57
70
|
const puppeteerInstance = await browserInstance;
|
|
58
|
-
const comps = await (0, renderer_1.getCompositions)(
|
|
71
|
+
const comps = await (0, renderer_1.getCompositions)(urlOrBundle, {
|
|
59
72
|
inputProps,
|
|
60
73
|
puppeteerInstance,
|
|
61
74
|
envVariables,
|
|
@@ -140,16 +153,19 @@ const render = async () => {
|
|
|
140
153
|
}
|
|
141
154
|
},
|
|
142
155
|
outputDir,
|
|
143
|
-
serveUrl,
|
|
156
|
+
serveUrl: urlOrBundle,
|
|
144
157
|
dumpBrowserLogs: remotion_1.Internals.Logging.isEqualOrBelowLogLevel(remotion_1.Internals.Logging.getLogLevel(), 'verbose'),
|
|
145
158
|
envVariables,
|
|
146
159
|
frameRange,
|
|
147
160
|
parallelism,
|
|
148
161
|
puppeteerInstance,
|
|
149
162
|
quality,
|
|
150
|
-
timeoutInMilliseconds:
|
|
163
|
+
timeoutInMilliseconds: puppeteerTimeout,
|
|
151
164
|
chromiumOptions,
|
|
152
165
|
scale,
|
|
166
|
+
ffmpegExecutable,
|
|
167
|
+
browserExecutable,
|
|
168
|
+
port,
|
|
153
169
|
});
|
|
154
170
|
renderedDoneIn = Date.now() - startTime;
|
|
155
171
|
updateRenderProgress();
|
|
@@ -182,21 +198,8 @@ const render = async () => {
|
|
|
182
198
|
pixelFormat,
|
|
183
199
|
proResProfile,
|
|
184
200
|
quality,
|
|
185
|
-
serveUrl,
|
|
186
|
-
onDownload
|
|
187
|
-
const id = Math.random();
|
|
188
|
-
const download = {
|
|
189
|
-
id,
|
|
190
|
-
name: src,
|
|
191
|
-
progress: 0,
|
|
192
|
-
};
|
|
193
|
-
downloads.push(download);
|
|
194
|
-
updateRenderProgress();
|
|
195
|
-
return ({ percent }) => {
|
|
196
|
-
download.progress = percent;
|
|
197
|
-
updateRenderProgress();
|
|
198
|
-
};
|
|
199
|
-
},
|
|
201
|
+
serveUrl: urlOrBundle,
|
|
202
|
+
onDownload,
|
|
200
203
|
dumpBrowserLogs: remotion_1.Internals.Logging.isEqualOrBelowLogLevel(remotion_1.Internals.Logging.getLogLevel(), 'verbose'),
|
|
201
204
|
onStart: ({ frameCount }) => {
|
|
202
205
|
totalFrames = frameCount;
|
|
@@ -204,6 +207,7 @@ const render = async () => {
|
|
|
204
207
|
chromiumOptions,
|
|
205
208
|
timeoutInMilliseconds: remotion_1.Internals.getCurrentPuppeteerTimeout(),
|
|
206
209
|
scale,
|
|
210
|
+
port,
|
|
207
211
|
});
|
|
208
212
|
log_1.Log.info();
|
|
209
213
|
log_1.Log.info();
|
|
@@ -225,8 +229,5 @@ const render = async () => {
|
|
|
225
229
|
log_1.Log.warn('Do you have minimum required Node.js version?');
|
|
226
230
|
}
|
|
227
231
|
log_1.Log.info(chalk_1.default.green('\nYour video is ready!'));
|
|
228
|
-
closeServer().catch((err) => {
|
|
229
|
-
log_1.Log.error('Could not close web server', err);
|
|
230
|
-
});
|
|
231
232
|
};
|
|
232
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, } = 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,14 +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 { serveUrl, closeServer } = await renderer_1.RenderInternals.prepareServer(await urlOrBundle);
|
|
67
66
|
const puppeteerInstance = await browserInstance;
|
|
68
|
-
const comps = await (0, renderer_1.getCompositions)(
|
|
67
|
+
const comps = await (0, renderer_1.getCompositions)(await urlOrBundle, {
|
|
69
68
|
inputProps,
|
|
70
69
|
puppeteerInstance,
|
|
71
70
|
envVariables,
|
|
72
|
-
timeoutInMilliseconds:
|
|
71
|
+
timeoutInMilliseconds: puppeteerTimeout,
|
|
73
72
|
chromiumOptions,
|
|
73
|
+
port,
|
|
74
|
+
browserExecutable,
|
|
75
|
+
ffmpegExecutable,
|
|
74
76
|
});
|
|
75
77
|
const compositionId = (0, get_composition_id_1.getCompositionId)(comps);
|
|
76
78
|
const composition = comps.find((c) => c.id === compositionId);
|
|
@@ -79,11 +81,42 @@ const still = async () => {
|
|
|
79
81
|
}
|
|
80
82
|
const renderProgress = (0, progress_bar_1.createOverwriteableCliOutput)((0, parse_command_line_1.quietFlagProvided)());
|
|
81
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
|
+
};
|
|
82
115
|
await (0, renderer_1.renderStill)({
|
|
83
116
|
composition,
|
|
84
117
|
frame: stillFrame,
|
|
85
118
|
output: userOutput,
|
|
86
|
-
serveUrl,
|
|
119
|
+
serveUrl: await urlOrBundle,
|
|
87
120
|
quality,
|
|
88
121
|
dumpBrowserLogs: remotion_1.Internals.Logging.isEqualOrBelowLogLevel(remotion_1.Internals.Logging.getLogLevel(), 'verbose'),
|
|
89
122
|
envVariables,
|
|
@@ -92,18 +125,15 @@ const still = async () => {
|
|
|
92
125
|
chromiumOptions,
|
|
93
126
|
timeoutInMilliseconds: remotion_1.Internals.getCurrentPuppeteerTimeout(),
|
|
94
127
|
scale,
|
|
128
|
+
ffmpegExecutable,
|
|
129
|
+
browserExecutable,
|
|
130
|
+
overwrite,
|
|
131
|
+
onDownload,
|
|
95
132
|
});
|
|
133
|
+
frames = 1;
|
|
134
|
+
updateProgress();
|
|
135
|
+
log_1.Log.info();
|
|
96
136
|
const closeBrowserPromise = puppeteerInstance.close();
|
|
97
|
-
closeServer().catch((err) => {
|
|
98
|
-
log_1.Log.error('Could not close web server', err);
|
|
99
|
-
});
|
|
100
|
-
renderProgress.update((0, progress_bar_1.makeRenderingProgress)({
|
|
101
|
-
frames: 1,
|
|
102
|
-
concurrency: 1,
|
|
103
|
-
doneIn: Date.now() - renderStart,
|
|
104
|
-
steps,
|
|
105
|
-
totalFrames: 1,
|
|
106
|
-
}));
|
|
107
137
|
log_1.Log.info(chalk_1.default.green('\nYour still frame is ready!'));
|
|
108
138
|
const seconds = Math.round((Date.now() - startTime) / 1000);
|
|
109
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-preload.
|
|
3
|
+
"version": "4.0.0-preload.17+14cd6033f",
|
|
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-preload.
|
|
27
|
-
"@remotion/media-utils": "4.0.0-preload.
|
|
28
|
-
"@remotion/player": "4.0.0-preload.
|
|
29
|
-
"@remotion/renderer": "4.0.0-preload.
|
|
26
|
+
"@remotion/bundler": "4.0.0-preload.17+14cd6033f",
|
|
27
|
+
"@remotion/media-utils": "4.0.0-preload.17+14cd6033f",
|
|
28
|
+
"@remotion/player": "4.0.0-preload.17+14cd6033f",
|
|
29
|
+
"@remotion/renderer": "4.0.0-preload.17+14cd6033f",
|
|
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-preload.
|
|
35
|
+
"remotion": "4.0.0-preload.17+14cd6033f",
|
|
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": "14cd6033f4ad0fa75af142d54a4cd1a23aff3f21"
|
|
76
76
|
}
|