@remotion/cli 4.0.0-umungobongo.4 → 4.0.0-webhook.25
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/benchmark.d.ts +1 -0
- package/dist/benchmark.js +180 -0
- package/dist/compositions.js +4 -2
- package/dist/config/enforce-audio-track.d.ts +2 -0
- package/dist/config/enforce-audio-track.js +13 -0
- package/dist/config/ffmpeg-override.d.ts +3 -0
- package/dist/config/ffmpeg-override.js +12 -0
- package/dist/config/image-format.js +8 -1
- package/dist/config/index.d.ts +10 -1
- package/dist/config/index.js +17 -0
- package/dist/config/keyboard-shortcuts.d.ts +2 -0
- package/dist/config/keyboard-shortcuts.js +12 -0
- package/dist/config/log.d.ts +1 -1
- package/dist/config/muted.d.ts +2 -0
- package/dist/config/muted.js +13 -0
- package/dist/config/overwrite.d.ts +3 -1
- package/dist/config/overwrite.js +2 -3
- package/dist/config/public-dir.d.ts +2 -0
- package/dist/config/public-dir.js +12 -0
- package/dist/determine-image-format.d.ts +11 -0
- package/dist/determine-image-format.js +48 -0
- package/dist/editor/components/Canvas.js +193 -1
- package/dist/editor/components/CheckboardToggle.js +8 -1
- package/dist/editor/components/CopyButton.js +3 -16
- package/dist/editor/components/Editor.js +4 -90
- package/dist/editor/components/EditorContexts.d.ts +4 -0
- package/dist/editor/components/EditorContexts.js +83 -0
- package/dist/editor/components/InitialCompositionLoader.js +13 -0
- package/dist/editor/components/KeyboardShortcutsModal.js +15 -1
- package/dist/editor/components/Menu/MenuSubItem.js +2 -1
- package/dist/editor/components/MenuToolbar.js +15 -10
- package/dist/editor/components/NewComposition/RemInput.js +1 -1
- package/dist/editor/components/Notifications/NotificationCenter.js +1 -1
- package/dist/editor/components/Notifications/ServerDisconnected.d.ts +6 -0
- package/dist/editor/components/Notifications/ServerDisconnected.js +59 -0
- package/dist/editor/components/PlayPause.js +41 -23
- package/dist/editor/components/PlaybackKeyboardShortcutsManager.js +6 -18
- package/dist/editor/components/PlaybackRateSelector.js +5 -0
- package/dist/editor/components/Preview.d.ts +1 -0
- package/dist/editor/components/Preview.js +17 -9
- package/dist/editor/components/PreviewToolbar.js +2 -2
- package/dist/editor/components/ResetZoomButton.d.ts +4 -0
- package/dist/editor/components/ResetZoomButton.js +9 -0
- package/dist/editor/components/SizeSelector.d.ts +2 -1
- package/dist/editor/components/SizeSelector.js +58 -18
- package/dist/editor/components/Splitter/SplitterElement.js +1 -0
- package/dist/editor/components/TimeValue.js +9 -5
- package/dist/editor/components/Timeline/MaxTimelineTracks.d.ts +1 -0
- package/dist/editor/components/Timeline/MaxTimelineTracks.js +5 -3
- package/dist/editor/components/Timeline/Timeline.js +12 -5
- package/dist/editor/components/Timeline/TimelineDragHandler.js +120 -23
- package/dist/editor/components/Timeline/TimelineList.js +5 -4
- package/dist/editor/components/Timeline/TimelineListItem.d.ts +1 -0
- package/dist/editor/components/Timeline/TimelineListItem.js +8 -4
- package/dist/editor/components/Timeline/TimelinePlayCursorSyncer.js +3 -2
- package/dist/editor/components/Timeline/TimelineScrollable.js +3 -1
- package/dist/editor/components/Timeline/TimelineSlider.d.ts +3 -0
- package/dist/editor/components/Timeline/TimelineSlider.js +35 -2
- package/dist/editor/components/Timeline/TimelineSliderHandle.js +1 -3
- package/dist/editor/components/Timeline/TimelineTimeIndicators.d.ts +1 -1
- package/dist/editor/components/Timeline/TimelineTimeIndicators.js +106 -17
- package/dist/editor/components/Timeline/TimelineTracks.js +14 -9
- package/dist/editor/components/Timeline/TimelineZoomControls.js +1 -1
- package/dist/editor/components/Timeline/imperative-state.d.ts +3 -0
- package/dist/editor/components/Timeline/imperative-state.js +10 -1
- package/dist/editor/components/Timeline/timeline-refs.d.ts +2 -0
- package/dist/editor/components/Timeline/timeline-refs.js +3 -1
- package/dist/editor/components/Timeline/timeline-scroll-logic.d.ts +1 -1
- package/dist/editor/components/Timeline/timeline-scroll-logic.js +10 -7
- package/dist/editor/components/TimelineInOutToggle.d.ts +2 -2
- package/dist/editor/components/TimelineInOutToggle.js +66 -17
- package/dist/editor/components/ZoomPersistor.d.ts +1 -1
- package/dist/editor/components/ZoomPersistor.js +4 -4
- package/dist/editor/helpers/colors.d.ts +2 -1
- package/dist/editor/helpers/colors.js +2 -1
- package/dist/editor/helpers/get-effective-translation.d.ts +26 -0
- package/dist/editor/helpers/get-effective-translation.js +45 -0
- package/dist/editor/helpers/get-left-of-timeline-slider.d.ts +1 -0
- package/dist/editor/helpers/get-left-of-timeline-slider.js +7 -4
- package/dist/editor/helpers/get-timeline-sequence-layout.js +29 -9
- package/dist/editor/helpers/is-current-selected-still.d.ts +4 -0
- package/dist/editor/helpers/is-current-selected-still.js +15 -1
- package/dist/editor/helpers/use-keybinding.d.ts +1 -0
- package/dist/editor/helpers/use-keybinding.js +13 -1
- package/dist/editor/state/preview-size.d.ts +5 -2
- package/dist/editor/state/preview-size.js +39 -5
- package/dist/event-source-events.d.ts +3 -0
- package/dist/event-source.js +16 -1
- package/dist/get-cli-options.d.ts +16 -4
- package/dist/get-cli-options.js +32 -32
- package/dist/get-env.d.ts +1 -1
- package/dist/get-env.js +58 -6
- package/dist/get-final-output-codec.d.ts +9 -5
- package/dist/get-final-output-codec.js +56 -56
- package/dist/get-render-media-options.d.ts +7 -0
- package/dist/get-render-media-options.js +44 -0
- package/dist/handle-common-errors.js +5 -0
- package/dist/index.d.ts +26 -5
- package/dist/index.js +13 -3
- package/dist/initialize-cli.d.ts +1 -0
- package/dist/initialize-cli.js +22 -0
- package/dist/lambda-command.js +0 -2
- package/dist/list-of-remotion-packages.d.ts +1 -0
- package/dist/list-of-remotion-packages.js +20 -0
- package/dist/parse-command-line.d.ts +5 -1
- package/dist/parse-command-line.js +16 -12
- package/dist/preview-server/error-overlay/react-overlay/listen-to-runtime-errors.js +9 -1
- package/dist/preview-server/error-overlay/remotion-overlay/Button.js +1 -1
- package/dist/preview-server/error-overlay/remotion-overlay/CodeFrame.js +2 -0
- package/dist/preview-server/error-overlay/remotion-overlay/ErrorMessage.js +4 -2
- package/dist/preview-server/error-overlay/remotion-overlay/ErrorTitle.js +1 -1
- package/dist/preview-server/error-overlay/remotion-overlay/StackFrame.js +3 -1
- package/dist/preview-server/get-package-manager.d.ts +1 -0
- package/dist/preview-server/get-package-manager.js +8 -1
- package/dist/preview-server/live-events.js +4 -0
- package/dist/preview-server/routes.d.ts +3 -1
- package/dist/preview-server/routes.js +27 -6
- package/dist/preview-server/start-server.d.ts +4 -2
- package/dist/preview-server/start-server.js +7 -2
- package/dist/preview.js +14 -4
- package/dist/previewEntry.js +9 -2
- package/dist/print-help.js +6 -3
- package/dist/progress-bar.js +10 -3
- package/dist/render.js +25 -30
- package/dist/setup-cache.d.ts +4 -2
- package/dist/setup-cache.js +16 -11
- package/dist/smooth-zoom.d.ts +4 -0
- package/dist/smooth-zoom.js +20 -0
- package/dist/still.js +16 -26
- package/dist/upgrade.js +6 -18
- package/dist/validate-image-format.d.ts +2 -0
- package/dist/validate-image-format.js +15 -0
- package/dist/versions.js +3 -16
- package/package.json +7 -7
- package/web/favicon.png +0 -0
- package/dist/bundle.d.ts +0 -1
- package/dist/bundle.js +0 -32
- package/dist/config/bundle-out-dir.d.ts +0 -2
- package/dist/config/bundle-out-dir.js +0 -12
- package/dist/config/get-public-path.d.ts +0 -2
- package/dist/config/get-public-path.js +0 -12
- package/dist/prepare-entry-point.d.ts +0 -12
- package/dist/prepare-entry-point.js +0 -37
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const benchmarkCommand: (remotionRoot: string, args: string[]) => Promise<void>;
|
|
@@ -0,0 +1,180 @@
|
|
|
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.benchmarkCommand = void 0;
|
|
7
|
+
const renderer_1 = require("@remotion/renderer");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const chalk_1 = require("./chalk");
|
|
10
|
+
const config_1 = require("./config");
|
|
11
|
+
const get_cli_options_1 = require("./get-cli-options");
|
|
12
|
+
const get_render_media_options_1 = require("./get-render-media-options");
|
|
13
|
+
const log_1 = require("./log");
|
|
14
|
+
const make_progress_bar_1 = require("./make-progress-bar");
|
|
15
|
+
const parse_command_line_1 = require("./parse-command-line");
|
|
16
|
+
const progress_bar_1 = require("./progress-bar");
|
|
17
|
+
const setup_cache_1 = require("./setup-cache");
|
|
18
|
+
const truthy_1 = require("./truthy");
|
|
19
|
+
const DEFAULT_RUNS = 3;
|
|
20
|
+
const getValidConcurrency = (renderMediaOptions) => {
|
|
21
|
+
var _a;
|
|
22
|
+
const concurrency = 'concurrency' in renderMediaOptions
|
|
23
|
+
? (_a = renderMediaOptions.concurrency) !== null && _a !== void 0 ? _a : null
|
|
24
|
+
: null;
|
|
25
|
+
const { concurrencies } = parse_command_line_1.parsedCli;
|
|
26
|
+
if (!concurrencies) {
|
|
27
|
+
return [renderer_1.RenderInternals.getActualConcurrency(concurrency)];
|
|
28
|
+
}
|
|
29
|
+
return concurrencies
|
|
30
|
+
.split(',')
|
|
31
|
+
.map((c) => parseInt(c.trim(), 10));
|
|
32
|
+
};
|
|
33
|
+
const runBenchmark = async (runs, options, onProgress) => {
|
|
34
|
+
const timeTaken = [];
|
|
35
|
+
for (let run = 0; run < runs; ++run) {
|
|
36
|
+
const startTime = performance.now();
|
|
37
|
+
await (0, renderer_1.renderMedia)({
|
|
38
|
+
...options,
|
|
39
|
+
onProgress: ({ progress }) => onProgress === null || onProgress === void 0 ? void 0 : onProgress(run, progress),
|
|
40
|
+
});
|
|
41
|
+
const endTime = performance.now();
|
|
42
|
+
timeTaken.push(endTime - startTime);
|
|
43
|
+
}
|
|
44
|
+
return timeTaken;
|
|
45
|
+
};
|
|
46
|
+
const formatTime = (time) => {
|
|
47
|
+
let ret = '';
|
|
48
|
+
const hours = Math.floor(time / (60 * 60 * 1000));
|
|
49
|
+
if (hours) {
|
|
50
|
+
ret = `${hours}h`;
|
|
51
|
+
}
|
|
52
|
+
time %= 60 * 60 * 1000;
|
|
53
|
+
const minutes = Math.floor(time / (60 * 1000));
|
|
54
|
+
if (minutes) {
|
|
55
|
+
ret = `${ret}${minutes}m`;
|
|
56
|
+
}
|
|
57
|
+
time %= 60 * 1000;
|
|
58
|
+
const seconds = (time / 1000).toFixed(5);
|
|
59
|
+
if (seconds) {
|
|
60
|
+
ret = `${ret}${seconds}s`;
|
|
61
|
+
}
|
|
62
|
+
return ret;
|
|
63
|
+
};
|
|
64
|
+
const avg = (time) => time.reduce((prev, curr) => prev + curr) / time.length;
|
|
65
|
+
const stdDev = (time) => {
|
|
66
|
+
const mean = avg(time);
|
|
67
|
+
return Math.sqrt(time.map((x) => (x - mean) ** 2).reduce((a, b) => a + b) / time.length);
|
|
68
|
+
};
|
|
69
|
+
const getResults = (results, runs) => {
|
|
70
|
+
const mean = avg(results);
|
|
71
|
+
const dev = stdDev(results);
|
|
72
|
+
const max = Math.max(...results);
|
|
73
|
+
const min = Math.min(...results);
|
|
74
|
+
return ` Time (${chalk_1.chalk.green('mean')} ± ${chalk_1.chalk.green('σ')}): ${chalk_1.chalk.green(formatTime(mean))} ± ${chalk_1.chalk.green(formatTime(dev))}\n Range (${chalk_1.chalk.blue('min')} ... ${chalk_1.chalk.red('max')}): ${chalk_1.chalk.blue(formatTime(min))} ... ${chalk_1.chalk.red(formatTime(max))} \t ${chalk_1.chalk.gray(`${runs} runs`)}
|
|
75
|
+
`;
|
|
76
|
+
};
|
|
77
|
+
const makeBenchmarkProgressBar = ({ totalRuns, run, progress, doneIn, }) => {
|
|
78
|
+
const totalProgress = (run + progress) / totalRuns;
|
|
79
|
+
return [
|
|
80
|
+
`Rendering (${run + 1} out of ${totalRuns} runs)`,
|
|
81
|
+
(0, make_progress_bar_1.makeProgressBar)(totalProgress),
|
|
82
|
+
doneIn === null
|
|
83
|
+
? `${(totalProgress * 100).toFixed(2)}% `
|
|
84
|
+
: chalk_1.chalk.gray(doneIn),
|
|
85
|
+
].join(' ');
|
|
86
|
+
};
|
|
87
|
+
const benchmarkCommand = async (remotionRoot, args) => {
|
|
88
|
+
var _a, _b;
|
|
89
|
+
const runs = (_a = parse_command_line_1.parsedCli.runs) !== null && _a !== void 0 ? _a : DEFAULT_RUNS;
|
|
90
|
+
const filePath = args[0];
|
|
91
|
+
if (!filePath) {
|
|
92
|
+
log_1.Log.error('No entry file passed.');
|
|
93
|
+
log_1.Log.info('Pass an additional argument specifying the entry file');
|
|
94
|
+
log_1.Log.info();
|
|
95
|
+
log_1.Log.info(`$ remotion benchmark <entry file>`);
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
const fullPath = path_1.default.join(process.cwd(), filePath);
|
|
99
|
+
const { inputProps, envVariables, browserExecutable, ffmpegExecutable, ffprobeExecutable, chromiumOptions, port, puppeteerTimeout, browser, scale, publicDir, } = await (0, get_cli_options_1.getCliOptions)({
|
|
100
|
+
isLambda: false,
|
|
101
|
+
type: 'series',
|
|
102
|
+
codec: 'h264',
|
|
103
|
+
});
|
|
104
|
+
const browserInstance = (0, renderer_1.openBrowser)(browser, {
|
|
105
|
+
browserExecutable,
|
|
106
|
+
shouldDumpIo: renderer_1.RenderInternals.isEqualOrBelowLogLevel(config_1.ConfigInternals.Logging.getLogLevel(), 'verbose'),
|
|
107
|
+
chromiumOptions,
|
|
108
|
+
forceDeviceScaleFactor: scale,
|
|
109
|
+
});
|
|
110
|
+
const { urlOrBundle: bundleLocation, cleanup: cleanupBundle } = await (0, setup_cache_1.bundleOnCliOrTakeServeUrl)({
|
|
111
|
+
fullPath,
|
|
112
|
+
publicDir,
|
|
113
|
+
remotionRoot,
|
|
114
|
+
steps: ['bundling'],
|
|
115
|
+
});
|
|
116
|
+
const puppeteerInstance = await browserInstance;
|
|
117
|
+
const comps = await (0, renderer_1.getCompositions)(bundleLocation, {
|
|
118
|
+
inputProps,
|
|
119
|
+
envVariables,
|
|
120
|
+
chromiumOptions,
|
|
121
|
+
timeoutInMilliseconds: puppeteerTimeout,
|
|
122
|
+
ffmpegExecutable,
|
|
123
|
+
ffprobeExecutable,
|
|
124
|
+
port,
|
|
125
|
+
puppeteerInstance,
|
|
126
|
+
});
|
|
127
|
+
const ids = ((_b = args[1]) !== null && _b !== void 0 ? _b : '')
|
|
128
|
+
.split(',')
|
|
129
|
+
.map((c) => c.trim())
|
|
130
|
+
.filter(truthy_1.truthy);
|
|
131
|
+
const compositions = ids.map((compId) => {
|
|
132
|
+
const composition = comps.find((c) => c.id === compId);
|
|
133
|
+
if (!composition) {
|
|
134
|
+
throw new Error(`No composition with the ID "${compId}" found.`);
|
|
135
|
+
}
|
|
136
|
+
return composition;
|
|
137
|
+
});
|
|
138
|
+
if (compositions.length === 0) {
|
|
139
|
+
log_1.Log.error('No composition IDs passed. Add another argument to the command specifying at least 1 composition ID.');
|
|
140
|
+
}
|
|
141
|
+
const benchmark = {};
|
|
142
|
+
let count = 1;
|
|
143
|
+
const { codec, reason: codecReason } = (0, get_cli_options_1.getFinalCodec)({
|
|
144
|
+
downloadName: null,
|
|
145
|
+
outName: null,
|
|
146
|
+
});
|
|
147
|
+
for (const composition of compositions) {
|
|
148
|
+
const renderMediaOptions = await (0, get_render_media_options_1.getRenderMediaOptions)({
|
|
149
|
+
config: composition,
|
|
150
|
+
outputLocation: undefined,
|
|
151
|
+
serveUrl: bundleLocation,
|
|
152
|
+
codec,
|
|
153
|
+
});
|
|
154
|
+
const concurrency = getValidConcurrency(renderMediaOptions);
|
|
155
|
+
benchmark[composition.id] = {};
|
|
156
|
+
for (const con of concurrency) {
|
|
157
|
+
const benchmarkProgress = (0, progress_bar_1.createOverwriteableCliOutput)((0, parse_command_line_1.quietFlagProvided)());
|
|
158
|
+
log_1.Log.info();
|
|
159
|
+
log_1.Log.info(`${chalk_1.chalk.bold(`Benchmark #${count++}:`)} ${chalk_1.chalk.gray(`composition=${composition.id} concurrency=${con} codec=${codec} (${codecReason})`)}`);
|
|
160
|
+
const timeTaken = await runBenchmark(runs, {
|
|
161
|
+
...renderMediaOptions,
|
|
162
|
+
puppeteerInstance,
|
|
163
|
+
concurrency: con,
|
|
164
|
+
}, (run, progress) => {
|
|
165
|
+
benchmarkProgress.update(makeBenchmarkProgressBar({
|
|
166
|
+
totalRuns: runs,
|
|
167
|
+
run,
|
|
168
|
+
doneIn: null,
|
|
169
|
+
progress,
|
|
170
|
+
}));
|
|
171
|
+
});
|
|
172
|
+
benchmarkProgress.update('');
|
|
173
|
+
benchmarkProgress.update(getResults(timeTaken, runs));
|
|
174
|
+
benchmark[composition.id][`${con}`] = timeTaken;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
log_1.Log.info();
|
|
178
|
+
await cleanupBundle();
|
|
179
|
+
};
|
|
180
|
+
exports.benchmarkCommand = benchmarkCommand;
|
package/dist/compositions.js
CHANGED
|
@@ -27,7 +27,7 @@ const max = (arr) => {
|
|
|
27
27
|
const listCompositionsCommand = async (remotionRoot) => {
|
|
28
28
|
const file = parse_command_line_1.parsedCli._[1];
|
|
29
29
|
if (!file) {
|
|
30
|
-
log_1.Log.error('The `compositions` command requires you to specify a
|
|
30
|
+
log_1.Log.error('The `compositions` command requires you to specify a entry point. For example');
|
|
31
31
|
log_1.Log.error(' npx remotion compositions src/index.tsx');
|
|
32
32
|
log_1.Log.error('See https://www.remotion.dev/docs/register-root for more information.');
|
|
33
33
|
process.exit(1);
|
|
@@ -35,14 +35,16 @@ const listCompositionsCommand = async (remotionRoot) => {
|
|
|
35
35
|
const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
|
|
36
36
|
const fullPath = path_1.default.join(process.cwd(), file);
|
|
37
37
|
await (0, get_config_file_name_1.loadConfig)(remotionRoot);
|
|
38
|
-
const { browserExecutable, ffmpegExecutable, ffprobeExecutable, chromiumOptions, envVariables, inputProps, puppeteerTimeout, port, } = await (0, get_cli_options_1.getCliOptions)({
|
|
38
|
+
const { browserExecutable, ffmpegExecutable, ffprobeExecutable, chromiumOptions, envVariables, inputProps, puppeteerTimeout, port, publicDir, } = await (0, get_cli_options_1.getCliOptions)({
|
|
39
39
|
isLambda: false,
|
|
40
40
|
type: 'get-compositions',
|
|
41
|
+
codec: 'h264',
|
|
41
42
|
});
|
|
42
43
|
const { urlOrBundle: bundled, cleanup: cleanupBundle } = await (0, setup_cache_1.bundleOnCliOrTakeServeUrl)({
|
|
43
44
|
remotionRoot,
|
|
44
45
|
fullPath,
|
|
45
46
|
steps: ['bundling'],
|
|
47
|
+
publicDir,
|
|
46
48
|
});
|
|
47
49
|
const compositions = await (0, renderer_1.getCompositions)(bundled, {
|
|
48
50
|
browserExecutable,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEnforceAudioTrack = exports.setEnforceAudioTrack = void 0;
|
|
4
|
+
const DEFAULT_ENFORCE_AUDIO_TRACK = true;
|
|
5
|
+
let enforceAudioTrackState = DEFAULT_ENFORCE_AUDIO_TRACK;
|
|
6
|
+
const setEnforceAudioTrack = (enforceAudioTrack) => {
|
|
7
|
+
enforceAudioTrackState = enforceAudioTrack;
|
|
8
|
+
};
|
|
9
|
+
exports.setEnforceAudioTrack = setEnforceAudioTrack;
|
|
10
|
+
const getEnforceAudioTrack = () => {
|
|
11
|
+
return enforceAudioTrackState;
|
|
12
|
+
};
|
|
13
|
+
exports.getEnforceAudioTrack = getEnforceAudioTrack;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFfmpegOverrideFunction = exports.setFfmpegOverrideFunction = void 0;
|
|
4
|
+
let ffmpegOverrideFn = ({ args }) => args;
|
|
5
|
+
const setFfmpegOverrideFunction = (fn) => {
|
|
6
|
+
ffmpegOverrideFn = fn;
|
|
7
|
+
};
|
|
8
|
+
exports.setFfmpegOverrideFunction = setFfmpegOverrideFunction;
|
|
9
|
+
const getFfmpegOverrideFunction = () => {
|
|
10
|
+
return ffmpegOverrideFn;
|
|
11
|
+
};
|
|
12
|
+
exports.getFfmpegOverrideFunction = getFfmpegOverrideFunction;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getUserPreferredImageFormat = exports.setImageFormat = void 0;
|
|
4
4
|
const renderer_1 = require("@remotion/renderer");
|
|
5
|
+
const truthy_1 = require("../truthy");
|
|
5
6
|
let currentImageFormat;
|
|
6
7
|
const setImageFormat = (format) => {
|
|
7
8
|
if (typeof format === 'undefined') {
|
|
@@ -9,7 +10,13 @@ const setImageFormat = (format) => {
|
|
|
9
10
|
return;
|
|
10
11
|
}
|
|
11
12
|
if (!renderer_1.RenderInternals.validImageFormats.includes(format)) {
|
|
12
|
-
throw new TypeError(
|
|
13
|
+
throw new TypeError([
|
|
14
|
+
`Value ${format} is not valid as an image format.`,
|
|
15
|
+
// @ts-expect-error
|
|
16
|
+
format === 'jpg' ? 'Did you mean "jpeg"?' : null,
|
|
17
|
+
]
|
|
18
|
+
.filter(truthy_1.truthy)
|
|
19
|
+
.join(' '));
|
|
13
20
|
}
|
|
14
21
|
currentImageFormat = format;
|
|
15
22
|
};
|
package/dist/config/index.d.ts
CHANGED
|
@@ -13,7 +13,9 @@ export declare const ConfigInternals: {
|
|
|
13
13
|
getActualCrf: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => number;
|
|
14
14
|
getPixelFormat: () => "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
15
15
|
getProResProfile: () => "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
|
|
16
|
-
getShouldOverwrite: (
|
|
16
|
+
getShouldOverwrite: ({ defaultValue, }: {
|
|
17
|
+
defaultValue: boolean;
|
|
18
|
+
}) => boolean;
|
|
17
19
|
getBrowserExecutable: () => import("@remotion/renderer").BrowserExecutable;
|
|
18
20
|
getCustomFfprobeExecutable: () => import("@remotion/renderer").FfmpegExecutable;
|
|
19
21
|
getScale: () => number;
|
|
@@ -39,5 +41,12 @@ export declare const ConfigInternals: {
|
|
|
39
41
|
setStillFrame: (frame: number) => void;
|
|
40
42
|
getMaxTimelineTracks: () => number;
|
|
41
43
|
defaultOverrideFunction: WebpackOverrideFn;
|
|
44
|
+
setMuted: (muted: boolean) => void;
|
|
45
|
+
getMuted: () => boolean;
|
|
46
|
+
getEnforceAudioTrack: () => boolean;
|
|
47
|
+
setEnforceAudioTrack: (enforceAudioTrack: boolean) => void;
|
|
48
|
+
getKeyboardShortcutsEnabled: () => boolean;
|
|
49
|
+
getPublicDir: () => string | null;
|
|
50
|
+
getFfmpegOverrideFunction: () => import("@remotion/renderer").FfmpegOverrideFn;
|
|
42
51
|
};
|
|
43
52
|
export declare const overrideRemotion: () => void;
|
package/dist/config/index.js
CHANGED
|
@@ -57,14 +57,18 @@ const chromium_flags_2 = require("./chromium-flags");
|
|
|
57
57
|
const codec_2 = require("./codec");
|
|
58
58
|
const concurrency_2 = require("./concurrency");
|
|
59
59
|
const crf_2 = require("./crf");
|
|
60
|
+
const enforce_audio_track_1 = require("./enforce-audio-track");
|
|
60
61
|
const env_file_2 = require("./env-file");
|
|
61
62
|
const every_nth_frame_2 = require("./every-nth-frame");
|
|
62
63
|
const ffmpeg_executable_2 = require("./ffmpeg-executable");
|
|
64
|
+
const ffmpeg_override_1 = require("./ffmpeg-override");
|
|
63
65
|
const frame_range_2 = require("./frame-range");
|
|
64
66
|
const image_format_2 = require("./image-format");
|
|
65
67
|
const image_sequence_2 = require("./image-sequence");
|
|
68
|
+
const keyboard_shortcuts_1 = require("./keyboard-shortcuts");
|
|
66
69
|
const log_1 = require("./log");
|
|
67
70
|
const max_timeline_tracks_2 = require("./max-timeline-tracks");
|
|
71
|
+
const muted_1 = require("./muted");
|
|
68
72
|
const number_of_gif_loops_2 = require("./number-of-gif-loops");
|
|
69
73
|
const output_location_2 = require("./output-location");
|
|
70
74
|
const override_webpack_2 = require("./override-webpack");
|
|
@@ -72,6 +76,7 @@ const overwrite_2 = require("./overwrite");
|
|
|
72
76
|
const pixel_format_2 = require("./pixel-format");
|
|
73
77
|
const preview_server_2 = require("./preview-server");
|
|
74
78
|
const prores_profile_2 = require("./prores-profile");
|
|
79
|
+
const public_dir_1 = require("./public-dir");
|
|
75
80
|
const quality_2 = require("./quality");
|
|
76
81
|
const scale_2 = require("./scale");
|
|
77
82
|
const timeout_2 = require("./timeout");
|
|
@@ -79,11 +84,13 @@ const webpack_caching_2 = require("./webpack-caching");
|
|
|
79
84
|
exports.Config = {
|
|
80
85
|
Preview: {
|
|
81
86
|
setMaxTimelineTracks: max_timeline_tracks_2.setMaxTimelineTracks,
|
|
87
|
+
setKeyboardShortcutsEnabled: keyboard_shortcuts_1.setKeyboardShortcutsEnabled,
|
|
82
88
|
},
|
|
83
89
|
Bundling: {
|
|
84
90
|
overrideWebpackConfig: override_webpack_2.overrideWebpackConfig,
|
|
85
91
|
setCachingEnabled: webpack_caching_2.setWebpackCaching,
|
|
86
92
|
setPort: preview_server_2.setPort,
|
|
93
|
+
setPublicDir: public_dir_1.setPublicDir,
|
|
87
94
|
},
|
|
88
95
|
Log: {
|
|
89
96
|
setLevel: log_1.setLogLevel,
|
|
@@ -107,6 +114,8 @@ exports.Config = {
|
|
|
107
114
|
setScale: scale_2.setScale,
|
|
108
115
|
setEveryNthFrame: every_nth_frame_2.setEveryNthFrame,
|
|
109
116
|
setNumberOfGifLoops: number_of_gif_loops_2.setNumberOfGifLoops,
|
|
117
|
+
setMuted: muted_1.setMuted,
|
|
118
|
+
setEnforceAudioTrack: enforce_audio_track_1.setEnforceAudioTrack,
|
|
110
119
|
},
|
|
111
120
|
Output: {
|
|
112
121
|
setOutputLocation: output_location_2.setOutputLocation,
|
|
@@ -117,6 +126,7 @@ exports.Config = {
|
|
|
117
126
|
setCrf: crf_2.setCrf,
|
|
118
127
|
setImageSequence: image_sequence_2.setImageSequence,
|
|
119
128
|
setProResProfile: prores_profile_2.setProResProfile,
|
|
129
|
+
overrideFfmpegCommand: ffmpeg_override_1.setFfmpegOverrideFunction,
|
|
120
130
|
},
|
|
121
131
|
};
|
|
122
132
|
// eslint-disable-next-line no-restricted-imports
|
|
@@ -154,6 +164,13 @@ exports.ConfigInternals = {
|
|
|
154
164
|
setStillFrame: still_frame_1.setStillFrame,
|
|
155
165
|
getMaxTimelineTracks: max_timeline_tracks_1.getMaxTimelineTracks,
|
|
156
166
|
defaultOverrideFunction: override_webpack_1.defaultOverrideFunction,
|
|
167
|
+
setMuted: muted_1.setMuted,
|
|
168
|
+
getMuted: muted_1.getMuted,
|
|
169
|
+
getEnforceAudioTrack: enforce_audio_track_1.getEnforceAudioTrack,
|
|
170
|
+
setEnforceAudioTrack: enforce_audio_track_1.setEnforceAudioTrack,
|
|
171
|
+
getKeyboardShortcutsEnabled: keyboard_shortcuts_1.getKeyboardShortcutsEnabled,
|
|
172
|
+
getPublicDir: public_dir_1.getPublicDir,
|
|
173
|
+
getFfmpegOverrideFunction: ffmpeg_override_1.getFfmpegOverrideFunction,
|
|
157
174
|
};
|
|
158
175
|
const overrideRemotion = () => {
|
|
159
176
|
Object.assign(remotion_1.Config, exports.Config);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getKeyboardShortcutsEnabled = exports.setKeyboardShortcutsEnabled = void 0;
|
|
4
|
+
let shortcutsEnabled = true;
|
|
5
|
+
const setKeyboardShortcutsEnabled = (enabled) => {
|
|
6
|
+
shortcutsEnabled = enabled;
|
|
7
|
+
};
|
|
8
|
+
exports.setKeyboardShortcutsEnabled = setKeyboardShortcutsEnabled;
|
|
9
|
+
const getKeyboardShortcutsEnabled = () => {
|
|
10
|
+
return shortcutsEnabled;
|
|
11
|
+
};
|
|
12
|
+
exports.getKeyboardShortcutsEnabled = getKeyboardShortcutsEnabled;
|
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: () => "error" | "verbose" | "info" | "warn";
|
|
3
3
|
export declare const setLogLevel: (newLogLevel: LogLevel) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMuted = exports.setMuted = void 0;
|
|
4
|
+
const DEFAULT_MUTED_STATE = false;
|
|
5
|
+
let mutedState = DEFAULT_MUTED_STATE;
|
|
6
|
+
const setMuted = (muted) => {
|
|
7
|
+
mutedState = muted;
|
|
8
|
+
};
|
|
9
|
+
exports.setMuted = setMuted;
|
|
10
|
+
const getMuted = () => {
|
|
11
|
+
return mutedState;
|
|
12
|
+
};
|
|
13
|
+
exports.getMuted = getMuted;
|
package/dist/config/overwrite.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getShouldOverwrite = exports.setOverwriteOutput = void 0;
|
|
4
|
-
|
|
5
|
-
let shouldOverwrite = renderer_1.RenderInternals.DEFAULT_OVERWRITE;
|
|
4
|
+
let shouldOverwrite = null;
|
|
6
5
|
const setOverwriteOutput = (newOverwrite) => {
|
|
7
6
|
if (typeof newOverwrite !== 'boolean') {
|
|
8
7
|
throw new Error(`overwriteExisting must be a boolean but got ${typeof newOverwrite} (${JSON.stringify(newOverwrite)})`);
|
|
@@ -10,5 +9,5 @@ const setOverwriteOutput = (newOverwrite) => {
|
|
|
10
9
|
shouldOverwrite = newOverwrite;
|
|
11
10
|
};
|
|
12
11
|
exports.setOverwriteOutput = setOverwriteOutput;
|
|
13
|
-
const getShouldOverwrite = () => shouldOverwrite;
|
|
12
|
+
const getShouldOverwrite = ({ defaultValue, }) => shouldOverwrite !== null && shouldOverwrite !== void 0 ? shouldOverwrite : defaultValue;
|
|
14
13
|
exports.getShouldOverwrite = getShouldOverwrite;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setPublicDir = exports.getPublicDir = void 0;
|
|
4
|
+
let publicDir = null;
|
|
5
|
+
const getPublicDir = () => {
|
|
6
|
+
return publicDir;
|
|
7
|
+
};
|
|
8
|
+
exports.getPublicDir = getPublicDir;
|
|
9
|
+
const setPublicDir = (dir) => {
|
|
10
|
+
publicDir = dir;
|
|
11
|
+
};
|
|
12
|
+
exports.setPublicDir = setPublicDir;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ImageFormat, StillImageFormat } from '@remotion/renderer';
|
|
2
|
+
export declare const determineFinalImageFormat: ({ downloadName, outName, configImageFormat, cliFlag, isLambda, }: {
|
|
3
|
+
downloadName: string | null;
|
|
4
|
+
outName: string | null;
|
|
5
|
+
configImageFormat: ImageFormat | null;
|
|
6
|
+
cliFlag: ImageFormat | null;
|
|
7
|
+
isLambda: boolean;
|
|
8
|
+
}) => {
|
|
9
|
+
format: StillImageFormat;
|
|
10
|
+
source: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.determineFinalImageFormat = void 0;
|
|
4
|
+
const deriveExtensionFromFilename = (filename) => {
|
|
5
|
+
if (filename === null || filename === void 0 ? void 0 : filename.endsWith('.png')) {
|
|
6
|
+
return 'png';
|
|
7
|
+
}
|
|
8
|
+
if (filename === null || filename === void 0 ? void 0 : filename.endsWith('.jpg')) {
|
|
9
|
+
return 'jpeg';
|
|
10
|
+
}
|
|
11
|
+
if (filename === null || filename === void 0 ? void 0 : filename.endsWith('.jpeg')) {
|
|
12
|
+
return 'jpeg';
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
};
|
|
16
|
+
const determineFinalImageFormat = ({ downloadName, outName, configImageFormat, cliFlag, isLambda, }) => {
|
|
17
|
+
const outNameExtension = deriveExtensionFromFilename(outName);
|
|
18
|
+
const downloadNameExtension = deriveExtensionFromFilename(downloadName);
|
|
19
|
+
const outNameDescription = isLambda ? 'S3 output key' : 'out name';
|
|
20
|
+
if (outNameExtension &&
|
|
21
|
+
downloadNameExtension &&
|
|
22
|
+
outNameExtension !== downloadNameExtension) {
|
|
23
|
+
throw new TypeError(`Image format mismatch: ${outName} was given as the ${outNameDescription} and ${downloadName} was given as the download name, but the extensions don't match.`);
|
|
24
|
+
}
|
|
25
|
+
if (downloadNameExtension) {
|
|
26
|
+
if (cliFlag && downloadNameExtension !== cliFlag) {
|
|
27
|
+
throw new TypeError(`Image format mismatch: ${downloadName} was given as the download name, but --image-format=${cliFlag} was passed. The image formats must match.`);
|
|
28
|
+
}
|
|
29
|
+
return { format: downloadNameExtension, source: 'Download name extension' };
|
|
30
|
+
}
|
|
31
|
+
if (outNameExtension) {
|
|
32
|
+
if (cliFlag && outNameExtension !== cliFlag) {
|
|
33
|
+
throw new TypeError(`Image format mismatch: ${outName} was given as the ${outNameDescription}, but --image-format=${cliFlag} was passed. The image formats must match.`);
|
|
34
|
+
}
|
|
35
|
+
return { format: outNameExtension, source: 'Out name extension' };
|
|
36
|
+
}
|
|
37
|
+
if (cliFlag === 'none') {
|
|
38
|
+
throw new TypeError('The --image-format flag must not be "none" for stills.');
|
|
39
|
+
}
|
|
40
|
+
if (cliFlag !== null) {
|
|
41
|
+
return { format: cliFlag, source: '--image-format flag' };
|
|
42
|
+
}
|
|
43
|
+
if (configImageFormat !== null && configImageFormat !== 'none') {
|
|
44
|
+
return { format: configImageFormat, source: 'Config file' };
|
|
45
|
+
}
|
|
46
|
+
return { format: 'png', source: 'Default' };
|
|
47
|
+
};
|
|
48
|
+
exports.determineFinalImageFormat = determineFinalImageFormat;
|