@remotion/cli 3.2.39 → 3.2.41
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/LICENSE.md +1 -1
- package/dist/benchmark.js +7 -6
- package/dist/compositions.d.ts +1 -1
- package/dist/compositions.js +4 -3
- package/dist/config/entry-point.d.ts +2 -0
- package/dist/config/entry-point.js +12 -0
- package/dist/config/every-nth-frame.d.ts +1 -2
- package/dist/config/every-nth-frame.js +3 -11
- package/dist/config/height.d.ts +1 -1
- package/dist/config/height.js +4 -4
- package/dist/config/index.d.ts +5 -2
- package/dist/config/index.js +15 -8
- package/dist/config/log.d.ts +1 -1
- package/dist/config/number-of-gif-loops.d.ts +1 -2
- package/dist/config/number-of-gif-loops.js +3 -9
- package/dist/config/width.d.ts +1 -1
- package/dist/config/width.js +3 -3
- package/dist/editor/components/Canvas.js +3 -0
- package/dist/editor/components/GlobalKeybindings.js +4 -0
- package/dist/editor/components/NewComposition/MenuContent.js +7 -0
- package/dist/editor/components/PlayPause.js +6 -0
- package/dist/editor/components/PlaybackKeyboardShortcutsManager.js +3 -0
- package/dist/editor/components/QuickSwitcher/QuickSwitcherContent.js +2 -0
- package/dist/editor/components/QuickSwitcher/QuickSwitcherResult.js +1 -0
- package/dist/editor/components/TimelineInOutToggle.js +3 -0
- package/dist/editor/helpers/use-keybinding.d.ts +1 -0
- package/dist/editor/helpers/use-keybinding.js +3 -1
- package/dist/editor/helpers/use-menu-structure.js +10 -7
- package/dist/editor/state/z-index.js +1 -0
- package/dist/entry-point.d.ts +5 -0
- package/dist/entry-point.js +46 -0
- package/dist/get-cli-options.d.ts +4 -4
- package/dist/get-cli-options.js +7 -25
- package/dist/get-composition-id.d.ts +2 -1
- package/dist/get-composition-id.js +8 -6
- package/dist/get-composition-with-dimension-override.d.ts +3 -1
- package/dist/get-composition-with-dimension-override.js +2 -2
- package/dist/get-filename.d.ts +2 -1
- package/dist/get-filename.js +2 -1
- package/dist/get-render-media-options.js +8 -3
- package/dist/index.d.ts +10 -6
- package/dist/index.js +11 -11
- package/dist/lambda-command.d.ts +1 -1
- package/dist/lambda-command.js +2 -3
- package/dist/list-of-remotion-packages.js +1 -0
- package/dist/parse-command-line.d.ts +2 -0
- package/dist/parse-command-line.js +6 -0
- package/dist/preview-server/error-overlay/remotion-overlay/AskOnDiscord.js +1 -0
- package/dist/preview-server/error-overlay/remotion-overlay/HelpLink.js +1 -0
- package/dist/preview-server/error-overlay/remotion-overlay/OpenInEditor.js +1 -0
- package/dist/preview-server/error-overlay/remotion-overlay/SearchGitHubIssues.js +1 -0
- package/dist/preview.d.ts +1 -1
- package/dist/preview.js +4 -2
- package/dist/render.d.ts +1 -1
- package/dist/render.js +21 -12
- package/dist/still.d.ts +1 -1
- package/dist/still.js +26 -14
- package/dist/user-passed-output-location.d.ts +3 -2
- package/dist/user-passed-output-location.js +5 -7
- package/package.json +7 -7
|
@@ -0,0 +1,46 @@
|
|
|
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.findEntryPoint = void 0;
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const config_1 = require("./config");
|
|
10
|
+
const log_1 = require("./log");
|
|
11
|
+
const candidates = [
|
|
12
|
+
path_1.default.join('remotion', 'index.tsx'),
|
|
13
|
+
path_1.default.join('remotion', 'index.ts'),
|
|
14
|
+
path_1.default.join('remotion', 'index.js'),
|
|
15
|
+
path_1.default.join('src', 'index.tsx'),
|
|
16
|
+
path_1.default.join('src', 'index.ts'),
|
|
17
|
+
path_1.default.join('src', 'index.js'),
|
|
18
|
+
];
|
|
19
|
+
const findCommonPath = (remotionRoot) => {
|
|
20
|
+
return candidates.find((candidate) => (0, fs_1.existsSync)(path_1.default.resolve(remotionRoot, candidate)));
|
|
21
|
+
};
|
|
22
|
+
const findEntryPoint = (args, remotionRoot) => {
|
|
23
|
+
// 1st priority: Explicitly passed entry point
|
|
24
|
+
let file = args[0];
|
|
25
|
+
if (file) {
|
|
26
|
+
log_1.Log.verbose('Checking if', file, 'is the entry file');
|
|
27
|
+
// Intentionally resolving CLI files to CWD, while resolving config file to remotionRoot
|
|
28
|
+
if ((0, fs_1.existsSync)(path_1.default.resolve(process.cwd(), file))) {
|
|
29
|
+
return { file, remainingArgs: args.slice(1), reason: 'argument passed' };
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// 2nd priority: Config file
|
|
33
|
+
file = config_1.ConfigInternals.getEntryPoint();
|
|
34
|
+
if (file) {
|
|
35
|
+
log_1.Log.verbose('Entry point from config file is', file);
|
|
36
|
+
return { file, remainingArgs: args, reason: 'config file' };
|
|
37
|
+
}
|
|
38
|
+
// 3rd priority: Common paths
|
|
39
|
+
const found = findCommonPath(remotionRoot);
|
|
40
|
+
if (found) {
|
|
41
|
+
log_1.Log.verbose('Selected', found, 'as the entry point because file exists and is a common entry point and no entry point was explicitly selected');
|
|
42
|
+
return { file: found, remainingArgs: args, reason: 'common paths' };
|
|
43
|
+
}
|
|
44
|
+
return { file: null, remainingArgs: args, reason: 'none found' };
|
|
45
|
+
};
|
|
46
|
+
exports.findEntryPoint = findEntryPoint;
|
|
@@ -11,7 +11,6 @@ export declare const getAndValidateAbsoluteOutputFile: (relativeOutputLocation:
|
|
|
11
11
|
export declare const getCliOptions: (options: {
|
|
12
12
|
isLambda: boolean;
|
|
13
13
|
type: 'still' | 'series' | 'get-compositions';
|
|
14
|
-
codec: Codec;
|
|
15
14
|
}) => Promise<{
|
|
16
15
|
puppeteerTimeout: number;
|
|
17
16
|
concurrency: number | null;
|
|
@@ -23,15 +22,14 @@ export declare const getCliOptions: (options: {
|
|
|
23
22
|
browser: import("@remotion/renderer").Browser;
|
|
24
23
|
crf: import("@remotion/renderer").Crf | null;
|
|
25
24
|
pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
26
|
-
imageFormat: "png" | "jpeg" | "none";
|
|
27
25
|
proResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
|
|
28
26
|
everyNthFrame: number;
|
|
29
|
-
numberOfGifLoops: number
|
|
27
|
+
numberOfGifLoops: import("./config/number-of-gif-loops").Loop;
|
|
30
28
|
stillFrame: number;
|
|
31
29
|
browserExecutable: BrowserExecutable;
|
|
32
30
|
ffmpegExecutable: import("@remotion/renderer").FfmpegExecutable;
|
|
33
31
|
ffprobeExecutable: import("@remotion/renderer").FfmpegExecutable;
|
|
34
|
-
logLevel: "
|
|
32
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
35
33
|
scale: number;
|
|
36
34
|
chromiumOptions: ChromiumOptions;
|
|
37
35
|
overwrite: boolean;
|
|
@@ -42,4 +40,6 @@ export declare const getCliOptions: (options: {
|
|
|
42
40
|
ffmpegOverride: import("@remotion/renderer").FfmpegOverrideFn;
|
|
43
41
|
audioBitrate: string | null;
|
|
44
42
|
videoBitrate: string | null;
|
|
43
|
+
height: number | null;
|
|
44
|
+
width: number | null;
|
|
45
45
|
}>;
|
package/dist/get-cli-options.js
CHANGED
|
@@ -11,7 +11,6 @@ const config_1 = require("./config");
|
|
|
11
11
|
const get_env_1 = require("./get-env");
|
|
12
12
|
const get_final_output_codec_1 = require("./get-final-output-codec");
|
|
13
13
|
const get_input_props_1 = require("./get-input-props");
|
|
14
|
-
const image_formats_1 = require("./image-formats");
|
|
15
14
|
const log_1 = require("./log");
|
|
16
15
|
const parse_command_line_1 = require("./parse-command-line");
|
|
17
16
|
const getAndValidateFrameRange = () => {
|
|
@@ -86,20 +85,10 @@ const getCrf = (shouldOutputImageSequence) => {
|
|
|
86
85
|
: config_1.ConfigInternals.getCrfOrUndefined();
|
|
87
86
|
return crf;
|
|
88
87
|
};
|
|
89
|
-
const getAndValidatePixelFormat = (codec) => {
|
|
90
|
-
const pixelFormat = config_1.ConfigInternals.getPixelFormat();
|
|
91
|
-
renderer_1.RenderInternals.validateSelectedPixelFormatAndCodecCombination(pixelFormat, codec);
|
|
92
|
-
return pixelFormat;
|
|
93
|
-
};
|
|
94
88
|
const getProResProfile = () => {
|
|
95
89
|
const proResProfile = config_1.ConfigInternals.getProResProfile();
|
|
96
90
|
return proResProfile;
|
|
97
91
|
};
|
|
98
|
-
const getAndValidateImageFormat = ({ shouldOutputImageSequence, codec, pixelFormat, }) => {
|
|
99
|
-
const imageFormat = (0, image_formats_1.getImageFormat)(shouldOutputImageSequence ? undefined : codec);
|
|
100
|
-
renderer_1.RenderInternals.validateSelectedPixelFormatAndImageFormatCombination(pixelFormat, imageFormat);
|
|
101
|
-
return imageFormat;
|
|
102
|
-
};
|
|
103
92
|
const getAndValidateBrowser = async (browserExecutable) => {
|
|
104
93
|
const browser = getBrowser();
|
|
105
94
|
try {
|
|
@@ -126,17 +115,7 @@ const getCliOptions = async (options) => {
|
|
|
126
115
|
});
|
|
127
116
|
const crf = getCrf(shouldOutputImageSequence);
|
|
128
117
|
const videoBitrate = config_1.ConfigInternals.getVideoBitrate();
|
|
129
|
-
|
|
130
|
-
crf,
|
|
131
|
-
codec: options.codec,
|
|
132
|
-
videoBitrate,
|
|
133
|
-
});
|
|
134
|
-
const pixelFormat = getAndValidatePixelFormat(options.codec);
|
|
135
|
-
const imageFormat = getAndValidateImageFormat({
|
|
136
|
-
shouldOutputImageSequence,
|
|
137
|
-
codec: options.codec,
|
|
138
|
-
pixelFormat,
|
|
139
|
-
});
|
|
118
|
+
const pixelFormat = config_1.ConfigInternals.getPixelFormat();
|
|
140
119
|
const proResProfile = getProResProfile();
|
|
141
120
|
const browserExecutable = config_1.ConfigInternals.getBrowserExecutable();
|
|
142
121
|
const ffmpegExecutable = config_1.ConfigInternals.getCustomFfmpegExecutable();
|
|
@@ -149,9 +128,11 @@ const getCliOptions = async (options) => {
|
|
|
149
128
|
headless: config_1.ConfigInternals.getChromiumHeadlessMode(),
|
|
150
129
|
gl: (_a = config_1.ConfigInternals.getChromiumOpenGlRenderer()) !== null && _a !== void 0 ? _a : renderer_1.RenderInternals.DEFAULT_OPENGL_RENDERER,
|
|
151
130
|
};
|
|
152
|
-
const everyNthFrame = config_1.ConfigInternals.
|
|
153
|
-
const numberOfGifLoops = config_1.ConfigInternals.
|
|
131
|
+
const everyNthFrame = config_1.ConfigInternals.getEveryNthFrame();
|
|
132
|
+
const numberOfGifLoops = config_1.ConfigInternals.getNumberOfGifLoops();
|
|
154
133
|
const concurrency = config_1.ConfigInternals.getConcurrency();
|
|
134
|
+
const height = config_1.ConfigInternals.getHeight();
|
|
135
|
+
const width = config_1.ConfigInternals.getWidth();
|
|
155
136
|
renderer_1.RenderInternals.validateConcurrency(concurrency, 'concurrency');
|
|
156
137
|
return {
|
|
157
138
|
puppeteerTimeout: config_1.ConfigInternals.getCurrentPuppeteerTimeout(),
|
|
@@ -164,7 +145,6 @@ const getCliOptions = async (options) => {
|
|
|
164
145
|
browser: await getAndValidateBrowser(browserExecutable),
|
|
165
146
|
crf,
|
|
166
147
|
pixelFormat,
|
|
167
|
-
imageFormat,
|
|
168
148
|
proResProfile,
|
|
169
149
|
everyNthFrame,
|
|
170
150
|
numberOfGifLoops,
|
|
@@ -183,6 +163,8 @@ const getCliOptions = async (options) => {
|
|
|
183
163
|
ffmpegOverride: config_1.ConfigInternals.getFfmpegOverrideFunction(),
|
|
184
164
|
audioBitrate: config_1.ConfigInternals.getAudioBitrate(),
|
|
185
165
|
videoBitrate,
|
|
166
|
+
height,
|
|
167
|
+
width,
|
|
186
168
|
};
|
|
187
169
|
};
|
|
188
170
|
exports.getCliOptions = getCliOptions;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { TCompMetadata } from 'remotion';
|
|
2
|
-
export declare const getCompositionId: (validCompositions: TCompMetadata[]) => Promise<{
|
|
2
|
+
export declare const getCompositionId: (validCompositions: TCompMetadata[], args: string[]) => Promise<{
|
|
3
3
|
compositionId: string;
|
|
4
4
|
reason: string;
|
|
5
5
|
config: TCompMetadata;
|
|
6
|
+
argsAfterComposition: string[];
|
|
6
7
|
}>;
|
|
@@ -2,20 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCompositionId = void 0;
|
|
4
4
|
const log_1 = require("./log");
|
|
5
|
-
const parse_command_line_1 = require("./parse-command-line");
|
|
6
5
|
const select_composition_1 = require("./select-composition");
|
|
7
|
-
const getCompositionId = async (validCompositions) => {
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const getCompositionId = async (validCompositions, args) => {
|
|
7
|
+
const [compName, ...remainingArgs] = args;
|
|
8
|
+
if (compName) {
|
|
9
|
+
const config = validCompositions.find((c) => c.id === compName);
|
|
10
10
|
if (!config) {
|
|
11
|
-
throw new Error(`Cannot find composition with ID "${
|
|
11
|
+
throw new Error(`Cannot find composition with ID "${compName}". Available composition: ${validCompositions
|
|
12
12
|
.map((c) => c.id)
|
|
13
13
|
.join(', ')}`);
|
|
14
14
|
}
|
|
15
15
|
return {
|
|
16
|
-
compositionId:
|
|
16
|
+
compositionId: compName,
|
|
17
17
|
reason: 'Passed as argument',
|
|
18
18
|
config,
|
|
19
|
+
argsAfterComposition: remainingArgs,
|
|
19
20
|
};
|
|
20
21
|
}
|
|
21
22
|
if (!process.env.CI) {
|
|
@@ -25,6 +26,7 @@ const getCompositionId = async (validCompositions) => {
|
|
|
25
26
|
compositionId,
|
|
26
27
|
reason,
|
|
27
28
|
config: validCompositions.find((c) => c.id === compositionId),
|
|
29
|
+
argsAfterComposition: args,
|
|
28
30
|
};
|
|
29
31
|
}
|
|
30
32
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { TCompMetadata } from 'remotion';
|
|
2
|
-
export declare const getCompositionWithDimensionOverride: ({ validCompositions, height, width, }: {
|
|
2
|
+
export declare const getCompositionWithDimensionOverride: ({ validCompositions, height, width, args, }: {
|
|
3
3
|
validCompositions: TCompMetadata[];
|
|
4
4
|
height: number | null;
|
|
5
5
|
width: number | null;
|
|
6
|
+
args: string[];
|
|
6
7
|
}) => Promise<{
|
|
7
8
|
compositionId: string;
|
|
8
9
|
reason: string;
|
|
9
10
|
config: TCompMetadata;
|
|
11
|
+
argsAfterComposition: string[];
|
|
10
12
|
}>;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCompositionWithDimensionOverride = void 0;
|
|
4
4
|
const get_composition_id_1 = require("./get-composition-id");
|
|
5
|
-
const getCompositionWithDimensionOverride = async ({ validCompositions, height, width, }) => {
|
|
6
|
-
const returnValue = await (0, get_composition_id_1.getCompositionId)(validCompositions);
|
|
5
|
+
const getCompositionWithDimensionOverride = async ({ validCompositions, height, width, args, }) => {
|
|
6
|
+
const returnValue = await (0, get_composition_id_1.getCompositionId)(validCompositions, args);
|
|
7
7
|
return {
|
|
8
8
|
...returnValue,
|
|
9
9
|
config: {
|
package/dist/get-filename.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Codec } from '@remotion/renderer';
|
|
2
|
-
export declare const getOutputFilename: ({ codec, imageSequence, compositionName, defaultExtension, }: {
|
|
2
|
+
export declare const getOutputFilename: ({ codec, imageSequence, compositionName, defaultExtension, args, }: {
|
|
3
3
|
codec: Codec;
|
|
4
4
|
imageSequence: boolean;
|
|
5
5
|
compositionName: string;
|
|
6
6
|
defaultExtension: string;
|
|
7
|
+
args: string[];
|
|
7
8
|
}) => string;
|
package/dist/get-filename.js
CHANGED
|
@@ -4,10 +4,11 @@ exports.getOutputFilename = void 0;
|
|
|
4
4
|
const renderer_1 = require("@remotion/renderer");
|
|
5
5
|
const log_1 = require("./log");
|
|
6
6
|
const user_passed_output_location_1 = require("./user-passed-output-location");
|
|
7
|
-
const getOutputFilename = ({ codec, imageSequence, compositionName, defaultExtension, }) => {
|
|
7
|
+
const getOutputFilename = ({ codec, imageSequence, compositionName, defaultExtension, args, }) => {
|
|
8
8
|
let filename = (0, user_passed_output_location_1.getOutputLocation)({
|
|
9
9
|
compositionId: compositionName,
|
|
10
10
|
defaultExtension,
|
|
11
|
+
args,
|
|
11
12
|
});
|
|
12
13
|
let extension = renderer_1.RenderInternals.getExtensionOfFilename(filename);
|
|
13
14
|
if (imageSequence) {
|
|
@@ -4,15 +4,20 @@ exports.getRenderMediaOptions = void 0;
|
|
|
4
4
|
const renderer_1 = require("@remotion/renderer");
|
|
5
5
|
const config_1 = require("./config");
|
|
6
6
|
const get_cli_options_1 = require("./get-cli-options");
|
|
7
|
+
const image_formats_1 = require("./image-formats");
|
|
7
8
|
const getRenderMediaOptions = async ({ outputLocation, config, serveUrl, codec, }) => {
|
|
8
|
-
const { proResProfile, concurrency, frameRange, overwrite, inputProps, envVariables, quality, crf, pixelFormat,
|
|
9
|
+
const { proResProfile, concurrency, frameRange, overwrite, inputProps, envVariables, quality, crf, pixelFormat, browserExecutable, ffmpegExecutable, ffprobeExecutable, scale, chromiumOptions, port, numberOfGifLoops, everyNthFrame, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, height, width, } = await (0, get_cli_options_1.getCliOptions)({
|
|
9
10
|
isLambda: false,
|
|
10
11
|
type: 'series',
|
|
11
|
-
codec,
|
|
12
12
|
});
|
|
13
|
+
const imageFormat = (0, image_formats_1.getImageFormat)(codec);
|
|
13
14
|
return {
|
|
14
15
|
outputLocation,
|
|
15
|
-
composition:
|
|
16
|
+
composition: {
|
|
17
|
+
...config,
|
|
18
|
+
width: width !== null && width !== void 0 ? width : config.width,
|
|
19
|
+
height: height !== null && height !== void 0 ? height : config.height,
|
|
20
|
+
},
|
|
16
21
|
crf,
|
|
17
22
|
envVariables,
|
|
18
23
|
ffmpegExecutable,
|
package/dist/index.d.ts
CHANGED
|
@@ -66,11 +66,9 @@ export declare const CliInternals: {
|
|
|
66
66
|
warn: (message?: any, ...optionalParams: any[]) => void;
|
|
67
67
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
68
68
|
};
|
|
69
|
-
loadConfigFile: (remotionRoot: string, configFileName: string, isJavascript: boolean) => Promise<string | null>;
|
|
70
69
|
getCliOptions: (options: {
|
|
71
70
|
isLambda: boolean;
|
|
72
71
|
type: "still" | "series" | "get-compositions";
|
|
73
|
-
codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
74
72
|
}) => Promise<{
|
|
75
73
|
puppeteerTimeout: number;
|
|
76
74
|
concurrency: number | null;
|
|
@@ -82,15 +80,14 @@ export declare const CliInternals: {
|
|
|
82
80
|
browser: import("@remotion/renderer").Browser;
|
|
83
81
|
crf: import("@remotion/renderer").Crf | null;
|
|
84
82
|
pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
85
|
-
imageFormat: "png" | "jpeg" | "none";
|
|
86
83
|
proResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
|
|
87
84
|
everyNthFrame: number;
|
|
88
|
-
numberOfGifLoops: number
|
|
85
|
+
numberOfGifLoops: import("./config/number-of-gif-loops").Loop;
|
|
89
86
|
stillFrame: number;
|
|
90
87
|
browserExecutable: import("@remotion/renderer").BrowserExecutable;
|
|
91
88
|
ffmpegExecutable: import("@remotion/renderer").FfmpegExecutable;
|
|
92
89
|
ffprobeExecutable: import("@remotion/renderer").FfmpegExecutable;
|
|
93
|
-
logLevel: "
|
|
90
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
94
91
|
scale: number;
|
|
95
92
|
chromiumOptions: import("@remotion/renderer").ChromiumOptions;
|
|
96
93
|
overwrite: boolean;
|
|
@@ -101,8 +98,9 @@ export declare const CliInternals: {
|
|
|
101
98
|
ffmpegOverride: import("@remotion/renderer").FfmpegOverrideFn;
|
|
102
99
|
audioBitrate: string | null;
|
|
103
100
|
videoBitrate: string | null;
|
|
101
|
+
height: number | null;
|
|
102
|
+
width: number | null;
|
|
104
103
|
}>;
|
|
105
|
-
parseCommandLine: () => void;
|
|
106
104
|
loadConfig: (remotionRoot: string) => Promise<string | null>;
|
|
107
105
|
initializeCli: (remotionRoot: string) => Promise<void>;
|
|
108
106
|
BooleanFlags: string[];
|
|
@@ -139,4 +137,10 @@ export declare const CliInternals: {
|
|
|
139
137
|
compositionId: string;
|
|
140
138
|
reason: string;
|
|
141
139
|
}>;
|
|
140
|
+
findEntryPoint: (args: string[], remotionRoot: string) => {
|
|
141
|
+
file: string | null;
|
|
142
|
+
remainingArgs: string[];
|
|
143
|
+
reason: string;
|
|
144
|
+
};
|
|
145
|
+
getImageFormat: (codec: import("@remotion/renderer").CodecOrUndefined) => "png" | "jpeg" | "none";
|
|
142
146
|
};
|
package/dist/index.js
CHANGED
|
@@ -26,14 +26,15 @@ const compositions_1 = require("./compositions");
|
|
|
26
26
|
const index_1 = require("./config/index");
|
|
27
27
|
const determine_image_format_1 = require("./determine-image-format");
|
|
28
28
|
const download_progress_1 = require("./download-progress");
|
|
29
|
+
const entry_point_1 = require("./entry-point");
|
|
29
30
|
const find_closest_package_json_1 = require("./find-closest-package-json");
|
|
30
31
|
const format_bytes_1 = require("./format-bytes");
|
|
31
32
|
const get_cli_options_1 = require("./get-cli-options");
|
|
32
33
|
const get_config_file_name_1 = require("./get-config-file-name");
|
|
33
34
|
const handle_common_errors_1 = require("./handle-common-errors");
|
|
35
|
+
const image_formats_1 = require("./image-formats");
|
|
34
36
|
const initialize_cli_1 = require("./initialize-cli");
|
|
35
37
|
const lambda_command_1 = require("./lambda-command");
|
|
36
|
-
const load_config_1 = require("./load-config");
|
|
37
38
|
const log_1 = require("./log");
|
|
38
39
|
const make_progress_bar_1 = require("./make-progress-bar");
|
|
39
40
|
const parse_command_line_1 = require("./parse-command-line");
|
|
@@ -47,8 +48,7 @@ const upgrade_1 = require("./upgrade");
|
|
|
47
48
|
const versions_1 = require("./versions");
|
|
48
49
|
const cli = async () => {
|
|
49
50
|
(0, index_1.overrideRemotion)();
|
|
50
|
-
const args =
|
|
51
|
-
const command = args[2];
|
|
51
|
+
const [command, ...args] = parse_command_line_1.parsedCli._;
|
|
52
52
|
if (parse_command_line_1.parsedCli.help) {
|
|
53
53
|
(0, print_help_1.printHelp)();
|
|
54
54
|
process.exit(0);
|
|
@@ -61,19 +61,19 @@ const cli = async () => {
|
|
|
61
61
|
await (0, initialize_cli_1.initializeCli)(remotionRoot);
|
|
62
62
|
try {
|
|
63
63
|
if (command === 'compositions') {
|
|
64
|
-
await (0, compositions_1.listCompositionsCommand)(remotionRoot);
|
|
64
|
+
await (0, compositions_1.listCompositionsCommand)(remotionRoot, args);
|
|
65
65
|
}
|
|
66
66
|
else if (command === 'preview') {
|
|
67
|
-
await (0, preview_1.previewCommand)(remotionRoot);
|
|
67
|
+
await (0, preview_1.previewCommand)(remotionRoot, args);
|
|
68
68
|
}
|
|
69
69
|
else if (command === 'lambda') {
|
|
70
|
-
await (0, lambda_command_1.lambdaCommand)(remotionRoot);
|
|
70
|
+
await (0, lambda_command_1.lambdaCommand)(remotionRoot, args);
|
|
71
71
|
}
|
|
72
72
|
else if (command === 'render') {
|
|
73
|
-
await (0, render_1.render)(remotionRoot);
|
|
73
|
+
await (0, render_1.render)(remotionRoot, args);
|
|
74
74
|
}
|
|
75
75
|
else if (command === 'still') {
|
|
76
|
-
await (0, still_1.still)(remotionRoot);
|
|
76
|
+
await (0, still_1.still)(remotionRoot, args);
|
|
77
77
|
}
|
|
78
78
|
else if (command === 'upgrade') {
|
|
79
79
|
await (0, upgrade_1.upgrade)(remotionRoot, parse_command_line_1.parsedCli['package-manager']);
|
|
@@ -82,7 +82,7 @@ const cli = async () => {
|
|
|
82
82
|
await (0, versions_1.versionsCommand)(remotionRoot);
|
|
83
83
|
}
|
|
84
84
|
else if (command === 'benchmark') {
|
|
85
|
-
await (0, benchmark_1.benchmarkCommand)(remotionRoot,
|
|
85
|
+
await (0, benchmark_1.benchmarkCommand)(remotionRoot, args);
|
|
86
86
|
}
|
|
87
87
|
else if (command === 'help') {
|
|
88
88
|
(0, print_help_1.printHelp)();
|
|
@@ -115,9 +115,7 @@ exports.CliInternals = {
|
|
|
115
115
|
chalk: chalk_1.chalk,
|
|
116
116
|
makeProgressBar: make_progress_bar_1.makeProgressBar,
|
|
117
117
|
Log: log_1.Log,
|
|
118
|
-
loadConfigFile: load_config_1.loadConfigFile,
|
|
119
118
|
getCliOptions: get_cli_options_1.getCliOptions,
|
|
120
|
-
parseCommandLine: parse_command_line_1.parseCommandLine,
|
|
121
119
|
loadConfig: get_config_file_name_1.loadConfig,
|
|
122
120
|
initializeCli: initialize_cli_1.initializeCli,
|
|
123
121
|
BooleanFlags: parse_command_line_1.BooleanFlags,
|
|
@@ -131,4 +129,6 @@ exports.CliInternals = {
|
|
|
131
129
|
determineFinalImageFormat: determine_image_format_1.determineFinalImageFormat,
|
|
132
130
|
minimist: minimist_1.default,
|
|
133
131
|
selectComposition: select_composition_1.selectComposition,
|
|
132
|
+
findEntryPoint: entry_point_1.findEntryPoint,
|
|
133
|
+
getImageFormat: image_formats_1.getImageFormat,
|
|
134
134
|
};
|
package/dist/lambda-command.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const lambdaCommand: (remotionRoot: string) => Promise<never>;
|
|
1
|
+
export declare const lambdaCommand: (remotionRoot: string, args: string[]) => Promise<never>;
|
package/dist/lambda-command.js
CHANGED
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.lambdaCommand = void 0;
|
|
4
4
|
const log_1 = require("./log");
|
|
5
|
-
const parse_command_line_1 = require("./parse-command-line");
|
|
6
5
|
const get_package_manager_1 = require("./preview-server/get-package-manager");
|
|
7
6
|
const update_available_1 = require("./preview-server/update-available");
|
|
8
|
-
const lambdaCommand = async (remotionRoot) => {
|
|
7
|
+
const lambdaCommand = async (remotionRoot, args) => {
|
|
9
8
|
try {
|
|
10
9
|
const path = require.resolve('@remotion/lambda', {
|
|
11
10
|
paths: [remotionRoot],
|
|
12
11
|
});
|
|
13
12
|
const { LambdaInternals } = require(path);
|
|
14
|
-
await LambdaInternals.executeCommand(
|
|
13
|
+
await LambdaInternals.executeCommand(args, remotionRoot);
|
|
15
14
|
process.exit(0);
|
|
16
15
|
}
|
|
17
16
|
catch (err) {
|
|
@@ -36,6 +36,8 @@ export declare type CommandLineOptions = {
|
|
|
36
36
|
['disable-headless']: boolean;
|
|
37
37
|
['disable-keyboard-shortcuts']: boolean;
|
|
38
38
|
muted: boolean;
|
|
39
|
+
height: number;
|
|
40
|
+
width: number;
|
|
39
41
|
['enforce-audio-track']: boolean;
|
|
40
42
|
gl: OpenGlRenderer;
|
|
41
43
|
['package-manager']: string;
|
|
@@ -80,6 +80,12 @@ const parseCommandLine = () => {
|
|
|
80
80
|
if (exports.parsedCli.timeout) {
|
|
81
81
|
config_1.Config.Puppeteer.setTimeoutInMilliseconds(exports.parsedCli.timeout);
|
|
82
82
|
}
|
|
83
|
+
if (exports.parsedCli.height) {
|
|
84
|
+
config_1.Config.Output.overrideHeight(exports.parsedCli.height);
|
|
85
|
+
}
|
|
86
|
+
if (exports.parsedCli.width) {
|
|
87
|
+
config_1.Config.Output.overrideWidth(exports.parsedCli.width);
|
|
88
|
+
}
|
|
83
89
|
if (exports.parsedCli.frames) {
|
|
84
90
|
config_1.ConfigInternals.setFrameRangeFromCli(exports.parsedCli.frames);
|
|
85
91
|
}
|
|
@@ -23,6 +23,7 @@ const SearchGithubIssues = ({ message, canHaveKeyboardShortcuts }) => {
|
|
|
23
23
|
key: 'g',
|
|
24
24
|
callback: onEditor,
|
|
25
25
|
commandCtrlKey: true,
|
|
26
|
+
preventDefault: true,
|
|
26
27
|
});
|
|
27
28
|
return () => unregister();
|
|
28
29
|
}, [canHaveKeyboardShortcuts, openInBrowser, registerKeybinding]);
|
package/dist/preview.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const previewCommand: (remotionRoot: string) => Promise<void>;
|
|
1
|
+
export declare const previewCommand: (remotionRoot: string, args: string[]) => Promise<void>;
|
package/dist/preview.js
CHANGED
|
@@ -8,6 +8,7 @@ const better_opn_1 = __importDefault(require("better-opn"));
|
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const chalk_1 = require("./chalk");
|
|
10
10
|
const config_1 = require("./config");
|
|
11
|
+
const entry_point_1 = require("./entry-point");
|
|
11
12
|
const get_env_1 = require("./get-env");
|
|
12
13
|
const get_input_props_1 = require("./get-input-props");
|
|
13
14
|
const get_network_address_1 = require("./get-network-address");
|
|
@@ -31,8 +32,9 @@ const waitForLiveEventsListener = () => {
|
|
|
31
32
|
});
|
|
32
33
|
});
|
|
33
34
|
};
|
|
34
|
-
const previewCommand = async (remotionRoot) => {
|
|
35
|
-
const file =
|
|
35
|
+
const previewCommand = async (remotionRoot, args) => {
|
|
36
|
+
const { file, reason } = (0, entry_point_1.findEntryPoint)(args, remotionRoot);
|
|
37
|
+
log_1.Log.verbose('Entry point:', file, 'reason:', reason);
|
|
36
38
|
if (!file) {
|
|
37
39
|
log_1.Log.error('The preview command requires you to specify a root file. For example');
|
|
38
40
|
log_1.Log.error(' npx remotion preview src/index.tsx');
|
package/dist/render.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const render: (remotionRoot: string) => Promise<void>;
|
|
1
|
+
export declare const render: (remotionRoot: string, args: string[]) => Promise<void>;
|
package/dist/render.js
CHANGED
|
@@ -12,18 +12,20 @@ const path_1 = __importDefault(require("path"));
|
|
|
12
12
|
const remotion_1 = require("remotion");
|
|
13
13
|
const chalk_1 = require("./chalk");
|
|
14
14
|
const config_1 = require("./config");
|
|
15
|
+
const entry_point_1 = require("./entry-point");
|
|
15
16
|
const get_cli_options_1 = require("./get-cli-options");
|
|
16
|
-
const
|
|
17
|
+
const get_composition_with_dimension_override_1 = require("./get-composition-with-dimension-override");
|
|
17
18
|
const get_filename_1 = require("./get-filename");
|
|
18
19
|
const get_render_media_options_1 = require("./get-render-media-options");
|
|
20
|
+
const image_formats_1 = require("./image-formats");
|
|
19
21
|
const log_1 = require("./log");
|
|
20
22
|
const parse_command_line_1 = require("./parse-command-line");
|
|
21
23
|
const progress_bar_1 = require("./progress-bar");
|
|
22
24
|
const setup_cache_1 = require("./setup-cache");
|
|
23
25
|
const user_passed_output_location_1 = require("./user-passed-output-location");
|
|
24
|
-
const render = async (remotionRoot) => {
|
|
26
|
+
const render = async (remotionRoot, args) => {
|
|
25
27
|
const startTime = Date.now();
|
|
26
|
-
const file =
|
|
28
|
+
const { file, remainingArgs, reason: entryPointReason, } = (0, entry_point_1.findEntryPoint)(args, remotionRoot);
|
|
27
29
|
if (!file) {
|
|
28
30
|
log_1.Log.error('No entry point specified. Pass more arguments:');
|
|
29
31
|
log_1.Log.error(' npx remotion render [entry-point] [composition-name] [out-name]');
|
|
@@ -39,15 +41,9 @@ const render = async (remotionRoot) => {
|
|
|
39
41
|
process.exit(1);
|
|
40
42
|
}
|
|
41
43
|
log_1.Log.verbose('Asset dirs', downloadMap.assetDir);
|
|
42
|
-
const {
|
|
43
|
-
downloadName: null,
|
|
44
|
-
outName: (0, user_passed_output_location_1.getUserPassedOutputLocation)(),
|
|
45
|
-
});
|
|
46
|
-
(0, get_cli_options_1.validateFfmpegCanUseCodec)(codec);
|
|
47
|
-
const { concurrency, frameRange, shouldOutputImageSequence, overwrite, inputProps, envVariables, quality, browser, imageFormat, browserExecutable, ffmpegExecutable, ffprobeExecutable, scale, chromiumOptions, port, everyNthFrame, puppeteerTimeout, publicDir, } = await (0, get_cli_options_1.getCliOptions)({
|
|
44
|
+
const { concurrency, frameRange, shouldOutputImageSequence, overwrite, inputProps, envVariables, quality, browser, browserExecutable, ffmpegExecutable, ffprobeExecutable, scale, chromiumOptions, port, everyNthFrame, puppeteerTimeout, publicDir, height, width, } = await (0, get_cli_options_1.getCliOptions)({
|
|
48
45
|
isLambda: false,
|
|
49
46
|
type: 'series',
|
|
50
|
-
codec,
|
|
51
47
|
});
|
|
52
48
|
const ffmpegVersion = await renderer_1.RenderInternals.getFfmpegVersion({
|
|
53
49
|
ffmpegExecutable,
|
|
@@ -100,7 +96,17 @@ const render = async (remotionRoot) => {
|
|
|
100
96
|
downloadMap,
|
|
101
97
|
port,
|
|
102
98
|
});
|
|
103
|
-
const { compositionId, config, reason } = await (0,
|
|
99
|
+
const { compositionId, config, reason, argsAfterComposition } = await (0, get_composition_with_dimension_override_1.getCompositionWithDimensionOverride)({
|
|
100
|
+
validCompositions: comps,
|
|
101
|
+
height,
|
|
102
|
+
width,
|
|
103
|
+
args: remainingArgs,
|
|
104
|
+
});
|
|
105
|
+
const { codec, reason: codecReason } = (0, get_cli_options_1.getFinalCodec)({
|
|
106
|
+
downloadName: null,
|
|
107
|
+
outName: (0, user_passed_output_location_1.getUserPassedOutputLocation)(argsAfterComposition),
|
|
108
|
+
});
|
|
109
|
+
(0, get_cli_options_1.validateFfmpegCanUseCodec)(codec);
|
|
104
110
|
renderer_1.RenderInternals.validateEvenDimensionsWithCodec({
|
|
105
111
|
width: config.width,
|
|
106
112
|
height: config.height,
|
|
@@ -112,8 +118,9 @@ const render = async (remotionRoot) => {
|
|
|
112
118
|
imageSequence: shouldOutputImageSequence,
|
|
113
119
|
compositionName: compositionId,
|
|
114
120
|
defaultExtension: renderer_1.RenderInternals.getFileExtensionFromCodec(codec, 'final'),
|
|
121
|
+
args: argsAfterComposition,
|
|
115
122
|
});
|
|
116
|
-
log_1.Log.info(chalk_1.chalk.gray(`Composition = ${compositionId} (${reason}), Codec = ${codec} (${codecReason}), Output = ${relativeOutputLocation}`));
|
|
123
|
+
log_1.Log.info(chalk_1.chalk.gray(`Entry point = ${file} (${entryPointReason}), Composition = ${compositionId} (${reason}), Codec = ${codec} (${codecReason}), Output = ${relativeOutputLocation}`));
|
|
117
124
|
const absoluteOutputFile = (0, get_cli_options_1.getAndValidateAbsoluteOutputFile)(relativeOutputLocation, overwrite);
|
|
118
125
|
const outputDir = shouldOutputImageSequence
|
|
119
126
|
? absoluteOutputFile
|
|
@@ -153,6 +160,7 @@ const render = async (remotionRoot) => {
|
|
|
153
160
|
downloads,
|
|
154
161
|
}));
|
|
155
162
|
};
|
|
163
|
+
const imageFormat = (0, image_formats_1.getImageFormat)(shouldOutputImageSequence ? undefined : codec);
|
|
156
164
|
if (shouldOutputImageSequence) {
|
|
157
165
|
fs_1.default.mkdirSync(absoluteOutputFile, {
|
|
158
166
|
recursive: true,
|
|
@@ -202,6 +210,7 @@ const render = async (remotionRoot) => {
|
|
|
202
210
|
log_1.Log.info();
|
|
203
211
|
log_1.Log.info();
|
|
204
212
|
log_1.Log.info(chalk_1.chalk.green('\nYour image sequence is ready!'));
|
|
213
|
+
log_1.Log.info(chalk_1.chalk.cyan(`▶ ${absoluteOutputFile}`));
|
|
205
214
|
return;
|
|
206
215
|
}
|
|
207
216
|
const options = await (0, get_render_media_options_1.getRenderMediaOptions)({
|
package/dist/still.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const still: (remotionRoot: string) => Promise<void>;
|
|
1
|
+
export declare const still: (remotionRoot: string, args: string[]) => Promise<void>;
|