@remotion/cli 3.2.31 → 3.2.33
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/bundle.d.ts +1 -0
- package/dist/bundle.js +32 -0
- package/dist/config/bitrate.d.ts +4 -0
- package/dist/config/bitrate.js +21 -0
- package/dist/config/bundle-out-dir.d.ts +2 -0
- package/dist/config/bundle-out-dir.js +12 -0
- package/dist/config/crf.d.ts +1 -2
- package/dist/config/crf.js +1 -9
- package/dist/config/get-public-path.d.ts +2 -0
- package/dist/config/get-public-path.js +12 -0
- package/dist/config/index.d.ts +3 -1
- package/dist/config/index.js +8 -4
- package/dist/config/log.d.ts +1 -1
- package/dist/editor/components/Button.d.ts +4 -0
- package/dist/editor/components/Button.js +24 -0
- package/dist/editor/components/PreviewZoomControls.d.ts +2 -0
- package/dist/editor/components/PreviewZoomControls.js +49 -0
- package/dist/editor/helpers/normalize-wheel.d.ts +5 -0
- package/dist/editor/helpers/normalize-wheel.js +20 -0
- package/dist/get-cli-options.d.ts +4 -2
- package/dist/get-cli-options.js +11 -6
- package/dist/get-render-media-options.js +3 -1
- package/dist/index.d.ts +7 -4
- package/dist/index.js +6 -4
- package/dist/initialize-render-cli.d.ts +1 -0
- package/dist/initialize-render-cli.js +22 -0
- package/dist/lambda-command.js +1 -1
- package/dist/list-of-remotion-packages.js +1 -0
- package/dist/parse-command-line.d.ts +1 -0
- package/dist/parse-command-line.js +6 -0
- package/dist/prepare-entry-point.d.ts +12 -0
- package/dist/prepare-entry-point.js +37 -0
- package/dist/preview-server/get-package-manager.d.ts +1 -1
- package/dist/preview-server/get-package-manager.js +10 -1
- package/dist/preview-server/routes.js +1 -1
- package/dist/preview-server/update-available.js +2 -2
- package/dist/print-help.js +8 -0
- package/dist/render.js +3 -3
- package/dist/upgrade.d.ts +1 -1
- package/dist/upgrade.js +2 -2
- package/dist/validate-image-format.d.ts +2 -0
- package/dist/validate-image-format.js +15 -0
- package/dist/webpack-cache.d.ts +12 -0
- package/dist/webpack-cache.js +66 -0
- package/package.json +8 -9
- package/vitest.config.ts +0 -9
package/dist/bundle.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const bundleCommand: (remotionRoot: string) => Promise<void>;
|
package/dist/bundle.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bundleCommand = void 0;
|
|
4
|
+
const get_cli_options_1 = require("./get-cli-options");
|
|
5
|
+
const initialize_render_cli_1 = require("./initialize-render-cli");
|
|
6
|
+
const log_1 = require("./log");
|
|
7
|
+
const parse_command_line_1 = require("./parse-command-line");
|
|
8
|
+
const prepare_entry_point_1 = require("./prepare-entry-point");
|
|
9
|
+
const bundleCommand = async (remotionRoot) => {
|
|
10
|
+
const file = parse_command_line_1.parsedCli._[1];
|
|
11
|
+
if (!file) {
|
|
12
|
+
log_1.Log.error('No entry point specified. Pass more arguments:');
|
|
13
|
+
log_1.Log.error(' npx remotion bundle [entry-point]');
|
|
14
|
+
log_1.Log.error('Documentation: https://www.remotion.dev/docs/cli/bundle');
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
await (0, initialize_render_cli_1.initializeRenderCli)(remotionRoot, 'bundle');
|
|
18
|
+
const { publicPath, bundleOutDir } = await (0, get_cli_options_1.getCliOptions)({
|
|
19
|
+
isLambda: false,
|
|
20
|
+
type: 'get-compositions-or-bundle',
|
|
21
|
+
});
|
|
22
|
+
const { urlOrBundle } = await (0, prepare_entry_point_1.prepareEntryPoint)({
|
|
23
|
+
file,
|
|
24
|
+
otherSteps: [],
|
|
25
|
+
outDir: bundleOutDir,
|
|
26
|
+
publicPath,
|
|
27
|
+
remotionRoot,
|
|
28
|
+
});
|
|
29
|
+
log_1.Log.info();
|
|
30
|
+
log_1.Log.info(urlOrBundle);
|
|
31
|
+
};
|
|
32
|
+
exports.bundleCommand = bundleCommand;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getVideoBitrate = exports.setVideoBitrate = exports.getAudioBitrate = exports.setAudioBitrate = void 0;
|
|
4
|
+
let audioBitrate;
|
|
5
|
+
const setAudioBitrate = (bitrate) => {
|
|
6
|
+
audioBitrate = bitrate;
|
|
7
|
+
};
|
|
8
|
+
exports.setAudioBitrate = setAudioBitrate;
|
|
9
|
+
const getAudioBitrate = () => {
|
|
10
|
+
return audioBitrate;
|
|
11
|
+
};
|
|
12
|
+
exports.getAudioBitrate = getAudioBitrate;
|
|
13
|
+
let videoBitrate;
|
|
14
|
+
const setVideoBitrate = (bitrate) => {
|
|
15
|
+
videoBitrate = bitrate;
|
|
16
|
+
};
|
|
17
|
+
exports.setVideoBitrate = setVideoBitrate;
|
|
18
|
+
const getVideoBitrate = () => {
|
|
19
|
+
return videoBitrate;
|
|
20
|
+
};
|
|
21
|
+
exports.getVideoBitrate = getVideoBitrate;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setBundleDir = exports.getBundleOutDir = void 0;
|
|
4
|
+
let bundleOutDir = null;
|
|
5
|
+
const getBundleOutDir = () => {
|
|
6
|
+
return bundleOutDir;
|
|
7
|
+
};
|
|
8
|
+
exports.getBundleOutDir = getBundleOutDir;
|
|
9
|
+
const setBundleDir = (path) => {
|
|
10
|
+
bundleOutDir = path;
|
|
11
|
+
};
|
|
12
|
+
exports.setBundleDir = setBundleDir;
|
package/dist/config/crf.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Crf } from '@remotion/renderer';
|
|
2
2
|
export declare const setCrf: (newCrf: Crf) => void;
|
|
3
3
|
export declare const getCrfOrUndefined: () => Crf;
|
|
4
|
-
export declare const getActualCrf: (codec: Codec) => number;
|
package/dist/config/crf.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const renderer_1 = require("@remotion/renderer");
|
|
3
|
+
exports.getCrfOrUndefined = exports.setCrf = void 0;
|
|
5
4
|
let currentCrf;
|
|
6
5
|
const setCrf = (newCrf) => {
|
|
7
6
|
if (typeof newCrf !== 'number' && newCrf !== undefined) {
|
|
@@ -14,10 +13,3 @@ const getCrfOrUndefined = () => {
|
|
|
14
13
|
return currentCrf;
|
|
15
14
|
};
|
|
16
15
|
exports.getCrfOrUndefined = getCrfOrUndefined;
|
|
17
|
-
const getActualCrf = (codec) => {
|
|
18
|
-
var _a;
|
|
19
|
-
const crf = (_a = (0, exports.getCrfOrUndefined)()) !== null && _a !== void 0 ? _a : renderer_1.RenderInternals.getDefaultCrfForCodec(codec);
|
|
20
|
-
renderer_1.RenderInternals.validateSelectedCrfAndCodecCombination(crf, codec);
|
|
21
|
-
return crf;
|
|
22
|
-
};
|
|
23
|
-
exports.getActualCrf = getActualCrf;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setPublicPath = exports.getPublicPath = void 0;
|
|
4
|
+
let publicPath = null;
|
|
5
|
+
const getPublicPath = () => {
|
|
6
|
+
return publicPath;
|
|
7
|
+
};
|
|
8
|
+
exports.getPublicPath = getPublicPath;
|
|
9
|
+
const setPublicPath = (path) => {
|
|
10
|
+
publicPath = path;
|
|
11
|
+
};
|
|
12
|
+
exports.setPublicPath = setPublicPath;
|
package/dist/config/index.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export declare const ConfigInternals: {
|
|
|
10
10
|
getOutputCodecOrUndefined: () => import("@remotion/renderer").CodecOrUndefined;
|
|
11
11
|
getCustomFfmpegExecutable: () => import("@remotion/renderer").FfmpegExecutable;
|
|
12
12
|
getBrowser: () => import("@remotion/renderer").Browser | null;
|
|
13
|
-
getActualCrf: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => number;
|
|
14
13
|
getPixelFormat: () => "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
15
14
|
getProResProfile: () => "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
|
|
16
15
|
getShouldOverwrite: ({ defaultValue, }: {
|
|
@@ -48,5 +47,8 @@ export declare const ConfigInternals: {
|
|
|
48
47
|
getKeyboardShortcutsEnabled: () => boolean;
|
|
49
48
|
getPublicDir: () => string | null;
|
|
50
49
|
getFfmpegOverrideFunction: () => import("@remotion/renderer").FfmpegOverrideFn;
|
|
50
|
+
getAudioBitrate: () => string | null;
|
|
51
|
+
getVideoBitrate: () => string | null;
|
|
52
|
+
getCrfOrUndefined: () => import("@remotion/renderer").Crf;
|
|
51
53
|
};
|
|
52
54
|
export declare const overrideRemotion: () => void;
|
package/dist/config/index.js
CHANGED
|
@@ -31,7 +31,6 @@ const browser_executable_1 = require("./browser-executable");
|
|
|
31
31
|
const chromium_flags_1 = require("./chromium-flags");
|
|
32
32
|
const codec_1 = require("./codec");
|
|
33
33
|
const concurrency_1 = require("./concurrency");
|
|
34
|
-
const crf_1 = require("./crf");
|
|
35
34
|
const env_file_1 = require("./env-file");
|
|
36
35
|
const every_nth_frame_1 = require("./every-nth-frame");
|
|
37
36
|
const ffmpeg_executable_1 = require("./ffmpeg-executable");
|
|
@@ -52,11 +51,12 @@ const scale_1 = require("./scale");
|
|
|
52
51
|
const still_frame_1 = require("./still-frame");
|
|
53
52
|
const timeout_1 = require("./timeout");
|
|
54
53
|
const webpack_caching_1 = require("./webpack-caching");
|
|
54
|
+
const bitrate_1 = require("./bitrate");
|
|
55
55
|
const browser_executable_2 = require("./browser-executable");
|
|
56
56
|
const chromium_flags_2 = require("./chromium-flags");
|
|
57
57
|
const codec_2 = require("./codec");
|
|
58
58
|
const concurrency_2 = require("./concurrency");
|
|
59
|
-
const
|
|
59
|
+
const crf_1 = require("./crf");
|
|
60
60
|
const enforce_audio_track_1 = require("./enforce-audio-track");
|
|
61
61
|
const env_file_2 = require("./env-file");
|
|
62
62
|
const every_nth_frame_2 = require("./every-nth-frame");
|
|
@@ -123,9 +123,11 @@ exports.Config = {
|
|
|
123
123
|
setPixelFormat: pixel_format_2.setPixelFormat,
|
|
124
124
|
setOutputFormat: codec_2.setOutputFormat,
|
|
125
125
|
setCodec: codec_2.setCodec,
|
|
126
|
-
setCrf:
|
|
126
|
+
setCrf: crf_1.setCrf,
|
|
127
127
|
setImageSequence: image_sequence_2.setImageSequence,
|
|
128
128
|
setProResProfile: prores_profile_2.setProResProfile,
|
|
129
|
+
setAudioBitrate: bitrate_1.setAudioBitrate,
|
|
130
|
+
setVideoBitrate: bitrate_1.setVideoBitrate,
|
|
129
131
|
overrideFfmpegCommand: ffmpeg_override_1.setFfmpegOverrideFunction,
|
|
130
132
|
},
|
|
131
133
|
};
|
|
@@ -135,7 +137,6 @@ exports.ConfigInternals = {
|
|
|
135
137
|
getOutputCodecOrUndefined: codec_1.getOutputCodecOrUndefined,
|
|
136
138
|
getCustomFfmpegExecutable: ffmpeg_executable_1.getCustomFfmpegExecutable,
|
|
137
139
|
getBrowser: browser_1.getBrowser,
|
|
138
|
-
getActualCrf: crf_1.getActualCrf,
|
|
139
140
|
getPixelFormat: pixel_format_1.getPixelFormat,
|
|
140
141
|
getProResProfile: prores_profile_1.getProResProfile,
|
|
141
142
|
getShouldOverwrite: overwrite_1.getShouldOverwrite,
|
|
@@ -171,6 +172,9 @@ exports.ConfigInternals = {
|
|
|
171
172
|
getKeyboardShortcutsEnabled: keyboard_shortcuts_1.getKeyboardShortcutsEnabled,
|
|
172
173
|
getPublicDir: public_dir_1.getPublicDir,
|
|
173
174
|
getFfmpegOverrideFunction: ffmpeg_override_1.getFfmpegOverrideFunction,
|
|
175
|
+
getAudioBitrate: bitrate_1.getAudioBitrate,
|
|
176
|
+
getVideoBitrate: bitrate_1.getVideoBitrate,
|
|
177
|
+
getCrfOrUndefined: crf_1.getCrfOrUndefined,
|
|
174
178
|
};
|
|
175
179
|
const overrideRemotion = () => {
|
|
176
180
|
Object.assign(remotion_1.Config, exports.Config);
|
package/dist/config/log.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LogLevel } from '@remotion/renderer';
|
|
2
|
-
export declare const getLogLevel: () => "
|
|
2
|
+
export declare const getLogLevel: () => "verbose" | "info" | "warn" | "error";
|
|
3
3
|
export declare const setLogLevel: (newLogLevel: LogLevel) => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Button = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const colors_1 = require("../helpers/colors");
|
|
6
|
+
const layout_1 = require("./layout");
|
|
7
|
+
const container = {
|
|
8
|
+
padding: 10,
|
|
9
|
+
cursor: 'pointer',
|
|
10
|
+
fontSize: 14,
|
|
11
|
+
};
|
|
12
|
+
const button = {
|
|
13
|
+
border: `1px solid ${colors_1.INPUT_BORDER_COLOR_UNHOVERED}`,
|
|
14
|
+
borderRadius: 4,
|
|
15
|
+
backgroundColor: colors_1.INPUT_BACKGROUND,
|
|
16
|
+
appearance: 'none',
|
|
17
|
+
fontFamily: 'inherit',
|
|
18
|
+
fontSize: 14,
|
|
19
|
+
color: 'white',
|
|
20
|
+
};
|
|
21
|
+
const Button = ({ children, ...props }) => {
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)("button", { ...props, style: button, type: "button", children: (0, jsx_runtime_1.jsx)(layout_1.Row, { style: container, children: children }) }));
|
|
23
|
+
};
|
|
24
|
+
exports.Button = Button;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PreviewZoomControls = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const minus_1 = require("../icons/minus");
|
|
7
|
+
const plus_1 = require("../icons/plus");
|
|
8
|
+
const preview_size_1 = require("../state/preview-size");
|
|
9
|
+
const ControlButton_1 = require("./ControlButton");
|
|
10
|
+
const layout_1 = require("./layout");
|
|
11
|
+
const container = {
|
|
12
|
+
color: 'black',
|
|
13
|
+
flexDirection: 'row',
|
|
14
|
+
display: 'flex',
|
|
15
|
+
};
|
|
16
|
+
const buttonStyle = {
|
|
17
|
+
fontSize: 24,
|
|
18
|
+
};
|
|
19
|
+
const iconStyle = {
|
|
20
|
+
color: 'white',
|
|
21
|
+
width: 14,
|
|
22
|
+
};
|
|
23
|
+
const PreviewZoomControls = () => {
|
|
24
|
+
const { size, setSize } = (0, react_1.useContext)(preview_size_1.PreviewSizeContext);
|
|
25
|
+
const onZoomOutClicked = (0, react_1.useCallback)(() => {
|
|
26
|
+
setSize((z) => {
|
|
27
|
+
// TODO: Don't assume 1
|
|
28
|
+
const newSize = Number((z.size === 'auto' ? 1 : z.size - preview_size_1.ZOOM_BUTTON_STEP).toFixed(2));
|
|
29
|
+
return { ...z, size: Math.max(preview_size_1.PREVIEW_MIN_ZOOM, newSize) };
|
|
30
|
+
});
|
|
31
|
+
}, [setSize]);
|
|
32
|
+
const onZoomInClicked = (0, react_1.useCallback)(() => {
|
|
33
|
+
setSize((z) => {
|
|
34
|
+
// TODO: Don't assume 1
|
|
35
|
+
if (z.size === 'auto')
|
|
36
|
+
return {
|
|
37
|
+
size: 1 + preview_size_1.ZOOM_BUTTON_STEP,
|
|
38
|
+
translation: {
|
|
39
|
+
x: 0,
|
|
40
|
+
y: 0,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
const newSize = Number((Number(z) + preview_size_1.ZOOM_BUTTON_STEP).toFixed(2));
|
|
44
|
+
return { ...z, size: Math.min(preview_size_1.PREVIEW_MAX_ZOOM, newSize) };
|
|
45
|
+
});
|
|
46
|
+
}, [setSize]);
|
|
47
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { onClick: onZoomOutClicked, style: buttonStyle, title: "Zoom out preview", role: 'ControlButton', type: "button", disabled: size.size !== 'auto' && preview_size_1.PREVIEW_MIN_ZOOM === size.size, children: (0, jsx_runtime_1.jsx)(minus_1.Minus, { style: iconStyle }) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { onClick: onZoomInClicked, style: buttonStyle, title: "Zoom in preview", role: 'button', type: "button", disabled: size.size !== 'auto' && preview_size_1.PREVIEW_MAX_ZOOM === size.size, children: (0, jsx_runtime_1.jsx)(plus_1.Plus, { style: iconStyle }) })] }));
|
|
48
|
+
};
|
|
49
|
+
exports.PreviewZoomControls = PreviewZoomControls;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeWheel = void 0;
|
|
4
|
+
// Taken from https://github.com/tldraw/tldraw/blob/254dfdfd77c4abde53240f7d8ca3558e08688493/packages/core/src/hooks/useZoomEvents.ts which is adapted from https://stackoverflow.com/a/13650579
|
|
5
|
+
const MAX_ZOOM_STEP = 10;
|
|
6
|
+
function normalizeWheel(event) {
|
|
7
|
+
const { deltaY, deltaX } = event;
|
|
8
|
+
let deltaZ = 0;
|
|
9
|
+
if (event.ctrlKey || event.metaKey) {
|
|
10
|
+
const signY = Math.sign(event.deltaY);
|
|
11
|
+
const absDeltaY = Math.abs(event.deltaY);
|
|
12
|
+
let dy = deltaY;
|
|
13
|
+
if (absDeltaY > MAX_ZOOM_STEP) {
|
|
14
|
+
dy = MAX_ZOOM_STEP * signY;
|
|
15
|
+
}
|
|
16
|
+
deltaZ = dy;
|
|
17
|
+
}
|
|
18
|
+
return { deltaX, deltaY, deltaZ };
|
|
19
|
+
}
|
|
20
|
+
exports.normalizeWheel = normalizeWheel;
|
|
@@ -21,7 +21,7 @@ export declare const getCliOptions: (options: {
|
|
|
21
21
|
envVariables: Record<string, string>;
|
|
22
22
|
quality: number | undefined;
|
|
23
23
|
browser: import("@remotion/renderer").Browser;
|
|
24
|
-
crf:
|
|
24
|
+
crf: import("@remotion/renderer").Crf | null;
|
|
25
25
|
pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
26
26
|
imageFormat: "png" | "jpeg" | "none";
|
|
27
27
|
proResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
|
|
@@ -31,7 +31,7 @@ export declare const getCliOptions: (options: {
|
|
|
31
31
|
browserExecutable: BrowserExecutable;
|
|
32
32
|
ffmpegExecutable: import("@remotion/renderer").FfmpegExecutable;
|
|
33
33
|
ffprobeExecutable: import("@remotion/renderer").FfmpegExecutable;
|
|
34
|
-
logLevel: "
|
|
34
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
35
35
|
scale: number;
|
|
36
36
|
chromiumOptions: ChromiumOptions;
|
|
37
37
|
overwrite: boolean;
|
|
@@ -40,4 +40,6 @@ export declare const getCliOptions: (options: {
|
|
|
40
40
|
enforceAudioTrack: boolean;
|
|
41
41
|
publicDir: string | null;
|
|
42
42
|
ffmpegOverride: import("@remotion/renderer").FfmpegOverrideFn;
|
|
43
|
+
audioBitrate: string | null;
|
|
44
|
+
videoBitrate: string | null;
|
|
43
45
|
}>;
|
package/dist/get-cli-options.js
CHANGED
|
@@ -80,13 +80,10 @@ const getAndValidateShouldOutputImageSequence = async ({ frameRange, isLambda, }
|
|
|
80
80
|
}
|
|
81
81
|
return shouldOutputImageSequence;
|
|
82
82
|
};
|
|
83
|
-
const
|
|
83
|
+
const getCrf = (shouldOutputImageSequence) => {
|
|
84
84
|
const crf = shouldOutputImageSequence
|
|
85
85
|
? null
|
|
86
|
-
: config_1.ConfigInternals.
|
|
87
|
-
if (crf !== null) {
|
|
88
|
-
renderer_1.RenderInternals.validateSelectedCrfAndCodecCombination(crf, codec);
|
|
89
|
-
}
|
|
86
|
+
: config_1.ConfigInternals.getCrfOrUndefined();
|
|
90
87
|
return crf;
|
|
91
88
|
};
|
|
92
89
|
const getAndValidatePixelFormat = (codec) => {
|
|
@@ -127,7 +124,13 @@ const getCliOptions = async (options) => {
|
|
|
127
124
|
const overwrite = config_1.ConfigInternals.getShouldOverwrite({
|
|
128
125
|
defaultValue: !options.isLambda,
|
|
129
126
|
});
|
|
130
|
-
const crf =
|
|
127
|
+
const crf = getCrf(shouldOutputImageSequence);
|
|
128
|
+
const videoBitrate = config_1.ConfigInternals.getVideoBitrate();
|
|
129
|
+
renderer_1.RenderInternals.validateQualitySettings({
|
|
130
|
+
crf,
|
|
131
|
+
codec: options.codec,
|
|
132
|
+
videoBitrate,
|
|
133
|
+
});
|
|
131
134
|
const pixelFormat = getAndValidatePixelFormat(options.codec);
|
|
132
135
|
const imageFormat = getAndValidateImageFormat({
|
|
133
136
|
shouldOutputImageSequence,
|
|
@@ -178,6 +181,8 @@ const getCliOptions = async (options) => {
|
|
|
178
181
|
enforceAudioTrack: config_1.ConfigInternals.getEnforceAudioTrack(),
|
|
179
182
|
publicDir: config_1.ConfigInternals.getPublicDir(),
|
|
180
183
|
ffmpegOverride: config_1.ConfigInternals.getFfmpegOverrideFunction(),
|
|
184
|
+
audioBitrate: config_1.ConfigInternals.getAudioBitrate(),
|
|
185
|
+
videoBitrate,
|
|
181
186
|
};
|
|
182
187
|
};
|
|
183
188
|
exports.getCliOptions = getCliOptions;
|
|
@@ -5,7 +5,7 @@ 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
7
|
const getRenderMediaOptions = async ({ outputLocation, config, serveUrl, codec, }) => {
|
|
8
|
-
const { proResProfile, concurrency, frameRange, overwrite, inputProps, envVariables, quality, crf, pixelFormat, imageFormat, browserExecutable, ffmpegExecutable, ffprobeExecutable, scale, chromiumOptions, port, numberOfGifLoops, everyNthFrame, muted, enforceAudioTrack, ffmpegOverride, } = await (0, get_cli_options_1.getCliOptions)({
|
|
8
|
+
const { proResProfile, concurrency, frameRange, overwrite, inputProps, envVariables, quality, crf, pixelFormat, imageFormat, browserExecutable, ffmpegExecutable, ffprobeExecutable, scale, chromiumOptions, port, numberOfGifLoops, everyNthFrame, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, } = await (0, get_cli_options_1.getCliOptions)({
|
|
9
9
|
isLambda: false,
|
|
10
10
|
type: 'series',
|
|
11
11
|
codec,
|
|
@@ -39,6 +39,8 @@ const getRenderMediaOptions = async ({ outputLocation, config, serveUrl, codec,
|
|
|
39
39
|
concurrency,
|
|
40
40
|
serveUrl,
|
|
41
41
|
codec,
|
|
42
|
+
audioBitrate,
|
|
43
|
+
videoBitrate,
|
|
42
44
|
};
|
|
43
45
|
};
|
|
44
46
|
exports.getRenderMediaOptions = getRenderMediaOptions;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import minimist from 'minimist';
|
|
2
2
|
export declare const cli: () => Promise<void>;
|
|
3
3
|
export { ConfigInternals, overrideRemotion } from './config/index';
|
|
4
4
|
export * from './render';
|
|
@@ -80,7 +80,7 @@ export declare const CliInternals: {
|
|
|
80
80
|
envVariables: Record<string, string>;
|
|
81
81
|
quality: number | undefined;
|
|
82
82
|
browser: import("@remotion/renderer").Browser;
|
|
83
|
-
crf:
|
|
83
|
+
crf: import("@remotion/renderer").Crf | null;
|
|
84
84
|
pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
85
85
|
imageFormat: "png" | "jpeg" | "none";
|
|
86
86
|
proResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
|
|
@@ -90,7 +90,7 @@ export declare const CliInternals: {
|
|
|
90
90
|
browserExecutable: import("@remotion/renderer").BrowserExecutable;
|
|
91
91
|
ffmpegExecutable: import("@remotion/renderer").FfmpegExecutable;
|
|
92
92
|
ffprobeExecutable: import("@remotion/renderer").FfmpegExecutable;
|
|
93
|
-
logLevel: "
|
|
93
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
94
94
|
scale: number;
|
|
95
95
|
chromiumOptions: import("@remotion/renderer").ChromiumOptions;
|
|
96
96
|
overwrite: boolean;
|
|
@@ -99,13 +99,15 @@ export declare const CliInternals: {
|
|
|
99
99
|
enforceAudioTrack: boolean;
|
|
100
100
|
publicDir: string | null;
|
|
101
101
|
ffmpegOverride: import("@remotion/renderer").FfmpegOverrideFn;
|
|
102
|
+
audioBitrate: string | null;
|
|
103
|
+
videoBitrate: string | null;
|
|
102
104
|
}>;
|
|
103
105
|
parseCommandLine: () => void;
|
|
104
106
|
loadConfig: (remotionRoot: string) => Promise<string | null>;
|
|
105
107
|
initializeCli: (remotionRoot: string) => Promise<void>;
|
|
106
108
|
BooleanFlags: string[];
|
|
107
109
|
quietFlagProvided: () => boolean;
|
|
108
|
-
parsedCli: import("./parse-command-line").CommandLineOptions &
|
|
110
|
+
parsedCli: import("./parse-command-line").CommandLineOptions & minimist.ParsedArgs;
|
|
109
111
|
handleCommonError: (err: Error) => Promise<void>;
|
|
110
112
|
formatBytes: (number: number, options?: Intl.NumberFormatOptions & {
|
|
111
113
|
locale: string;
|
|
@@ -132,4 +134,5 @@ export declare const CliInternals: {
|
|
|
132
134
|
format: import("@remotion/renderer").StillImageFormat;
|
|
133
135
|
source: string;
|
|
134
136
|
};
|
|
137
|
+
minimist: typeof minimist;
|
|
135
138
|
};
|
package/dist/index.js
CHANGED
|
@@ -13,12 +13,15 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
16
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
20
|
exports.CliInternals = exports.overrideRemotion = exports.ConfigInternals = exports.cli = void 0;
|
|
18
21
|
const renderer_1 = require("@remotion/renderer");
|
|
22
|
+
const minimist_1 = __importDefault(require("minimist"));
|
|
19
23
|
const benchmark_1 = require("./benchmark");
|
|
20
24
|
const chalk_1 = require("./chalk");
|
|
21
|
-
const check_version_1 = require("./check-version");
|
|
22
25
|
const compositions_1 = require("./compositions");
|
|
23
26
|
const index_1 = require("./config/index");
|
|
24
27
|
const determine_image_format_1 = require("./determine-image-format");
|
|
@@ -50,8 +53,6 @@ const cli = async () => {
|
|
|
50
53
|
process.exit(0);
|
|
51
54
|
}
|
|
52
55
|
const remotionRoot = (0, find_closest_package_json_1.findRemotionRoot)();
|
|
53
|
-
// To check node version and to warn if node version is <12.10.0
|
|
54
|
-
(0, check_version_1.checkNodeVersion)();
|
|
55
56
|
if (command !== versions_1.VERSIONS_COMMAND) {
|
|
56
57
|
await (0, versions_1.validateVersionsBeforeCommand)(remotionRoot);
|
|
57
58
|
}
|
|
@@ -74,7 +75,7 @@ const cli = async () => {
|
|
|
74
75
|
await (0, still_1.still)(remotionRoot);
|
|
75
76
|
}
|
|
76
77
|
else if (command === 'upgrade') {
|
|
77
|
-
await (0, upgrade_1.upgrade)(remotionRoot);
|
|
78
|
+
await (0, upgrade_1.upgrade)(remotionRoot, parse_command_line_1.parsedCli['package-manager']);
|
|
78
79
|
}
|
|
79
80
|
else if (command === versions_1.VERSIONS_COMMAND) {
|
|
80
81
|
await (0, versions_1.versionsCommand)(remotionRoot);
|
|
@@ -127,4 +128,5 @@ exports.CliInternals = {
|
|
|
127
128
|
findRemotionRoot: find_closest_package_json_1.findRemotionRoot,
|
|
128
129
|
getFinalCodec: get_cli_options_1.getFinalCodec,
|
|
129
130
|
determineFinalImageFormat: determine_image_format_1.determineFinalImageFormat,
|
|
131
|
+
minimist: minimist_1.default,
|
|
130
132
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const initializeRenderCli: (remotionRoot: string, type: 'still' | 'sequence' | 'lambda' | 'preview') => Promise<void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initializeRenderCli = void 0;
|
|
4
|
+
const get_config_file_name_1 = require("./get-config-file-name");
|
|
5
|
+
const log_1 = require("./log");
|
|
6
|
+
const parse_command_line_1 = require("./parse-command-line");
|
|
7
|
+
const initializeRenderCli = async (remotionRoot, type) => {
|
|
8
|
+
const appliedName = await (0, get_config_file_name_1.loadConfig)(remotionRoot);
|
|
9
|
+
(0, parse_command_line_1.parseCommandLine)(type);
|
|
10
|
+
// Only now Log.verbose is available
|
|
11
|
+
log_1.Log.verbose('Remotion root directory:', remotionRoot);
|
|
12
|
+
if (remotionRoot !== process.cwd()) {
|
|
13
|
+
log_1.Log.warn(`Warning: The root directory of your project is ${remotionRoot}, but you are executing this command from ${process.cwd()}. The recommendation is to execute commands from the root directory.`);
|
|
14
|
+
}
|
|
15
|
+
if (appliedName) {
|
|
16
|
+
log_1.Log.verbose(`Applied configuration from ${appliedName}.`);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
log_1.Log.verbose('No config file loaded.');
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.initializeRenderCli = initializeRenderCli;
|
package/dist/lambda-command.js
CHANGED
|
@@ -15,7 +15,7 @@ const lambdaCommand = async (remotionRoot) => {
|
|
|
15
15
|
process.exit(0);
|
|
16
16
|
}
|
|
17
17
|
catch (err) {
|
|
18
|
-
const manager = (0, get_package_manager_1.getPackageManager)(remotionRoot);
|
|
18
|
+
const manager = (0, get_package_manager_1.getPackageManager)(remotionRoot, undefined);
|
|
19
19
|
const installCommand = manager === 'unknown' ? 'npm i' : manager.installCommand;
|
|
20
20
|
log_1.Log.error(err);
|
|
21
21
|
log_1.Log.error('Remotion Lambda is not installed.');
|
|
@@ -38,6 +38,7 @@ export declare type CommandLineOptions = {
|
|
|
38
38
|
muted: boolean;
|
|
39
39
|
['enforce-audio-track']: boolean;
|
|
40
40
|
gl: OpenGlRenderer;
|
|
41
|
+
['package-manager']: string;
|
|
41
42
|
};
|
|
42
43
|
export declare const BooleanFlags: string[];
|
|
43
44
|
export declare const parsedCli: CommandLineOptions & minimist.ParsedArgs;
|
|
@@ -130,6 +130,12 @@ const parseCommandLine = () => {
|
|
|
130
130
|
if (typeof exports.parsedCli['public-dir'] !== 'undefined') {
|
|
131
131
|
config_1.Config.Bundling.setPublicDir(exports.parsedCli['public-dir']);
|
|
132
132
|
}
|
|
133
|
+
if (typeof exports.parsedCli['audio-bitrate'] !== 'undefined') {
|
|
134
|
+
config_1.Config.Output.setAudioBitrate(exports.parsedCli['audio-bitrate']);
|
|
135
|
+
}
|
|
136
|
+
if (typeof exports.parsedCli['video-bitrate'] !== 'undefined') {
|
|
137
|
+
config_1.Config.Output.setVideoBitrate(exports.parsedCli['video-bitrate']);
|
|
138
|
+
}
|
|
133
139
|
};
|
|
134
140
|
exports.parseCommandLine = parseCommandLine;
|
|
135
141
|
const quietFlagProvided = () => exports.parsedCli.quiet || exports.parsedCli.q;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RenderStep } from './step';
|
|
2
|
+
export declare const prepareEntryPoint: ({ file, otherSteps, publicPath, outDir, remotionRoot, }: {
|
|
3
|
+
file: string;
|
|
4
|
+
otherSteps: RenderStep[];
|
|
5
|
+
outDir: string | null;
|
|
6
|
+
publicPath: string | null;
|
|
7
|
+
remotionRoot: string;
|
|
8
|
+
}) => Promise<{
|
|
9
|
+
urlOrBundle: string;
|
|
10
|
+
steps: RenderStep[];
|
|
11
|
+
shouldDelete: boolean;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,37 @@
|
|
|
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.prepareEntryPoint = void 0;
|
|
7
|
+
const renderer_1 = require("@remotion/renderer");
|
|
8
|
+
const promises_1 = require("fs/promises");
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const process_1 = require("process");
|
|
11
|
+
const log_1 = require("./log");
|
|
12
|
+
const setup_cache_1 = require("./setup-cache");
|
|
13
|
+
const prepareEntryPoint = async ({ file, otherSteps, publicPath, outDir, remotionRoot, }) => {
|
|
14
|
+
if (renderer_1.RenderInternals.isServeUrl(file)) {
|
|
15
|
+
return { urlOrBundle: file, steps: otherSteps, shouldDelete: false };
|
|
16
|
+
}
|
|
17
|
+
const joined = path_1.default.resolve(process.cwd(), file);
|
|
18
|
+
try {
|
|
19
|
+
const stats = await (0, promises_1.stat)(joined);
|
|
20
|
+
if (stats.isDirectory()) {
|
|
21
|
+
return { urlOrBundle: joined, steps: otherSteps, shouldDelete: false };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
log_1.Log.error(`No file or directory exists at ${joined}.`);
|
|
26
|
+
(0, process_1.exit)(1);
|
|
27
|
+
}
|
|
28
|
+
const urlOrBundle = await (0, setup_cache_1.bundleOnCliOrTakeServeUrl)({
|
|
29
|
+
fullPath: joined,
|
|
30
|
+
steps: ['bundling', ...otherSteps],
|
|
31
|
+
outDir,
|
|
32
|
+
publicPath,
|
|
33
|
+
remotionRoot,
|
|
34
|
+
});
|
|
35
|
+
return { urlOrBundle, steps: ['bundling', ...otherSteps], shouldDelete: true };
|
|
36
|
+
};
|
|
37
|
+
exports.prepareEntryPoint = prepareEntryPoint;
|
|
@@ -6,5 +6,5 @@ declare type LockfilePath = {
|
|
|
6
6
|
startCommand: string;
|
|
7
7
|
};
|
|
8
8
|
export declare const lockFilePaths: LockfilePath[];
|
|
9
|
-
export declare const getPackageManager: (remotionRoot: string) => LockfilePath | 'unknown';
|
|
9
|
+
export declare const getPackageManager: (remotionRoot: string, packageManager: string | undefined) => LockfilePath | 'unknown';
|
|
10
10
|
export {};
|
|
@@ -26,7 +26,16 @@ exports.lockFilePaths = [
|
|
|
26
26
|
startCommand: 'pnpm start',
|
|
27
27
|
},
|
|
28
28
|
];
|
|
29
|
-
const getPackageManager = (remotionRoot) => {
|
|
29
|
+
const getPackageManager = (remotionRoot, packageManager) => {
|
|
30
|
+
if (packageManager) {
|
|
31
|
+
const manager = exports.lockFilePaths.find((p) => p.manager === packageManager);
|
|
32
|
+
if (!manager) {
|
|
33
|
+
throw new Error(`The package manager ${packageManager} is not supported. Supported package managers are ${exports.lockFilePaths
|
|
34
|
+
.map((p) => p.manager)
|
|
35
|
+
.join(', ')}`);
|
|
36
|
+
}
|
|
37
|
+
return manager;
|
|
38
|
+
}
|
|
30
39
|
const existingPkgManagers = exports.lockFilePaths.filter((p) => fs_1.default.existsSync(path_1.default.join(remotionRoot, p.path)));
|
|
31
40
|
if (existingPkgManagers.length === 0) {
|
|
32
41
|
return 'unknown';
|
|
@@ -30,7 +30,7 @@ const handleFallback = async ({ remotionRoot, hash, response, getCurrentInputPro
|
|
|
30
30
|
const displayName = (0, open_in_editor_1.getDisplayNameForEditor)(edit ? edit.command : null);
|
|
31
31
|
response.setHeader('content-type', 'text/html');
|
|
32
32
|
response.writeHead(200);
|
|
33
|
-
const packageManager = (0, get_package_manager_1.getPackageManager)(remotionRoot);
|
|
33
|
+
const packageManager = (0, get_package_manager_1.getPackageManager)(remotionRoot, undefined);
|
|
34
34
|
response.end(bundler_1.BundlerInternals.indexHtml({
|
|
35
35
|
staticHash: hash,
|
|
36
36
|
baseDir: '/',
|
|
@@ -9,7 +9,7 @@ const get_latest_remotion_version_1 = require("../get-latest-remotion-version");
|
|
|
9
9
|
const get_package_manager_1 = require("./get-package-manager");
|
|
10
10
|
const isUpdateAvailable = async ({ remotionRoot, currentVersion, }) => {
|
|
11
11
|
const latest = await (0, get_latest_remotion_version_1.getLatestRemotionVersion)();
|
|
12
|
-
const pkgManager = (0, get_package_manager_1.getPackageManager)(remotionRoot);
|
|
12
|
+
const pkgManager = (0, get_package_manager_1.getPackageManager)(remotionRoot, undefined);
|
|
13
13
|
return {
|
|
14
14
|
updateAvailable: semver_1.default.lt(currentVersion, latest),
|
|
15
15
|
currentVersion,
|
|
@@ -28,7 +28,7 @@ exports.getRemotionVersion = getRemotionVersion;
|
|
|
28
28
|
const isUpdateAvailableWithTimeout = (remotionRoot) => {
|
|
29
29
|
const version = (0, exports.getRemotionVersion)();
|
|
30
30
|
const threeSecTimeout = new Promise((resolve) => {
|
|
31
|
-
const pkgManager = (0, get_package_manager_1.getPackageManager)(remotionRoot);
|
|
31
|
+
const pkgManager = (0, get_package_manager_1.getPackageManager)(remotionRoot, undefined);
|
|
32
32
|
setTimeout(() => {
|
|
33
33
|
resolve({
|
|
34
34
|
currentVersion: version,
|
package/dist/print-help.js
CHANGED
|
@@ -31,6 +31,8 @@ const printHelp = () => {
|
|
|
31
31
|
['--overwrite', 'Overwrite if file exists, default true'],
|
|
32
32
|
['--sequence', 'Output as an image sequence'],
|
|
33
33
|
['--codec', 'Video of audio codec'],
|
|
34
|
+
['--audio-bitrate', 'Customize the output audio bitrate'],
|
|
35
|
+
['--video-bitrate', 'Customize the output video bitrate'],
|
|
34
36
|
['--crf', 'FFMPEG CRF value, controls quality, see docs for info'],
|
|
35
37
|
['--browser-executable', 'Custom path for browser executable'],
|
|
36
38
|
['--frames', 'Render a portion or a still of a video'],
|
|
@@ -67,6 +69,12 @@ const printHelp = () => {
|
|
|
67
69
|
log_1.Log.info();
|
|
68
70
|
log_1.Log.info('remotion upgrade');
|
|
69
71
|
log_1.Log.info(chalk_1.chalk.gray('Ensure Remotion is on the newest version.'));
|
|
72
|
+
printFlags([
|
|
73
|
+
[
|
|
74
|
+
'--package-manager',
|
|
75
|
+
'Force a specific package manager, defaults to use from lockfile',
|
|
76
|
+
],
|
|
77
|
+
]);
|
|
70
78
|
log_1.Log.info();
|
|
71
79
|
log_1.Log.info('Visit https://www.remotion.dev/docs/cli for browsable CLI documentation.');
|
|
72
80
|
};
|
package/dist/render.js
CHANGED
|
@@ -21,7 +21,6 @@ const parse_command_line_1 = require("./parse-command-line");
|
|
|
21
21
|
const progress_bar_1 = require("./progress-bar");
|
|
22
22
|
const setup_cache_1 = require("./setup-cache");
|
|
23
23
|
const user_passed_output_location_1 = require("./user-passed-output-location");
|
|
24
|
-
const validate_ffmpeg_version_1 = require("./validate-ffmpeg-version");
|
|
25
24
|
const render = async (remotionRoot) => {
|
|
26
25
|
const startTime = Date.now();
|
|
27
26
|
const file = parse_command_line_1.parsedCli._[1];
|
|
@@ -59,10 +58,11 @@ const render = async (remotionRoot) => {
|
|
|
59
58
|
const absoluteOutputFile = (0, get_cli_options_1.getAndValidateAbsoluteOutputFile)(relativeOutputLocation, overwrite);
|
|
60
59
|
const compositionId = (0, get_composition_id_1.getCompositionId)();
|
|
61
60
|
log_1.Log.info(chalk_1.chalk.gray(`Composition = ${compositionId}, Codec = ${codec} (${codecReason}), Output = ${relativeOutputLocation}`));
|
|
62
|
-
|
|
63
|
-
await (0, validate_ffmpeg_version_1.checkAndValidateFfmpegVersion)({
|
|
61
|
+
const ffmpegVersion = await renderer_1.RenderInternals.getFfmpegVersion({
|
|
64
62
|
ffmpegExecutable,
|
|
65
63
|
});
|
|
64
|
+
log_1.Log.verbose('FFMPEG Version:', ffmpegVersion ? ffmpegVersion.join('.') : 'Built from source');
|
|
65
|
+
log_1.Log.verbose('Browser executable: ', browserExecutable);
|
|
66
66
|
const browserInstance = (0, renderer_1.openBrowser)(browser, {
|
|
67
67
|
browserExecutable,
|
|
68
68
|
shouldDumpIo: renderer_1.RenderInternals.isEqualOrBelowLogLevel(config_1.ConfigInternals.Logging.getLogLevel(), 'verbose'),
|
package/dist/upgrade.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const upgrade: (remotionRoot: string) => Promise<void>;
|
|
1
|
+
export declare const upgrade: (remotionRoot: string, packageManager: string | undefined) => Promise<void>;
|
package/dist/upgrade.js
CHANGED
|
@@ -20,13 +20,13 @@ const getUpgradeCommand = ({ manager, packages, version, }) => {
|
|
|
20
20
|
};
|
|
21
21
|
return commands[manager];
|
|
22
22
|
};
|
|
23
|
-
const upgrade = async (remotionRoot) => {
|
|
23
|
+
const upgrade = async (remotionRoot, packageManager) => {
|
|
24
24
|
var _a;
|
|
25
25
|
const packageJsonFilePath = path_1.default.join(remotionRoot, 'package.json');
|
|
26
26
|
const packageJson = require(packageJsonFilePath);
|
|
27
27
|
const dependencies = Object.keys(packageJson.dependencies);
|
|
28
28
|
const latestRemotionVersion = await (0, get_latest_remotion_version_1.getLatestRemotionVersion)();
|
|
29
|
-
const manager = (0, get_package_manager_1.getPackageManager)(remotionRoot);
|
|
29
|
+
const manager = (0, get_package_manager_1.getPackageManager)(remotionRoot, packageManager);
|
|
30
30
|
if (manager === 'unknown') {
|
|
31
31
|
throw new Error(`No lockfile was found in your project (one of ${get_package_manager_1.lockFilePaths
|
|
32
32
|
.map((p) => p.path)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateImageFormat = void 0;
|
|
4
|
+
const log_1 = require("./log");
|
|
5
|
+
const validateImageFormat = (imageFormat, outName) => {
|
|
6
|
+
if (imageFormat === 'png' && (outName === null || outName === void 0 ? void 0 : outName.endsWith('.png'))) {
|
|
7
|
+
log_1.Log.warn(`Rendering a PNG, expected a .png extension but got ${outName}`);
|
|
8
|
+
}
|
|
9
|
+
if (imageFormat === 'jpeg' &&
|
|
10
|
+
!(outName === null || outName === void 0 ? void 0 : outName.endsWith('.jpg')) &&
|
|
11
|
+
!(outName === null || outName === void 0 ? void 0 : outName.endsWith('.jpeg'))) {
|
|
12
|
+
log_1.Log.warn(`Rendering a JPEG, expected a .jpg or .jpeg extension but got ${outName}`);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
exports.validateImageFormat = validateImageFormat;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare type Environment = 'development' | 'production';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace NodeJS {
|
|
4
|
+
interface ProcessVersions {
|
|
5
|
+
pnp?: string;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export declare const clearCache: (environment: Environment, inputProps: object | null) => Promise<void>;
|
|
10
|
+
export declare const getWebpackCacheName: (environment: Environment, inputProps: object | null) => string;
|
|
11
|
+
export declare const cacheExists: (environment: Environment, inputProps: object | null) => boolean;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
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.cacheExists = exports.getWebpackCacheName = exports.clearCache = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const remotion_1 = require("remotion");
|
|
10
|
+
// Inlined from https://github.com/webpack/webpack/blob/4c2ee7a4ddb8db2362ca83b6c4190523387ba7ee/lib/config/defaults.js#L265
|
|
11
|
+
// An algorithm to determine where Webpack will cache the depencies
|
|
12
|
+
const getWebpackCacheDir = () => {
|
|
13
|
+
const cwd = process.cwd();
|
|
14
|
+
let dir = cwd;
|
|
15
|
+
for (;;) {
|
|
16
|
+
try {
|
|
17
|
+
if (fs_1.default.statSync(path_1.default.join(dir, 'package.json')).isFile()) {
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
// eslint-disable-next-line no-empty
|
|
21
|
+
}
|
|
22
|
+
catch (e) { }
|
|
23
|
+
const parent = path_1.default.dirname(dir);
|
|
24
|
+
if (dir === parent) {
|
|
25
|
+
dir = undefined;
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
dir = parent;
|
|
29
|
+
}
|
|
30
|
+
if (!dir) {
|
|
31
|
+
return path_1.default.resolve(cwd, '.cache/webpack');
|
|
32
|
+
}
|
|
33
|
+
if (process.versions.pnp === '1') {
|
|
34
|
+
return path_1.default.resolve(dir, '.pnp/.cache/webpack');
|
|
35
|
+
}
|
|
36
|
+
if (process.versions.pnp === '3') {
|
|
37
|
+
return path_1.default.resolve(dir, '.yarn/.cache/webpack');
|
|
38
|
+
}
|
|
39
|
+
return path_1.default.resolve(dir, 'node_modules/.cache/webpack');
|
|
40
|
+
};
|
|
41
|
+
const remotionCacheLocation = (environment, inputProps) => {
|
|
42
|
+
return path_1.default.join(getWebpackCacheDir(), (0, exports.getWebpackCacheName)(environment, inputProps));
|
|
43
|
+
};
|
|
44
|
+
const clearCache = (environment, inputProps) => {
|
|
45
|
+
var _a;
|
|
46
|
+
return ((_a = fs_1.default.promises.rm) !== null && _a !== void 0 ? _a : fs_1.default.promises.rmdir)(remotionCacheLocation(environment, inputProps), {
|
|
47
|
+
recursive: true,
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
exports.clearCache = clearCache;
|
|
51
|
+
const getWebpackCacheName = (environment, inputProps) => {
|
|
52
|
+
// In development, let's reset the cache when input props
|
|
53
|
+
// are changing, because they are injected using Webpack and if changed,
|
|
54
|
+
// it will get the cached version
|
|
55
|
+
if (environment === 'development') {
|
|
56
|
+
return `remotion-v3-${environment}-${(0, remotion_1.random)(JSON.stringify(inputProps))}`;
|
|
57
|
+
}
|
|
58
|
+
// In production, the cache is independent from input props because
|
|
59
|
+
// they are passed over URL params. Speed is mostly important in production.
|
|
60
|
+
return `remotion-v3-${environment}`;
|
|
61
|
+
};
|
|
62
|
+
exports.getWebpackCacheName = getWebpackCacheName;
|
|
63
|
+
const cacheExists = (environment, inputProps) => {
|
|
64
|
+
return fs_1.default.existsSync(remotionCacheLocation(environment, inputProps));
|
|
65
|
+
};
|
|
66
|
+
exports.cacheExists = cacheExists;
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/cli",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.33",
|
|
4
4
|
"description": "CLI for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"bin": {
|
|
8
8
|
"remotion": "remotion-cli.js"
|
|
9
9
|
},
|
|
10
|
-
"module": "true",
|
|
11
10
|
"scripts": {
|
|
12
11
|
"lint": "eslint src --ext ts,tsx",
|
|
13
12
|
"test": "vitest --run",
|
|
@@ -23,15 +22,15 @@
|
|
|
23
22
|
"author": "Jonny Burger <jonny@remotion.dev>",
|
|
24
23
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
25
24
|
"dependencies": {
|
|
26
|
-
"@remotion/bundler": "3.2.
|
|
27
|
-
"@remotion/media-utils": "3.2.
|
|
28
|
-
"@remotion/player": "3.2.
|
|
29
|
-
"@remotion/renderer": "3.2.
|
|
25
|
+
"@remotion/bundler": "3.2.33",
|
|
26
|
+
"@remotion/media-utils": "3.2.33",
|
|
27
|
+
"@remotion/player": "3.2.33",
|
|
28
|
+
"@remotion/renderer": "3.2.33",
|
|
30
29
|
"better-opn": "2.1.1",
|
|
31
30
|
"dotenv": "9.0.2",
|
|
32
31
|
"memfs": "3.4.3",
|
|
33
32
|
"minimist": "1.2.6",
|
|
34
|
-
"remotion": "3.2.
|
|
33
|
+
"remotion": "3.2.33",
|
|
35
34
|
"semver": "7.3.5",
|
|
36
35
|
"source-map": "0.6.1"
|
|
37
36
|
},
|
|
@@ -58,7 +57,7 @@
|
|
|
58
57
|
"react": "^18.0.0",
|
|
59
58
|
"react-dom": "^18.0.0",
|
|
60
59
|
"typescript": "^4.7.0",
|
|
61
|
-
"vitest": "
|
|
60
|
+
"vitest": "0.24.3"
|
|
62
61
|
},
|
|
63
62
|
"keywords": [
|
|
64
63
|
"remotion",
|
|
@@ -71,5 +70,5 @@
|
|
|
71
70
|
"publishConfig": {
|
|
72
71
|
"access": "public"
|
|
73
72
|
},
|
|
74
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "3c864e5ab73870674d028a1199005ddbabaede12"
|
|
75
74
|
}
|